您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ssSetInputPortWidth函数代码示例

51自学网 2021-06-03 08:17:56
  C++
这篇教程C++ ssSetInputPortWidth函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ssSetInputPortWidth函数的典型用法代码示例。如果您正苦于以下问题:C++ ssSetInputPortWidth函数的具体用法?C++ ssSetInputPortWidth怎么用?C++ ssSetInputPortWidth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ssSetInputPortWidth函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: mdlSetOutputPortWidth

 static void mdlSetOutputPortWidth(SimStruct *S, int_T port, int_T outputPortWidth) {     if( ((ssGetInputPortWidth(S, 0) != DYNAMICALLY_SIZED) && (ssGetInputPortWidth(S, 0) != outputPortWidth)) || /         ((ssGetOutputPortWidth(S, 1) != DYNAMICALLY_SIZED) && (ssGetOutputPortWidth(S, 1) != outputPortWidth)) )     {         ssSetErrorStatus(S,"xdot and x must have the same size");         return;     }     if( intval(mxGetScalar(paramInitialConditionSource)) > 1 )     {         if( (ssGetInputPortWidth(S, 1) != DYNAMICALLY_SIZED) && (ssGetInputPortWidth(S, 1) != outputPortWidth) )         {             ssSetErrorStatus(S,"xdot, x0 and x must have the same size");             return;         }         ssSetInputPortWidth(S, 1, outputPortWidth);     }     else     {         if( (mxGetNumberOfElements(paramInitialCondition) != 1) && (mxGetNumberOfElements(paramInitialCondition) != outputPortWidth) )         {             ssSetErrorStatus(S,"xdot, x0 and x must have the same size");             return;         }     }     ssSetInputPortWidth(S, 0, outputPortWidth);     ssSetOutputPortWidth(S, 1, outputPortWidth); }
开发者ID:diogoalmeida,项目名称:thesis,代码行数:28,


示例2: mdlInitializeSizes

/* Function: mdlInitializeSizes =============================================== * Abstract: *   Setup sizes of the various vectors. */static void mdlInitializeSizes(SimStruct *S){    DECL_AND_INIT_DIMSINFO(inputDimsInfo);    DECL_AND_INIT_DIMSINFO(outputDimsInfo);    ssSetNumSFcnParams(S, NPARAMS);     if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {	 return; /* Parameter mismatch will be reported by Simulink */     }    ssSetNumContStates(S, NUM_CONT_STATES);    ssSetNumDiscStates(S, NUM_DISC_STATES);    if (!ssSetNumInputPorts(S, NUM_INPUTS)) return;    /*Input Port 0 */    ssSetInputPortWidth(S,  0, INPUT_0_WIDTH); /* */    ssSetInputPortDataType(S, 0, SS_UINT8);    ssSetInputPortComplexSignal(S,  0, INPUT_0_COMPLEX);    ssSetInputPortDirectFeedThrough(S, 0, INPUT_0_FEEDTHROUGH);    ssSetInputPortRequiredContiguous(S, 0, 1); /*direct input signal access*/    /*Input Port 1 */    ssSetInputPortWidth(S,  1, INPUT_1_WIDTH);    ssSetInputPortDataType(S, 1, SS_UINT8);    ssSetInputPortComplexSignal(S, 1, INPUT_1_COMPLEX);    ssSetInputPortDirectFeedThrough(S, 1, INPUT_1_FEEDTHROUGH);    ssSetInputPortRequiredContiguous(S, 1, 1); /*direct input signal access*/    /*Input Port 2 */    ssSetInputPortWidth(S,  2, INPUT_2_WIDTH); /* */    ssSetInputPortDataType(S, 2, SS_UINT8);    ssSetInputPortComplexSignal(S,  2, INPUT_2_COMPLEX);    ssSetInputPortDirectFeedThrough(S, 2, INPUT_2_FEEDTHROUGH);    ssSetInputPortRequiredContiguous(S, 2, 1); /*direct input signal access*/    if (!ssSetNumOutputPorts(S, NUM_OUTPUTS)) return;    /* Output Port 0 */    ssSetOutputPortWidth(S, 0, OUTPUT_0_WIDTH);    ssSetOutputPortDataType(S, 0, SS_DOUBLE);    ssSetOutputPortComplexSignal(S, 0, OUTPUT_0_COMPLEX);    /* Output Port 1 */    ssSetOutputPortWidth(S, 1, OUTPUT_1_WIDTH);    ssSetOutputPortDataType(S, 1, SS_DOUBLE);    ssSetOutputPortComplexSignal(S, 1, OUTPUT_1_COMPLEX);    ssSetNumSampleTimes(S, 1);    ssSetNumRWork(S, 0);    ssSetNumIWork(S, 0);    ssSetNumPWork(S, 0);    ssSetNumModes(S, 0);    ssSetNumNonsampledZCs(S, 0);    ssSetSimulinkVersionGeneratedIn(S, "8.4");    /* Take care when specifying exception free code - see sfuntmpl_doc.c */    ssSetOptions(S, (SS_OPTION_EXCEPTION_FREE_CODE |                     SS_OPTION_USE_TLC_WITH_ACCELERATOR | 		     SS_OPTION_WORKS_WITH_CODE_REUSE));}
开发者ID:sarnold,项目名称:Hexapod,代码行数:64,


示例3: mdlInitializeSizes

