Пример #1
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 );
    }
}
Пример #2
0
/*
 * instance operation:  render
 */
void
ooaofooa_DOC_CELL_op_render( ooaofooa_DOC_CELL * self)
{
  ooaofooa_DOC_CELL * doc_cell=0;ooaofooa_DOC_PAR * doc_par=0;
  /* SELECT any doc_cell FROM INSTANCES OF DOC_CELL */
  doc_cell = (ooaofooa_DOC_CELL *) Escher_SetGetAny( &pG_ooaofooa_DOC_CELL_extent.active );
  /* ASSIGN doc_cell = self */
  doc_cell = self;
  /* T::include( file:docbook/t.tableentrybegin.h ) */
#include "docbook/t.tableentrybegin.h"
  /* SELECT one doc_par RELATED BY self->DOC_PAR[R2318] */
  doc_par = ( 0 != self ) ? self->DOC_PAR_R2318_contains : 0;
  /* IF ( not_empty doc_par ) */
  if ( ( 0 != doc_par ) ) {
    /* doc_par.render() */
    ooaofooa_DOC_PAR_op_render( doc_par );
  }
  /* T::include( file:docbook/t.tableentryend.h ) */
#include "docbook/t.tableentryend.h"
  /* SELECT one doc_cell RELATED BY self->DOC_CELL[R2304.follows] */
  doc_cell = ( 0 != self ) ? self->DOC_CELL_R2304_follows : 0;
  /* IF ( not_empty doc_cell ) */
  if ( ( 0 != doc_cell ) ) {
    /* doc_cell.render() */
    ooaofooa_DOC_CELL_op_render( doc_cell );
  }

}
Пример #3
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 );
  }
}
Пример #4
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 );
  }

}
Пример #5
0
/*
 * instance operation:  render
 */
void
ooaofooa_DOC_IMG_op_render( ooaofooa_DOC_IMG * self)
{
  ooaofooa_DOC_IMG * doc_img=0;
  /* SELECT any doc_img FROM INSTANCES OF DOC_IMG */
  doc_img = (ooaofooa_DOC_IMG *) Escher_SetGetAny( &pG_ooaofooa_DOC_IMG_extent.active );
  /* ASSIGN doc_img = self */
  doc_img = self;
  /* T::include( file:docbook/t.image.h ) */
#include "docbook/t.image.h"

}
Пример #6
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 );
  }

}
Пример #7
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 );
  }

}
Пример #8
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 );
  }

}
Пример #9
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 );
    }
}
Пример #10
0
/*
 * 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 );
  }

}
Пример #11
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 );
        }
    }
}
Пример #12
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 );
  }

}
Пример #13
0
static void
Tracking_Display_CB_act4( Tracking_Display * self, const Escher_xtUMLEvent_t * const event )
{
  r_t heartRate;Tracking_TrackLog * trackLog=0;
  /* ASSIGN heartRate = 0.0 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN heartRate = 0.0" );
  heartRate = 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 heartRate = trackLog.currentHeartRate */
    XTUML_OAL_STMT_TRACE( 2, "ASSIGN heartRate = trackLog.currentHeartRate" );
    heartRate = trackLog->currentHeartRate;
  }
  /* UI::setData(unit:bpm, value:heartRate) */
  XTUML_OAL_STMT_TRACE( 1, "UI::setData(unit:bpm, value:heartRate)" );
  Tracking_UI_setData( GPSWatch_Unit_bpm_e, heartRate );
}
Пример #14
0
static void
Tracking_Display_CB_act3( Tracking_Display * self, const Escher_xtUMLEvent_t * const event )
{
  r_t pace;Tracking_TrackLog * trackLog=0;
  /* ASSIGN pace = 0.0 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN pace = 0.0" );
  pace = 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 pace = trackLog.currentPace */
    XTUML_OAL_STMT_TRACE( 2, "ASSIGN pace = trackLog.currentPace" );
    pace = Tracking_TrackLog_MDA_currentPace( trackLog );
  }
  /* UI::setData(unit:minPerKm, value:pace) */
  XTUML_OAL_STMT_TRACE( 1, "UI::setData(unit:minPerKm, value:pace)" );
  Tracking_UI_setData( GPSWatch_Unit_minPerKm_e, pace );
}
Пример #15
0
/*
 * instance operation:  render
 */
void
ooaofooa_DOC_TBL_op_render( ooaofooa_DOC_TBL * self)
{
  ooaofooa_DOC_TBL * doc_tbl=0;ooaofooa_DOC_ROW * doc_row=0;
  /* SELECT any doc_tbl FROM INSTANCES OF DOC_TBL */
  doc_tbl = (ooaofooa_DOC_TBL *) Escher_SetGetAny( &pG_ooaofooa_DOC_TBL_extent.active );
  /* ASSIGN doc_tbl = self */
  doc_tbl = self;
  /* T::include( file:docbook/t.tablebegin.h ) */
#include "docbook/t.tablebegin.h"
  /* SELECT one doc_row RELATED BY self->DOC_ROW[R2317] */
  doc_row = ( 0 != self ) ? self->DOC_ROW_R2317_has_first : 0;
  /* IF ( not_empty doc_row ) */
  if ( ( 0 != doc_row ) ) {
    /* doc_row.render() */
    ooaofooa_DOC_ROW_op_render( doc_row );
  }
  /* T::include( file:docbook/t.tableend.h ) */
#include "docbook/t.tableend.h"

}
Пример #16
0
static void
Tracking_Display_CB_act2( Tracking_Display * self, const Escher_xtUMLEvent_t * const event )
{
  r_t speed;Tracking_TrackLog * trackLog=0;
  /* ASSIGN speed = 0.0 */
  XTUML_OAL_STMT_TRACE( 1, "ASSIGN speed = 0.0" );
  speed = 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 speed = trackLog.currentSpeed */
    XTUML_OAL_STMT_TRACE( 2, "ASSIGN speed = trackLog.currentSpeed" );
    speed = trackLog->currentSpeed;
  }
  /* UI::setData(unit:kmPerHour, value:speed) */
  XTUML_OAL_STMT_TRACE( 1, "UI::setData(unit:kmPerHour, value:speed)" );
  Tracking_UI_setData( GPSWatch_Unit_kmPerHour_e, speed );
}
Пример #17
0
/*
 * class operation:  update
 */
void
monitor_O2saturation_op_update( const i_t p_O2saturation )
{
  monitor_O2saturation * O2saturation=0;monitor_vitalsign * vitalsign=0;
  /* SELECT any O2saturation FROM INSTANCES OF O2saturation */
  XTUML_OAL_STMT_TRACE( 1, "SELECT any O2saturation FROM INSTANCES OF O2saturation" );
  O2saturation = (monitor_O2saturation *) Escher_SetGetAny( &pG_monitor_O2saturation_extent.active );
  /* SELECT one vitalsign RELATED BY O2saturation->vitalsign[R2] */
  XTUML_OAL_STMT_TRACE( 1, "SELECT one vitalsign RELATED BY O2saturation->vitalsign[R2]" );
  vitalsign = ( 0 != O2saturation ) ? O2saturation->vitalsign_R2 : 0;
  /* IF ( not_empty vitalsign ) */
  XTUML_OAL_STMT_TRACE( 1, "IF ( not_empty vitalsign )" );
  if ( ( 0 != vitalsign ) ) {
    /* ASSIGN vitalsign.value = PARAM.O2saturation */
    XTUML_OAL_STMT_TRACE( 2, "ASSIGN vitalsign.value = PARAM.O2saturation" );
    vitalsign->value = p_O2saturation;
    /* SEND UI::display(name:vitalsign.name, value:vitalsign.value) */
    XTUML_OAL_STMT_TRACE( 2, "SEND UI::display(name:vitalsign.name, value:vitalsign.value)" );
    monitor_UI_display( vitalsign->name, vitalsign->value );
  }

}
Пример #18
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" );
    }
  }
}
Пример #19
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 );
    }
}
Пример #20
0
/*
 * class operation:  update
 */
