set_values
Description
set_values.c is a Motif GUI source file that provides a function (set_values) to populate the text input fields of the βSpacingsβ and βThresholdsβ configuration dialogs. Its primary purpose is to ensure that when these dialogs are displayed, the text widgets reflect the current values of the global parameters they control, providing up-to-date feedback to the user.
How It Works
set_values()function:- This function uses
XtSetValuesto update theXmNvalueresource of variousXmText(orXmTextField) widgets. - Spacing Parameters: It retrieves the current values of global variables such as
PORT_NOMINAL_SPACING,PORT_AB_AC_ratio,PORT_AB_AD_ratio,STBD_NOMINAL_SPACING,STBD_AB_AC_ratio, andSTBD_AB_AD_ratio. Thesefloatvalues are formatted into strings usingsprintfand then set as theXmNvalueforSpacingText1throughSpacingText6respectively. - Threshold Parameters: Similarly, it retrieves the current integer values of global variables
athresh,pthresh,oftotal,nobelow, andfirstsam. These are formatted into strings and set as theXmNvalueforThresholdText1throughThresholdText5respectively. This function effectively synchronizes the displayed GUI values with the internal application state, making the configuration dialogs user-friendly.
- This function uses