Exemple #1
0
/*---------------------------------------------------------------------
 * Generate delayed event to the application.
 * Deactivate fired timer.
 *-------------------------------------------------------------------*/
static void
timer_fire(
  ETimer_t * const t
)
{
  t->expiration = ( t->recurrence == 0 ) ? 0 : t->expiration + t->recurrence;
  Escher_SendEvent( t->event );
  if ( 0 != t->recurrence ) {
    Escher_xtUMLEvent_t * e = Escher_AllocatextUMLEvent();
    Escher_memmove( e, t->event, sizeof( Escher_xtUMLEvent_t ) );
    t->event = e;
    #ifdef ESCHER_TASKING_POSIX
    Escher_mutex_lock( SEMAPHORE_FLAVOR_TIMER );
    #endif
    animate = animate->next;      /* Remove from front of list.    */
    timer_insert_sorted( t );
    #ifdef ESCHER_TASKING_POSIX
    Escher_mutex_unlock( SEMAPHORE_FLAVOR_TIMER );
    #endif
  } else {
  #ifdef ESCHER_TASKING_POSIX
  Escher_mutex_lock( SEMAPHORE_FLAVOR_TIMER );
  #endif
  animate = animate->next;        /* Remove from active list.      */
  t->next = inanimate;            /* Connect to inactive list.     */
  inanimate = t;
  #ifdef ESCHER_TASKING_POSIX
  Escher_mutex_unlock( SEMAPHORE_FLAVOR_TIMER );
  #endif
  }
}
Exemple #2
0
/*
 * Interface:  UI
 * Required Port:  UI
 * From Provider Message:  modePressed
 */
void
Tracking_UI_modePressed()
{
    {   Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( (void *) 0, &Tracking_Display_CBevent1c );
        Escher_SendEvent( e );
    }

}
Exemple #3
0
/*
 * Interface:  LocationProvider
 * Provided Port:  LOC
 * To Provider Message:  unregisterListener
 */
void
Location_LOC_unregisterListener()
{
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( (void *) 0, &Location_GPS_CBevent3c );
    Escher_SendEvent( e );
  }

}
/*
 * Interface:  HeartRateProvider
 * Provided Port:  HR
 * To Provider Message:  unregisterListener
 */
void
HeartRateMonitor_HR_unregisterListener()
{
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( (void *) 0, &HeartRateMonitor_HeartRateMonitor_CBevent2c );
    Escher_SendEvent( e );
  }

}
Exemple #5
0
/*
 * Interface:  synchronization
 * Provided Port:  to_heart
 * To Provider Message:  systolic_pulse
 */
void
pacemaker_to_heart_systolic_pulse()
{
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( (void *) 0, &pacemaker_PACER_CBevent4c );
    Escher_SendEvent( e );
  }

}
Exemple #6
0
/*
 * Interface:  host
 * Provided Port:  host
 * To Provider Message:  current_temp
 */
void
pacer_host_current_temp()
{
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( (void *) 0, &hostmonitor_HM_CBevent2c );
    Escher_SendEvent( e );
  }

}
Exemple #7
0
/*
 * Interface:  host
 * Provided Port:  host
 * To Provider Message:  breath_taken
 */
void
pacer_host_breath_taken()
{
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( (void *) 0, &hostmonitor_HM_CBevent1c );
    Escher_SendEvent( e );
  }

}
Exemple #8
0
/*
 * Interface:  monitor
 * Provided Port:  monitor
 * To Provider Message:  increased_activty
 */
void
pacemaker_monitor_increased_activty( const i_t p_current_rate, const i_t p_current_temp )
{
  { pacemaker_PACER_CBevent5 * e = (pacemaker_PACER_CBevent5 *) Escher_NewxtUMLEvent( (void *) 0, &pacemaker_PACER_CBevent5c );
    e->p_current_rate = p_current_rate;    e->p_current_temp = p_current_temp;
    Escher_SendEvent( (Escher_xtUMLEvent_t *) e );
  }

}
Exemple #9
0
/*
 * Domain Function:  test
 */
void
polycalc_test()
{
  /* GENERATE PUZZLE_A1:start() TO PUZZLE CLASS */
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( (void *) 0, &polycalc_PUZZLE_CBevent1c );
    Escher_SendEvent( e );
  }


}
Exemple #10
0
/*
 * Domain Function:  deeptest
 */