static void mdlInitializeSizes(SimStruct *S) {    ssSetNumSFcnParams(S, NPAR);    if(ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S))   return;        if(!ssSetNumInputPorts(S, NIN)) return;        {        int_T   i;        for(i = 0; i < NIN; i++){            ssSetInputPortDirectFeedThrough(S, i, 1);            ssSetInputPortDataType(S, i, DYNAMICALLY_TYPED);        }                ssSetInputPortWidth(S, 0, IP0_SIZE);        ssSetInputPortWidth(S, 1, IP1_SIZE);        ssSetInputPortWidth(S, 2, IP2_SIZE);    }        if(!ssSetNumOutputPorts(S, NOUT))    return;    {            ssSetOutputPortWidth(S, 0, OP0_SIZE);			ssSetOutputPortWidth(S, 1, OP1_SIZE);    }        ssSetNumSampleTimes(S, 1);           sensorData.imuData_ptr = &imuData;	sensorData.gpsData_ptr = &gpsData;	sensorData.adData_ptr = &adData;	sensorData.accelData_ptr = &accelData;		init_control();}
开发者ID:PAAW,项目名称:mAEWing1,代码行数:33,


示例4: mdlInitializeSizes

static void mdlInitializeSizes(SimStruct *S) {	bool dataPort;	ssSetNumSFcnParams(S,3);	if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {		return; /* Parameter mismatch will be reported by Simulink */	}	dataPort = PARAM(2)[0];	if (dataPort) {		if (!ssSetNumInputPorts(S,2)) return;		ssSetInputPortWidth(S,1,DYNAMICALLY_SIZED);		ssSetInputPortDirectFeedThrough(S,1,1);	} else {		if (!ssSetNumInputPorts(S,1)) return;	}	ssSetInputPortWidth(S,0,1);	ssSetInputPortDirectFeedThrough(S,0,1);	ssSetNumContStates(S,0);	ssSetNumDiscStates(S,0);	if (!ssSetNumOutputPorts(S,0)) return;	ssSetInputPortDataType(S, 0, DYNAMICALLY_TYPED);	ssSetNumSampleTimes(S,1);	ssSetNumRWork(S,1);	ssSetNumIWork(S,1);	ssSetNumPWork(S,2);	ssSetNumModes(S,0);	ssSetNumNonsampledZCs(S,0);	ssSetOptions(S,0);}
开发者ID:rhopfer,项目名称:rtairos,代码行数:33,


示例5: mdlInitializeSizes

static void mdlInitializeSizes(SimStruct *S){    int i;    ssSetNumSFcnParams(S, NPARAMS);  /* Number of expected parameters */    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {        /* Return if number of expected != number of actual parameters */        return;    }    for (i = 0; i < NPARAMS; i++)        ssSetSFcnParamTunable(S, i, 0);    ssSetNumContStates(S, 0);    ssSetNumDiscStates(S, 0);    if (!ssSetNumInputPorts(S, 2)) return;    ssSetInputPortWidth(S, 0, 7);    ssSetInputPortRequiredContiguous(S, 0, true);    ssSetInputPortDirectFeedThrough(S, 0, 1);    ssSetInputPortWidth(S, 1, DYNAMICALLY_SIZED);    ssSetInputPortRequiredContiguous(S, 1, true);    ssSetInputPortDirectFeedThrough(S, 1, 1);    if (!ssSetNumOutputPorts(S, 1)) return;    ssSetOutputPortWidth(S, 0, 12);    ssSetNumSampleTimes(S, 1);    ssSetNumRWork(S, 0);    ssSetNumIWork(S, 5);    ssSetNumPWork(S, 0);    ssSetNumModes(S, 0);    ssSetNumNonsampledZCs(S, 0);}
开发者ID:TomaszSz,项目名称:T-MATS,代码行数:35,


示例6: mdlInitializeSizes

/* Function: mdlInitializeSizes */static void mdlInitializeSizes(SimStruct *S){    ssSetNumSFcnParams(S, 19);  /* Number of expected parameters */    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {        return; /* Parameter mismatch will be reported by Simulink */    }    ssSetNumContStates(S, 4); /* Number of continuous states*/    if (!ssSetNumInputPorts(S, 3)) return; /*Number of INPUTS*/    ssSetInputPortWidth(S, 0, 1);          /* In0.0: I */    ssSetInputPortWidth(S, 1, 1);          /* In1.0: x */    ssSetInputPortWidth(S, 2, 1);          /* In1.0: dx */    ssSetInputPortDirectFeedThrough(S, 0, 1);    ssSetInputPortDirectFeedThrough(S, 1, 1);    ssSetInputPortDirectFeedThrough(S, 2, 1);    if (!ssSetNumOutputPorts(S, 1)) return;/* Number of OUTPUTS */    ssSetOutputPortWidth(S, 0, 1);         /* Out0.0: deltaF */    ssSetNumSampleTimes(S, 1);    ssSetSimStateCompliance(S, USE_DEFAULT_SIM_STATE);    ssSetOptions(S, 0);}
开发者ID:JobAngel,项目名称:Job-IIT,代码行数:28,


示例7: mdlSetDefaultPortDimensionInfo

/* Function: mdlSetDefaultPortDimensionInfo =============================== * Abstract: *    This method is called when there is not enough information in your *    model to uniquely determine the port dimensionality of signals *    entering or leaving your block. When this occurs, Simulink's *    dimension propagation engine calls this method to ask you to set *    your S-functions default dimensions for any input and output ports *    that are dynamically sized. * *    If you do not provide this method and you have dynamically sized ports *    where Simulink does not have enough information to propagate the *    dimensionality to your S-function, then Simulink will set these unknown *    ports to the 'block width' which is determined by examining any known *    ports. If there are no known ports, the width will be set to 1. * */static void mdlSetDefaultPortDimensionInfo(SimStruct *S){/* Set input port 4 default dimension */  if (ssGetInputPortWidth(S, 3) == DYNAMICALLY_SIZED) {ssSetInputPortWidth(S, 3, 1);  }/* Set input port 5 default dimension */  if (ssGetInputPortWidth(S, 4) == DYNAMICALLY_SIZED) {ssSetInputPortWidth(S, 4, 1);  }}
开发者ID:querquer,项目名称:faultinjection-framework,代码行数:29,


示例8: mdlInitializeSizes

/* Function: mdlInitializeSizes =============================================== * Abstract: *    The sizes information is used by Simulink to determine the S-function *    block's characteristics (number of inputs, outputs, states, etc.). */static void mdlInitializeSizes(SimStruct *S){    ssSetNumSFcnParams(S, NPARAMS);  /* Number of expected parameters */#if defined(MATLAB_MEX_FILE)    if (ssGetNumSFcnParams(S) == ssGetSFcnParamsCount(S)) {        mdlCheckParameters(S);        if (ssGetErrorStatus(S) != NULL) {            return;        }    } else {        return; /* Parameter mismatch will be reported by Simulink */    }#endif    {        int iParam = 0;        int nParam = ssGetNumSFcnParams(S);        for ( iParam = 0; iParam < nParam; iParam++ )        {            ssSetSFcnParamTunable( S, iParam, SS_PRM_SIM_ONLY_TUNABLE );        }    }    ssSetNumContStates(S, NSTATES);    ssSetNumDiscStates(S, 0);    if (!ssSetNumInputPorts(S, NINPUTS)) return;    ssSetInputPortWidth(S, 0, 1);    ssSetInputPortDirectFeedThrough(S, 0, TRUE);    ssSetInputPortWidth(S, 1, 1);    ssSetInputPortDirectFeedThrough(S, 1, TRUE);    ssSetInputPortWidth(S, 2, 1);    ssSetInputPortDirectFeedThrough(S, 2, TRUE);    if (!ssSetNumOutputPorts(S, NOUTPUTS)) return;    //ssSetOutputPortWidth(S, 0, NOUTPUTS);    {        ssSetOutputPortWidth(S, 0, 1);    }    ssSetNumSampleTimes(S, 1);    ssSetNumRWork(S, 0);    ssSetNumIWork(S, 0);    ssSetNumPWork(S, 0);    ssSetNumModes(S, 0);    ssSetNumNonsampledZCs(S, 0);    ssSetSimStateCompliance(S, USE_DEFAULT_SIM_STATE);    /* Take care when specifying exception free code - see sfuntmpl_doc.c */    ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE);}
开发者ID:minosniu,项目名称:nerf-c,代码行数:56,


示例9: mdlInitializeSizes

/* Function: mdlInitializeSizes =============================================== * Abstract: *    The sizes information is used by Simulink to determine the S-function *    block's characteristics (number of inputs, outputs, states, etc.). */static void mdlInitializeSizes(SimStruct *S){    /* See sfuntmpl_doc.c for more details on the macros below */    ssSetNumSFcnParams(S, 1);  /* Number of expected parameters */    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {        /* Return if number of expected != number of actual parameters */        return;    }    ssSetNumContStates(S, 0);    ssSetNumDiscStates(S, 0);    if (!ssSetNumInputPorts(S, 3)) return;    ssSetInputPortWidth(S, 0, 1);    ssSetInputPortWidth(S, 1, 1);    ssSetInputPortWidth(S, 2, 1);    ssSetInputPortRequiredContiguous(S, 0, true); /*direct input signal access*/    ssSetInputPortRequiredContiguous(S, 1, true); /*direct input signal access*/    ssSetInputPortRequiredContiguous(S, 2, true); /*direct input signal access*/    /*     * Set direct feedthrough flag (1=yes, 0=no).     * A port has direct feedthrough if the input is used in either     * the mdlOutputs or mdlGetTimeOfNextVarHit functions.     * See matlabroot/simulink/src/sfuntmpl_directfeed.txt.     */    ssSetInputPortDirectFeedThrough(S, 0, 1);    ssSetInputPortDirectFeedThrough(S, 1, 1);    ssSetInputPortDirectFeedThrough(S, 2, 1);    if (!ssSetNumOutputPorts(S, 5)) return;    ssSetOutputPortWidth(S, 0, 1);    ssSetOutputPortWidth(S, 1, 1);    ssSetOutputPortWidth(S, 2, 1);    ssSetOutputPortWidth(S, 3, 1);    ssSetOutputPortWidth(S, 4, 1);            ssSetNumSampleTimes(S, 1);    ssSetNumRWork(S, 0);    ssSetNumIWork(S, 0);    ssSetNumPWork(S, 0);    ssSetNumModes(S, 0);    ssSetNumNonsampledZCs(S, 0);    /* Specify the sim state compliance to be same as a built-in block */    ssSetSimStateCompliance(S, USE_DEFAULT_SIM_STATE);    ssSetOptions(S, 0);}
开发者ID:KevinKSY,项目名称:EngineSystemModel,代码行数:56,


示例10: mdlInitializeSizes

/*=====================================* * Configuration and execution methods * *=====================================*/static void mdlInitializeSizes(SimStruct *S){#ifdef DEBUG	debug("mdlInitializeSizes entered./n");#endif    ssSetNumSFcnParams(S, NPAR);  /* Number of expected parameters */    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {		mdlCheckParameters(S);        if (ssGetErrorStatus(S) != NULL) return;    }    ssSetNumContStates(S, 0);    ssSetNumDiscStates(S, 0);    if (!ssSetNumInputPorts(S, 1)) return;    ssSetInputPortWidth(S, 0, NI);    ssSetInputPortDirectFeedThrough(S, 0, 1);    if (!ssSetNumOutputPorts(S, 1)) return;    ssSetOutputPortWidth(S, 0, NO);    ssSetNumSampleTimes(S, 1);    ssSetNumRWork(S, 0);    ssSetNumIWork(S, 0);    ssSetNumPWork(S, 0);    ssSetNumModes(S, 0);    ssSetNumNonsampledZCs(S, 0);    /* Take care when specifying exception free code - see sfuntmpl_doc.c */    ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE);#ifdef DEBUG	debug("mdlInitializeSizes left./n");#endif} /* mdlInitializeSizes */
开发者ID:sk4ld,项目名称:DVCP-VAM,代码行数:37,


示例11: mdlInitializeSizes

static void mdlInitializeSizes(SimStruct *S){    ssSetNumSFcnParams(S, N_PARAMS);  /* Number of expected parameters */    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {        /* Return if number of expected != number of actual parameters */        return;    }    ssSetNumContStates(S, N_STATES);    ssSetNumDiscStates(S, 0);    if (!ssSetNumInputPorts(S, 1)) return;    ssSetInputPortWidth(S, 0, N_INPUTS);    ssSetInputPortDirectFeedThrough(S, 0, 1);    if (!ssSetNumOutputPorts(S, 1)) return;    ssSetOutputPortWidth(S, 0, N_OUTPUTS);    ssSetNumSampleTimes(S, 1);    ssSetNumRWork(S, 0);    ssSetNumIWork(S, 0);    ssSetNumPWork(S, 0);    ssSetNumModes(S, 0);    ssSetNumNonsampledZCs(S, 0);    ssSetOptions(S, 0);}
开发者ID:zapv1348,项目名称:fall_2015,代码行数:27,


示例12: mdlInitializeSizes

/* Function: mdlInitializeSizes =============================================== * Abstract: *   Setup sizes of the various vectors. */static void mdlInitializeSizes(SimStruct *S){    ssSetNumSFcnParams(S, 0);    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {        return; /* Parameter mismatch will be reported by Simulink */    }    if (!ssSetNumInputPorts(S, 1)) return;    ssSetInputPortWidth(S, 0, DYNAMICALLY_SIZED);    ssSetInputPortDirectFeedThrough(S, 0, 1);    if (!ssSetNumOutputPorts(S,1)) return;    ssSetOutputPortWidth(S, 0, DYNAMICALLY_SIZED);    ssSetNumSampleTimes(S, 1);    /* specify the sim state compliance to be same as a built-in block */    ssSetSimStateCompliance(S, USE_DEFAULT_SIM_STATE);    /* Take care when specifying exception free code - see sfuntmpl_doc.c */    ssSetOptions(S,                 SS_OPTION_WORKS_WITH_CODE_REUSE |                 SS_OPTION_EXCEPTION_FREE_CODE |                 SS_OPTION_USE_TLC_WITH_ACCELERATOR);    /*main();*/}
开发者ID:verivital,项目名称:slsf_randgen,代码行数:30,


示例13: mdlInitializeSizes

static void mdlInitializeSizes(SimStruct *S){   ssSetNumSFcnParams(S, 4);  /* B,x0,U,P Number of expected parameters */  if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S))    return;  else  {    if (CheckPar(S))      return;  }    ssSetNumContStates(S, (int) B(S,"CStates"));    ssSetNumDiscStates(S, (int) B(S,"DStates"));    if (!ssSetNumInputPorts(S, 1)) return;    ssSetInputPortWidth(S, 0, (int)  (U(S,"Number")*B(S,"WaterIn")+B(S,"Setpoints")));    ssSetInputPortDirectFeedThrough(S, 0, (int) B(S,"Direct"));    ssSetInputPortRequiredContiguous(S, 0, 1); /*direct input signal access*/    if (!ssSetNumOutputPorts(S,1)) return;    ssSetOutputPortWidth(S, 0, (int) (U(S,"Number")*B(S,"WaterOut")+B(S,"Measurements")) );    ssSetNumSampleTimes(S, 1);    ssSetNumRWork(S, 0);    ssSetNumIWork(S, 0);    ssSetNumPWork(S, 0);    ssSetNumModes(S, 0);    ssSetNumNonsampledZCs(S, 0);    /* Take care when specifying exception free code - see sfuntmpl_doc.c */    ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE |                 SS_OPTION_USE_TLC_WITH_ACCELERATOR);       }
开发者ID:Stimela,项目名称:Stimela,代码行数:34,