void
monitor_pulse_op_update( const i_t p_pulse )
{
  monitor_pulse * pulse=0;monitor_vitalsign * vitalsign=0;
  /* SELECT any pulse FROM INSTANCES OF pulse */
  XTUML_OAL_STMT_TRACE( 1, "SELECT any pulse FROM INSTANCES OF pulse" );
  pulse = (monitor_pulse *) Escher_SetGetAny( &pG_monitor_pulse_extent.active );
  /* SELECT one vitalsign RELATED BY pulse->vitalsign[R2] */
  XTUML_OAL_STMT_TRACE( 1, "SELECT one vitalsign RELATED BY pulse->vitalsign[R2]" );
  vitalsign = ( 0 != pulse ) ? pulse->vitalsign_R2 : 0;
  /* IF ( not_empty vitalsign ) */
  XTUML_OAL_STMT_TRACE( 1, "IF ( not_empty vitalsign )" );
  if ( ( 0 != vitalsign ) ) {
    monitor_alarm * redalarm=0;monitor_alarm * yellowalarm=0;
    /* ASSIGN vitalsign.value = PARAM.pulse */
    XTUML_OAL_STMT_TRACE( 2, "ASSIGN vitalsign.value = PARAM.pulse" );
    vitalsign->value = p_pulse;
    /* SEND UI::display(name:vitalsign.name, value:vitalsign.value) */
    XTUML_OAL_STMT_TRACE( 2, "SEND UI::display(name:vitalsign.name, value:vitalsign.value)" );
    monitor_UI_display( vitalsign->name, vitalsign->value );
    /* SELECT one redalarm RELATED BY vitalsign->alarm[R7] WHERE ( ( SELECTED.color == red ) ) */
    XTUML_OAL_STMT_TRACE( 2, "SELECT one redalarm RELATED BY vitalsign->alarm[R7] WHERE ( ( SELECTED.color == red ) )" );
    {redalarm = 0;
    {monitor_alarm * selected = ( 0 != vitalsign ) ? vitalsign->alarm_R7_sounds : 0;
    if ( ( 0 != selected ) && ( selected->color == capssys_color_red_e ) ) {
      redalarm = selected;
    }}}
    /* SELECT one yellowalarm RELATED BY vitalsign->alarm[R7] WHERE ( ( SELECTED.color == yellow ) ) */
    XTUML_OAL_STMT_TRACE( 2, "SELECT one yellowalarm RELATED BY vitalsign->alarm[R7] WHERE ( ( SELECTED.color == yellow ) )" );
    {yellowalarm = 0;
    {monitor_alarm * selected = ( 0 != vitalsign ) ? vitalsign->alarm_R7_sounds : 0;
    if ( ( 0 != selected ) && ( selected->color == capssys_color_yellow_e ) ) {
      yellowalarm = selected;
    }}}
    /* IF ( ( vitalsign.value < vitalsign.yellow_threshold ) ) */
    XTUML_OAL_STMT_TRACE( 2, "IF ( ( vitalsign.value < vitalsign.yellow_threshold ) )" );
    if ( ( vitalsign->value < vitalsign->yellow_threshold ) ) {
      /* IF ( empty redalarm ) */
      XTUML_OAL_STMT_TRACE( 3, "IF ( empty redalarm )" );
      if ( ( 0 == redalarm ) ) {
        /* IF ( not_empty yellowalarm ) */
        XTUML_OAL_STMT_TRACE( 4, "IF ( not_empty yellowalarm )" );
        if ( ( 0 != yellowalarm ) ) {
          /* UNRELATE yellowalarm FROM vitalsign ACROSS R7 */
          XTUML_OAL_STMT_TRACE( 5, "UNRELATE yellowalarm FROM vitalsign ACROSS R7" );
          monitor_alarm_R7_Unlink_sounds( vitalsign, yellowalarm );
          /* DELETE OBJECT INSTANCE yellowalarm */
          XTUML_OAL_STMT_TRACE( 5, "DELETE OBJECT INSTANCE yellowalarm" );
          if ( 0 == yellowalarm ) {
            XTUML_EMPTY_HANDLE_TRACE( "alarm", "Escher_DeleteInstance" );
          }
          Escher_DeleteInstance( (Escher_iHandle_t) yellowalarm, monitor_DOMAIN_ID, monitor_alarm_CLASS_NUMBER );
        }
        /* CREATE OBJECT INSTANCE redalarm OF alarm */
        XTUML_OAL_STMT_TRACE( 4, "CREATE OBJECT INSTANCE redalarm OF alarm" );
        redalarm = (monitor_alarm *) Escher_CreateInstance( monitor_DOMAIN_ID, monitor_alarm_CLASS_NUMBER );
        /* ASSIGN redalarm.color = red */
        XTUML_OAL_STMT_TRACE( 4, "ASSIGN redalarm.color = red" );
        redalarm->color = capssys_color_red_e;
        /* RELATE redalarm TO vitalsign ACROSS R7 */
        XTUML_OAL_STMT_TRACE( 4, "RELATE redalarm TO vitalsign ACROSS R7" );
        monitor_alarm_R7_Link_sounds( vitalsign, redalarm );
      }
    }
    else if ( ( vitalsign->value < vitalsign->yellow_threshold ) ) {
      /* IF ( empty yellowalarm ) */
      XTUML_OAL_STMT_TRACE( 3, "IF ( empty yellowalarm )" );
      if ( ( 0 == yellowalarm ) ) {
        /* CREATE OBJECT INSTANCE yellowalarm OF alarm */
        XTUML_OAL_STMT_TRACE( 4, "CREATE OBJECT INSTANCE yellowalarm OF alarm" );
        yellowalarm = (monitor_alarm *) Escher_CreateInstance( monitor_DOMAIN_ID, monitor_alarm_CLASS_NUMBER );
        /* ASSIGN yellowalarm.color = yellow */
        XTUML_OAL_STMT_TRACE( 4, "ASSIGN yellowalarm.color = yellow" );
        yellowalarm->color = capssys_color_yellow_e;
        /* RELATE yellowalarm TO vitalsign ACROSS R7 */
        XTUML_OAL_STMT_TRACE( 4, "RELATE yellowalarm TO vitalsign ACROSS R7" );
        monitor_alarm_R7_Link_sounds( vitalsign, yellowalarm );
      }
    }
    else {
    }
  }

}
Пример #21
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;

}
Пример #22
0
/*
 * Domain Function:  setup
 */