void
polycalc_deeptest()
{
  /* GENERATE LOCATION_A1:start() TO LOCATION CLASS */
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( (void *) 0, &polycalc_LOCATION_CBevent1c );
    Escher_SendEvent( e );
  }


}
static void
perf_funcs_B_act1( perf_funcs_B * self, const Escher_xtUMLEvent_t * const event )
{
  perf_funcs_A * a=0;
  /* SELECT one a RELATED BY self->A[R1] */
  a = ( 0 != self ) ? self->A_R1 : 0;
  /* GENERATE A1:e() TO a */
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( a, &perf_funcs_Aevent1c );
    Escher_SendEvent( e );
  }
}
Exemple #12
0
/*
 * Interface:  i1
 * Provided Port:  catch
 * To Provider Message:  s1
 */
void
c2_catch_s1( const i_t p_sp1)
{
  /* <message compname="c2" compnum="1" portname="catch" portnum="0" msgname="s1" msgnum="0"/> */
  COMP_MSG_START_TRACE( "%d", 1, 0, 0, p_sp1 );
  { c2_TAC_A_CBevent1 * e = (c2_TAC_A_CBevent1 *) Escher_NewxtUMLEvent( (void *) 0, &c2_TAC_A_CBevent1c );
    e->p_sp1 = p_sp1;
    Escher_SendEvent( (Escher_xtUMLEvent_t *) e );
  }

}
Exemple #13
0
/*
 * Interface:  UI
 * Provided Port:  UI
 * To Provider Message:  startTest
 */
void
UI_UI_startTest()
{
  /* GENERATE TestCase2:start(iterations:2) TO TestCase CREATOR */
  XTUML_OAL_STMT_TRACE( 1, "GENERATE TestCase2:start(iterations:2) TO TestCase CREATOR" );
  { UI_TestCaseevent2 * e = (UI_TestCaseevent2 *) Escher_NewxtUMLEvent( (void *) 0, &UI_TestCaseevent2c );
    e->p_iterations = 2;
    Escher_SendEvent( (Escher_xtUMLEvent_t *) e );
  }

}
Exemple #14
0
/*
 * Domain Function:  test
 */
void
perf_funcs_test()
{
  perf_funcs_BENCHMARK * benchmark=0; 
  /* SELECT any benchmark FROM INSTANCES OF BENCHMARK */
  benchmark = (perf_funcs_BENCHMARK *) Escher_SetGetAny( &pG_perf_funcs_BENCHMARK_extent.active );
  /* GENERATE BENCHMARK1:go() TO benchmark */
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( benchmark, &perf_funcs_BENCHMARKevent1c );
    Escher_SendEvent( e );
  }

}
static void
polycalc_ORANGE_act1( polycalc_ORANGE * self, const Escher_xtUMLEvent_t * const event )
{
  polycalc_FRUIT * fruit = 0; /* fruit (FRUIT) */
 
  /* SELECT one fruit RELATED BY self->FRUIT[R3] */
  fruit = self->FRUIT_R3;
  /* GENERATE FRUIT2:juiced(percentage:100) TO fruit */
  { polycalc_FRUITevent2 * e = (polycalc_FRUITevent2 *) Escher_NewxtUMLEvent( fruit, &polycalc_FRUITevent2c );
    e->p_percentage = 100;
    Escher_SendEvent( (Escher_xtUMLEvent_t *) e );
  }
}
static void
perf_funcs_A_act1( perf_funcs_A * self, const Escher_xtUMLEvent_t * const event )
{
  perf_funcs_B * b=0;
  /* SELECT one b RELATED BY self->B[R1] */
  b = ( 0 != self ) ? self->B_R1 : 0;
  /* GENERATE B1:e1() TO b */
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( b, &perf_funcs_Bevent1c );
    Escher_SendEvent( e );
  }
  /* ASSIGN self.odometer = ( self.odometer + 2 ) */
  self->odometer = ( self->odometer + 2 );
}
Exemple #17
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 );
  }

}
Exemple #18
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 );
  }

}
Exemple #19
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 );
  }

}
Exemple #20
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 );
  }

}
Exemple #21
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 );
        }
    }
}
/*
 * Domain Function:  solve_concurrently
 */