示例14: mdlInitializeSizes

static void mdlInitializeSizes(SimStruct *S){    int i;    ssSetNumSFcnParams(S, NPARAMS);  /* Number of expected parameters */    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {        /* Return if number of expected != number of actual parameters */        return;    }    for (i = 0; i < NPARAMS; i++)        ssSetSFcnParamTunable(S, i, 0);    ssSetNumContStates(S, 0);    ssSetNumDiscStates(S, 0);    if (!ssSetNumInputPorts(S, 1)) return;    ssSetInputPortWidth(S, 0, 3);    ssSetInputPortRequiredContiguous(S, 0, true);    ssSetInputPortDirectFeedThrough(S, 0, 1);    if (!ssSetNumOutputPorts(S, 1)) return;    ssSetOutputPortWidth(S, 0, 1);    ssSetNumSampleTimes(S, 1);    ssSetNumRWork(S, 0);    ssSetNumIWork(S, 0);    ssSetNumPWork(S, 0);    ssSetNumModes(S, 0);    ssSetNumNonsampledZCs(S, 0);    ssSetOptions(S,            SS_OPTION_WORKS_WITH_CODE_REUSE |            SS_OPTION_USE_TLC_WITH_ACCELERATOR);}
开发者ID:imclab,项目名称:T-MATS,代码行数:34,


