aqhome-apps: all apps now work again.

This commit is contained in:
Martin Preuss
2025-03-09 23:25:02 +01:00
parent 9c1188b4d1
commit 3e4e3ffe2d
58 changed files with 1695 additions and 1425 deletions

View File

@@ -40,7 +40,7 @@ static void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREAC
* ------------------------------------------------------------------------------------------------
*/
AQHREACT_UNIT *AqHomeReact_UnitHighPass_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitHighPass_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_PORT *port;

View File

@@ -10,6 +10,7 @@
#define AQHOMEREACT_U_HIGHPASS_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
@@ -19,7 +20,7 @@
AQHREACT_UNIT *AqHomeReact_UnitHighPass_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitHighPass_new(AQH_OBJECT *aqh);

View File

@@ -33,7 +33,7 @@
* ------------------------------------------------------------------------------------------------
*/
static AQHREACT_UNIT *_unitLogical_new(AQHOME_REACT *aqh);
static AQHREACT_UNIT *_unitLogical_new(AQH_OBJECT *aqh);
static int _outputResult(AQHREACT_UNIT *unit, AQHREACT_PORT *port, int result);
static int _cbProcessOr(AQHREACT_UNIT *unit);
static int _cbProcessAnd(AQHREACT_UNIT *unit);
@@ -48,7 +48,7 @@ static int _cbProcessInvert(AQHREACT_UNIT *unit);
*/
AQHREACT_UNIT *AqHomeReact_UnitOr_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitOr_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
@@ -61,7 +61,7 @@ AQHREACT_UNIT *AqHomeReact_UnitOr_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitNor_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitNor_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
@@ -75,7 +75,7 @@ AQHREACT_UNIT *AqHomeReact_UnitNor_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitAnd_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitAnd_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
@@ -88,7 +88,7 @@ AQHREACT_UNIT *AqHomeReact_UnitAnd_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitNand_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitNand_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
@@ -102,7 +102,7 @@ AQHREACT_UNIT *AqHomeReact_UnitNand_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitXor_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitXor_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
@@ -115,7 +115,7 @@ AQHREACT_UNIT *AqHomeReact_UnitXor_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitInvert_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitInvert_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
@@ -129,7 +129,7 @@ AQHREACT_UNIT *AqHomeReact_UnitInvert_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *_unitLogical_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *_unitLogical_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_PORT *port;

View File

