void c3_NMPC_Controller_method_dispatcher(SimStruct *S, int_T method, void *data)
{
  switch (method) {
   case SS_CALL_MDL_START:
    mdlStart_c3_NMPC_Controller(S);
    break;

   case SS_CALL_MDL_SET_WORK_WIDTHS:
    mdlSetWorkWidths_c3_NMPC_Controller(S);
    break;

   case SS_CALL_MDL_PROCESS_PARAMETERS:
    mdlProcessParameters_c3_NMPC_Controller(S);
    break;

   default:
    /* Unhandled method */
    sf_mex_error_message("Stateflow Internal Error:\n"
                         "Error calling c3_NMPC_Controller_method_dispatcher.\n"
                         "Can't handle method %d.\n", method);
    break;
  }
}
Example #2
0
extern const mxArray* sf_internal_get_sim_state_c2_Leda(SimStruct* S)
{
  ChartInfoStruct *chartInfo = (ChartInfoStruct*) ssGetUserData(S);
  mxArray *plhs[1] = { NULL };

  mxArray *prhs[4];
  int mxError = 0;
  prhs[0] = mxCreateString("chart_simctx_raw2high");
  prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S));
  prhs[2] = (mxArray*) get_sim_state_c2_Leda((SFc2_LedaInstanceStruct*)
    chartInfo->chartInstance);         /* raw sim ctx */
  prhs[3] = (mxArray*) sf_get_sim_state_info_c2_Leda();/* state var info */
  mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate");
  mxDestroyArray(prhs[0]);
  mxDestroyArray(prhs[1]);
  mxDestroyArray(prhs[2]);
  mxDestroyArray(prhs[3]);
  if (mxError || plhs[0] == NULL) {
    sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_raw2high'.\n");
  }

  return plhs[0];
}
Example #3
0
static void mdlStart_c2_tablerot_id(SimStruct *S)
{
 SFc2_tablerot_idInstanceStruct *chartInstance;
 chartInstance = (SFc2_tablerot_idInstanceStruct *)malloc(sizeof(SFc2_tablerot_idInstanceStruct));
 memset(chartInstance, 0, sizeof(SFc2_tablerot_idInstanceStruct));
 if(chartInstance==NULL) {
     sf_mex_error_message("Could not allocate memory for chart instance.");
 }
 chartInstance->chartInfo.chartInstance = chartInstance;
 chartInstance->chartInfo.isEMLChart = 1;
 chartInstance->chartInfo.chartInitialized = 0;
 chartInstance->chartInfo.sFunctionGateway = sf_opaque_gateway_c2_tablerot_id;
 chartInstance->chartInfo.initializeChart = sf_opaque_initialize_c2_tablerot_id;
 chartInstance->chartInfo.terminateChart = sf_opaque_terminate_c2_tablerot_id;
 chartInstance->chartInfo.enableChart = sf_opaque_enable_c2_tablerot_id;
 chartInstance->chartInfo.disableChart = sf_opaque_disable_c2_tablerot_id;
 chartInstance->chartInfo.getSimState = sf_opaque_get_sim_state_c2_tablerot_id;
 chartInstance->chartInfo.setSimState = sf_opaque_set_sim_state_c2_tablerot_id;
 chartInstance->chartInfo.getSimStateInfo = sf_get_sim_state_info_c2_tablerot_id;
    chartInstance->chartInfo.zeroCrossings = NULL;
    chartInstance->chartInfo.outputs = NULL;
    chartInstance->chartInfo.derivatives = NULL;
 chartInstance->chartInfo.mdlRTW = mdlRTW_c2_tablerot_id;
 chartInstance->chartInfo.mdlStart = mdlStart_c2_tablerot_id;
 chartInstance->chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c2_tablerot_id;
 chartInstance->chartInfo.extModeExec = NULL;
 chartInstance->chartInfo.restoreLastMajorStepConfiguration = NULL;
 chartInstance->chartInfo.restoreBeforeLastMajorStepConfiguration = NULL;
 chartInstance->chartInfo.storeCurrentConfiguration = NULL;
 chartInstance->S = S;
 ssSetUserData(S,(void *)(&(chartInstance->chartInfo))); /* register the chart instance with simstruct */

 if(!sim_mode_is_rtw_gen(S)) {
     init_dsm_address_info(chartInstance);
 }
   chart_debug_initialization(S,1);
}
Example #4
0
extern void sf_internal_set_sim_state_c9_Array(SimStruct* S, const mxArray *st)
{
  ChartInfoStruct *chartInfo = (ChartInfoStruct*) ssGetUserData(S);
  mxArray *plhs[1] = { NULL };

  mxArray *prhs[4];
  int mxError = 0;
  prhs[0] = mxCreateString("chart_simctx_high2raw");
  prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S));
  prhs[2] = mxDuplicateArray(st);      /* high level simctx */
  prhs[3] = (mxArray*) sf_get_sim_state_info_c9_Array();/* state var info */
  mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate");
  mxDestroyArray(prhs[0]);
  mxDestroyArray(prhs[1]);
  mxDestroyArray(prhs[2]);
  mxDestroyArray(prhs[3]);
  if (mxError || plhs[0] == NULL) {
    sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_high2raw'.\n");
  }

  set_sim_state_c9_Array((SFc9_ArrayInstanceStruct*)chartInfo->chartInstance,
    mxDuplicateArray(plhs[0]));
  mxDestroyArray(plhs[0]);
}
Example #5
0
extern void sf_internal_set_sim_state_c2_Expriment_Pose(SimStruct* S, const
  mxArray *st)
{
  ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S));
  ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo);
  mxArray *plhs[1] = { NULL };

  mxArray *prhs[3];
  int mxError = 0;
  prhs[0] = mxCreateString("chart_simctx_high2raw");
  prhs[1] = mxDuplicateArray(st);      /* high level simctx */
  prhs[2] = (mxArray*) sf_get_sim_state_info_c2_Expriment_Pose();/* state var info */
  mxError = sf_mex_call_matlab(1, plhs, 3, prhs, "sfprivate");
  mxDestroyArray(prhs[0]);
  mxDestroyArray(prhs[1]);
  mxDestroyArray(prhs[2]);
  if (mxError || plhs[0] == NULL) {
    sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_high2raw'.\n");
  }

  set_sim_state_c2_Expriment_Pose((SFc2_Expriment_PoseInstanceStruct*)
    chartInfo->chartInstance, mxDuplicateArray(plhs[0]));
  mxDestroyArray(plhs[0]);
}
void c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile_method_dispatcher
  (SimStruct *S, int_T method, void *data)
{
  switch (method) {
   case SS_CALL_MDL_START:
    mdlStart_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile(S);
    break;

   case SS_CALL_MDL_SET_WORK_WIDTHS:
    mdlSetWorkWidths_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile(S);
    break;

   case SS_CALL_MDL_PROCESS_PARAMETERS:
    mdlProcessParameters_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile(S);
    break;

   default:
    /* Unhandled method */
    sf_mex_error_message("Stateflow Internal Error:\n"
                         "Error calling c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile_method_dispatcher.\n"
                         "Can't handle method %d.\n", method);
    break;
  }
}
Example #7
0
void c6_adcs_v15_integral_Power_nom_no_charge_in_detumb_method_dispatcher
(SimStruct *S, int_T method, void *data)
{
    switch (method) {
    case SS_CALL_MDL_START:
        mdlStart_c6_adcs_v15_integral_Power_nom_no_charge_in_detumb(S);
        break;

    case SS_CALL_MDL_SET_WORK_WIDTHS:
        mdlSetWorkWidths_c6_adcs_v15_integral_Power_nom_no_charge_in_detumb(S);
        break;

    case SS_CALL_MDL_PROCESS_PARAMETERS:
        mdlProcessParameters_c6_adcs_v15_integral_Power_nom_no_charge_in_detumb(S);
        break;

    default:
        /* Unhandled method */
        sf_mex_error_message("Stateflow Internal Error:\n"
                             "Error calling c6_adcs_v15_integral_Power_nom_no_charge_in_detumb_method_dispatcher.\n"
                             "Can't handle method %d.\n", method);
        break;
    }
}
static void mdlStart_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile(SimStruct
  *S)
{
  SFc2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmileInstanceStruct
    *chartInstance;
  ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)utMalloc(sizeof
    (ChartRunTimeInfo));
  chartInstance =
    (SFc2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmileInstanceStruct *)
    utMalloc(sizeof
             (SFc2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmileInstanceStruct));
  memset(chartInstance, 0, sizeof
         (SFc2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmileInstanceStruct));
  if (chartInstance==NULL) {
    sf_mex_error_message("Could not allocate memory for chart instance.");
  }

  chartInstance->chartInfo.chartInstance = chartInstance;
  chartInstance->chartInfo.isEMLChart = 1;
  chartInstance->chartInfo.chartInitialized = 0;
  chartInstance->chartInfo.sFunctionGateway =
    sf_opaque_gateway_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile;
  chartInstance->chartInfo.initializeChart =
    sf_opaque_initialize_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile;
  chartInstance->chartInfo.terminateChart =
    sf_opaque_terminate_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile;
  chartInstance->chartInfo.enableChart =
    sf_opaque_enable_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile;
  chartInstance->chartInfo.disableChart =
    sf_opaque_disable_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile;
  chartInstance->chartInfo.getSimState =
    sf_opaque_get_sim_state_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile;
  chartInstance->chartInfo.setSimState =
    sf_opaque_set_sim_state_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile;
  chartInstance->chartInfo.getSimStateInfo =
    sf_get_sim_state_info_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile;
  chartInstance->chartInfo.zeroCrossings = NULL;
  chartInstance->chartInfo.outputs = NULL;
  chartInstance->chartInfo.derivatives = NULL;
  chartInstance->chartInfo.mdlRTW =
    mdlRTW_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile;
  chartInstance->chartInfo.mdlStart =
    mdlStart_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile;
  chartInstance->chartInfo.mdlSetWorkWidths =
    mdlSetWorkWidths_c2_ARP_02_RPSsmile_GloveAtomicBradNotImitateSmile;
  chartInstance->chartInfo.extModeExec = NULL;
  chartInstance->chartInfo.restoreLastMajorStepConfiguration = NULL;
  chartInstance->chartInfo.restoreBeforeLastMajorStepConfiguration = NULL;
  chartInstance->chartInfo.storeCurrentConfiguration = NULL;
  chartInstance->chartInfo.debugInstance = sfGlobalDebugInstanceStruct;
  chartInstance->S = S;
  crtInfo->instanceInfo = (&(chartInstance->chartInfo));
  crtInfo->isJITEnabled = false;
  ssSetUserData(S,(void *)(crtInfo));  /* register the chart instance with simstruct */
  init_dsm_address_info(chartInstance);
  if (!sim_mode_is_rtw_gen(S)) {
  }

  sf_opaque_init_subchart_simstructs(chartInstance->chartInfo.chartInstance);
  chart_debug_initialization(S,1);
}
static void mdlStart_c3_Engine_Vehicle_CVT_Wit_System1_trial1(SimStruct *S)
{
    SFc3_Engine_Vehicle_CVT_Wit_System1_trial1InstanceStruct *chartInstance;
    ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)utMalloc(sizeof
                                 (ChartRunTimeInfo));
    chartInstance = (SFc3_Engine_Vehicle_CVT_Wit_System1_trial1InstanceStruct *)
                    utMalloc(sizeof(SFc3_Engine_Vehicle_CVT_Wit_System1_trial1InstanceStruct));
    memset(chartInstance, 0, sizeof
           (SFc3_Engine_Vehicle_CVT_Wit_System1_trial1InstanceStruct));
    if (chartInstance==NULL) {
        sf_mex_error_message("Could not allocate memory for chart instance.");
    }

    chartInstance->chartInfo.chartInstance = chartInstance;
    chartInstance->chartInfo.isEMLChart = 0;
    chartInstance->chartInfo.chartInitialized = 0;
    chartInstance->chartInfo.sFunctionGateway =
        sf_opaque_gateway_c3_Engine_Vehicle_CVT_Wit_System1_trial1;
    chartInstance->chartInfo.initializeChart =
        sf_opaque_initialize_c3_Engine_Vehicle_CVT_Wit_System1_trial1;
    chartInstance->chartInfo.terminateChart =
        sf_opaque_terminate_c3_Engine_Vehicle_CVT_Wit_System1_trial1;
    chartInstance->chartInfo.enableChart =
        sf_opaque_enable_c3_Engine_Vehicle_CVT_Wit_System1_trial1;
    chartInstance->chartInfo.disableChart =
        sf_opaque_disable_c3_Engine_Vehicle_CVT_Wit_System1_trial1;
    chartInstance->chartInfo.getSimState =
        sf_opaque_get_sim_state_c3_Engine_Vehicle_CVT_Wit_System1_trial1;
    chartInstance->chartInfo.setSimState =
        sf_opaque_set_sim_state_c3_Engine_Vehicle_CVT_Wit_System1_trial1;
    chartInstance->chartInfo.getSimStateInfo =
        sf_get_sim_state_info_c3_Engine_Vehicle_CVT_Wit_System1_trial1;
    chartInstance->chartInfo.zeroCrossings = NULL;
    chartInstance->chartInfo.outputs = NULL;
    chartInstance->chartInfo.derivatives = NULL;
    chartInstance->chartInfo.mdlRTW =
        mdlRTW_c3_Engine_Vehicle_CVT_Wit_System1_trial1;
    chartInstance->chartInfo.mdlStart =
        mdlStart_c3_Engine_Vehicle_CVT_Wit_System1_trial1;
    chartInstance->chartInfo.mdlSetWorkWidths =
        mdlSetWorkWidths_c3_Engine_Vehicle_CVT_Wit_System1_trial1;
    chartInstance->chartInfo.extModeExec = NULL;
    chartInstance->chartInfo.restoreLastMajorStepConfiguration = NULL;
    chartInstance->chartInfo.restoreBeforeLastMajorStepConfiguration = NULL;
    chartInstance->chartInfo.storeCurrentConfiguration = NULL;
    chartInstance->chartInfo.callAtomicSubchartUserFcn = NULL;
    chartInstance->chartInfo.callAtomicSubchartAutoFcn = NULL;
    chartInstance->chartInfo.debugInstance = sfGlobalDebugInstanceStruct;
    chartInstance->S = S;
    crtInfo->checksum = SF_RUNTIME_INFO_CHECKSUM;
    crtInfo->instanceInfo = (&(chartInstance->chartInfo));
    crtInfo->isJITEnabled = false;
    crtInfo->compiledInfo = NULL;
    ssSetUserData(S,(void *)(crtInfo));  /* register the chart instance with simstruct */
    init_dsm_address_info(chartInstance);
    init_simulink_io_address(chartInstance);
    if (!sim_mode_is_rtw_gen(S)) {
    }

    sf_opaque_init_subchart_simstructs(chartInstance->chartInfo.chartInstance);
    chart_debug_initialization(S,1);
}