void
sudoku_solve_concurrently( void )
{
  i_t score;  sudoku_ROW * row;
  /* ASSIGN score = CELL::score() */
  score = sudoku_CELL_op_score();
  /* ::display(  ) */
  sudoku_display();
  /* SELECT any row FROM INSTANCES OF ROW */
  row = (sudoku_ROW *) Escher_SetGetAny( &pG_sudoku_ROW_extent.active );
  /* GENERATE ROW1:update() TO row */
  {
  Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( row, &sudoku_ROWevent1c );
  Escher_SendEvent( e );
  }

}
static void
stringtest_device_act2( stringtest_device * self, const Escher_xtUMLEvent_t * const event )
{
  stringtest_deviceevent2 * rcvd_evt = (stringtest_deviceevent2 *) event;
  stringtest_host * h;c_t l[ESCHER_SYS_MAX_STRING_LEN];
  /* ASSIGN h = PARAM.h */
  h = rcvd_evt->p_h;
  /* ASSIGN l = buffer::scmp(s1:h.upper, s2:PARAM.s) */
  Escher_strcpy( l, stringtest_buffer_op_scmp(h->upper, rcvd_evt->p_s).s );
  /* ASSIGN l = buffer::scmp(s1:self.lower, s2:) */
  Escher_strcpy( l, stringtest_buffer_op_scmp(self->lower, stringtest_device_op_rstr(self).s).s );
  /* GENERATE host2:put(s:l, d:self) TO h */
  { stringtest_hostevent2 * e = (stringtest_hostevent2 *) Escher_NewxtUMLEvent( h, &stringtest_hostevent2c );
    Escher_strcpy( e->p_s, l );    e->p_d = self;
    Escher_SendEvent( (Escher_xtUMLEvent_t *) e );
  }
}
Exemple #24
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 );
  }

}
Exemple #25
0
/*---------------------------------------------------------------------
 * Generate delayed event to the application.
 * Deactivate fired timer.
 *-------------------------------------------------------------------*/
static void
timer_fire(
  ETimer_t * const t
)
{
  t->expiration = ( t->recurrence == 0 ) ? 0 : t->expiration + t->recurrence;
  Escher_SendEvent( t->event );
  if ( 0 != t->recurrence ) {
    Escher_xtUMLEvent_t * e = Escher_AllocatextUMLEvent();
    Escher_memmove( e, t->event, sizeof( Escher_xtUMLEvent_t ) );
    t->event = e;
    animate = animate->next;      /* Remove from front of list.    */
    timer_insert_sorted( t );
  } else {
  animate = animate->next;        /* Remove from active list.      */
  t->next = inanimate;            /* Connect to inactive list.     */
  inanimate = t;
  }
}
static void
MicrowaveOven_MO_B_act2( MicrowaveOven_MO_B * self, const Escher_xtUMLEvent_t * const event )
{
  /* IF ( ( self.beep_count == 0 ) ) */
  XTUML_OAL_STMT_TRACE( 1, "IF ( ( self.beep_count == 0 ) )" );
  if ( ( self->beep_count == 0 ) ) {
    Escher_xtUMLEvent_t * delay_over;  /* delay_over */ 
    /* CREATE EVENT INSTANCE delay_over(  ) TO self */
    XTUML_OAL_STMT_TRACE( 2, "CREATE EVENT INSTANCE delay_over(  ) TO self" );
    delay_over = Escher_NewxtUMLEvent( (void *) self, &MicrowaveOven_MO_Bevent2c );
    /* ASSIGN self.beeper_delay_over = delay_over */
    XTUML_OAL_STMT_TRACE( 2, "ASSIGN self.beeper_delay_over = delay_over" );
    self->beeper_delay_over = delay_over;
    /* ASSIGN self.beeper_timer = TIM::timer_start(event_inst:self.beeper_delay_over, microseconds:100000) */
    XTUML_OAL_STMT_TRACE( 2, "ASSIGN self.beeper_timer = TIM::timer_start(event_inst:self.beeper_delay_over, microseconds:100000)" );
    self->beeper_timer = TIM_timer_start( (Escher_xtUMLEvent_t *)self->beeper_delay_over, 100000 );
  }
  else if ( ( self->beep_count == 4 ) ) {
    MicrowaveOven_MO_O * oven = 0; /* oven (MO_O) */
 
    /* GENERATE MO_B3:beeping_stopped() TO self */
    XTUML_OAL_STMT_TRACE( 2, "GENERATE MO_B3:beeping_stopped() TO self" );
    { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( self, &MicrowaveOven_MO_Bevent3c );
      Escher_SendSelfEvent( e );
    }
    /* SELECT one oven RELATED BY self->MO_O[R3] */
    XTUML_OAL_STMT_TRACE( 2, "SELECT one oven RELATED BY self->MO_O[R3]" );
    oven = self->MO_O_R3;
    /* GENERATE MO_O6:beeping_over() TO oven */
    XTUML_OAL_STMT_TRACE( 2, "GENERATE MO_O6:beeping_over() TO oven" );
    { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( oven, &MicrowaveOven_MO_Oevent6c );
      Escher_SendEvent( e );
    }
  }
  else {
    /* ASSIGN self.beeper_timer = TIM::timer_start(event_inst:self.beeper_delay_over, microseconds:100000) */
    XTUML_OAL_STMT_TRACE( 2, "ASSIGN self.beeper_timer = TIM::timer_start(event_inst:self.beeper_delay_over, microseconds:100000)" );
    self->beeper_timer = TIM_timer_start( (Escher_xtUMLEvent_t *)self->beeper_delay_over, 100000 );
  }
  /* ASSIGN self.beep_count = ( self.beep_count + 1 ) */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN self.beep_count = ( self.beep_count + 1 )" );
  self->beep_count = ( self->beep_count + 1 );
}
Exemple #27
0
/*
 * Interface:  i1
 * Provided Port:  catch
 * To Provider Message:  s1
 */
