📄 coeff_obj.c
字号:
/*************************************************************************************************************************************************************The coeff_obj.c module encapsulates the parameter data structures*************************************************************************************************************************************************************/#include <stdio.h>#include <stdlib.h>#include <errno.h>#include <string.h>#include "coeff_obj.h"#include "ugm_macros.h"#include "ugm_defines.h"#include "scenario_obj.h"#include "proc_obj.h"#include "memory_obj.h"#include "globals.h"char coeff_obj_c_sccs_id[] = "@(#)coeff_obj.c 1.84 12/4/00";/*****************************************************************************\********************************************************************************* **** STATIC MEMORY FOR THIS OBJECT **** *********************************************************************************\*****************************************************************************/static coeff_val_info saved_coefficient;static coeff_val_info current_coefficient;static coeff_int_info step_coeff;static coeff_int_info start_coeff;static coeff_int_info stop_coeff;static coeff_int_info best_fit_coeff;static char coeff_filename[MAX_FILENAME_LEN];/*****************************************************************************\********************************************************************************* **** STATIC FUNCTION PROTOTYPES **** *********************************************************************************\*****************************************************************************//*****************************************************************************\********************************************************************************* **** SET FUNCTIONS **** *********************************************************************************\*****************************************************************************//*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetCurrentDiffusion** PURPOSE: set the diffusion field** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetCurrentDiffusion (double val){ if (val == 0) { current_coefficient.diffusion = 1; saved_coefficient.diffusion = 1; } else { current_coefficient.diffusion = val; saved_coefficient.diffusion = val; }}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetCurrentSpread** PURPOSE: set the spread field of current_coefficient struct** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetCurrentSpread (double val){ if (val == 0) { current_coefficient.spread = 1; saved_coefficient.spread = 1; } else { current_coefficient.spread = val; saved_coefficient.spread = val; }}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetCurrentBreed** PURPOSE: set breed field of current_coefficient struct** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetCurrentBreed (double val){ if (val == 0) { current_coefficient.breed = 1; saved_coefficient.breed = 1; } else { current_coefficient.breed = val; saved_coefficient.breed = val; }}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetCurrentSlopeResist** PURPOSE: set slope_resistance field of current_coefficient struct** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetCurrentSlopeResist (double val){ if (val == 0) { current_coefficient.slope_resistance = 1; saved_coefficient.slope_resistance = 1; } else { current_coefficient.slope_resistance = val; saved_coefficient.slope_resistance = val; }}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetCurrentRoadGravity** PURPOSE: set road_gravity field of current_coefficient** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetCurrentRoadGravity (double val){ if (val == 0) { current_coefficient.road_gravity = 1; saved_coefficient.road_gravity = 1; } else { current_coefficient.road_gravity = val; saved_coefficient.road_gravity = val; }}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetStepDiffusion** PURPOSE: set diffusion field of step_coeff struct** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStepDiffusion (int val){ step_coeff.diffusion = val;}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetStepSpread** PURPOSE: set spread of step_coeff struct** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStepSpread (int val){ step_coeff.spread = val;}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetStepBreed** PURPOSE: set breed field of step_coeff** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStepBreed (int val){ step_coeff.breed = val;}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetStepSlopeResist** PURPOSE: set slope_resistance field of step_coeff** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStepSlopeResist (int val){ step_coeff.slope_resistance = val;}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetStepRoadGravity** PURPOSE: set road_gravity field of step_coeff struct** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStepRoadGravity (int val){ step_coeff.road_gravity = val;}/*************************************************************************************************************************************************************** FUNCTION NAME: diffusion** PURPOSE: set diffusion field of start_coeff struct** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStartDiffusion (int val){ start_coeff.diffusion = val;}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetStartSpread** PURPOSE: set spread field of start_coeff** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStartSpread (int val){ start_coeff.spread = val;}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetStartBreed** PURPOSE: set breed field of start_coeff** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStartBreed (int val){ start_coeff.breed = val;}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetStartSlopeResist** PURPOSE: set slope_resistance field of start_coeff** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStartSlopeResist (int val){ start_coeff.slope_resistance = val;}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetStartRoadGravity** PURPOSE: set road_gravity field of start_coeff** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStartRoadGravity (int val){ start_coeff.road_gravity = val;}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetStopDiffusion** PURPOSE: set diffusion field of stop_coeff** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStopDiffusion (int val){ stop_coeff.diffusion = val;}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetStopSpread** PURPOSE: set spread field of stop_coeff** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStopSpread (int val){ stop_coeff.spread = val;}/*************************************************************************************************************************************************************** FUNCTION NAME: coeff_SetStopBreed** PURPOSE: set breed field of stop_coeff** AUTHOR: Keith Clarke** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500** CREATION DATE: 11/11/1999** DESCRIPTION:*****/void coeff_SetStopBreed (int val){ stop_coeff.breed = val;}/******************************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -