| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | include_once(dirname(__FILE__).'/Measure.php');
|
|---|
| 4 | include_once(dirname(__FILE__).'/Graph.php');
|
|---|
| 5 | include_once(dirname(__FILE__).'/Main.php');
|
|---|
| 6 |
|
|---|
| 7 | class ModuleTimeMeasure extends Module
|
|---|
| 8 | {
|
|---|
| 9 | function __construct(System $System)
|
|---|
| 10 | {
|
|---|
| 11 | parent::__construct($System);
|
|---|
| 12 | $this->Name = 'TimeMeasure';
|
|---|
| 13 | $this->Version = '1.0';
|
|---|
| 14 | $this->Creator = 'Chronos';
|
|---|
| 15 | $this->License = 'GNU/GPLv3';
|
|---|
| 16 | $this->Description = 'Time measure of custom values, char';
|
|---|
| 17 | $this->Dependencies = array(ModuleUser::GetName());
|
|---|
| 18 | $this->Models = array(Measure::GetClassName());
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | function DoStart(): void
|
|---|
| 22 | {
|
|---|
| 23 | $this->System->RegisterPage(['grafy'], 'PageMeasure');
|
|---|
| 24 | $this->System->RegisterPage(['grafy', 'graf.png'], 'PageGraph');
|
|---|
| 25 | $this->System->RegisterPage(['grafy', 'add.php'], 'PageMeasureAddValue');
|
|---|
| 26 | $this->System->FormManager->RegisterClass('Measure', array(
|
|---|
| 27 | 'Title' => 'Měření',
|
|---|
| 28 | 'Table' => 'Measure',
|
|---|
| 29 | 'Items' => array(
|
|---|
| 30 | 'Name' => array('Type' => 'String', 'Caption' => 'Zkratka', 'Default' => 'measure'),
|
|---|
| 31 | 'Title' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => 'Měření'),
|
|---|
| 32 | 'Description' => array('Type' => 'String', 'Caption' => 'Popis', 'Default' => 'Měření veličiny'),
|
|---|
| 33 | 'Unit' => array('Type' => 'String', 'Caption' => 'Jednotka', 'Default' => ''),
|
|---|
| 34 | 'Continuity' => array('Type' => 'Boolean', 'Caption' => 'Spojitost', 'Default' => '0'),
|
|---|
| 35 | 'Period' => array('Type' => 'Integer', 'Caption' => 'Perioda měření', 'Default' => '60'),
|
|---|
| 36 | 'PermissionAdd' => array('Type' => 'String', 'Caption' => 'Oprávnění k měření', 'Default' => 'localhost.localdomain'),
|
|---|
| 37 | 'PermissionView' => array('Type' => 'String', 'Caption' => 'Oprávnění k prohlížení', 'Default' => 'all'),
|
|---|
| 38 | 'Enabled' => array('Type' => 'Boolean', 'Caption' => 'Povolení', 'Default' => '1'),
|
|---|
| 39 | 'DataType' => array('Type' => 'String', 'Caption' => 'Typ datových položek', 'Default' => 'int'),
|
|---|
| 40 | 'DataTable' => array('Type' => 'String', 'Caption' => 'Tabulka měřených dat', 'Default' => 'data'),
|
|---|
| 41 | ),
|
|---|
| 42 | ));
|
|---|
| 43 | }
|
|---|
| 44 | }
|
|---|