??
This commit is contained in:
@@ -1,19 +1,49 @@
|
||||
Logo
|
||||
Issues
|
||||
Pull-Requests
|
||||
Meilensteine
|
||||
Erkunden
|
||||
dh
|
||||
/
|
||||
Energiemanager_Symconmodule_Demo
|
||||
Code
|
||||
Issues
|
||||
Pull-Requests
|
||||
Actions
|
||||
Pakete
|
||||
Projekte
|
||||
Releases
|
||||
Wiki
|
||||
Aktivität
|
||||
Einstellungen
|
||||
Energiemanager_Symconmodule...
|
||||
/
|
||||
CC100_HW
|
||||
/
|
||||
module.php
|
||||
Daniel Häfliger
|
||||
Daniel Häfliger
|
||||
432c295a24
|
||||
Refactoring
|
||||
vor 3 Stunden
|
||||
206 Zeilen
|
||||
7.1 KiB
|
||||
PHP
|
||||
<?php
|
||||
|
||||
class CC100_HW extends IPSModule
|
||||
{
|
||||
private $DigOutPID = "/sys/kernel/dout_drv/DOUT_DATA";
|
||||
private $PT1PID = "/sys/bus/iio/devices/iio:device2/in_voltage13_raw";
|
||||
private $PT2PID = "/sys/bus/iio/devices/iio:device2/in_voltage1_raw";
|
||||
private $DIN_FILE = "/sys/bus/iio/devices/iio:device2/in_voltage1_raw";
|
||||
private $waitingTime = 1; // Waiting time (in ms) for a new attempt to write a digital output (if file is blocked)
|
||||
private $maxTime = 5000; // Max time (in ms) for the writing process
|
||||
|
||||
private $DigOutPID = "/sys/kernel/dout_drv/DOUT_DATA";
|
||||
private $PT1PID = "/sys/bus/iio/devices/iio:device2/in_voltage13_raw";
|
||||
private $PT2PID = "/sys/bus/iio/devices/iio:device2/in_voltage1_raw";
|
||||
private $DIN_FILE = "/sys/bus/iio/devices/iio:device2/in_voltage1_raw";
|
||||
private $waitingTime = 1; // Waiting time (in ms) for a new attempt to write a digital output (if file is blocked)
|
||||
private $maxTime = 5000; // Max time (in ms) for the writing process
|
||||
|
||||
public function Create()
|
||||
{
|
||||
parent::Create();
|
||||
|
||||
|
||||
$this->RegisterPropertyString("FilePath", $this->DigOutPID);
|
||||
$this->RegisterVariableBoolean("Bit1", "DO 1", "~Switch", 1);
|
||||
$this->RegisterVariableBoolean("Bit2", "DO 2", "~Switch", 2);
|
||||
$this->RegisterVariableBoolean("Bit3", "DO 3", "~Switch", 3);
|
||||
@@ -119,7 +149,7 @@ class CC100_HW extends IPSModule
|
||||
|
||||
private function TryWriteFile($starttime)
|
||||
{
|
||||
$this->readAndConvertToBools($this->$DIN_FILE);
|
||||
$this->readAndConvertToBools($DIN_FILE);
|
||||
|
||||
$currentTime = microtime(true) * 1000;
|
||||
if ($currentTime - $starttime <= $this->maxTime) {
|
||||
@@ -204,3 +234,10 @@ class CC100_HW extends IPSModule
|
||||
}
|
||||
|
||||
?>
|
||||
Powered by Gitea
|
||||
Version: 1.22.0 Seite:
|
||||
167ms
|
||||
Template:
|
||||
7ms
|
||||
Lizenzen
|
||||
API
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"compatibility": {
|
||||
"version": "7.1"
|
||||
},
|
||||
"version": "0.162",
|
||||
"version": "0.163",
|
||||
"build": 0,
|
||||
"date": 0
|
||||
}
|
||||
Reference in New Issue
Block a user