2022-07-06 17:51:51 +00:00
|
|
|
|
/*
|
|
|
|
|
* node_settings.h
|
|
|
|
|
*
|
|
|
|
|
* Created on: 6 июл. 2022 г.
|
|
|
|
|
* Author: alexander
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef NODE_SETTINGS_H_
|
|
|
|
|
#define NODE_SETTINGS_H_
|
|
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
2022-07-08 16:45:45 +00:00
|
|
|
|
#include "parameter.h"
|
|
|
|
|
#include "value.h"
|
2022-07-06 17:51:51 +00:00
|
|
|
|
|
2022-07-08 16:45:45 +00:00
|
|
|
|
typedef struct NodeValue
|
2022-07-06 17:51:51 +00:00
|
|
|
|
{
|
2022-07-08 16:45:45 +00:00
|
|
|
|
Value name;
|
|
|
|
|
bool set;
|
|
|
|
|
bool change;
|
|
|
|
|
char *current;
|
|
|
|
|
struct NodeValue *next;
|
|
|
|
|
} NodeValue;
|
2022-07-06 17:51:51 +00:00
|
|
|
|
|
2022-07-08 16:45:45 +00:00
|
|
|
|
typedef struct NodeParameter
|
2022-07-06 17:51:51 +00:00
|
|
|
|
{
|
2022-07-08 16:45:45 +00:00
|
|
|
|
Parameter name;
|
|
|
|
|
bool set;
|
2022-07-07 16:35:48 +00:00
|
|
|
|
bool change;
|
2022-07-08 16:45:45 +00:00
|
|
|
|
char *key;
|
|
|
|
|
NodeValue *value;
|
|
|
|
|
bool singleValue;
|
|
|
|
|
size_t countValue;
|
|
|
|
|
size_t countValueSet;
|
2022-07-11 17:06:05 +00:00
|
|
|
|
struct NodeParameter *dependence;
|
|
|
|
|
struct NodeParameter *conflict;
|
2022-07-08 16:45:45 +00:00
|
|
|
|
struct NodeParameter *next;
|
|
|
|
|
} NodeParameter;
|
|
|
|
|
|
|
|
|
|
typedef struct NodeHead
|
2022-07-06 17:51:51 +00:00
|
|
|
|
{
|
2022-07-08 16:45:45 +00:00
|
|
|
|
NodeParameter *parameter;
|
|
|
|
|
size_t countParameter;
|
|
|
|
|
size_t countParameterSet;
|
|
|
|
|
} NodeHead;
|
|
|
|
|
|
|
|
|
|
extern NodeHead settings;
|
|
|
|
|
|
2022-07-11 17:06:05 +00:00
|
|
|
|
NodeParameter* getParameter(Parameter name);
|
2022-07-13 17:49:49 +00:00
|
|
|
|
NodeValue* getValue(Value name);
|
2022-07-11 17:06:05 +00:00
|
|
|
|
void addParameterKey(Parameter name, char *key, bool set, bool singleValue, NodeParameter *dependence, NodeParameter *conflict);
|
2022-07-08 16:45:45 +00:00
|
|
|
|
void addParameterValue(Parameter pName, Value vName, char *current, bool set);
|
|
|
|
|
void freeSettings();
|
|
|
|
|
|
|
|
|
|
NodeValue *getSetNodeValue(NodeParameter *node);
|
2022-07-14 10:40:51 +00:00
|
|
|
|
char *getSetValueCurrent(Parameter name);
|
2022-07-08 16:45:45 +00:00
|
|
|
|
bool getSetParameter(Parameter name);
|
|
|
|
|
bool getSetValue(Parameter pName, Value vName);
|
2022-07-11 17:06:05 +00:00
|
|
|
|
int getCountValue(Parameter name);
|
2022-07-08 16:45:45 +00:00
|
|
|
|
void changeParameter(Parameter name);
|
|
|
|
|
void changeValue(Parameter pName, Value vName);
|
|
|
|
|
void saveChangeSettings();
|
|
|
|
|
void resetChangeSettings();
|
2022-07-11 17:06:05 +00:00
|
|
|
|
void setParameter(Parameter name, bool set);
|
2022-07-08 16:45:45 +00:00
|
|
|
|
void setParameterValue(Parameter pName, Value vName, char *current);
|
2022-07-06 17:51:51 +00:00
|
|
|
|
|
|
|
|
|
#endif /* SETTINGS_H_ */
|