Пример #1
0
/*
 * instance operation:  addHeartRateSample
 */
void
Tracking_TrackLog::Tracking_TrackLog_op_addHeartRateSample( Tracking_TrackLog * self, Tracking * thismodule, r4_t p_heartRate)
{
  Tracking_HeartRateSample * v_sample; 
  /* CREATE OBJECT INSTANCE sample OF HeartRateSample */
  XTUML_OAL_STMT_TRACE( 1, "CREATE OBJECT INSTANCE sample OF HeartRateSample" );
  v_sample = (Tracking_HeartRateSample *) thismodule->Escher_CreateInstance( Tracking_DOMAIN_ID, Tracking_HeartRateSample_CLASS_NUMBER );
  /* ASSIGN sample.heartRate = PARAM.heartRate */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN sample.heartRate = PARAM.heartRate" );
  v_sample->heartRate = p_heartRate;
  /* RELATE self TO sample ACROSS R6 */
  XTUML_OAL_STMT_TRACE( 1, "RELATE self TO sample ACROSS R6" );
  Tracking_HeartRateSample::Tracking_HeartRateSample_R6_Link( self, v_sample, thismodule );
  /* ASSIGN self.currentHeartRate = PARAM.heartRate */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN self.currentHeartRate = PARAM.heartRate" );
  self->currentHeartRate = p_heartRate;
  /* GENERATE Display_A2:refresh() TO Display CLASS */
  XTUML_OAL_STMT_TRACE( 1, "GENERATE Display_A2:refresh() TO Display CLASS" );
  { Escher_xtUMLEvent_t * e = thismodule->Escher_NewxtUMLEvent( (void *) 0, &Tracking_Display_CBevent2c );
  e->sc_e = &(thismodule->sc_Tracking_Display_CBevent2);
    thismodule->Escher_SendEvent( e );
  }


}
Пример #2
0
/*
 * instance operation:  clearLapMarkers
 */
void
Tracking_TrackLog::Tracking_TrackLog_op_clearLapMarkers( Tracking_TrackLog * self, Tracking * thismodule)
{
  sys_sets::Escher_ObjectSet_s v_lapMarkers_space={0}; sys_sets::Escher_ObjectSet_s * v_lapMarkers = &v_lapMarkers_space; /* lapMarkers (LapMarker) */
 Tracking_LapMarker * v_lapMarker; 
  /* SELECT many lapMarkers RELATED BY self->LapMarker[R5] */
  XTUML_OAL_STMT_TRACE( 1, "SELECT many lapMarkers RELATED BY self->LapMarker[R5]" );
  thismodule->Escher_ClearSet( v_lapMarkers );
  if ( 0 != self ) {
    thismodule->Escher_CopySet( v_lapMarkers, &self->LapMarker_R5 );
  }
  /* FOR EACH lapMarker IN lapMarkers */
  XTUML_OAL_STMT_TRACE( 1, "FOR EACH lapMarker IN lapMarkers" );
  { sys_sets::Escher_Iterator_s iter1;
  Tracking_LapMarker * Tracking_LapMarkeriter1;
  Escher_IteratorReset( &iter1, v_lapMarkers );
  while ( (Tracking_LapMarkeriter1 = (Tracking_LapMarker *)thismodule->Escher_IteratorNext( &iter1 )) != 0 ) {
    v_lapMarker = Tracking_LapMarkeriter1; {
    /* UNRELATE self FROM lapMarker ACROSS R5 */
    XTUML_OAL_STMT_TRACE( 2, "UNRELATE self FROM lapMarker ACROSS R5" );
    Tracking_LapMarker::Tracking_LapMarker_R5_Unlink( self, v_lapMarker, thismodule );
    /* DELETE OBJECT INSTANCE lapMarker */
    XTUML_OAL_STMT_TRACE( 2, "DELETE OBJECT INSTANCE lapMarker" );
    if ( 0 == v_lapMarker ) {
      XTUML_EMPTY_HANDLE_TRACE( "LapMarker", "Escher_DeleteInstance" );
    }
    thismodule->Escher_DeleteInstance( (Escher_iHandle_t) v_lapMarker, Tracking_DOMAIN_ID, Tracking_LapMarker_CLASS_NUMBER );
  }}}
    thismodule->Escher_ClearSet( v_lapMarkers ); /* lapMarkers (LapMarker) */

}
Пример #3
0
/*
 * instance operation:  clearHeartRateSamples
 */
void
Tracking_TrackLog::Tracking_TrackLog_op_clearHeartRateSamples( Tracking_TrackLog * self, Tracking * thismodule)
{
  sys_sets::Escher_ObjectSet_s v_samples_space={0}; sys_sets::Escher_ObjectSet_s * v_samples = &v_samples_space; /* samples (HeartRateSample) */
 Tracking_HeartRateSample * v_sample; 
  /* SELECT many samples RELATED BY self->HeartRateSample[R6] */
  XTUML_OAL_STMT_TRACE( 1, "SELECT many samples RELATED BY self->HeartRateSample[R6]" );
  thismodule->Escher_ClearSet( v_samples );
  if ( 0 != self ) {
    thismodule->Escher_CopySet( v_samples, &self->HeartRateSample_R6 );
  }
  /* FOR EACH sample IN samples */
  XTUML_OAL_STMT_TRACE( 1, "FOR EACH sample IN samples" );
  { sys_sets::Escher_Iterator_s iter2;
  Tracking_HeartRateSample * Tracking_HeartRateSampleiter2;
  Escher_IteratorReset( &iter2, v_samples );
  while ( (Tracking_HeartRateSampleiter2 = (Tracking_HeartRateSample *)thismodule->Escher_IteratorNext( &iter2 )) != 0 ) {
    v_sample = Tracking_HeartRateSampleiter2; {
    /* UNRELATE self FROM sample ACROSS R6 */
    XTUML_OAL_STMT_TRACE( 2, "UNRELATE self FROM sample ACROSS R6" );
    Tracking_HeartRateSample::Tracking_HeartRateSample_R6_Unlink( self, v_sample, thismodule );
    /* DELETE OBJECT INSTANCE sample */
    XTUML_OAL_STMT_TRACE( 2, "DELETE OBJECT INSTANCE sample" );
    if ( 0 == v_sample ) {
      XTUML_EMPTY_HANDLE_TRACE( "HeartRateSample", "Escher_DeleteInstance" );
    }
    thismodule->Escher_DeleteInstance( (Escher_iHandle_t) v_sample, Tracking_DOMAIN_ID, Tracking_HeartRateSample_CLASS_NUMBER );
  }}}
    thismodule->Escher_ClearSet( v_samples ); /* samples (HeartRateSample) */

}
Пример #4
0
/*
 * instance operation:  addLapMarker
 */
void
Tracking_TrackLog::Tracking_TrackLog_op_addLapMarker( Tracking_TrackLog * self, Tracking * thismodule)
{
  Tracking_WorkoutTimer * v_timer = 0; /* timer (WorkoutTimer) */
 Tracking_LapMarker * v_lapMarker; 
  /* SELECT one timer RELATED BY self->WorkoutTimer[R4] */
  XTUML_OAL_STMT_TRACE( 1, "SELECT one timer RELATED BY self->WorkoutTimer[R4]" );
  v_timer = self->WorkoutTimer_R4;
  /* CREATE OBJECT INSTANCE lapMarker OF LapMarker */
  XTUML_OAL_STMT_TRACE( 1, "CREATE OBJECT INSTANCE lapMarker OF LapMarker" );
  v_lapMarker = (Tracking_LapMarker *) thismodule->Escher_CreateInstance( Tracking_DOMAIN_ID, Tracking_LapMarker_CLASS_NUMBER );
  /* ASSIGN lapMarker.lapTime = timer.time */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN lapMarker.lapTime = timer.time" );
  v_lapMarker->lapTime = v_timer->time;
  /* RELATE self TO lapMarker ACROSS R5 */
  XTUML_OAL_STMT_TRACE( 1, "RELATE self TO lapMarker ACROSS R5" );
  Tracking_LapMarker::Tracking_LapMarker_R5_Link( self, v_lapMarker, thismodule );
  /* GENERATE Display_A2:refresh() TO Display CLASS */
  XTUML_OAL_STMT_TRACE( 1, "GENERATE Display_A2:refresh() TO Display CLASS" );
  { Escher_xtUMLEvent_t * e = thismodule->Escher_NewxtUMLEvent( (void *) 0, &Tracking_Display_CBevent2c );
  e->sc_e = &(thismodule->sc_Tracking_Display_CBevent2);
    thismodule->Escher_SendEvent( e );
  }


}
/*
 * instance operation:  close
 */
void
Tracking_Achievement_op_close( Tracking_Achievement * self)
{
  Tracking_WorkoutTimer * workoutTimer=0;Tracking_Goal * goal=0;
  /* SELECT one goal RELATED BY self->Goal[R14.is open for] */
  XTUML_OAL_STMT_TRACE( 1, "SELECT one goal RELATED BY self->Goal[R14.is open for]" );
  goal = ( 0 != self ) ? self->Goal_R14_is_open_for : 0;
  /* SELECT one workoutTimer RELATED BY goal->WorkoutSession[R11.is currently executing within]->WorkoutTimer[R8.is timed by] */
  XTUML_OAL_STMT_TRACE( 1, "SELECT one workoutTimer RELATED BY goal->WorkoutSession[R11.is currently executing within]->WorkoutTimer[R8.is timed by]" );
  workoutTimer = 0;
  {  if ( 0 != goal ) {
  Tracking_WorkoutSession * WorkoutSession_R11_is_currently_executing_within = goal->WorkoutSession_R11_is_currently_executing_within;
  if ( 0 != WorkoutSession_R11_is_currently_executing_within ) {
  workoutTimer = WorkoutSession_R11_is_currently_executing_within->WorkoutTimer_R8_is_timed_by;
}}}
  /* ASSIGN self.endTime = workoutTimer.time */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN self.endTime = workoutTimer.time" );
  self->endTime = workoutTimer->time;
  /* UNRELATE self FROM goal ACROSS R14 */
  XTUML_OAL_STMT_TRACE( 1, "UNRELATE self FROM goal ACROSS R14" );
  Tracking_Achievement_R14_Unlink_has_open( goal, self );
  /* RELATE self TO goal ACROSS R12 */
  XTUML_OAL_STMT_TRACE( 1, "RELATE self TO goal ACROSS R12" );
  Tracking_Achievement_R12_Link_has_recorded( goal, self );

}
static void
MicrowaveOven_MO_B_act1( MicrowaveOven_MO_B * self, const Escher_xtUMLEvent_t * const event )
{
  bool cancelled_timer; 
  /* ASSIGN self.beep_count = 0 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN self.beep_count = 0" );
  self->beep_count = 0;
  /* ASSIGN cancelled_timer = TIM::timer_cancel(timer_inst_ref:self.beeper_timer) */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN cancelled_timer = TIM::timer_cancel(timer_inst_ref:self.beeper_timer)" );
  cancelled_timer = TIM_timer_cancel( self->beeper_timer );
}
Пример #7
0
static void
hostmonitor_HM_act2( hostmonitor_HM * self, const Escher_xtUMLEvent_t * const event )
{
  /* SEND monitor::increased_activty(current_rate:self.lastRate, current_temp:self.lastTemp) */
  XTUML_OAL_STMT_TRACE( 1, "SEND monitor::increased_activty(current_rate:self.lastRate, current_temp:self.lastTemp)" );
  hostmonitor_monitor_increased_activty( self->lastRate, self->lastTemp );
  /* GENERATE HM1:poll() TO self */
  XTUML_OAL_STMT_TRACE( 1, "GENERATE HM1:poll() TO self" );
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( self, &hostmonitor_HMevent1c );
    Escher_SendSelfEvent( e );
  }
}
Пример #8
0
static void
Tracking_Display_CB_act5( Tracking_Display * self, const Escher_xtUMLEvent_t * const event )
{
  Escher_ObjectSet_s lapMarkers_space={0}; Escher_ObjectSet_s * lapMarkers = &lapMarkers_space;
  /* SELECT many lapMarkers FROM INSTANCES OF LapMarker */
  XTUML_OAL_STMT_TRACE( 1, "SELECT many lapMarkers FROM INSTANCES OF LapMarker" );
  Escher_CopySet( lapMarkers, &pG_Tracking_LapMarker_extent.active );
  /* UI::setData(unit:laps, value:cardinality lapMarkers) */
  XTUML_OAL_STMT_TRACE( 1, "UI::setData(unit:laps, value:cardinality lapMarkers)" );
  Tracking_UI_setData( GPSWatch_Unit_laps_e, Escher_SetCardinality( lapMarkers ) );
  Escher_ClearSet( lapMarkers );
}
Пример #9
0
/*
 * Interface:  i1
 * Provided Port:  catch
 * To Provider Message:  s2
 */
void
c1_catch_s2()
{
  /* <message compname="c1" compnum="0" portname="catch" portnum="0" msgname="s2" msgnum="1"/> */
  COMP_MSG_START_TRACE( "", 0, 0, 1 );
  c_t s[ESCHER_SYS_MAX_STRING_LEN]; i_t r; 
  /* ASSIGN s = 'tic catch s2' */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN s = 'tic catch s2'" );
  Escher_strcpy( s, "tic catch s2" );
  /* ASSIGN r = lase::o2(op2:1) */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN r = lase::o2(op2:1)" );
  r = c1_lase_o2( 1 );
}
Пример #10
0
/*
 * Interface:  i2
 * Provided Port:  burn
 * To Provider Message:  o4
 */
i_t
c1_burn_o4()
{
  /* <message compname="c1" compnum="0" portname="burn" portnum="1" msgname="o4" msgnum="2"/> */
  COMP_MSG_START_TRACE( "", 0, 1, 2 );
  c_t s[ESCHER_SYS_MAX_STRING_LEN]; 
  /* ASSIGN s = 'tic.burn::o4' */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN s = 'tic.burn::o4'" );
  Escher_strcpy( s, "tic.burn::o4" );
  /* RETURN 1 */
  XTUML_OAL_STMT_TRACE( 1, "RETURN 1" );
  return 1;
}
Пример #11
0
/*
 * Interface:  i2
 * Provided Port:  burn
 * To Provider Message:  o3
 */
