FUNCTION convert_to_maths_value
(* SCHEMA step_merged_ap_schema; *)
-- IN AP238 STEP-NC/AP242
FUNCTION convert_to_maths_value
(val : GENERIC : G ) : maths_value;
LOCAL
types : SET OF STRING := TYPEOF(val);
ival : maths_integer;
rval : maths_real;
nval : maths_number;
tfval : maths_boolean;
lval : maths_logical;
sval : maths_string;
bval : maths_binary;
tval : maths_tuple := the_empty_maths_tuple;
mval : maths_value;
END_LOCAL;
IF schema_prefix + 'MATHS_VALUE' IN types THEN
RETURN (val);
END_IF;
IF 'INTEGER' IN types THEN
ival := val;
RETURN (ival);
END_IF;
IF 'REAL' IN types THEN
rval := val;
RETURN (rval);
END_IF;
IF 'NUMBER' IN types THEN
nval := val;
RETURN (nval);
END_IF;
IF 'BOOLEAN' IN types THEN
tfval := val;
RETURN (tfval);
END_IF;
IF 'LOGICAL' IN types THEN
lval := val;
RETURN (lval);
END_IF;
IF 'STRING' IN types THEN
sval := val;
RETURN (sval);
END_IF;
IF 'BINARY' IN types THEN
bval := val;
RETURN (bval);
END_IF;
IF 'LIST' IN types THEN
REPEAT i := 1 TO SIZEOF(val);
mval := convert_to_maths_value(val[i]);
IF NOT EXISTS(mval) THEN
RETURN (?);
END_IF;
INSERT( tval, mval, i - 1 );
END_REPEAT;
RETURN (tval);
END_IF;
RETURN (?);
END_FUNCTION;
Referenced By
Defintion convert_to_maths_value is references by the following definitions:
[Top Level Definitions] [Exit]Generated by STEP Tools® EXPRESS to HTML Converter
2024-09-06T14:00:33-04:00