00001
00025 #include "RothPipeline.h"
00026
00027 RothPipeline * InitRothPipelineEmpty() {
00028 RothPipeline * rp = NULL;
00029
00030 if ( (rp = (RothPipeline *) malloc(sizeof(RothPipeline))) == NULL ) {
00031 ERR_ERROR_CONTINUE("Unable to allocate memory for RothPipeline. \n", ERR_ENOMEM);
00032 return rp;
00033 }
00034
00035 if ( RothPipelineSetDefaultValues(rp) ) {
00036 ERR_ERROR_CONTINUE("Initialization of RothPipeline failed. \n", ERR_EBADFUNC);
00037 }
00038
00039 return rp;
00040 }
00041
00042 int RothPipelineSetDefaultValues(RothPipeline * rp) {
00043 if ( rp == NULL ) {
00044 ERR_ERROR("RothPipeline not initialized, unable to set default values. \n", ERR_EINVAL);
00045 }
00046
00047 rp->pipe = EnumInitPipe;
00048 rp->drx = rp->lrx = 0.0;
00049 rp->fdead = rp->lmex = rp->taur = 0.0;
00050 rp->ppflux = rp->slp_k = rp->wnd_b = rp->wnd_e = rp->wnd_k = 0.0;
00051 rp->d1hfm = rp->d10hfm = rp->d100hfm = rp->lhfm = rp->lwfm = 0.0;
00052 rp->wnd_fpm = rp->slp = rp->wnd_vec = rp->asp = 0.0;
00053
00054 rp->rxint = rp->ros_0 = rp->hpua = 0.0;
00055 rp->ros_max = rp->ros_az_max = rp->wnd_eff = 0.0;
00056 rp->lwratio = 1.0;
00057 rp->eccen = 0.0;
00058 rp->phi_w = rp->phi_s = rp->phi_ew = 0.0;
00059 rp->wnd_lim = ROTH_PIPELINE_NO_WIND_LIMIT;
00060 rp->ros_any = rp->ros_az_any = 0.0;
00061
00062 return ERR_SUCCESS;
00063 }
00064
00065 void FreeRothPipeline(void * vptr) {
00066 RothPipeline * rp = NULL;
00067 if ( vptr != NULL ) {
00068 rp = (RothPipeline *) vptr;
00069 if ( rp != NULL ) {
00070 free(rp);
00071 }
00072 }
00073 rp = NULL;
00074 return;
00075 }
00076
00077