void
c1_burn_o3()
{
  /* <message compname="c1" compnum="0" portname="burn" portnum="1" msgname="o3" msgnum="1"/> */
  COMP_MSG_START_TRACE( "", 0, 1, 1 );
  c_t s[ESCHER_SYS_MAX_STRING_LEN]; 
  /* ASSIGN s = 'tic burn o3' */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN s = 'tic burn o3'" );
  Escher_strcpy( s, "tic burn o3" );
  /*  SEND toss::s1(sp1:1) */
  XTUML_OAL_STMT_TRACE( 1, " SEND toss::s1(sp1:1)" );
  c1_toss_s1( 1 );
}
Пример #12
0
/*
 * class operation:  init
 */
monitor_vitalsign *
monitor_O2saturation_op_init()
{
  monitor_O2saturation * O2saturation;monitor_vitalsign * vitalsign;
  /* CREATE OBJECT INSTANCE O2saturation OF O2saturation */
  XTUML_OAL_STMT_TRACE( 1, "CREATE OBJECT INSTANCE O2saturation OF O2saturation" );
  O2saturation = (monitor_O2saturation *) Escher_CreateInstance( monitor_DOMAIN_ID, monitor_O2saturation_CLASS_NUMBER );
  /* CREATE OBJECT INSTANCE vitalsign OF vitalsign */
  XTUML_OAL_STMT_TRACE( 1, "CREATE OBJECT INSTANCE vitalsign OF vitalsign" );
  vitalsign = (monitor_vitalsign *) Escher_CreateInstance( monitor_DOMAIN_ID, monitor_vitalsign_CLASS_NUMBER );
  /* ASSIGN vitalsign.name = O2saturation */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN vitalsign.name = O2saturation" );
  Escher_strcpy( vitalsign->name, "O2saturation" );
  /* ASSIGN vitalsign.value = 0 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN vitalsign.value = 0" );
  vitalsign->value = 0;
  /* ASSIGN vitalsign.yellow_threshold = 93 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN vitalsign.yellow_threshold = 93" );
  vitalsign->yellow_threshold = 93;
  /* ASSIGN vitalsign.red_threshold = 85 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN vitalsign.red_threshold = 85" );
  vitalsign->red_threshold = 85;
  /* RELATE O2saturation TO vitalsign ACROSS R2 */
  XTUML_OAL_STMT_TRACE( 1, "RELATE O2saturation TO vitalsign ACROSS R2" );
  monitor_O2saturation_R2_Link( vitalsign, O2saturation );
  /* RETURN vitalsign */
  XTUML_OAL_STMT_TRACE( 1, "RETURN vitalsign" );
  {monitor_vitalsign * xtumlOALrv = vitalsign;
  return xtumlOALrv;}

}
Пример #13
0
/*
 * Domain Function:  CloseDoor
 */
void
MicrowaveOven_CloseDoor()
{
  MicrowaveOven_MO_D * door; 
  /* SELECT any door FROM INSTANCES OF MO_D */
  XTUML_OAL_STMT_TRACE( 1, "SELECT any door FROM INSTANCES OF MO_D" );
  door = (MicrowaveOven_MO_D *) Escher_SetGetAny( &pG_MicrowaveOven_MO_D_extent.active );
  /* GENERATE MO_D2:close() TO door */
  XTUML_OAL_STMT_TRACE( 1, "GENERATE MO_D2:close() TO door" );
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( door, &MicrowaveOven_MO_Devent2c );
    Escher_SendEvent( e );
  }

}
Пример #14
0
/*
 * class operation:  init
 */