void
c1_catch_s1( const i_t p_sp1)
{
  /* <message compname="c1" compnum="0" portname="catch" portnum="0" msgname="s1" msgnum="0"/> */
  COMP_MSG_START_TRACE( "%d", 0, 0, 0, p_sp1 );
  c_t s[ESCHER_SYS_MAX_STRING_LEN]; c1_PONG * pong=0; 
  /* ASSIGN s = 'tic catch' */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN s = 'tic catch'" );
  Escher_strcpy( s, "tic catch" );
  /* SELECT any pong FROM INSTANCES OF PONG */
  XTUML_OAL_STMT_TRACE( 1, "SELECT any pong FROM INSTANCES OF PONG" );
  pong = (c1_PONG *) Escher_SetGetAny( &pG_c1_PONG_extent.active );
  /* GENERATE PONG1:back() TO pong */
  XTUML_OAL_STMT_TRACE( 1, "GENERATE PONG1:back() TO pong" );
  { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( pong, &c1_PONGevent1c );
    Escher_SendEvent( e );
  }
  /* IF ( ( 3 != PARAM.sp1 ) ) */
  XTUML_OAL_STMT_TRACE( 1, "IF ( ( 3 != PARAM.sp1 ) )" );
  if ( ( 3 != p_sp1 ) ) {
    /* LOG::LogFailure( message:'tic catch did not get 3' ) */
    XTUML_OAL_STMT_TRACE( 2, "LOG::LogFailure( message:'tic catch did not get 3' )" );
    LOG_LogFailure( "tic catch did not get 3" );
  }
  else {
    i_t r; 
    /* ASSIGN r = lase::o2(op2:1) */
    XTUML_OAL_STMT_TRACE( 2, "ASSIGN r = lase::o2(op2:1)" );
    r = c1_lase_o2( 1 );
    /* IF ( ( 3 != r ) ) */
    XTUML_OAL_STMT_TRACE( 2, "IF ( ( 3 != r ) )" );
    if ( ( 3 != r ) ) {
      /* LOG::LogFailure( message:'tic catch did not get 3 returned from lase' ) */
      XTUML_OAL_STMT_TRACE( 3, "LOG::LogFailure( message:'tic catch did not get 3 returned from lase' )" );
      LOG_LogFailure( "tic catch did not get 3 returned from lase" );
    }
  }
}
Exemple #28
0
/*
 * Interface:  UI
 * Required Port:  UI
 * From Provider Message:  startStopPressed
 */
