Data Sub-Package
Profiles must be created and attached to a profile library before they can be used as an object attribute value. To create a new profile, use prg_profile_create_bt(). You can also create a new profile by combining two existing ones, using prg_profiles_merge_bt(). To attach a profile to a library, use the Library sub-package function prg_profile_lib_profile_add().
Profiles are assigned as object attribute values indirectly, by using a profile specification. A profile specification is a string that contains the information needed to access the profile. To assign a profile to an object attribute, first obtain a specification with prg_profile_spec_get(), then use the Kernel Procedure op_ima_obj_attr_set() to assign it.
To access a profile's data, you must first load it into memory. If the profile is an object attribute value, use one of the op_ima_obj_attr_get() KPs to retrieve the profile's specification (reading it in as a string), then load the profile with prg_profile_load(). You can also load a profile directly from a profile library with the Library sub-package functions prg_profile_lib_profile_named_load() or prg_profile_lib_profile_nth_load(). When you no longer need access to a profile you have loaded, dereference it with prg_profile_unload().
To free the memory used by a profile you created, use prg_profile_destroy().
To retrieve information and data from a profile, use these functions:
- prg_profile_name_get() obtains a profile's name.
- prg_profile_x_units_get() and prg_profile_y_units_get() obtain the units for the x and y data.
- prg_profile_data_length_get_bt() obtains the number of data entries in a profile.
- prg_profile_data_entry_get_bt() retrieves one data entry from a profile.
- prg_profile_all_data_entries_get_bt() retrieves all data entries from a profile.
- prg_profile_earliest_time_get() and prg_profile_latest_time_get() retrieve the first and last time, respectively, from a profile's data entries.
- prg_profile_duration_get() retrieves the difference between the first and last times in a profile.
- prg_profile_start_time_get() retrieves the start time of a profile.
You can set the start time of a profile with prg_profile_start_time_set().
You can scale the data in a profile with prg_profile_scale().
Profiles sometimes contain unwanted fluctuations in the data values. To remove these glitches, use prg_profile_data_glitch_remove().