YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
param_angle.c File Reference
#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"
Include dependency graph for param_angle.c:

Go to the source code of this file.

Data Structures

struct  yac_param_angle
 

Functions

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_paramyac_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)
 

Variables

static const struct yac_param_vtable yac_param_angle_vtable
 

Function Documentation

◆ yac_param_angle_delete()

static void yac_param_angle_delete ( struct yac_param * param)
static

Definition at line 44 of file param_angle.c.

Here is the call graph for this function:

◆ yac_param_angle_get_name()

static const char * yac_param_angle_get_name ( const struct yac_param * param)
static

Definition at line 37 of file param_angle.c.

Here is the call graph for this function:

◆ yac_param_angle_get_scalar()

static int yac_param_angle_get_scalar ( const struct yac_param * param,
char * buf,
size_t buflen )
static

Definition at line 86 of file param_angle.c.

Here is the call graph for this function:

◆ yac_param_angle_get_scalar_dble()

static int yac_param_angle_get_scalar_dble ( const struct yac_param * param,
double * value )
static

Definition at line 78 of file param_angle.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_param_angle_get_scalar_int()

static int yac_param_angle_get_scalar_int ( const struct yac_param * param,
int * value )
static

Definition at line 113 of file param_angle.c.

Here is the call graph for this function:

◆ yac_param_angle_get_scalar_kind()

static int yac_param_angle_get_scalar_kind ( const struct yac_param * param,
enum yac_param_scalar_kind * scalar_kind )
static

Definition at line 100 of file param_angle.c.

Here is the call graph for this function:

◆ yac_param_angle_get_type()

static enum yac_param_type yac_param_angle_get_type ( const struct yac_param * param)
static

Definition at line 24 of file param_angle.c.

◆ yac_param_angle_is_default()

static int yac_param_angle_is_default ( const struct yac_param * param)
static

Definition at line 30 of file param_angle.c.

Here is the call graph for this function:

◆ 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
nameName of the parameter
value_ptrPointer to the double value (in radians)
default_valueDefault value (in radians, ignored if has_default is false)
value_minMinimum allowed value (inclusive, in radians)
value_maxMaximum allowed value (inclusive, in radians)
has_defaultIf true, parameter has a default value; if false, value is undefined until set
is_definedIf 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_param_angle_set_scalar()

static int yac_param_angle_set_scalar ( struct yac_param * param,
const char * value_str )
static

Definition at line 64 of file param_angle.c.

Here is the call graph for this function:

◆ yac_param_angle_set_scalar_dble()

static int yac_param_angle_set_scalar_dble ( struct yac_param * param,
double value )
static

Definition at line 52 of file param_angle.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_param_angle_set_scalar_int()

static int yac_param_angle_set_scalar_int ( struct yac_param * param,
int value )
static

Definition at line 108 of file param_angle.c.

Here is the call graph for this function:

Variable Documentation

◆ yac_param_angle_vtable

const struct yac_param_vtable yac_param_angle_vtable
static
Initial value:
= {
.get_sub_count = NULL,
.get_sub_by_name = NULL,
.get_sub_by_index = NULL,
.append = NULL,
.get_scalar_kind = yac_param_angle_get_scalar_kind,
.set_scalar_int = yac_param_angle_set_scalar_int,
.set_scalar_dble = yac_param_angle_set_scalar_dble,
.get_scalar_int = yac_param_angle_get_scalar_int,
}
static void yac_param_angle_delete(struct yac_param *param)
Definition param_angle.c:44
static enum yac_param_type yac_param_angle_get_type(const struct yac_param *param)
Definition param_angle.c:24
static int yac_param_angle_get_scalar_dble(const struct yac_param *param, double *value)
Definition param_angle.c:78
static int yac_param_angle_set_scalar_dble(struct yac_param *param, double value)
Definition param_angle.c:52
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)
Definition param_angle.c:30
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)
Definition param_angle.c:37
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)
Definition param_angle.c:86
static int yac_param_angle_set_scalar(struct yac_param *param, const char *value_str)
Definition param_angle.c:64

Definition at line 130 of file param_angle.c.