void
Tracking_UI_startStopPressed()
{
    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 ( empty workoutTimer ) */
    XTUML_OAL_STMT_TRACE( 1, "IF ( empty workoutTimer )" );
    if ( ( 0 == workoutTimer ) ) {
        /* CREATE OBJECT INSTANCE workoutTimer OF WorkoutTimer */
        XTUML_OAL_STMT_TRACE( 2, "CREATE OBJECT INSTANCE workoutTimer OF WorkoutTimer" );
        workoutTimer = (Tracking_WorkoutTimer *) Escher_CreateInstance( Tracking_DOMAIN_ID, Tracking_WorkoutTimer_CLASS_NUMBER );
        /* ASSIGN workoutTimer.time = 0 */
        XTUML_OAL_STMT_TRACE( 2, "ASSIGN workoutTimer.time = 0" );
        workoutTimer->time = 0;
    }
    /* GENERATE WorkoutTimer1:startStopPressed() TO workoutTimer */
    XTUML_OAL_STMT_TRACE( 1, "GENERATE WorkoutTimer1:startStopPressed() TO workoutTimer" );
    {   Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( workoutTimer, &Tracking_WorkoutTimerevent1c );
        Escher_SendEvent( e );
    }
}
Exemple #29
0
/*
 * Domain Function:  perftest
 */
bool
perf_funcs_perftest( i_t p_count, i_t p_duration, i_t p_phase, i_t p_testnum)
{
  bool testloop; 
  /* ASSIGN testloop = TRUE */
  testloop = TRUE;
  /* IF ( ( 6 == PARAM.phase ) ) */
  if ( ( 6 == p_phase ) ) {
    perf_funcs_BENCHMARK * benchmark=0; 
    /* SELECT any benchmark FROM INSTANCES OF BENCHMARK */
    benchmark = (perf_funcs_BENCHMARK *) Escher_SetGetAny( &pG_perf_funcs_BENCHMARK_extent.active );
    /* GENERATE BENCHMARK2:stop() TO benchmark */
    { Escher_xtUMLEvent_t * e = Escher_NewxtUMLEvent( benchmark, &perf_funcs_BENCHMARKevent2c );
      Escher_SendEvent( e );
    }
  }
  else if ( ( 1 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::create_instance(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_create_instance(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 2 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::delete_instance(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_delete_instance(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 3 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::delete_many(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_delete_many(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 4 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::generate_and_dispatch_event(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_generate_and_dispatch_event(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 5 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::select_one_related(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_select_one_related(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 6 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::select_any_from(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_select_any_from(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 7 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::relate_one(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_relate_one(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 8 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::relate_one_to_many(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_relate_one_to_many(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 9 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::relate_one_using(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_relate_one_using(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 10 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::cardinality_10000(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_cardinality_10000(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 11 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::cardinality_1000(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_cardinality_1000(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 12 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::cardinality_100(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_cardinality_100(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 13 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::cardinality_10(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_cardinality_10(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 14 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::select_any_where_10000(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_select_any_where_10000(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 15 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::select_any_where_1000(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_select_any_where_1000(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 16 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::select_any_where_100(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_select_any_where_100(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 17 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::select_any_where_10(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_select_any_where_10(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 18 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::read_attribute(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_read_attribute(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 19 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::write_attribute(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_write_attribute(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 20 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::bridge_void_void(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_bridge_void_void(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 21 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::bridge_void_integer(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_bridge_void_integer(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 22 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::bridge_integer_integer(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_bridge_integer_integer(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 23 == p_testnum ) ) {
    /* ASSIGN testloop = CBENCH::function_void_void(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_CBENCH_op_function_void_void(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 24 == p_testnum ) ) {
    /* ASSIGN testloop = CBENCH::function_void_integer(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_CBENCH_op_function_void_integer(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 25 == p_testnum ) ) {
    /* ASSIGN testloop = CBENCH::function_integer_integer(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_CBENCH_op_function_integer_integer(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 26 == p_testnum ) ) {
    /* ASSIGN testloop = CBENCH::read_struct_member(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_CBENCH_op_read_struct_member(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 27 == p_testnum ) ) {
    /* ASSIGN testloop = CBENCH::write_struct_member(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_CBENCH_op_write_struct_member(p_count, p_duration, p_phase, p_testnum);
  }
  else if ( ( 99 == p_testnum ) ) {
    /* ASSIGN testloop = BENCHMARK::generate_event(count:PARAM.count, duration:PARAM.duration, phase:PARAM.phase, testnum:PARAM.testnum) */
    testloop = perf_funcs_BENCHMARK_op_generate_event(p_count, p_duration, p_phase, p_testnum);
  }
  else {
    /* ::xit(  ) */
    perf_funcs_xit();
  }
  /* RETURN testloop */
  return testloop;

}