@@ -10,18 +10,19 @@
#define AQHOMEREACT_U_LOGICAL_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
AQHREACT_UNIT *AqHomeReact_UnitOr_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitNor_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitOr_new(AQH_OBJECT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitNor_new(AQH_OBJECT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitAnd_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitNand_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitAnd_new(AQH_OBJECT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitNand_new(AQH_OBJECT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitXor_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitInvert_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitXor_new(AQH_OBJECT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitInvert_new(AQH_OBJECT *aqh);

View File

@@ -40,7 +40,7 @@ static void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREAC
* ------------------------------------------------------------------------------------------------
*/
AQHREACT_UNIT *AqHomeReact_UnitLowPass_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitLowPass_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_PORT *port;

View File

@@ -10,6 +10,7 @@
#define AQHOMEREACT_U_LOWPASS_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
@@ -18,7 +19,7 @@
#define AQHOMEREACT_UNIT_LOWPASS_PARAM_NEWVALUE "newValue"
AQHREACT_UNIT *AqHomeReact_UnitLowPass_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitLowPass_new(AQH_OBJECT *aqh);

View File

@@ -50,24 +50,24 @@ static void _readProxyFromXml(GWEN_XMLNODE *xmlNode,
static int _readInputPortsFromXml(AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlNode);
static int _readOutputPortsFromXml(AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlNode);
static int _finishParams(AQHREACT_UNIT *unit);
static void _readUnitsFromXml(AQHOME_REACT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlNode);
static AQHREACT_UNIT *_readOneUnitFromXml(AQHOME_REACT *aqh, GWEN_XMLNODE *xmlNode);
static void _readUnitsFromXml(AQH_OBJECT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlNode);
static AQHREACT_UNIT *_readOneUnitFromXml(AQH_OBJECT *aqh, GWEN_XMLNODE *xmlNode);
static int _readParamsFromXml(AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlNodeUnit, const char *mainGroupName);
static int _readParamFromXml(AQHREACT_UNIT *unit, GWEN_XMLNODE *paramNode);
static int _setParamDataFromString(AQHREACT_PARAM *param, const char *value);
static int _readLinksFromXml(AQHOME_REACT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlNode);
static int _readLinkFromXml(AQHOME_REACT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *linkNode);
static int _linkFromThisModulesInput(AQHOME_REACT *aqh,
static int _readLinksFromXml(AQH_OBJECT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlNode);
static int _readLinkFromXml(AQH_OBJECT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *linkNode);
static int _linkFromThisModulesInput(AQH_OBJECT *aqh,
AQHREACT_UNIT *unit,
const char *emittingPortName,
const char *receivingUnitName,
const char *receivingPortName);
static int _linkToThisModulesOutput(AQHOME_REACT *aqh,
static int _linkToThisModulesOutput(AQH_OBJECT *aqh,
AQHREACT_UNIT *unit,
const char *emittingUnitName,
const char *emittingPortName,
const char *receivingPortName);
static int _linkBetweenUnits(AQHOME_REACT *aqh,
static int _linkBetweenUnits(AQH_OBJECT *aqh,
AQHREACT_UNIT *unit,
const char *emittingUnitName,
const char *emittingPortName,
@@ -140,7 +140,7 @@ MODULE_PROXY_DESCR *ModuleProxyDescr_List_FindByName(const MODULE_PROXY_DESCR_LI
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
AQHREACT_UNIT *AqHomeReact_UnitModule_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitModule_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_UNIT_MODULE *xunit;
@@ -176,7 +176,7 @@ void _freeData(GWEN_UNUSED void *bp, void *p)
AQHREACT_UNIT *AqHomeReact_UnitModule_fromXml(AQHOME_REACT *aqh, GWEN_XMLNODE *xmlNode)
AQHREACT_UNIT *AqHomeReact_UnitModule_fromXml(AQH_OBJECT *aqh, GWEN_XMLNODE *xmlNode)
{
AQHREACT_UNIT *unit;
AQHREACT_UNIT_MODULE *xunit;
@@ -452,7 +452,7 @@ int _finishParams(AQHREACT_UNIT *unit)
void _readUnitsFromXml(AQHOME_REACT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlNode)
void _readUnitsFromXml(AQH_OBJECT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlNode)
{
GWEN_XMLNODE *nGroup;
AQHREACT_UNIT_MODULE *xunit;
@@ -481,7 +481,7 @@ void _readUnitsFromXml(AQHOME_REACT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *xml
AQHREACT_UNIT *_readOneUnitFromXml(AQHOME_REACT *aqh, GWEN_XMLNODE *xmlNode)
AQHREACT_UNIT *_readOneUnitFromXml(AQH_OBJECT *aqh, GWEN_XMLNODE *xmlNode)
{
const char *id;
const char *t;
@@ -495,7 +495,7 @@ AQHREACT_UNIT *_readOneUnitFromXml(AQHOME_REACT *aqh, GWEN_XMLNODE *xmlNode)
AQHREACT_UNIT *subUnit;
int rv;
subUnit=AqHomeReact_CreateUnitByName(aqh, t);
subUnit=AQH_ReactServer_CreateUnitByName(aqh, t);
if (subUnit==NULL) {
DBG_INFO(NULL, "Could not create unit of type \"%s\"", t);
return NULL;
@@ -610,7 +610,7 @@ int _setParamDataFromString(AQHREACT_PARAM *param, const char *value)
int _readLinksFromXml(AQHOME_REACT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlNode)
int _readLinksFromXml(AQH_OBJECT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlNode)
{
GWEN_XMLNODE *nGroup;
@@ -635,7 +635,7 @@ int _readLinksFromXml(AQHOME_REACT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlN
int _readLinkFromXml(AQHOME_REACT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *linkNode)
int _readLinkFromXml(AQH_OBJECT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *linkNode)
{
const char *emittingUnitName;
const char *emittingPortName;
@@ -673,7 +673,7 @@ int _readLinkFromXml(AQHOME_REACT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *linkN
int _linkFromThisModulesInput(AQHOME_REACT *aqh,
int _linkFromThisModulesInput(AQH_OBJECT *aqh,
AQHREACT_UNIT *unit,
const char *emittingPortName,
const char *receivingUnitName,
@@ -689,7 +689,7 @@ int _linkFromThisModulesInput(AQHOME_REACT *aqh,
receivingUnit=AQHREACT_Unit_List_GetById(xunit->unitList, receivingUnitName);
if (receivingUnit==NULL)
receivingUnit=AqHomeReact_FindUnitByUnitId(aqh, receivingUnitName);
receivingUnit=AQH_ReactServer_FindUnitByUnitId(aqh, receivingUnitName);
if (receivingUnit==NULL) {
DBG_ERROR(NULL, "Target unit \"%s\" not found", receivingUnitName);
return GWEN_ERROR_NOT_FOUND;
@@ -718,7 +718,7 @@ int _linkFromThisModulesInput(AQHOME_REACT *aqh,
int _linkToThisModulesOutput(AQHOME_REACT *aqh,
int _linkToThisModulesOutput(AQH_OBJECT *aqh,
AQHREACT_UNIT *unit,
const char *emittingUnitName,
const char *emittingPortName,
@@ -735,7 +735,7 @@ int _linkToThisModulesOutput(AQHOME_REACT *aqh,
emittingUnit=AQHREACT_Unit_List_GetById(xunit->unitList, emittingUnitName);
if (emittingUnit==NULL)
emittingUnit=AqHomeReact_FindUnitByUnitId(aqh, emittingUnitName);
emittingUnit=AQH_ReactServer_FindUnitByUnitId(aqh, emittingUnitName);
if (emittingUnit==NULL) {
DBG_ERROR(NULL, "Source unit \"%s\" not found", emittingUnitName);
return GWEN_ERROR_NOT_FOUND;
@@ -764,7 +764,7 @@ int _linkToThisModulesOutput(AQHOME_REACT *aqh,
int _linkBetweenUnits(AQHOME_REACT *aqh,
int _linkBetweenUnits(AQH_OBJECT *aqh,
AQHREACT_UNIT *unit,
const char *emittingUnitName,
const char *emittingPortName,
@@ -782,7 +782,7 @@ int _linkBetweenUnits(AQHOME_REACT *aqh,
emittingUnit=AQHREACT_Unit_List_GetById(xunit->unitList, emittingUnitName);
if (emittingUnit==NULL)
emittingUnit=AqHomeReact_FindUnitByUnitId(aqh, emittingUnitName);
emittingUnit=AQH_ReactServer_FindUnitByUnitId(aqh, emittingUnitName);
if (emittingUnit==NULL) {
DBG_ERROR(NULL, "Source unit \"%s\" not found", emittingUnitName);
return GWEN_ERROR_NOT_FOUND;
@@ -790,7 +790,7 @@ int _linkBetweenUnits(AQHOME_REACT *aqh,
receivingUnit=AQHREACT_Unit_List_GetById(xunit->unitList, receivingUnitName);
if (receivingUnit==NULL)
receivingUnit=AqHomeReact_FindUnitByUnitId(aqh, receivingUnitName);
receivingUnit=AQH_ReactServer_FindUnitByUnitId(aqh, receivingUnitName);
if (receivingUnit==NULL) {
DBG_ERROR(NULL, "Target unit \"%s\" not found", receivingUnitName);
return GWEN_ERROR_NOT_FOUND;

View File

@@ -1,6 +1,6 @@
/****************************************************************************
* This file is part of the project AqHome.
* AqHome (c) by 2024 Martin Preuss, all rights reserved.
* AqHome (c) by 2025 Martin Preuss, all rights reserved.
*
* The license for this file can be found in the file COPYING which you
* should have received along with this file.
@@ -10,15 +10,16 @@
#define AQHOMEREACT_U_MODULE_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
#include <gwenhywfar/xml.h>
AQHREACT_UNIT *AqHomeReact_UnitModule_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitModule_new(AQH_OBJECT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitModule_fromXml(AQHOME_REACT *aqh, GWEN_XMLNODE *xmlNode);
AQHREACT_UNIT *AqHomeReact_UnitModule_fromXml(AQH_OBJECT *aqh, GWEN_XMLNODE *xmlNode);
#endif

View File

@@ -37,7 +37,7 @@ static void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREAC
* ------------------------------------------------------------------------------------------------
*/
AQHREACT_UNIT *AqHomeReact_UnitPassthrough_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitPassthrough_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_PORT *port;

View File

@@ -10,6 +10,7 @@
#define AQHOMEREACT_U_PASSTHROUGH_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
@@ -19,7 +20,7 @@
AQHREACT_UNIT *AqHomeReact_UnitPassthrough_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitPassthrough_new(AQH_OBJECT *aqh);

View File

@@ -62,7 +62,7 @@ static void _setOutput(AQHREACT_UNIT *unit, AQHREACT_UNIT_STABILIZE *xunit, int
* ------------------------------------------------------------------------------------------------
*/
AQHREACT_UNIT *AqHomeReact_UnitStabilize_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitStabilize_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT_STABILIZE *xunit;
AQHREACT_UNIT *unit;

View File

@@ -10,6 +10,7 @@
#define AQHOMEREACT_U_STABILIZE_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
@@ -17,7 +18,7 @@
#define AQHOMEREACT_UNIT_STABILIZE_PARAM_HOLDTIME_LOW "holdTimeLow"
AQHREACT_UNIT *AqHomeReact_UnitStabilize_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitStabilize_new(AQH_OBJECT *aqh);

View File

@@ -33,7 +33,7 @@
* ------------------------------------------------------------------------------------------------
*/
static AQHREACT_UNIT *_unitStatFns_new(AQHOME_REACT *aqh);
static AQHREACT_UNIT *_unitStatFns_new(AQH_OBJECT *aqh);
static int _outputResult(AQHREACT_UNIT *unit, AQHREACT_PORT *port, double result);
static int _cbProcessAvg(AQHREACT_UNIT *unit);
static int _cbProcessMin(AQHREACT_UNIT *unit);
@@ -47,7 +47,7 @@ static int _cbProcessMax(AQHREACT_UNIT *unit);
*/
AQHREACT_UNIT *AqHomeReact_UnitAverage_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitAverage_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
@@ -60,7 +60,7 @@ AQHREACT_UNIT *AqHomeReact_UnitAverage_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitMinValue_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitMinValue_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
@@ -73,7 +73,7 @@ AQHREACT_UNIT *AqHomeReact_UnitMinValue_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitMaxValue_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitMaxValue_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
@@ -86,7 +86,7 @@ AQHREACT_UNIT *AqHomeReact_UnitMaxValue_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *_unitStatFns_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *_unitStatFns_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_PORT *port;

View File

@@ -10,13 +10,14 @@
#define AQHOMEREACT_U_STATFNS_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
AQHREACT_UNIT *AqHomeReact_UnitAverage_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitMinValue_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitMaxValue_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitAverage_new(AQH_OBJECT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitMinValue_new(AQH_OBJECT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitMaxValue_new(AQH_OBJECT *aqh);

View File

@@ -52,7 +52,7 @@ static void _readParams(AQHREACT_UNIT *unit);
* ------------------------------------------------------------------------------------------------
*/
AQHREACT_UNIT *AqHomeReact_UnitSuntime_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitSuntime_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_UNIT_SUNTIME *xunit;
@@ -125,7 +125,7 @@ int _cbProcess(AQHREACT_UNIT *unit)
xunit=GWEN_INHERIT_GETDATA(AQHREACT_UNIT, AQHREACT_UNIT_SUNTIME, unit);
if (xunit) {
if (unit && AQHREACT_Unit_InputHasChanged(unit)) {
if (unit /* && AQHREACT_Unit_InputHasChanged(unit)*/) {
int rv;
if (AQHREACT_Unit_GetGpInt(unit)==-1)
@@ -184,7 +184,7 @@ int _isInsideSuntime(AQHREACT_UNIT *unit)
endTimeInMinutes=xunit->sunSetTimeInMinutes+xunit->offsetMinsForSunset;
result=(nowInMinutes>=startTimeInMinutes && nowInMinutes<=endTimeInMinutes)?1:0;
DBG_DEBUG(NULL, "Is inside suntime: %d", result);
DBG_ERROR(NULL, "Is inside suntime: %d", result);
return result;
}
return 0;
@@ -205,14 +205,14 @@ void _updateSuntimes(AQHREACT_UNIT *unit)
t=AQHomeReact_GetSunriseTimeForDateAndLoc(xunit->date, xunit->latitude, xunit->longitude);
xunit->sunRiseTimeInMinutes=_gwenTimeToMinutes(t);
DBG_INFO(NULL, "%s: Sunrise today at %02d:%02d UTC",
GWEN_Date_GetString(xunit->date), xunit->sunRiseTimeInMinutes/60, xunit->sunRiseTimeInMinutes%60);
DBG_ERROR(NULL, "%s: Sunrise today at %02d:%02d UTC",
GWEN_Date_GetString(xunit->date), xunit->sunRiseTimeInMinutes/60, xunit->sunRiseTimeInMinutes%60);
GWEN_Time_free(t);
t=AQHomeReact_GetSunsetTimeForDateAndLoc(xunit->date, xunit->latitude, xunit->longitude);
xunit->sunSetTimeInMinutes=_gwenTimeToMinutes(t);
DBG_INFO(NULL, "%s: Sunset today at %02d:%02d UTC",
GWEN_Date_GetString(xunit->date), xunit->sunSetTimeInMinutes/60, xunit->sunSetTimeInMinutes%60);
DBG_ERROR(NULL, "%s: Sunset today at %02d:%02d UTC",
GWEN_Date_GetString(xunit->date), xunit->sunSetTimeInMinutes/60, xunit->sunSetTimeInMinutes%60);
GWEN_Time_free(t);
}
@@ -261,7 +261,7 @@ void _readParams(AQHREACT_UNIT *unit)
xunit=GWEN_INHERIT_GETDATA(AQHREACT_UNIT, AQHREACT_UNIT_SUNTIME, unit);
if (xunit) {
DBG_INFO(NULL, "Reading parameters");
DBG_ERROR(NULL, "Reading parameters");
/* default to "Neues Rathaus" Celle ;-) */
xunit->latitude=AQHREACT_Unit_GetParamValueDouble(unit, AQHOMEREACT_UNIT_SUNTIME_PARAM_LAT, 52.619425);
xunit->longitude=AQHREACT_Unit_GetParamValueDouble(unit, AQHOMEREACT_UNIT_SUNTIME_PARAM_LONG, 10.087891);

View File

@@ -10,6 +10,7 @@
#define AQHOMEREACT_U_SUNTIME_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
@@ -22,7 +23,7 @@
AQHREACT_UNIT *AqHomeReact_UnitSuntime_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitSuntime_new(AQH_OBJECT *aqh);
#endif

View File

@@ -12,6 +12,8 @@
#include "./u_timeprogram_p.h"
#include "aqhome-react/types/prgrule.h"
#include <gwenhywfar/debug.h>
#include <gwenhywfar/xml.h>
#include <gwenhywfar/text.h>
@@ -96,7 +98,7 @@ void ModuleTimerAction_free(MODULE_TIMER_ACTION *act)
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
AQHREACT_UNIT *AqHomeReact_UnitTimeProgram_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitTimeProgram_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_UNIT_TIMEPROGRAM *xunit;

View File

@@ -10,6 +10,7 @@
#define AQHOMEREACT_U_TIMEPROGRAM_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
@@ -18,7 +19,7 @@
AQHREACT_UNIT *AqHomeReact_UnitTimeProgram_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitTimeProgram_new(AQH_OBJECT *aqh);
#endif

View File

@@ -17,7 +17,7 @@
AQHREACT_UNIT *AqHomeReact_UnitTimer_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitTimer_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;

View File

@@ -10,11 +10,12 @@
#define AQHOMEREACT_U_TIMER_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
AQHREACT_UNIT *AqHomeReact_UnitTimer_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitTimer_new(AQH_OBJECT *aqh);
void AqHomeReact_UnitTimer_GenerateTick(AQHREACT_UNIT *unit);

View File

@@ -41,7 +41,7 @@ static void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREAC
* ------------------------------------------------------------------------------------------------
*/
AQHREACT_UNIT *AqHomeReact_UnitValueFilter_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitValueFilter_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_PORT *port;

View File

@@ -10,6 +10,7 @@
#define AQHOMEREACT_U_VALUEFILTER_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
@@ -17,7 +18,7 @@
#define AQHOMEREACT_UNIT_VALUEFILTER_PARAM_VALUENAME "valueName"
AQHREACT_UNIT *AqHomeReact_UnitValueFilter_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitValueFilter_new(AQH_OBJECT *aqh);

View File

@@ -12,14 +12,15 @@
#include "./u_valueset.h"
#include "aqhome/ipc/data/msg_data_set.h"
#include "aqhome/ipc/data/ipc_data.h"
#include "aqhome/msg/ipc/data/m_ipcd.h"
#include "aqhome/msg/ipc/data/m_ipcd_setdata.h"
#include "aqhome/ipc2/endpoint.h"
#include <gwenhywfar/debug.h>
#include <gwenhywfar/text.h>
//#define DEBUG_DRY_RUN 1 /* don't actually set value if "1" */
#define DEBUG_DRY_RUN 0 /* don't actually set value if "1" */
/* ------------------------------------------------------------------------------------------------
@@ -37,10 +38,8 @@
*/
static void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREACT_DATAOBJECT *dataObject);
static GWEN_MSG *_mkSetDataMsgString(GWEN_MSG_ENDPOINT *brokerEndpoint,
const char *sValueName, const AQHREACT_DATAOBJECT *dataObject);
static GWEN_MSG *_mkSetDataMsgDouble(GWEN_MSG_ENDPOINT *brokerEndpoint,
const char *sValueName, const AQHREACT_DATAOBJECT *dataObject);
static AQH_MESSAGE *_mkSetDataMsgString(AQH_OBJECT *brokerEndpoint, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject);
static AQH_MESSAGE *_mkSetDataMsgDouble(AQH_OBJECT *brokerEndpoint, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject);
@@ -49,7 +48,7 @@ static GWEN_MSG *_mkSetDataMsgDouble(GWEN_MSG_ENDPOINT *brokerEndpoint,
* ------------------------------------------------------------------------------------------------
*/
AQHREACT_UNIT *AqHomeReact_UnitValueSet_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitValueSet_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_PORT *port;
@@ -83,11 +82,11 @@ void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREACT_DATAO
sValueName=AQHREACT_Unit_GetParamValueString(unit, AQHOMEREACT_UNIT_VALUESET_PARAM_VALUENAME, NULL);
if (sValueName && *sValueName) {
GWEN_MSG_ENDPOINT *brokerEndpoint;
AQH_OBJECT *brokerEndpoint;
brokerEndpoint=AqHomeReact_GetBrokerEndpoint(AQHREACT_Unit_GetAqHomeReact(unit));
brokerEndpoint=AQH_ReactServer_GetBrokerEndpoint(AQHREACT_Unit_GetAqHomeReact(unit));
if (brokerEndpoint) {
GWEN_MSG *msgOut;
AQH_MESSAGE *msgOut;
switch(AQHREACT_DataObject_GetDataType(dataObject)) {
case AQHREACT_DATAOBJECTTYPE_DOUBLE:
@@ -110,10 +109,10 @@ void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREACT_DATAO
AQHREACT_DataObject_Dump(dataObject, dbuf, 0);
DBG_ERROR(NULL, "%s\n", GWEN_Buffer_GetStart(dbuf));
GWEN_Buffer_free(dbuf);
GWEN_Msg_free(msgOut);
AQH_Message_free(msgOut);
#else
DBG_INFO(NULL, "Sending data for value \"%s\"", sValueName);
GWEN_MsgEndpoint_AddSendMessage(brokerEndpoint, msgOut);
AQH_Endpoint_AddMsgOut(brokerEndpoint, msgOut);
#endif
}
}
@@ -122,26 +121,27 @@ void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREACT_DATAO
}
GWEN_MSG *_mkSetDataMsgString(GWEN_MSG_ENDPOINT *brokerEndpoint, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject)
AQH_MESSAGE *_mkSetDataMsgString(AQH_OBJECT *brokerEndpoint, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject)
{
GWEN_MSG *msgOut;
AQH_MESSAGE *msgOut;
AQH_VALUE *v;
v=AQH_Value_new();
AQH_Value_SetNameForSystem(v, sValueName);
msgOut=AQH_SetDataIpcMsg_new(AQH_MSGTYPE_IPC_DATA_SETDATA,
GWEN_MsgEndpoint_GetNextMessageId(brokerEndpoint), 0,
v, AQHREACT_DataObject_GetStringData(dataObject));
msgOut=AQH_IpcdMessageSetData_new(AQH_MSGTYPE_IPC_DATA_SETDATA,
AQH_Endpoint_GetNextMessageId(brokerEndpoint), 0,
v, AQHREACT_DataObject_GetStringData(dataObject));
AQH_Value_free(v);
return msgOut;
}
GWEN_MSG *_mkSetDataMsgDouble(GWEN_MSG_ENDPOINT *brokerEndpoint, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject)
AQH_MESSAGE *_mkSetDataMsgDouble(AQH_OBJECT *brokerEndpoint, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject)
{
GWEN_MSG *msgOut;
AQH_MESSAGE *msgOut;
AQH_VALUE *v;
double data;
GWEN_BUFFER *buf;
@@ -159,9 +159,9 @@ GWEN_MSG *_mkSetDataMsgDouble(GWEN_MSG_ENDPOINT *brokerEndpoint, const char *sVa
return NULL;
}
msgOut=AQH_SetDataIpcMsg_new(AQH_MSGTYPE_IPC_DATA_SETDATA,
GWEN_MsgEndpoint_GetNextMessageId(brokerEndpoint), 0,
v, GWEN_Buffer_GetStart(buf));
msgOut=AQH_IpcdMessageSetData_new(AQH_MSGTYPE_IPC_DATA_SETDATA,
AQH_Endpoint_GetNextMessageId(brokerEndpoint), 0,
v, GWEN_Buffer_GetStart(buf));
GWEN_Buffer_free(buf);
AQH_Value_free(v);
return msgOut;

View File

@@ -10,6 +10,7 @@
#define AQHOMEREACT_U_VALUESET_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
@@ -17,7 +18,7 @@
#define AQHOMEREACT_UNIT_VALUESET_PARAM_VALUENAME "valueName"
AQHREACT_UNIT *AqHomeReact_UnitValueSet_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitValueSet_new(AQH_OBJECT *aqh);

View File

@@ -16,7 +16,7 @@
AQHREACT_UNIT *AqHomeReact_UnitVarChanges_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitVarChanges_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_PORT *port;

View File

@@ -10,6 +10,7 @@
#define AQHOMEREACT_U_VARCHANGES_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
@@ -22,7 +23,7 @@
AQHREACT_UNIT *AqHomeReact_UnitVarChanges_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitVarChanges_new(AQH_OBJECT *aqh);
/**
* Called from AqHomeReact when a value on the server changed.

View File

@@ -47,7 +47,7 @@ static void _setStringValue(AQHREACT_UNIT *unit, const char *sValueName, const A
* ------------------------------------------------------------------------------------------------
*/
AQHREACT_UNIT *AqHomeReact_UnitVarSet_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitVarSet_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_PORT *port;
@@ -100,11 +100,11 @@ void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREACT_DATAO
void _setDoubleValue(AQHREACT_UNIT *unit, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject)
{
AQHOME_REACT *aqh;
AQH_OBJECT *aqh;
int rv;
aqh=AQHREACT_Unit_GetAqHomeReact(unit);
rv=AqHomeReact_SetDoubleValue(aqh, sValueName, AQHREACT_DataObject_GetDoubleData(dataObject));
rv=AQH_ReactServer_SetDoubleValue(aqh, sValueName, AQHREACT_DataObject_GetDoubleData(dataObject));
if (rv<0) {
DBG_INFO(NULL, "here (%d)", rv);
}
@@ -114,11 +114,11 @@ void _setDoubleValue(AQHREACT_UNIT *unit, const char *sValueName, const AQHREACT
void _setStringValue(AQHREACT_UNIT *unit, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject)
{
AQHOME_REACT *aqh;
AQH_OBJECT *aqh;
int rv;
aqh=AQHREACT_Unit_GetAqHomeReact(unit);
rv=AqHomeReact_SetCharValue(aqh, sValueName, AQHREACT_DataObject_GetStringData(dataObject));
rv=AQH_ReactServer_SetCharValue(aqh, sValueName, AQHREACT_DataObject_GetStringData(dataObject));
if (rv<0) {
DBG_INFO(NULL, "here (%d)", rv);
}

View File

@@ -10,6 +10,7 @@
#define AQHOMEREACT_U_VARSET_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
@@ -17,7 +18,7 @@
#define AQHOMEREACT_UNIT_VARSET_PARAM_VALUENAME "varName"
AQHREACT_UNIT *AqHomeReact_UnitVarSet_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitVarSet_new(AQH_OBJECT *aqh);

View File

@@ -41,7 +41,7 @@ static void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREAC
* ------------------------------------------------------------------------------------------------
*/
AQHREACT_UNIT *AqHomeReact_UnitZeroPosNegString_new(AQHOME_REACT *aqh)
AQHREACT_UNIT *AqHomeReact_UnitZeroPosNegString_new(AQH_OBJECT *aqh)
{
AQHREACT_UNIT *unit;
AQHREACT_PORT *port;

View File

@@ -10,6 +10,7 @@
#define AQHOMEREACT_U_ZEROPOSNEGSTRING_H
#include "aqhome-react/server.h"
#include "aqhome-react/aqhome_react.h"
#include "aqhome-react/types/unit.h"
@@ -19,7 +20,7 @@
#define AQHOMEREACT_UNIT_VALUESET_PARAM_VALUE_ZERO "valueIfZero"
AQHREACT_UNIT *AqHomeReact_UnitZeroPosNegString_new(AQHOME_REACT *aqh);
AQHREACT_UNIT *AqHomeReact_UnitZeroPosNegString_new(AQH_OBJECT *aqh);