monitor_vitalsign *
monitor_pulse_op_init()
{
  monitor_pulse * pulse;monitor_vitalsign * vitalsign;
  /* CREATE OBJECT INSTANCE pulse OF pulse */
  XTUML_OAL_STMT_TRACE( 1, "CREATE OBJECT INSTANCE pulse OF pulse" );
  pulse = (monitor_pulse *) Escher_CreateInstance( monitor_DOMAIN_ID, monitor_pulse_CLASS_NUMBER );
  /* CREATE OBJECT INSTANCE vitalsign OF vitalsign */
  XTUML_OAL_STMT_TRACE( 1, "CREATE OBJECT INSTANCE vitalsign OF vitalsign" );
  vitalsign = (monitor_vitalsign *) Escher_CreateInstance( monitor_DOMAIN_ID, monitor_vitalsign_CLASS_NUMBER );
  /* ASSIGN vitalsign.name = pulse */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN vitalsign.name = pulse" );
  Escher_strcpy( vitalsign->name, "pulse" );
  /* ASSIGN vitalsign.value = 0 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN vitalsign.value = 0" );
  vitalsign->value = 0;
  /* ASSIGN vitalsign.yellow_threshold = 20 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN vitalsign.yellow_threshold = 20" );
  vitalsign->yellow_threshold = 20;
  /* ASSIGN vitalsign.red_threshold = 10 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN vitalsign.red_threshold = 10" );
  vitalsign->red_threshold = 10;
  /* RELATE pulse TO vitalsign ACROSS R2 */
  XTUML_OAL_STMT_TRACE( 1, "RELATE pulse TO vitalsign ACROSS R2" );
  monitor_pulse_R2_Link( vitalsign, pulse );
  /* RETURN vitalsign */
  XTUML_OAL_STMT_TRACE( 1, "RETURN vitalsign" );
  {monitor_vitalsign * xtumlOALrv = vitalsign;
  return xtumlOALrv;}

}
Пример #15
0
/*
 * Domain Function:  CancelCooking
 */
void
MicrowaveOven_CancelCooking()
{
  MicrowaveOven_MO_O * oven; 
  /* SELECT any oven FROM INSTANCES OF MO_O */
  XTUML_OAL_STMT_TRACE( 1, "SELECT any oven FROM INSTANCES OF MO_O" );
  oven = (MicrowaveOven_MO_O *) Escher_SetGetAny( &pG_MicrowaveOven_MO_O_extent.active );
  /* GENERATE MO_O4:cancel_cooking() TO oven */
  XTUML_OAL_STMT_TRACE( 1, "GENERATE MO_O4:cancel_cooking() TO oven" );
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( oven, &MicrowaveOven_MO_Oevent4c );
    Escher_SendEvent( e );
  }

}
Пример #16
0
/*
 * Domain Function:  DecreasePower
 */
void
MicrowaveOven_DecreasePower()
{
  MicrowaveOven_MO_MT * tube; 
  /* SELECT any tube FROM INSTANCES OF MO_MT */
  XTUML_OAL_STMT_TRACE( 1, "SELECT any tube FROM INSTANCES OF MO_MT" );
  tube = (MicrowaveOven_MO_MT *) Escher_SetGetAny( &pG_MicrowaveOven_MO_MT_extent.active );
  /* GENERATE MO_MT2:decrease_power() TO tube */
  XTUML_OAL_STMT_TRACE( 1, "GENERATE MO_MT2:decrease_power() TO tube" );
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( tube, &MicrowaveOven_MO_MTevent2c );
    Escher_SendEvent( e );
  }

}
Пример #17
0
/*
 * Domain Function:  TestSequence1
 */
void
MicrowaveOven_TestSequence1()
{
  MicrowaveOven_MO_TS * testSequence; 
  /* CREATE OBJECT INSTANCE testSequence OF MO_TS */
  XTUML_OAL_STMT_TRACE( 1, "CREATE OBJECT INSTANCE testSequence OF MO_TS" );
  testSequence = (MicrowaveOven_MO_TS *) Escher_CreateInstance( MicrowaveOven_DOMAIN_ID, MicrowaveOven_MO_TS_CLASS_NUMBER );
  testSequence->TestSeqID = (Escher_UniqueID_t) testSequence;
  /* GENERATE MO_TS2:perform_test_seq_1() TO testSequence */
  XTUML_OAL_STMT_TRACE( 1, "GENERATE MO_TS2:perform_test_seq_1() TO testSequence" );
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( testSequence, &MicrowaveOven_MO_TSevent2c );
    Escher_SendEvent( e );
  }

}
Пример #18
0
/*
 * Interface:  HeartRateProvider
 * Required Port:  HR
 * From Provider Message:  heartRateChanged
 */
void
Tracking_HR_heartRateChanged( const r_t p_heartRate)
{
    Tracking_TrackLog * trackLog=0;
    /* SELECT any trackLog FROM INSTANCES OF TrackLog */
    XTUML_OAL_STMT_TRACE( 1, "SELECT any trackLog FROM INSTANCES OF TrackLog" );
    trackLog = (Tracking_TrackLog *) Escher_SetGetAny( &pG_Tracking_TrackLog_extent.active );
    /* IF ( not empty trackLog ) */
    XTUML_OAL_STMT_TRACE( 1, "IF ( not empty trackLog )" );
    if ( !( 0 == trackLog ) ) {
        /* trackLog.addHeartRateSample( heartRate:PARAM.heartRate ) */
        XTUML_OAL_STMT_TRACE( 2, "trackLog.addHeartRateSample( heartRate:PARAM.heartRate )" );
        Tracking_TrackLog_op_addHeartRateSample( trackLog,  p_heartRate );
    }
}
Пример #19
0
/*
 * Interface:  LocationUtil
 * Provided Port:  UTIL
 * To Provider Message:  getDistance
 */
