MCPcopy Create free account
hub / github.com/NatLabRockies/SAM / ssc_invoke_handler

Function ssc_invoke_handler

src/simulation.cpp:446–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444
445
446static ssc_bool_t ssc_invoke_handler( ssc_module_t , ssc_handler_t ,
447 int action_type, float f0, float ,
448 const char *s0, const char *,
449 void *user_data )
450{
451 ISimulationHandler *hh = (ISimulationHandler*) user_data;
452 if (!hh) return 0;
453
454 if (action_type == SSC_LOG)
455 {
456 switch( (int)f0 )
457 {
458 case SSC_NOTICE:
459 hh->Notice( s0 );
460 break;
461 case SSC_WARNING:
462 hh->Warn( s0 );
463 break;
464 case SSC_ERROR:
465 hh->Error( s0 );
466 break;
467 }
468
469 return hh->IsCancelled() ? 0 : 1;
470 }
471 else if (action_type == SSC_UPDATE)
472 {
473 hh->Update( f0, s0 );
474 return hh->IsCancelled() ? 0 : 1;
475 }
476 else
477 return 0;
478}
479
480bool Simulation::InvokeSSC(bool silent, const wxString& fn)
481{

Callers

nothing calls this directly

Calls 5

NoticeMethod · 0.80
WarnMethod · 0.45
ErrorMethod · 0.45
IsCancelledMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected