From 54bdd895f7af09f793fbd6252a9ddd0a66bc292d Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Tue, 13 Jul 2021 10:38:55 +0800 Subject: [PATCH] Feature/sangshuduo/td 5136 taosdemo rework (#6837) * [TD-5136]: taosdemo simulate real senario. * update test case according to taosdemo change * adjust range of semi-random data. --- src/kit/taosdemo/taosdemo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index c92b8e41a6..fa3d263678 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -1331,21 +1331,21 @@ static float demo_current_float(){ static int cursor; cursor++; cursor = cursor % MAX_PREPARED_RAND; - return (float)(5 + randfloat[cursor] / 1000000000); + return (float)(9.8 + 0.04 * (randint[cursor] % 10) + randfloat[cursor]/1000000000); } static int32_t demo_voltage_int(){ static int cursor; cursor++; cursor = cursor % MAX_PREPARED_RAND; - return 210 + randint[cursor] % 20; + return 215 + randint[cursor] % 10; } static float demo_phase_float(){ static int cursor; cursor++; cursor = cursor % MAX_PREPARED_RAND; - return (float)(120 + randfloat[cursor] / 1000000000); + return (float)((115 + randint[cursor] % 10 + randfloat[cursor]/1000000000)/360); } #if 0 -- GitLab