r4_t
Location_UTIL_getDistance( GPSWatch_sdt_Location p_fromLocation, GPSWatch_sdt_Location p_toLocation)
{
  /* RETURN ( PARAM.fromLocation.longitude + PARAM.toLocation.latitude ) */
  XTUML_OAL_STMT_TRACE( 1, "RETURN ( PARAM.fromLocation.longitude + PARAM.toLocation.latitude )" );
  return ( p_fromLocation.longitude + p_toLocation.latitude );
}
Пример #20
0
/*
 * Interface:  UI
 * Provided Port:  UI
 * To Provider Message:  setTime
 */
void
UI_UI_setTime( const i_t p_time)
{
  /* GuiBridge::setTime( time:PARAM.time ) */
  XTUML_OAL_STMT_TRACE( 1, "GuiBridge::setTime( time:PARAM.time )" );
  UI_GuiBridge_setTime( p_time );
}
Пример #21
0
/*
 * Domain Function:  init
 */
void
UI_init()
{
  /* GuiBridge::connect(  ) */
  XTUML_OAL_STMT_TRACE( 1, "GuiBridge::connect(  )" );
  UI_GuiBridge_connect();

}
Пример #22
0
/*
 * Domain Function:  RunTestCase
 */
void
UI_RunTestCase()
{
  /* TestCase::execute() */
  XTUML_OAL_STMT_TRACE( 1, "TestCase::execute()" );
  UI_TestCase_op_execute();

}
Пример #23
0
/*
 * Interface:  UI
 * Required Port:  UI
 * From Provider Message:  lapResetPressed
 */
void
Tracking_UI_lapResetPressed()
{
    Tracking_WorkoutTimer * workoutTimer=0;
    /* SELECT any workoutTimer FROM INSTANCES OF WorkoutTimer */
    XTUML_OAL_STMT_TRACE( 1, "SELECT any workoutTimer FROM INSTANCES OF WorkoutTimer" );
    workoutTimer = (Tracking_WorkoutTimer *) Escher_SetGetAny( &pG_Tracking_WorkoutTimer_extent.active );
    /* IF ( not empty workoutTimer ) */
    XTUML_OAL_STMT_TRACE( 1, "IF ( not empty workoutTimer )" );
    if ( !( 0 == workoutTimer ) ) {
        /* GENERATE WorkoutTimer2:lapResetPressed() TO workoutTimer */
        XTUML_OAL_STMT_TRACE( 2, "GENERATE WorkoutTimer2:lapResetPressed() TO workoutTimer" );
        {   Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( workoutTimer, &Tracking_WorkoutTimerevent2c );
            Escher_SendEvent( e );
        }
    }
}
Пример #24
0
static void
hostmonitor_HM_act1( hostmonitor_HM * self, const Escher_xtUMLEvent_t * const event )
{
  hostmonitor_RM * rm=0;hostmonitor_TM * tm=0;
  /* SELECT one tm RELATED BY self->TM[R2] */
  XTUML_OAL_STMT_TRACE( 1, "SELECT one tm RELATED BY self->TM[R2]" );
  tm = ( 0 != self ) ? self->TM_R2 : 0;
  /* ASSIGN self.lastTemp = tm.getCurrentTemp() */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN self.lastTemp = tm.getCurrentTemp()" );
  self->lastTemp = hostmonitor_TM_op_getCurrentTemp(tm);
  /* SELECT one rm RELATED BY self->RM[R3] */
  XTUML_OAL_STMT_TRACE( 1, "SELECT one rm RELATED BY self->RM[R3]" );
  rm = ( 0 != self ) ? self->RM_R3 : 0;
  /* ASSIGN self.lastRate = rm.getCurrentRate() */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN self.lastRate = rm.getCurrentRate()" );
  self->lastRate = hostmonitor_RM_op_getCurrentRate(rm);
  /* IF ( ( ( self.lastTemp > 37.5 ) or ( self.lastRate > 18 ) ) ) */
  XTUML_OAL_STMT_TRACE( 1, "IF ( ( ( self.lastTemp > 37.5 ) or ( self.lastRate > 18 ) ) )" );
  if ( ( ( self->lastTemp > 37.5 ) || ( self->lastRate > 18 ) ) ) {
    /* GENERATE HM2:increasedActivity() TO self */
    XTUML_OAL_STMT_TRACE( 2, "GENERATE HM2:increasedActivity() TO self" );
    { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( self, &hostmonitor_HMevent2c );
      Escher_SendSelfEvent( e );
    }
  }
  /* GENERATE HM1:poll() TO self */
  XTUML_OAL_STMT_TRACE( 1, "GENERATE HM1:poll() TO self" );
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( self, &hostmonitor_HMevent1c );
    Escher_SendSelfEvent( e );
  }
}
Пример #25
0
/*
 * Domain Function:  test
 */