示例15: mdlInitializeSizes

void mdlInitializeSizes(SimStruct *S)/* ======================================================================== */{    /* parameters */    ssSetNumSFcnParams(S, NUM_PARAMS);    #if defined(MATLAB_MEX_FILE)    if (ssGetNumSFcnParams(S) == ssGetSFcnParamsCount(S)) {        mdlCheckParameters(S);        if (ssGetErrorStatus(S) != NULL) return;    } else        return;    #endif    ssSetSFcnParamTunable(S, FREQUENCY,   SS_PRM_SIM_ONLY_TUNABLE);    ssSetSFcnParamTunable(S, BANDWIDTH,   SS_PRM_NOT_TUNABLE);    ssSetSFcnParamTunable(S, TXVGA_GAIN,  SS_PRM_SIM_ONLY_TUNABLE);    /* ports */    ssSetNumSampleTimes(S, 1);    if (!ssSetNumOutputPorts(S, 0) || !ssSetNumInputPorts(S, 1)) return;    ssSetInputPortWidth(S, 0, DYNAMICALLY_SIZED);    ssSetInputPortComplexSignal(S, 0, COMPLEX_YES);    ssSetInputPortDataType(S, 0, SS_INT8);    ssSetInputPortDirectFeedThrough(S, 0, true);    ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL);    /* work Vectors */    ssSetNumPWork(S, P_WORK_LENGTH);    ssSetNumIWork(S, 0);    ssSetNumRWork(S, NUM_PARAMS);    ssSetNumModes(S, 0);    ssSetNumNonsampledZCs(S, 0);    ssSetSimStateCompliance(S, USE_DEFAULT_SIM_STATE);    ssSetOptions(S, 0);}
开发者ID:PostalMuttonchops,项目名称:simulink-hackrf,代码行数:35,


示例16: set_input_port

static void set_input_port (SimStruct *S, int_T num, DTypeId type){	ssSetInputPortWidth (S, num, 1);	ssSetInputPortDataType (S, num, type);	ssSetInputPortComplexSignal (S,  num, COMPLEX_NO);	ssSetInputPortDirectFeedThrough (S, num, 1);	ssSetInputPortRequiredContiguous (S, num, 1); /*direct input signal access*/}
开发者ID:denrusio,项目名称:vak-opensource,代码行数:8,


示例17: mdlInitializeSizes

/* Function: mdlInitializeSizes =============================================== * Abstract: *    The sizes information is used by Simulink to determine the S-function *    block's characteristics (number of inputs, outputs, states, etc.). */static void mdlInitializeSizes(SimStruct *S){    /* See sfuntmpl.doc for more details on the macros below */    ssSetNumSFcnParams(S, 0);  /* Number of expected parameters */    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {        /* Return if number of expected != number of actual parameters */        return;    }    ssSetNumContStates(S, 1);  /* how many continuous states? */    ssSetNumDiscStates(S, 0);    if (!ssSetNumInputPorts(S, 1)) return;    ssSetInputPortWidth(S, 0, 1);    /*     * Set direct feedthrough flag (1=yes, 0=no).     * A port has direct feedthrough if the input is used in either     * the mdlOutputs or mdlGetTimeOfNextVarHit functions.     * See matlabroot/simulink/src/sfuntmpl_directfeed.txt.     */    ssSetInputPortDirectFeedThrough(S, 0, 1);    if (!ssSetNumOutputPorts(S, 1)) return;    ssSetOutputPortWidth(S, 0, 1);    ssSetNumSampleTimes(S, 1);    /*      * If your Fortran code uses REAL for the state, input, and/or output      * datatypes, use these DWorks as work areas to downcast continuous      * states from double to REAL before calling your code.  You could     * also put the work vectors in hard-coded local (stack) variables.     *     * For fixed step code, keep a copy of the variables  to be output      * in a DWork vector so the mdlOutputs() function can provide output      * data when needed. You can use as many DWork vectors as you like      * for both input and output (or hard-code local variables).     */    if(!ssSetNumDWork(   S, 3)) return;    ssSetDWorkWidth(     S, 0, ssGetOutputPortWidth(S,0));    ssSetDWorkDataType(  S, 0, SS_SINGLE); /* use SS_DOUBLE if needed */    ssSetDWorkWidth(     S, 1, ssGetInputPortWidth(S,0));    ssSetDWorkDataType(  S, 1, SS_SINGLE);    ssSetDWorkWidth(     S, 2, ssGetNumContStates(S));    ssSetDWorkDataType(  S, 2, SS_SINGLE);    ssSetNumNonsampledZCs(S, 0);    /* Specify the sim state compliance to be same as a built-in block */    /* see sfun_simstate.c for example of other possible settings */    ssSetSimStateCompliance(S, USE_DEFAULT_SIM_STATE);    ssSetOptions(S, 0);}
开发者ID:Tri-o-copter,项目名称:Brainware,代码行数:63,


示例18: mdlInitializeSizes

static void mdlInitializeSizes(SimStruct *S){    int i,nChannels;    static char msg[256];    ssSetNumSFcnParams(S, NUMBER_OF_ARGS);  /* Number of expected parameters */    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {        /* Return if number of expected != number of actual parameters */        sprintf(msg,"Wrong Number of input arguments passed./n%d arguments are expected/n",NUMBER_OF_ARGS);        ssSetErrorStatus(S,msg);        return;    }    ssSetNumContStates(S, 0);    ssSetNumDiscStates(S, 0);        ssSetNumInputPorts(S, 0);//there is no input     //if (!ssSetNumInputPorts(S, 1)) return;        nChannels=(uint_T)mxGetN(CHANNEL_ARG);       //if (!ssSetNumOutputPorts(S, 1)) return;    ssSetNumOutputPorts(S,nChannels);//set number of outputs ports    for(i=0;i<nChannels;i++)    {        ssSetOutputPortWidth(S, i, 1);//set width of each port to 1        }        ssSetInputPortWidth(S, 0, 1);    ssSetInputPortRequiredContiguous(S, 0, true); /*direct input signal access*/    /*     * Set direct feedthrough flag (1=yes, 0=no).     * A port has direct feedthrough if the input is used in either     * the mdlOutputs or mdlGetTimeOfNextVarHit functions.     */    ssSetInputPortDirectFeedThrough(S, 0, 1);       ssSetNumSampleTimes(S, 1);//set number of sample time to 1,which means all input ports share same Ts        ssSetNumRWork(S, NO_R_WORKS);//number of float in work vector    ssSetNumIWork(S, NO_I_WORKS);//number of int in work vector    ssSetNumPWork(S, 0);//number of pointer in work vector        ssSetNumModes(S, 0);    ssSetNumNonsampledZCs(S, 0);//no need for pass-zero check         ssSetSFcnParamNotTunable(S,0);    ssSetSFcnParamNotTunable(S,1);    ssSetSFcnParamNotTunable(S,2);    ssSetSFcnParamNotTunable(S,3);    ssSetSFcnParamNotTunable(S,4);        ssSetOptions(S,SS_OPTION_EXCEPTION_FREE_CODE|SS_OPTION_PLACE_ASAP);    /* Specify the sim state compliance to be same as a built-in block */    ssSetSimStateCompliance(S, USE_DEFAULT_SIM_STATE);}
开发者ID:nathanlrf,项目名称:AutoLab,代码行数:57,


示例19: mdlInitializeSizes

static void mdlInitializeSizes(SimStruct *S){    ssSetNumSFcnParams(S, 0);						    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {        return; /* Parameter mismatch will be reported by Simulink */    }    /* no states, all computation will be done in output section */    ssSetNumContStates(S, 0);    ssSetNumDiscStates(S, 0);        /* one input port: state x(k) + vector of references */    ssSetNumInputPorts(S, 1);         /* one output port: control action */    ssSetNumOutputPorts(S, 1);    /* width of input vector - number of states of the original problem.      * note that tracking includes additional states, here we do not consider them     */    if (MPT_TRACKING>0) {        ssSetInputPortWidth(S, 0, MPT_NXT + MPT_NREF);    } else {        /* dimension extended by one to allow empty reference to be passed */        /*ssSetInputPortWidth(S, 0, MPT_NXT + 1); */        ssSetInputPortWidth(S, 0, MPT_NXT);    }        ssSetInputPortDirectFeedThrough(S, 0, 1);        /* width of output - number of control actions */    ssSetOutputPortWidth(S, 0, MPT_NU);        ssSetNumSampleTimes(S, 1);    /* Take care when specifying exception free code - see sfuntmpl.doc */    ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE);    }
开发者ID:EMBOCONcs,项目名称:EMBOCON_Interfaces,代码行数:40,


示例20: mdlInitializeSizes

static void mdlInitializeSizes(SimStruct *S){    if (!ssSetNumInputPorts(S, 2)) return;    ssSetInputPortWidth(S, 0, NUM_STATES);  // x0    ssSetInputPortWidth(S, 1, 1);           // reference    ssSetInputPortDirectFeedThrough(S, 0, true);    ssSetInputPortRequiredContiguous(S, 0, true);    ssSetInputPortDirectFeedThrough(S, 1, true);    ssSetInputPortRequiredContiguous(S, 1, true);    ssSetNumPWork(S, 6);    if (!ssSetNumOutputPorts(S, 4)) return;    ssSetOutputPortWidth(S, 0, NUM_CONTROLS);    ssSetOutputPortWidth(S, 1, NUM_STATES);    ssSetOutputPortWidth(S, 2, 1);    ssSetOutputPortWidth(S, 3, 1);    ssSetNumSampleTimes(S, 1);}
开发者ID:acados,项目名称:acados,代码行数:22,


示例21: mdlSetInputPortWidth

void mdlSetInputPortWidth(SimStruct *S, int portIndex, int width){  if (width != protocol->p_input_width) {    ssPrintf("AUTOSAR model expects an input port width of %u/n"             "Tried to set %u/n", protocol->p_input_width, width);    ssSetErrorStatus(S, "Tried to set port width not matching that specified"                        "by AUTOSAR model");    return;  }  ssSetInputPortWidth(S, portIndex, width);  return;}
开发者ID:phuonglab,项目名称:autosar,代码行数:13,


示例22: mdlInitializeSizes

static void mdlInitializeSizes(SimStruct *S) {   #ifdef MATLAB_MEX_FILE    // mexEvalString( "startio;" );   #endif    ssSetNumSFcnParams(S, NUMBER_OF_ARGS);    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {        return; /* Parameter mismatch will be reported by Simulink */    }    if (!ssSetNumInputPorts(S, 8)) return;    ssSetInputPortWidth(S,  0, 1);               // PWMPrescaler     /    1 / 0..63    ssSetInputPortDirectFeedThrough(S,  0, 0);    ssSetInputPortWidth(S,  1, 3);               // PWMWidth         /    3 / -1..+1 [Z Y X]    ssSetInputPortDirectFeedThrough(S,  1, 0);    ssSetInputPortWidth(S,  2, 5);               // EncoderReset     /    5 / [YAngle XAngle Z Y X]    ssSetInputPortDirectFeedThrough(S,  2, 0);    ssSetInputPortWidth(S,  3, 3);               // EncoderAutoReset /    3 / [Z Y X]    ssSetInputPortDirectFeedThrough(S,  3, 0);    ssSetInputPortWidth(S,  4, 3);               // RailLimit        /    3 / [Z Y X] [bit*64]    ssSetInputPortDirectFeedThrough(S,  4, 0);    ssSetInputPortWidth(S,  5, 3);               // RailLimitFlag    /    3 / [Z Y X]    ssSetInputPortDirectFeedThrough(S,  5, 0);    ssSetInputPortWidth(S,  6, 3);               // ThermFlag        /    3 / [Z Y X]    ssSetInputPortDirectFeedThrough(S,  6, 0);    ssSetInputPortWidth(S,  7, 1);               // TmrCntReset      /    1    ssSetInputPortDirectFeedThrough(S,  7, 0);    if (!ssSetNumOutputPorts(S, 13)) return;    ssSetOutputPortWidth(S,  0,  2 );            // Status           /    1 / [LogicVersion ErrorCode]    ssSetOutputPortWidth(S,  1,  1 );            // PWMPrescaler     /    1 / 0..63    ssSetOutputPortWidth(S,  2,  3 );            // PWMWidth         /    3 / -1..+1 [Z Y X]    ssSetOutputPortWidth(S,  3,  5 );            // EncoderCounter   /    5 / [YAngle XAngle Z Y X] [bit]    ssSetOutputPortWidth(S,  4,  5 );            // EncoderReset     /    3 / [YAngle XAngle Z Y X]    ssSetOutputPortWidth(S,  5,  3 );            // EncoderAutoReset /    3 / [Z Y X]    ssSetOutputPortWidth(S,  6,  3 );            // RailLimit        /    3 / [Z Y X] [bit*64]    ssSetOutputPortWidth(S,  7,  3 );            // RailLimitFlag    /    3 / [Z Y X]    ssSetOutputPortWidth(S,  8,  3 );            // LimitSwitch      /    3 / [Z Y X]    ssSetOutputPortWidth(S,  9,  3 );            // ThermStatus      /    3 / [Z Y X]    ssSetOutputPortWidth(S, 10,  3 );            // ThermFlag        /    3 / [Z Y X]    ssSetOutputPortWidth(S, 11,  1 );            // TmrCntCounter    /    1    ssSetOutputPortWidth(S, 12,  1 );            // TmrCntReset      /    1    ssSetNumSampleTimes(S, NSAMPLE_TIMES );    /* Take care when specifying exception free code */    ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE);}
开发者ID:araujokth,项目名称:kth-wsn,代码行数:47,


示例23: mdlInitializeSizes

/* Function: mdlInitializeSizes =============================================== * Abstract: *   Setup sizes of the various vectors. */static void mdlInitializeSizes(SimStruct *S){    slDataTypeAccess *dta = ssGetDataTypeAccess(S);    int              udtId;    ssSetNumSFcnParams(S, 0);  /* Number of expected parameters */    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {        /* Return if number of expected != number of actual parameters */        return;    }    /* Obtain an integer datatype ID for the udt (user-defined type) "Data" */    udtId = ssRegisterDataType(S, "Data");    if ( udtId == INVALID_DTYPE_ID ) return;    /* Register the size of the udt */    if (!ssSetDataTypeSize(S, udtId, sizeof(Data))) return;    /* Register the zero of the udt */    if (!ssSetDataTypeZero(S, udtId, &zero)) return;    /* Set input-port properties */    if (!ssSetNumInputPorts(S, 1)) return;    ssSetInputPortWidth(S, 0, 1);    ssSetInputPortDataType(S, 0, SS_DOUBLE);    ssSetInputPortDirectFeedThrough(S, 0, 1);    /* Set output port properties */    if (!ssSetNumOutputPorts(S, 1)) return;    ssSetOutputPortDataType(S, 0, udtId);    ssSetOutputPortWidth(S, 0, 1);    /* Set miscellaneous properties */    ssSetNumContStates(S, 0);    ssSetNumDiscStates(S, 0);    ssSetNumSampleTimes(S, 1);    ssSetNumRWork(S, 0);    ssSetNumIWork(S, 0);    ssSetNumPWork(S, 0);    ssSetNumModes(S, 0);    ssSetNumNonsampledZCs(S, 0);    /* specify the sim state compliance to be same as a built-in block */    ssSetSimStateCompliance(S, USE_DEFAULT_SIM_STATE);    ssSetOptions(S,                 SS_OPTION_WORKS_WITH_CODE_REUSE);}
开发者ID:Tri-o-copter,项目名称:Brainware,代码行数:52,


示例24: mdlInitializeSizes

/* Function: mdlInitializeSizes =============================================== * Abstract: *    The sizes information is used by Simulink to determine the S-function *    block's characteristics (number of inputs, outputs, states, etc.). */static void mdlInitializeSizes(SimStruct *S){  /*    setup the right number of parameters: distance, coelevation  */  ssSetNumSFcnParams(S,0);  if(ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)){    /*      sfunction is initialised with the wrong number of parameters    */    return;  }  /*    set number of continnuert and discrete states.  */  ssSetNumContStates(S, 0); /*zero continuert states*/  ssSetNumDiscStates(S, 0); /*zero discrete states*/  /*    specify the number of inputs to 1    (|R_sc(I)| and coelecation)  */  if (!ssSetNumInputPorts(S, 1)) return; /*wrong number of inputs*/  ssSetInputPortWidth(S, 0, 3);  ssSetInputPortRequiredContiguous(S, 0, true); /*direct input signal access*/  /*   * Set direct feedthrough flag (1=yes, 0=no).   * A port has direct feedthrough if the input is used in either   * the mdlOutputs or mdlGetTimeOfNextVarHit functions.   * See matlabroot/simulink/src/sfuntmpl_directfeed.txt.   */  ssSetInputPortDirectFeedThrough(S, 0, 1);  /*    check if the output is setup right:    gravitional potential of earth zonal harmonics.  */  if (!ssSetNumOutputPorts(S, 1)) return; /*no output set*/  ssSetOutputPortWidth(S, 0, 3);  ssSetNumSampleTimes(S, 1);}
开发者ID:jnemanja,项目名称:Aalto_HIL_framework,代码行数:52,


示例25: mdlInitializeSizes

/* Function: mdlInitializeSizes =============================================== * Abstract: *   Setup sizes of the various vectors. */static void mdlInitializeSizes(SimStruct *S){    DECL_AND_INIT_DIMSINFO(inputDimsInfo);    DECL_AND_INIT_DIMSINFO(outputDimsInfo);    ssSetNumSFcnParams(S, NPARAMS);  /* Number of expected parameters */      #if defined(MATLAB_MEX_FILE)	if (ssGetNumSFcnParams(S) == ssGetSFcnParamsCount(S)) {	  mdlCheckParameters(S);	  if (ssGetErrorStatus(S) != NULL) {	    return;	  }	 } else {	   return; /* Parameter mismatch will be reported by Simulink */	 }      #endif    ssSetNumContStates(S, NUM_CONT_STATES);    ssSetNumDiscStates(S, NUM_DISC_STATES);    if (!ssSetNumInputPorts(S, NUM_INPUTS)) return;    ssSetInputPortWidth(S, 0, INPUT_0_WIDTH);    ssSetInputPortDataType(S, 0, SS_INT16);    ssSetInputPortComplexSignal(S, 0, INPUT_0_COMPLEX);    ssSetInputPortDirectFeedThrough(S, 0, INPUT_0_FEEDTHROUGH);    ssSetInputPortRequiredContiguous(S, 0, 1); /*direct input signal access*/    if (!ssSetNumOutputPorts(S, NUM_OUTPUTS)) return;    ssSetNumSampleTimes(S, 1);    ssSetNumRWork(S, 0);    ssSetNumIWork(S, 0);    ssSetNumPWork(S, 0);    ssSetNumModes(S, 0);    ssSetNumNonsampledZCs(S, 0);    ssSetSimulinkVersionGeneratedIn(S, "8.3");    /* Take care when specifying exception free code - see sfuntmpl_doc.c */    ssSetOptions(S, (SS_OPTION_EXCEPTION_FREE_CODE |                     SS_OPTION_USE_TLC_WITH_ACCELERATOR | 		     SS_OPTION_WORKS_WITH_CODE_REUSE));}
开发者ID:MoreCoffee12,项目名称:MinSeg-Dual-Motor,代码行数:47,



注:本文中的ssSetInputPortWidth函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ ssSetNotMultipleInlinable函数代码示例
C++ ssSetInputPortRequiredContiguous函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。