A661_INTERNAL float READ_FLOAT(const buffer_el buffer[]) 
{
	unsigned tmp = READ_ULONG(buffer);
        return  * ( (float *)(&tmp) );  
}
int OperationalScenario_UA_1_receive(buffer_el buffer[],  int buffer_size, 
  inC_OperationalScenario* scade_ctx,  extern_in_ctx_t * extern_ctx){
  int widget_event_structure_current_size = 0;
  int A661_Run_Time_Command_limit = 0;
  int root_current_size = 0;
  int n = 0;
  int next_n = 0;
  /*  type root */
  switch (buffer[ n ]){
    case A661_BEGIN_BLOCK : 
      root_current_size = READ_ULONG(( buffer + ( 4 + n ) ));
      next_n = ( n + root_current_size );
      /*  LayerIdent */
      switch (buffer[ ( 1 + n ) ]){
        case 1 : 
          /*  root */
          n = ( 8 + n );
          A661_Run_Time_Command_limit = ( ( n + root_current_size ) - 12 );
          while(( n < A661_Run_Time_Command_limit )){
            /*  type A661_Run_Time_Command */
            switch (READ_USHORT(( buffer + n ))){
              case A661_NOTIFY_WIDGET_EVENT : 
                widget_event_structure_current_size = READ_USHORT(( buffer + ( 2 + n ) ));
                next_n = ( n + widget_event_structure_current_size );
                /*  WidgetIdent */
                switch (READ_USHORT(( buffer + ( 4 + n ) ))){
                  case 35 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_SELECTION : 
                        /*  PushButton_A661_EVT_SELECTION */
                        /*  Notify */
                        scade_ctx->upDateSw = TRUE;
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 26 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_SELECTION : 
                        /*  PushButton_A661_EVT_SELECTION */
                        /*  Notify */
                        scade_ctx->Power = TRUE;
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 1 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_SELECTION : 
                        /*  PushButton_A661_EVT_SELECTION */
                        /*  Notify */
                        scade_ctx->PassarFaseBtn = TRUE;
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  default : break;
                }
                break;
              default : break;
            }
            n = next_n;
          }
          n = ( 4 + n );
          break;
        default : break;
      }
      break;
    default : break;
  }
  return n ;
}
A661_INTERNAL kcg_real read_fr32_to_real(const buffer_el buffer[], const int max) 
{
	const int tmp = READ_ULONG(buffer);
        return  fr_to_real (tmp, 32, max);  
}
Exemple #4
0
int ua_receive(buffer_el buffer[],  int buffer_size,  inC_ts05* scade_ctx, 
  extern_in_ctx_t * extern_ctx){
  int widget_event_structure_current_size = 0;
  int A661_Run_Time_Command_limit = 0;
  int root_current_size = 0;
  int n = 0;
  int next_n = 0;
  /*  type root */
  switch (buffer[ n ]){
    case A661_BEGIN_BLOCK : 
      root_current_size = READ_ULONG(( buffer + ( 4 + n ) ));
      next_n = ( n + root_current_size );
      /*  LayerIdent */
      switch (buffer[ ( 1 + n ) ]){
        case 1 : 
          /*  root */
          n = ( 8 + n );
          A661_Run_Time_Command_limit = ( ( n + root_current_size ) - 12 );
          while(( n < A661_Run_Time_Command_limit )){
            /*  type A661_Run_Time_Command */
            switch (READ_USHORT(( buffer + n ))){
              case A661_NOTIFY_WIDGET_EVENT : 
                widget_event_structure_current_size = READ_USHORT(( buffer + ( 2 + n ) ));
                next_n = ( n + widget_event_structure_current_size );
                /*  WidgetIdent */
                switch (READ_USHORT(( buffer + ( 4 + n ) ))){
                  case 7504 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_SELECTION : 
                        /*  PushButton_A661_EVT_SELECTION */
                        /*  Notify */
                        scade_ctx->TEST_SAT_Initialization_Fail = TRUE;
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 7503 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_SELECTION : 
                        /*  PushButton_A661_EVT_SELECTION */
                        /*  Notify */
                        scade_ctx->TEST_SAT_Initialization_Success = TRUE;
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 7502 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_SELECTION : 
                        /*  PushButton_A661_EVT_SELECTION */
                        /*  Notify */
                        scade_ctx->TEST_SAT_Ejection_Signal = TRUE;
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 6562 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_VALUE_CHANGE : 
                        /*  Slider_A661_EVT_VALUE_CHANGE */
                        /*  Notify */
                        scade_ctx->TEST_SAT_Period_Update = TRUE;
                        /*  EvtValue */
                        scade_ctx->TEST_SAT_Period_Value = READ_FLOAT(( buffer + ( 6 + n ) ));
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 6552 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_VALUE_CHANGE : 
                        /*  Slider_A661_EVT_VALUE_CHANGE */
                        /*  Notify */
                        scade_ctx->TEST_SAT_DeclinationAngle_Update = TRUE;
                        /*  EvtValue */
                        scade_ctx->TEST_SAT_DeclinationAngle_Value = READ_FLOAT(( buffer + ( 6 + n ) ));
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 6542 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_VALUE_CHANGE : 
                        /*  Slider_A661_EVT_VALUE_CHANGE */
                        /*  Notify */
                        scade_ctx->TEST_SAT_Longitude_Update = TRUE;
                        /*  EvtValue */
                        scade_ctx->TEST_SAT_Longitude_Value = READ_FLOAT(( buffer + ( 6 + n ) ));
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 6532 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_VALUE_CHANGE : 
                        /*  Slider_A661_EVT_VALUE_CHANGE */
                        /*  Notify */
                        scade_ctx->TEST_SAT_Latitude_Update = TRUE;
                        /*  EvtValue */
                        scade_ctx->TEST_SAT_Latitude_Value = READ_FLOAT(( buffer + ( 6 + n ) ));
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 6522 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_VALUE_CHANGE : 
                        /*  Slider_A661_EVT_VALUE_CHANGE */
                        /*  Notify */
                        scade_ctx->TEST_SAT_Altitude_Update = TRUE;
                        /*  EvtValue */
                        scade_ctx->TEST_SAT_Altitude_Value = READ_FLOAT(( buffer + ( 6 + n ) ));
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 6512 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_VALUE_CHANGE : 
                        /*  Slider_A661_EVT_VALUE_CHANGE */
                        /*  Notify */
                        scade_ctx->TEST_SAT_AirSpeed_Update = TRUE;
                        /*  EvtValue */
                        scade_ctx->TEST_SAT_AirSpeed_Value = READ_FLOAT(( buffer + ( 6 + n ) ));
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 5101 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_SELECTION : 
                        /*  PushButton_A661_EVT_SELECTION */
                        /*  Notify */
                        scade_ctx->envia_foto_btn = TRUE;
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 1545 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_STATE_CHANGE : 
                        /*  ToggleButton_A661_EVT_STATE_CHANGE */
                        /*  Notify */
                        scade_ctx->TEST_Camera_Fail_Status_Changed = TRUE;
                        /*  EvtToggleState */
                        scade_ctx->TEST_Camera_Fail_Status_Value = buffer[ ( 4 + n ) ];
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 1542 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_SEL_ENTRY_CHANGE : 
                        /*  ComboBox_A661_EVT_SEL_ENTRY_CHANGE */
                        /*  Notify */
                        scade_ctx->TEST_SAT_CameraState_Update = TRUE;
                        /*  EvtEntryNumber */
                        scade_ctx->TEST_SAT_CameraState_Value = READ_USHORT(( buffer + ( 4 + n ) ));
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 1532 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_SEL_ENTRY_CHANGE : 
                        /*  ComboBox_A661_EVT_SEL_ENTRY_CHANGE */
                        /*  Notify */
                        scade_ctx->TEST_SAT_PropellersState_Update = TRUE;
                        /*  EvtEntryNumber */
                        scade_ctx->TEST_SAT_PropellersState_Value = READ_USHORT(( buffer + ( 4 + n ) ));
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 1525 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_STATE_CHANGE : 
                        /*  ToggleButton_A661_EVT_STATE_CHANGE */
                        /*  Notify */
                        scade_ctx->_1_Test_HorizonSensor_Fail_Status_Changed = TRUE;
                        /*  EvtToggleState */
                        scade_ctx->Test_HorizonSensor_Fail_Status_Value = buffer[ ( 4 + n ) ];
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 1522 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_SEL_ENTRY_CHANGE : 
                        /*  ComboBox_A661_EVT_SEL_ENTRY_CHANGE */
                        /*  Notify */
                        scade_ctx->TEST_SAT_HorizonSensorState_Update = TRUE;
                        /*  EvtEntryNumber */
                        scade_ctx->TEST_SAT_HorizonSensorState_Value = READ_USHORT(( buffer + ( 4 + n ) ));
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 1515 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_STATE_CHANGE : 
                        /*  ToggleButton_A661_EVT_STATE_CHANGE */
                        /*  Notify */
                        scade_ctx->Test_Gyroscope_Fail_Status_Changed = TRUE;
                        /*  EvtToggleState */
                        scade_ctx->Test_Gyroscope_Fail_Status_Value = buffer[ ( 4 + n ) ];
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 1512 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_SEL_ENTRY_CHANGE : 
                        /*  ComboBox_A661_EVT_SEL_ENTRY_CHANGE */
                        /*  Notify */
                        scade_ctx->TEST_SAT_GyroscopeState_Update = TRUE;
                        /*  EvtEntryNumber */
                        scade_ctx->TEST_SAT_GyroscopeState_Value = READ_USHORT(( buffer + ( 4 + n ) ));
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  case 1502 : 
                    /*  widget_event_structure */
                    n = ( 6 + n );
                    /*  type EventStructure */
                    switch (READ_USHORT(( buffer + ( 2 + n ) ))){
                      case A661_EVT_SEL_ENTRY_CHANGE : 
                        /*  ComboBox_A661_EVT_SEL_ENTRY_CHANGE */
                        /*  Notify */
                        scade_ctx->TEST_SAT_OperationMode_Update = TRUE;
                        /*  EvtEntryNumber */
                        scade_ctx->TEST_SAT_OperationMode_Value = READ_USHORT(( buffer + ( 4 + n ) ));
                        break;
                      default : break;
                    }
                    n = next_n;
                    break;
                  default : break;
                }
                break;
              default : break;
            }
            n = next_n;
          }
          n = ( 4 + n );
          break;
        default : break;
      }
      break;
    default : break;
  }
  return n ;
}