void
c1_test()
{
  c1_PING * ping; c1_PONG * pong; c_t s[ESCHER_SYS_MAX_STRING_LEN]; 
  /* CREATE OBJECT INSTANCE ping OF PING */
  XTUML_OAL_STMT_TRACE( 1, "CREATE OBJECT INSTANCE ping OF PING" );
  ping = (c1_PING *) Escher_CreateInstance( c1_DOMAIN_ID, c1_PING_CLASS_NUMBER );
  /* CREATE OBJECT INSTANCE pong OF PONG */
  XTUML_OAL_STMT_TRACE( 1, "CREATE OBJECT INSTANCE pong OF PONG" );
  pong = (c1_PONG *) Escher_CreateInstance( c1_DOMAIN_ID, c1_PONG_CLASS_NUMBER );
  /* RELATE ping TO pong ACROSS R1 */
  XTUML_OAL_STMT_TRACE( 1, "RELATE ping TO pong ACROSS R1" );
  c1_PING_R1_Link( pong, ping );
  /* ASSIGN ping.i = 0 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN ping.i = 0" );
  ping->i = 0;
  /* ASSIGN pong.s = 'pong' */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN pong.s = 'pong'" );
  Escher_strcpy( pong->s, "pong" );
  /* ASSIGN s = 'tic function test' */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN s = 'tic function test'" );
  Escher_strcpy( s, "tic function test" );
  /*  SEND toss::s1(sp1:1) */
  XTUML_OAL_STMT_TRACE( 1, " SEND toss::s1(sp1:1)" );
  c1_toss_s1( 1 );

}
Пример #26
0
/*
 * Interface:  LocationProvider
 * Required Port:  LOC
 * From Provider Message:  locationUpdate
 */
void
Tracking_LOC_locationUpdate( GPSWatch_sdt_Location p_location)
{
    Tracking_TrackLog * trackLog=0;
    /* LOG::LogInfo( message:location updated:  ) */
    XTUML_OAL_STMT_TRACE( 1, "LOG::LogInfo( message:location updated:  )" );
    LOG_LogInfo( "location updated: " );
    /* LOG::LogReal( message:longitude, r:PARAM.location.longitude ) */
    XTUML_OAL_STMT_TRACE( 1, "LOG::LogReal( message:longitude, r:PARAM.location.longitude )" );
    LOG_LogReal( "longitude", p_location.longitude );
    /* LOG::LogReal( message:latitude, r:PARAM.location.latitude ) */
    XTUML_OAL_STMT_TRACE( 1, "LOG::LogReal( message:latitude, r:PARAM.location.latitude )" );
    LOG_LogReal( "latitude", p_location.latitude );
    /* LOG::LogReal( message:speed, r:PARAM.location.speed ) */
    XTUML_OAL_STMT_TRACE( 1, "LOG::LogReal( message:speed, r:PARAM.location.speed )" );
    LOG_LogReal( "speed", p_location.speed );
    /* SELECT any trackLog FROM INSTANCES OF TrackLog */
    XTUML_OAL_STMT_TRACE( 1, "SELECT any trackLog FROM INSTANCES OF TrackLog" );
    trackLog = (Tracking_TrackLog *) Escher_SetGetAny( &pG_Tracking_TrackLog_extent.active );
    /* IF ( not empty trackLog ) */
    XTUML_OAL_STMT_TRACE( 1, "IF ( not empty trackLog )" );
    if ( !( 0 == trackLog ) ) {
        /* trackLog.addTrackPoint( location:PARAM.location ) */
        XTUML_OAL_STMT_TRACE( 2, "trackLog.addTrackPoint( location:PARAM.location )" );
        Tracking_TrackLog_op_addTrackPoint( trackLog,  p_location );
    }
}
Пример #27
0
static void
Tracking_Display_CB_act1( Tracking_Display * self, const Escher_xtUMLEvent_t * const event )
{
  r_t distance;Tracking_TrackLog * trackLog=0;
  /* ASSIGN distance = 0.0 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN distance = 0.0" );
  distance = 0.0;
  /* SELECT any trackLog FROM INSTANCES OF TrackLog */
  XTUML_OAL_STMT_TRACE( 1, "SELECT any trackLog FROM INSTANCES OF TrackLog" );
  trackLog = (Tracking_TrackLog *) Escher_SetGetAny( &pG_Tracking_TrackLog_extent.active );
  /* IF ( not empty trackLog ) */
  XTUML_OAL_STMT_TRACE( 1, "IF ( not empty trackLog )" );
  if ( !( 0 == trackLog ) ) {
    /* ASSIGN distance = trackLog.distance */
    XTUML_OAL_STMT_TRACE( 2, "ASSIGN distance = trackLog.distance" );
    distance = trackLog->distance;
  }
  /* IF ( ( distance > 1000.0 ) ) */
  XTUML_OAL_STMT_TRACE( 1, "IF ( ( distance > 1000.0 ) )" );
  if ( ( distance > 1000.0 ) ) {
    /* UI::setData(unit:km, value:( distance / 1000.0 )) */
    XTUML_OAL_STMT_TRACE( 2, "UI::setData(unit:km, value:( distance / 1000.0 ))" );
    Tracking_UI_setData( GPSWatch_Unit_km_e, ( distance / 1000.0 ) );
  }
  else {
    /* UI::setData(unit:meters, value:distance) */
    XTUML_OAL_STMT_TRACE( 2, "UI::setData(unit:meters, value:distance)" );
    Tracking_UI_setData( GPSWatch_Unit_meters_e, distance );
  }
}
Пример #28
0
/*
 * Interface:  i2
 * Provided Port:  burn
 * To Provider Message:  o2
 */
