aboutsummaryrefslogtreecommitdiff
path: root/dummy-data-generator.php
diff options
context:
space:
mode:
Diffstat (limited to 'dummy-data-generator.php')
-rwxr-xr-xdummy-data-generator.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/dummy-data-generator.php b/dummy-data-generator.php
new file mode 100755
index 0000000..505d133
--- /dev/null
+++ b/dummy-data-generator.php
@@ -0,0 +1,37 @@
+#!/usr/bin/env php
+<?php
+$arChannels = array(0, 1, 2, 3, 4, 7);
+
+$data = array(
+ 'channel' => 1,
+ 'state' => 1,
+ 'timestamp' => ''
+);
+foreach (array('t', 'h') as $type) {
+ for ($n = 0; $n < 8; $n++) {
+ $data[$type . $n] = '';
+ }
+}
+$data = array_merge(
+ $data,
+ array(
+ 'tc' => '',
+ 'fc' => '',
+ 'wg' => '',
+ 'ns' => '',
+ 'rain' => '',
+ 'checksum' => 0
+ )
+);
+
+$n = 0;
+while (true) {
+ foreach ($arChannels as $nChanNum) {
+ $data['t' . $nChanNum] = str_replace('.', ',', rand(160, 260) / 10);
+ $data['h' . $nChanNum] = rand(30, 80);
+ }
+ echo '$' . implode(';', $data) . "\r\n";
+ sleep(1);
+}
+
+?> \ No newline at end of file