void
sudoku_setup( void )
{
    sudoku_SEQUENCE * sequence;
  /* SELECT any sequence FROM INSTANCES OF SEQUENCE */
  sequence = (sudoku_SEQUENCE *) Escher_SetGetAny( &pG_sudoku_SEQUENCE_extent.active );
  /* IF ( empty sequence ) */
  if ( ( 0 == sequence ) ) {
    i_t i;sudoku_DIGIT * digit;Escher_ObjectSet_s rows_space; Escher_ObjectSet_s * rows = &rows_space; /* rows (ROW) */sudoku_ROW * row;Escher_ObjectSet_s cells_space; Escher_ObjectSet_s * cells = &cells_space; /* cells (CELL) */sudoku_CELL * cell;
    Escher_InitSet( rows );Escher_InitSet( cells );
    /* ASSIGN i = NVS::space_used() */
    i = NVS_space_used();
    /* IF ( ( i < 100 ) ) */
    if ( ( i < 100 ) ) {
      /* ASSIGN i = NVS::format() */
      i = NVS_format();
      /* IF ( ( i != 0 ) ) */
      if ( ( i != 0 ) ) {
        /* LOG::LogFailure( message:'Error formatting the NVS.' ) */
        LOG_LogFailure( "Error formatting the NVS." );
      }
    }
    /* LOG::LogInfo( message:'Did not find any PEI data, initializing NVS' ) */
    LOG_LogInfo( "Did not find any PEI data, initializing NVS" );
    /* ASSIGN i = NVS::version(first:1, second:2) */
    i = NVS_version( 1, 2 );
    /* ASSIGN i = NVS::checksum(first:1, second:2) */
    i = NVS_checksum( 1, 2 );
    /* ASSIGN i = 9 */
    i = 9;
    /* WHILE ( ( 0 < i ) ) */
    while ( ( 0 < i ) ) {
      sudoku_DIGIT * digit;
      /* CREATE OBJECT INSTANCE digit OF DIGIT */
      digit = (sudoku_DIGIT *) Escher_CreateInstance( sudoku_DOMAIN_ID, sudoku_DIGIT_CLASS_NUMBER );
      /* ASSIGN digit.value = i */
      digit->value = i;
      /* ASSIGN i = ( i - 1 ) */
      i = ( i - 1 );
    }
    /* CREATE OBJECT INSTANCE digit OF DIGIT */
    digit = (sudoku_DIGIT *) Escher_CreateInstance( sudoku_DOMAIN_ID, sudoku_DIGIT_CLASS_NUMBER );
    /* ASSIGN digit.value = 0 */
    digit->value = 0;
    /* ASSIGN i = 9 */
    i = 9;
    /* WHILE ( ( 0 < i ) ) */
    while ( ( 0 < i ) ) {
      sudoku_ROW * row;sudoku_COLUMN * column;sudoku_BOX * box;
      /* CREATE OBJECT INSTANCE sequence OF SEQUENCE */
      sequence = (sudoku_SEQUENCE *) Escher_CreateInstance( sudoku_DOMAIN_ID, sudoku_SEQUENCE_CLASS_NUMBER );
      /* ASSIGN sequence.solved = FALSE */
      sequence->solved = FALSE;
      /* ASSIGN sequence.requests = 0 */
      sequence->requests = 0;
      /* CREATE OBJECT INSTANCE row OF ROW */
      row = (sudoku_ROW *) Escher_CreateInstance( sudoku_DOMAIN_ID, sudoku_ROW_CLASS_NUMBER );
      /* ASSIGN row.number = i */
      row->number = i;
      /* RELATE row TO sequence ACROSS R1 */
      sudoku_ROW_R1_Link( sequence, row );
      /* CREATE OBJECT INSTANCE sequence OF SEQUENCE */
      sequence = (sudoku_SEQUENCE *) Escher_CreateInstance( sudoku_DOMAIN_ID, sudoku_SEQUENCE_CLASS_NUMBER );
      /* ASSIGN sequence.solved = FALSE */
      sequence->solved = FALSE;
      /* ASSIGN sequence.requests = 0 */
      sequence->requests = 0;
      /* CREATE OBJECT INSTANCE column OF COLUMN */
      column = (sudoku_COLUMN *) Escher_CreateInstance( sudoku_DOMAIN_ID, sudoku_COLUMN_CLASS_NUMBER );
      /* ASSIGN column.number = i */
      column->number = i;
      /* RELATE column TO sequence ACROSS R1 */
      sudoku_COLUMN_R1_Link( sequence, column );
      /* CREATE OBJECT INSTANCE sequence OF SEQUENCE */
      sequence = (sudoku_SEQUENCE *) Escher_CreateInstance( sudoku_DOMAIN_ID, sudoku_SEQUENCE_CLASS_NUMBER );
      /* ASSIGN sequence.solved = FALSE */
      sequence->solved = FALSE;
      /* ASSIGN sequence.requests = 0 */
      sequence->requests = 0;
      /* CREATE OBJECT INSTANCE box OF BOX */
      box = (sudoku_BOX *) Escher_CreateInstance( sudoku_DOMAIN_ID, sudoku_BOX_CLASS_NUMBER );
      /* ASSIGN box.number = i */
      box->number = i;
      /* RELATE box TO sequence ACROSS R1 */
      sudoku_BOX_R1_Link( sequence, box );
      /* ASSIGN i = ( i - 1 ) */
      i = ( i - 1 );
    }
    /* SELECT many rows FROM INSTANCES OF ROW */
    Escher_CopySet( rows, &pG_sudoku_ROW_extent.active );
    /* FOR EACH row IN rows */
    { Escher_Iterator_s iter1;
  sudoku_ROW * sudoku_ROWiter1;
  Escher_IteratorReset( &iter1, rows );
  while ( (sudoku_ROWiter1 = (sudoku_ROW *)Escher_IteratorNext( &iter1 )) != 0 ) {
    row = sudoku_ROWiter1; {
      Escher_ObjectSet_s columns_space; Escher_ObjectSet_s * columns = &columns_space; /* columns (COLUMN) */sudoku_COLUMN * column;
      Escher_InitSet( columns );
      /* SELECT many columns FROM INSTANCES OF COLUMN */
      Escher_CopySet( columns, &pG_sudoku_COLUMN_extent.active );
      /* FOR EACH column IN columns */
      { Escher_Iterator_s iter3;
  sudoku_COLUMN * sudoku_COLUMNiter3;
  Escher_IteratorReset( &iter3, columns );
  while ( (sudoku_COLUMNiter3 = (sudoku_COLUMN *)Escher_IteratorNext( &iter3 )) != 0 ) {
    column = sudoku_COLUMNiter3; {
        sudoku_CELL * cell;Escher_ObjectSet_s digits_space; Escher_ObjectSet_s * digits = &digits_space; /* digit (DIGIT) */
        Escher_InitSet( digits );
        /* CREATE OBJECT INSTANCE cell OF CELL */
        cell = (sudoku_CELL *) Escher_CreateInstance( sudoku_DOMAIN_ID, sudoku_CELL_CLASS_NUMBER );
        /* SELECT any digit FROM INSTANCES OF DIGIT WHERE ( SELECTED.value == 0 ) */
        digit = 0;
{ sudoku_DIGIT * selected;
  Escher_Iterator_s iter30_DIGIT;
  Escher_IteratorReset( &iter30_DIGIT, &pG_sudoku_DIGIT_extent.active );
  while ( (selected = (sudoku_DIGIT *) Escher_IteratorNext( &iter30_DIGIT )) != 0 ) {
    if ( ( selected->value == 0 ) ) {
      digit = selected;
      break;
    }
  }
}
        /* RELATE cell TO digit ACROSS R9 */
        sudoku_CELL_R9_Link( digit, cell );
        /* RELATE cell TO row ACROSS R2 */
        sudoku_CELL_R2_Link( row, cell );
        /* RELATE cell TO column ACROSS R3 */
        sudoku_CELL_R3_Link( column, cell );
        /* SELECT many digits FROM INSTANCES OF DIGIT WHERE ( SELECTED.value != 0 ) */
        Escher_ClearSet( digits );
{ sudoku_DIGIT * selected;
  Escher_Iterator_s iter31_DIGIT;
  Escher_IteratorReset( &iter31_DIGIT, &pG_sudoku_DIGIT_extent.active );
  while ( (selected = (sudoku_DIGIT *) Escher_IteratorNext( &iter31_DIGIT )) != 0 ) {
    if ( ( selected->value != 0 ) ) {
      Escher_SetInsertElement( digits, selected );
    }
  }
}
        /* FOR EACH digit IN digits */
        { Escher_Iterator_s iter4;
  sudoku_DIGIT * sudoku_DIGITiter4;
  Escher_IteratorReset( &iter4, digits );
  while ( (sudoku_DIGITiter4 = (sudoku_DIGIT *)Escher_IteratorNext( &iter4 )) != 0 ) {
    digit = sudoku_DIGITiter4; {
          sudoku_ELIGIBLE * eligible;
          /* CREATE OBJECT INSTANCE eligible OF ELIGIBLE */
          eligible = (sudoku_ELIGIBLE *) Escher_CreateInstance( sudoku_DOMAIN_ID, sudoku_ELIGIBLE_CLASS_NUMBER );
          /* RELATE digit TO cell ACROSS R8 USING eligible */
          sudoku_ELIGIBLE_R8_Link( cell, digit, eligible );
          }}
}
        Escher_ClearSet( digits );  /* Clear set: digit */
        }}
}
      Escher_ClearSet( columns );
      }}
}
    /* SELECT many cells FROM INSTANCES OF CELL */
    Escher_CopySet( cells, &pG_sudoku_CELL_extent.active );
    /* FOR EACH cell IN cells */
    { Escher_Iterator_s iter2;
  sudoku_CELL * sudoku_CELLiter2;
  Escher_IteratorReset( &iter2, cells );
  while ( (sudoku_CELLiter2 = (sudoku_CELL *)Escher_IteratorNext( &iter2 )) != 0 ) {
    cell = sudoku_CELLiter2; {
      /* IF ( ( ( cell.row_number <= 3 ) and ( cell.column_number <= 3 ) ) ) */
      if ( ( ( cell->row_number <= 3 ) && ( cell->column_number <= 3 ) ) ) {
        sudoku_BOX * box;
        /* SELECT any box FROM INSTANCES OF BOX WHERE ( SELECTED.number == 1 ) */
        box = 0;
{ sudoku_BOX * selected;
  Escher_Iterator_s iter32_BOX;
  Escher_IteratorReset( &iter32_BOX, &pG_sudoku_BOX_extent.active );
  while ( (selected = (sudoku_BOX *) Escher_IteratorNext( &iter32_BOX )) != 0 ) {
    if ( ( selected->number == 1 ) ) {
      box = selected;
      break;
    }
  }
}
        /* RELATE cell TO box ACROSS R4 */
        sudoku_CELL_R4_Link( box, cell );
      }
      else if ( ( ( cell->row_number <= 3 ) && ( ( 4 <= cell->column_number ) && ( cell->column_number <= 6 ) ) ) ) {
        sudoku_BOX * box;
        /* SELECT any box FROM INSTANCES OF BOX WHERE ( SELECTED.number == 2 ) */
        box = 0;
{ sudoku_BOX * selected;
  Escher_Iterator_s iter33_BOX;
  Escher_IteratorReset( &iter33_BOX, &pG_sudoku_BOX_extent.active );
  while ( (selected = (sudoku_BOX *) Escher_IteratorNext( &iter33_BOX )) != 0 ) {
    if ( ( selected->number == 2 ) ) {
      box = selected;
      break;
    }
  }
}
        /* RELATE cell TO box ACROSS R4 */
        sudoku_CELL_R4_Link( box, cell );
      }
      else if ( ( ( cell->row_number <= 3 ) && ( 7 <= cell->column_number ) ) ) {
        sudoku_BOX * box;
        /* SELECT any box FROM INSTANCES OF BOX WHERE ( SELECTED.number == 3 ) */
        box = 0;
{ sudoku_BOX * selected;
  Escher_Iterator_s iter34_BOX;
  Escher_IteratorReset( &iter34_BOX, &pG_sudoku_BOX_extent.active );
  while ( (selected = (sudoku_BOX *) Escher_IteratorNext( &iter34_BOX )) != 0 ) {
    if ( ( selected->number == 3 ) ) {
      box = selected;
      break;
    }
  }
}
        /* RELATE cell TO box ACROSS R4 */
        sudoku_CELL_R4_Link( box, cell );
      }
      else if ( ( ( ( 4 <= cell->row_number ) && ( cell->row_number <= 6 ) ) && ( cell->column_number <= 3 ) ) ) {
        sudoku_BOX * box;
        /* SELECT any box FROM INSTANCES OF BOX WHERE ( SELECTED.number == 4 ) */
        box = 0;
{ sudoku_BOX * selected;
  Escher_Iterator_s iter35_BOX;
  Escher_IteratorReset( &iter35_BOX, &pG_sudoku_BOX_extent.active );
  while ( (selected = (sudoku_BOX *) Escher_IteratorNext( &iter35_BOX )) != 0 ) {
    if ( ( selected->number == 4 ) ) {
      box = selected;
      break;
    }
  }
}
        /* RELATE cell TO box ACROSS R4 */
        sudoku_CELL_R4_Link( box, cell );
      }
      else if ( ( ( ( 4 <= cell->row_number ) && ( cell->row_number <= 6 ) ) && ( ( 4 <= cell->column_number ) && ( cell->column_number <= 6 ) ) ) ) {
        sudoku_BOX * box;
        /* SELECT any box FROM INSTANCES OF BOX WHERE ( SELECTED.number == 5 ) */
        box = 0;
{ sudoku_BOX * selected;
  Escher_Iterator_s iter36_BOX;
  Escher_IteratorReset( &iter36_BOX, &pG_sudoku_BOX_extent.active );
  while ( (selected = (sudoku_BOX *) Escher_IteratorNext( &iter36_BOX )) != 0 ) {
    if ( ( selected->number == 5 ) ) {
      box = selected;
      break;
    }
  }
}
        /* RELATE cell TO box ACROSS R4 */
        sudoku_CELL_R4_Link( box, cell );
      }
      else if ( ( ( ( 4 <= cell->row_number ) && ( cell->row_number <= 6 ) ) && ( 7 <= cell->column_number ) ) ) {
        sudoku_BOX * box;
        /* SELECT any box FROM INSTANCES OF BOX WHERE ( SELECTED.number == 6 ) */
        box = 0;
{ sudoku_BOX * selected;
  Escher_Iterator_s iter37_BOX;
  Escher_IteratorReset( &iter37_BOX, &pG_sudoku_BOX_extent.active );
  while ( (selected = (sudoku_BOX *) Escher_IteratorNext( &iter37_BOX )) != 0 ) {
    if ( ( selected->number == 6 ) ) {
      box = selected;
      break;
    }
  }
}
        /* RELATE cell TO box ACROSS R4 */
        sudoku_CELL_R4_Link( box, cell );
      }
      else if ( ( ( 7 <= cell->row_number ) && ( cell->column_number <= 3 ) ) ) {
        sudoku_BOX * box;
        /* SELECT any box FROM INSTANCES OF BOX WHERE ( SELECTED.number == 7 ) */
        box = 0;
{ sudoku_BOX * selected;
  Escher_Iterator_s iter38_BOX;
  Escher_IteratorReset( &iter38_BOX, &pG_sudoku_BOX_extent.active );
  while ( (selected = (sudoku_BOX *) Escher_IteratorNext( &iter38_BOX )) != 0 ) {
    if ( ( selected->number == 7 ) ) {
      box = selected;
      break;
    }
  }
}
        /* RELATE cell TO box ACROSS R4 */
        sudoku_CELL_R4_Link( box, cell );
      }
      else if ( ( ( 7 <= cell->row_number ) && ( ( 4 <= cell->column_number ) && ( cell->column_number <= 6 ) ) ) ) {
        sudoku_BOX * box;
        /* SELECT any box FROM INSTANCES OF BOX WHERE ( SELECTED.number == 8 ) */
        box = 0;
{ sudoku_BOX * selected;
  Escher_Iterator_s iter39_BOX;
  Escher_IteratorReset( &iter39_BOX, &pG_sudoku_BOX_extent.active );
  while ( (selected = (sudoku_BOX *) Escher_IteratorNext( &iter39_BOX )) != 0 ) {
    if ( ( selected->number == 8 ) ) {
      box = selected;
      break;
    }
  }
}
        /* RELATE cell TO box ACROSS R4 */
        sudoku_CELL_R4_Link( box, cell );
      }
      else if ( ( ( 7 <= cell->row_number ) && ( 7 <= cell->column_number ) ) ) {
        sudoku_BOX * box;
        /* SELECT any box FROM INSTANCES OF BOX WHERE ( SELECTED.number == 9 ) */
        box = 0;
{ sudoku_BOX * selected;
  Escher_Iterator_s iter40_BOX;
  Escher_IteratorReset( &iter40_BOX, &pG_sudoku_BOX_extent.active );
  while ( (selected = (sudoku_BOX *) Escher_IteratorNext( &iter40_BOX )) != 0 ) {
    if ( ( selected->number == 9 ) ) {
      box = selected;
      break;
    }
  }
}
        /* RELATE cell TO box ACROSS R4 */
        sudoku_CELL_R4_Link( box, cell );
      }
      }}
}
    Escher_ClearSet( rows );Escher_ClearSet( cells );
  }
  else {
    /* LOG::LogInfo( message:'PEI data found.' ) */
    LOG_LogInfo( "PEI data found." );
  }

}