#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include "param_angle.h"
#include "param_dble.h"
#include "param_internal.h"
#include "utils_common.h"
#include "ppm/core.h"
#include "yac_assert.h"
Go to the source code of this file.
|
| static enum yac_param_type | yac_param_angle_get_type (const struct yac_param *param) |
| |
| static int | yac_param_angle_is_default (const struct yac_param *param) |
| |
| static const char * | yac_param_angle_get_name (const struct yac_param *param) |
| |
| static void | yac_param_angle_delete (struct yac_param *param) |
| |
| static int | yac_param_angle_set_scalar_dble (struct yac_param *param, double value) |
| |
| static int | yac_param_angle_set_scalar (struct yac_param *param, const char *value_str) |
| |
| static int | yac_param_angle_get_scalar_dble (const struct yac_param *param, double *value) |
| |
| static int | yac_param_angle_get_scalar (const struct yac_param *param, char *buf, size_t buflen) |
| |
| static int | yac_param_angle_get_scalar_kind (const struct yac_param *param, enum yac_param_scalar_kind *scalar_kind) |
| |
| static int | yac_param_angle_set_scalar_int (struct yac_param *param, int value) |
| |
| static int | yac_param_angle_get_scalar_int (const struct yac_param *param, int *value) |
| |
| struct yac_param * | yac_param_angle_new (const char *name, double *value_ptr, double default_value, double value_min, double value_max, int has_default, int is_defined) |
| | Create an angle parameter (stored in radians)
|
| |
◆ yac_param_angle_delete()
| static void yac_param_angle_delete |
( |
struct yac_param * | param | ) |
|
|
static |
◆ yac_param_angle_get_name()
| static const char * yac_param_angle_get_name |
( |
const struct yac_param * | param | ) |
|
|
static |
◆ yac_param_angle_get_scalar()
| static int yac_param_angle_get_scalar |
( |
const struct yac_param * | param, |
|
|
char * | buf, |
|
|
size_t | buflen ) |
|
static |
◆ yac_param_angle_get_scalar_dble()
| static int yac_param_angle_get_scalar_dble |
( |
const struct yac_param * | param, |
|
|
double * | value ) |
|
static |
◆ yac_param_angle_get_scalar_int()
| static int yac_param_angle_get_scalar_int |
( |
const struct yac_param * | param, |
|
|
int * | value ) |
|
static |
◆ yac_param_angle_get_scalar_kind()
◆ yac_param_angle_get_type()
◆ yac_param_angle_is_default()
| static int yac_param_angle_is_default |
( |
const struct yac_param * | param | ) |
|
|
static |
◆ yac_param_angle_new()
| struct yac_param * yac_param_angle_new |
( |
const char * | name, |
|
|
double * | value_ptr, |
|
|
double | default_value, |
|
|
double | value_min, |
|
|
double | value_max, |
|
|
int | has_default, |
|
|
int | is_defined ) |
Create an angle parameter (stored in radians)
Unit handling:
- Numeric setter/getter APIs use radians.
- String setter/getter APIs use degrees by default.
- String setter accepts optional unit suffixes
deg, rad, d, r (case-insensitive); if present, conversion is applied accordingly.
Wrapping:
- All values provided via setter interfaces are wrapped to
[-PI; PI) before range validation and storage.
- If
has_default is non-zero, default_value is wrapped accordingly.
- If
is_defined is non-zero, the current value behind value_ptr is wrapped accordingly.
- Parameters
-
| name | Name of the parameter |
| value_ptr | Pointer to the double value (in radians) |
| default_value | Default value (in radians, ignored if has_default is false) |
| value_min | Minimum allowed value (inclusive, in radians) |
| value_max | Maximum allowed value (inclusive, in radians) |
| has_default | If true, parameter has a default value; if false, value is undefined until set |
| is_defined | If true, initial value is considered defined; if false, initial value is considered undefined and user must set it before getting |
- Returns
- Pointer to new parameter handle
Definition at line 148 of file param_angle.c.
◆ yac_param_angle_set_scalar()
| static int yac_param_angle_set_scalar |
( |
struct yac_param * | param, |
|
|
const char * | value_str ) |
|
static |
◆ yac_param_angle_set_scalar_dble()
| static int yac_param_angle_set_scalar_dble |
( |
struct yac_param * | param, |
|
|
double | value ) |
|
static |
◆ yac_param_angle_set_scalar_int()
| static int yac_param_angle_set_scalar_int |
( |
struct yac_param * | param, |
|
|
int | value ) |
|
static |
◆ yac_param_angle_vtable
Initial value:= {
.get_sub_count = NULL,
.get_sub_by_name = NULL,
.get_sub_by_index = NULL,
.append = NULL,
}
static void yac_param_angle_delete(struct yac_param *param)
static enum yac_param_type yac_param_angle_get_type(const struct yac_param *param)
static int yac_param_angle_get_scalar_dble(const struct yac_param *param, double *value)
static int yac_param_angle_set_scalar_dble(struct yac_param *param, double value)
static int yac_param_angle_set_scalar_int(struct yac_param *param, int value)
static int yac_param_angle_is_default(const struct yac_param *param)
static int yac_param_angle_get_scalar_int(const struct yac_param *param, int *value)
static const char * yac_param_angle_get_name(const struct yac_param *param)
static int yac_param_angle_get_scalar_kind(const struct yac_param *param, enum yac_param_scalar_kind *scalar_kind)
static int yac_param_angle_get_scalar(const struct yac_param *param, char *buf, size_t buflen)
static int yac_param_angle_set_scalar(struct yac_param *param, const char *value_str)
Definition at line 130 of file param_angle.c.