i_t
c2_burn_o2( const i_t p_op2)
{
  /* <message compname="c2" compnum="1" portname="burn" portnum="1" msgname="o2" msgnum="0"/> */
  COMP_MSG_START_TRACE( "%d", 1, 1, 0, p_op2 );
  c_t s[ESCHER_SYS_MAX_STRING_LEN]; i_t p; 
  /* ASSIGN s = 'tac burn' */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN s = 'tac burn'" );
  Escher_strcpy( s, "tac burn" );
  /* LOG::LogInfo( message:s ) */
  XTUML_OAL_STMT_TRACE( 1, "LOG::LogInfo( message:s )" );
  LOG_LogInfo( s );
  /* ASSIGN p = PARAM.op2 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN p = PARAM.op2" );
  p = p_op2;
  /* IF ( ( 2 != PARAM.op2 ) ) */
  XTUML_OAL_STMT_TRACE( 1, "IF ( ( 2 != PARAM.op2 ) )" );
  if ( ( 2 != p_op2 ) ) {
    /* LOG::LogFailure( message:'tac burn did not get 2' ) */
    XTUML_OAL_STMT_TRACE( 2, "LOG::LogFailure( message:'tac burn did not get 2' )" );
    LOG_LogFailure( "tac burn did not get 2" );
  }
  else {
    /* RETURN ( lase::o2(3) + 1 ) */
    XTUML_OAL_STMT_TRACE( 2, "RETURN ( lase::o2(3) + 1 )" );
    return ( c2_lase_o2( 3 ) + 1 );
  }
  /* RETURN 0 */
  XTUML_OAL_STMT_TRACE( 1, "RETURN 0" );
  return 0;
}
Пример #29
0
/*
 * Domain Function:  SpecifyCookingPeriod
 */
void
MicrowaveOven_SpecifyCookingPeriod( i_t p_cookingPeriod)
{
  i_t timePeriod; MicrowaveOven_MO_O * oven; 
  /* ASSIGN timePeriod = ( 1000000 * PARAM.cookingPeriod ) */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN timePeriod = ( 1000000 * PARAM.cookingPeriod )" );
  timePeriod = ( 1000000 * p_cookingPeriod );
  /* SELECT any oven FROM INSTANCES OF MO_O */
  XTUML_OAL_STMT_TRACE( 1, "SELECT any oven FROM INSTANCES OF MO_O" );
  oven = (MicrowaveOven_MO_O *) Escher_SetGetAny( &pG_MicrowaveOven_MO_O_extent.active );
  /* GENERATE MO_O8:cooking_period(period:timePeriod) TO oven */
  XTUML_OAL_STMT_TRACE( 1, "GENERATE MO_O8:cooking_period(period:timePeriod) TO oven" );
  { MicrowaveOven_MO_Oevent8 * e = (MicrowaveOven_MO_Oevent8 *) Escher_NewxtUMLEvent( oven, &MicrowaveOven_MO_Oevent8c );
    e->p_period = timePeriod;
    Escher_SendEvent( (Escher_xtUMLEvent_t *) e );
  }

}
Пример #30
0
/*
 * Interface:  i2
 * Provided Port:  burn
 * To Provider Message:  o4
 */
i_t
c2_burn_o4()
{
  /* <message compname="c2" compnum="1" portname="burn" portnum="1" msgname="o4" msgnum="2"/> */
  COMP_MSG_START_TRACE( "", 1, 1, 2 );
  /* RETURN 999 */
  XTUML_OAL_STMT_TRACE( 1, "RETURN 999" );
  return 999;
}