tResult cJuryTransmitter::Stop(__exception) { RETURN_IF_FAILED(cBaseQtFilter::Stop(__exception_ptr)); if (m_hTimerStop) { __synchronized_obj(m_oCriticalSectionTimerStop); _kernel->TimerDestroy(m_hTimerStop); m_hTimerStop = NULL; } if (m_hTimerNotAus) { __synchronized_obj(m_oCriticalSectionTimerNotAus); _kernel->TimerDestroy(m_hTimerNotAus); m_hTimerNotAus = NULL; } if (m_hTimerStart) { __synchronized_obj(m_oCriticalSectionTimerStart); _kernel->TimerDestroy(m_hTimerStart); m_hTimerStart = NULL; } if (m_hTimerRequestReady) { __synchronized_obj(m_oCriticalSectionTimerRequestReady); _kernel->TimerDestroy(m_hTimerRequestReady); m_hTimerRequestReady = NULL; } RETURN_NOERROR; }
/* If filterID is in request-list, and request-status in list is equal to input status, * function returns feedback command corresponding to the filterID and status in FilterList * Method is only called if StateController is in PASSIVE activity mode */ tUInt32 StateControlManagementSlim::CheckRequestRelevance(TFeedbackStruct::Data feedback) { __synchronized_obj(CritSectionCurrentScmState); tUInt32 ret_command = 0; // temporary copy of FilterList for current ScmState(Maneuver and step) std::vector<sc_Filter_passive> tmp_filterlist = m_SCMstructureList[i16CurrentScmManeuverID].Steps[i16CurrentScmStepID].activityLvl.passive.FilterList; for(tUInt32 i = 0; i < tmp_filterlist.size(); i++){ if(m_bDebugModeEnabled) LOG_WARNING(cString::Format("SCM - CheckRequestRelevance: awaited filterID %d, received filterID %d;",tmp_filterlist[i].filterID, feedback.ui32_filterID)); #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << "SCM - CheckRequestRelevance: awaited filterID "<< tmp_filterlist[i].filterID << ", received filterID "<< feedback.ui32_filterID << std::endl; #endif if(tmp_filterlist[i].filterID == feedback.ui32_filterID){ for(tUInt32 k = 0; k < tmp_filterlist[i].Requests.size(); k++){ if(m_bDebugModeEnabled) LOG_WARNING(cString::Format("SCM - CheckRequestRelevance: --> awaited status %d, received status %d;",tmp_filterlist[i].Requests[k].request, feedback.ui32_status)); #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << "SCM - CheckRequestRelevance: --> awaited status "<< tmp_filterlist[i].Requests[k].request << ", received status "<< feedback.ui32_status << std::endl; #endif if(tmp_filterlist[i].Requests[k].request == feedback.ui32_status){ ret_command = tmp_filterlist[i].Requests[k].command; if(m_bDebugModeEnabled) LOG_WARNING(cString::Format("SCM: CheckRequestRelevance successful, command: ",ret_command)); #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << "SCM: CheckRequestRelevance successful, command: "<< ret_command << std::endl; #endif return ret_command; } } } } #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << "SCM: CheckRequestRelevance failed, status received but not in list: "<< feedback.ui32_status << std::endl; #endif if(m_bDebugModeEnabled)LOG_ERROR(cString::Format("SCM: CheckRequestRelevance failed, status received but not in list: %d",feedback.ui32_status)); return ret_command; }
tResult YawToSteer::TransmitSignalValue(cOutputPin *outputPin, tFloat32 value) { __synchronized_obj(iosync); tUInt32 timeStamp = 0; cObjectPtr<IMediaSerializer> pSerializer; descriptionSignalValue->GetMediaSampleSerializer(&pSerializer); tInt nSize = pSerializer->GetDeserializedSize(); cObjectPtr<IMediaSample> newMediaSample; AllocMediaSample((tVoid **) &newMediaSample); newMediaSample->AllocBuffer(nSize); { __adtf_sample_write_lock_mediadescription(descriptionSignalValue, newMediaSample, pCoderOutput); if (!m_bIDsSignalSet) { pCoderOutput->GetID("f32Value", m_szIDSignalF32Value); pCoderOutput->GetID("ui32ArduinoTimestamp", m_szIDSignalArduinoTimestamp); m_bIDsSignalSet = tTrue; } // set values in new media sample pCoderOutput->Set(m_szIDSignalF32Value, (tVoid *) &(value)); pCoderOutput->Set(m_szIDSignalArduinoTimestamp, (tVoid *) &timeStamp); } newMediaSample->SetTime(_clock->GetTime()); outputPin->Transmit(newMediaSample); RETURN_NOERROR; }
tResult cSensorAnalyzer::ProcessUltrasonicSample(IMediaSample* pMediaSample, SensorDefinition::ultrasonicSensor usSensor) { __synchronized_obj(m_oProcessUsDataCritSection); //write values with zero tFloat32 f32value = 0; { // focus for sample read lock // read-out the incoming Media Sample __adtf_sample_read_lock_mediadescription(m_pDescriptionUsData,pMediaSample,pCoderInput); // get the IDs for the items in the media sample if(!m_bIDsUltrasonicSet) { pCoderInput->GetID("f32Value", m_szIDUltrasonicF32Value); pCoderInput->GetID("ui32ArduinoTimestamp", m_szIDUltrasonicArduinoTimestamp); m_bIDsUltrasonicSet = tTrue; } //get values from media sample pCoderInput->Get(m_szIDUltrasonicF32Value, (tVoid*)&f32value); // convert distance from meter to centimeter f32value = f32value * 100.0f; //emit signal to gui switch (usSensor) { case SensorDefinition::usFrontLeft: emit SensorDataChanged(LIST_ULTRASONIC_FRONT_LEFT, static_cast<float>(f32value)); break; case SensorDefinition::usFrontCenterLeft: emit SensorDataChanged(LIST_ULTRASONIC_FRONT_CENTER_LEFT, static_cast<float>(f32value)); break; case SensorDefinition::usFrontCenter: emit SensorDataChanged(LIST_ULTRASONIC_FRONT_CENTER, static_cast<float>(f32value)); break; case SensorDefinition::usFrontCenterRight: emit SensorDataChanged(LIST_ULTRASONIC_FRONT_CENTER_RIGHT, static_cast<float>(f32value)); break; case SensorDefinition::usFrontRight: emit SensorDataChanged(LIST_ULTRASONIC_FRONT_RIGHT, static_cast<float>(f32value)); break; case SensorDefinition::usSideLeft: emit SensorDataChanged(LIST_ULTRASONIC_SIDE_LEFT, static_cast<float>(f32value)); break; case SensorDefinition::usSideRight: emit SensorDataChanged(LIST_ULTRASONIC_SIDE_RIGHT, static_cast<float>(f32value)); break; case SensorDefinition::usRearLeft: emit SensorDataChanged(LIST_ULTRASONIC_REAR_LEFT, static_cast<float>(f32value)); break; case SensorDefinition::usRearCenter: emit SensorDataChanged(LIST_ULTRASONIC_REAR_CENTER, static_cast<float>(f32value)); break; case SensorDefinition::usRearRight: emit SensorDataChanged(LIST_ULTRASONIC_REAR_RIGHT, static_cast<float>(f32value)); break; } } RETURN_NOERROR; }
/* Function that is called for processing the data in activityLevel:Active of current SCM state; * calls a transmit function to transmit necessary activation signals & commands to corresponding filters */ tResult StateControlManagementSlim::ExecAction(){ __synchronized_obj(CritSectionCurrentScmState); if (CheckCurrentActivityLvlMode()==ACTIVE){ if(m_bDebugModeEnabled) LOG_WARNING(cString::Format("SCM: SCM in activityLvlMode ACTIVE, ExecAction() is executed.")); #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << "---" << std::endl << "SCM: SCM in activityLvlMode ACTIVE, ExecAction() is executed." << std::endl; #endif /* create ActionStruct of type Data for sending purpose */ TActionStruct::Data ActionStruct; std::vector<sc_Filter_active> tmp_filterlist = m_SCMstructureList[i16CurrentScmManeuverID].Steps[i16CurrentScmStepID].activityLvl.active.FilterList; /* Maximum number of Actions in ActionStruct is fixed to 5 at the moment */ if(tmp_filterlist.size() > 5){ #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << std::endl << "### --- " << std::endl << "SCM ERROR: ERROR in ExecAction(). Too many actions in maneuver: " << i16CurrentScmManeuverID << ", step: " << i16CurrentScmStepID << std::endl; #endif RETURN_AND_LOG_ERROR_STR(ERR_INVALID_INDEX, cString::Format("SCM: ERROR in ExecAction(). Too many actions in maneuver %d, step %d.", i16CurrentScmManeuverID,i16CurrentScmStepID)); } /* Maximum number of Actions in ActionStruct is now maximal 5 */ TActionStruct::Action* tmp_ActionArr = new TActionStruct::Action[5]; for(tUInt32 i = 0; i < tmp_filterlist.size(); i++){ tmp_ActionArr[i].filterID = tmp_filterlist[i].filterID; tmp_ActionArr[i].subAction.enabled = tmp_filterlist[i].action.enabled; tmp_ActionArr[i].subAction.started = tmp_filterlist[i].action.started; tmp_ActionArr[i].subAction.command = tmp_filterlist[i].action.command; if(m_bDebugModeEnabled) LOG_WARNING(cString::Format("SCM ExecAction: --> ID: %d, subAction.enabled: %d, subAction.started: %d, subAction.command: %d.", tmp_ActionArr[i].filterID,tmp_ActionArr[i].subAction.enabled,tmp_ActionArr[i].subAction.started, tmp_ActionArr[i].subAction.command)); #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << "SCM ExecAction: --> ID: " << tmp_ActionArr[i].filterID << ", subAction.enabled: " << tmp_ActionArr[i].subAction.enabled << ", subAction.started: " <<tmp_ActionArr[i].subAction.started << ", subAction.command: " << tmp_ActionArr[i].subAction.command << "." << std::endl; #endif } ActionStruct.action_1 = tmp_ActionArr[0]; ActionStruct.action_2 = tmp_ActionArr[1]; ActionStruct.action_3 = tmp_ActionArr[2]; ActionStruct.action_4 = tmp_ActionArr[3]; ActionStruct.action_5 = tmp_ActionArr[4]; /* change activity level to passive, has to be done here in order to receive all signals/events! */ ChangeCurrentActivityLvlMode(PASSIVE); /* call transmit function */ tResult tmp_result = TransmitActionStruct(ActionStruct); delete [] tmp_ActionArr; if (tmp_result < 0){ #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << std::endl << "### --- " << std::endl << "SCM ERROR: ERROR occurred during transmitting the ActionStruct!" << std::endl; #endif RETURN_AND_LOG_ERROR_STR(ERR_FAILED,cString::Format("SCM: ERROR occurred during transmitting the ActionStruct!")); } }else{ #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << std::endl << "### --- " << std::endl << "SCM ERROR: ERROR occurred in ExecAction! ActivityLvlMode is NOT 'ACTIVE'!" << std::endl; #endif RETURN_AND_LOG_ERROR_STR(ERR_INVALID_STATE,cString::Format("SCM: ERROR occurred in ExecAction! ActivityLvlMode is NOT 'ACTIVE'!")); } RETURN_NOERROR; }
tResult cJuryModule::OnNotAus() { m_iNotAusCounter = 0; __synchronized_obj(m_oCriticalSectionTimerNotAus); m_hTimerNotAus = _kernel->TimerCreate(GetPropertyInt("Send time interval in sec")*1000000, 0, static_cast<IRunnable*>(this), NULL, &m_iNotAusCounter, sizeof(m_iNotAusCounter), 0, adtf_util::cString::Format("%s.timerNotAus", OIGetInstanceName())); RETURN_NOERROR; }
tResult cJuryTransmitter::OnStop(tInt16 entryId) { m_Stop_entry_id = entryId; m_hTimerStopCounter = 0; __synchronized_obj(m_oCriticalSectionTimerStop); m_hTimerStop = _kernel->TimerCreate(GetPropertyInt("Send time interval in sec")*1000000, 0, static_cast<IRunnable*>(this), NULL, &m_hTimerStopCounter, sizeof(m_hTimerStopCounter), 0, adtf_util::cString::Format("%s.timerStop", OIGetInstanceName())); RETURN_NOERROR; }
tResult cJuryTransmitter::OnRequestReady(tInt16 entryId) { m_Request_Ready_entry_id = entryId; m_hTimerRequestReadyCounter= 0; __synchronized_obj(m_oCriticalSectionTimerRequestReady); // Create a timer that will trigger the signal generation every 2 sec. m_hTimerRequestReady = _kernel->TimerCreate(GetPropertyInt("Send time interval in sec")*1000000, 0, static_cast<IRunnable*>(this), NULL, &m_hTimerRequestReadyCounter, sizeof(m_hTimerRequestReadyCounter), 0, adtf_util::cString::Format("%s.timerRequestReady", OIGetInstanceName())); RETURN_NOERROR; }
tResult StateControlManagementSlim::TransmitActionStruct(TActionStruct::Data ActionStruct){ __synchronized_obj(m_oCriticalSectionTransmitActionStruct); tTimeStamp cur_time = _clock->GetStreamTime(); RETURN_IF_FAILED(TActionStruct_object.Transmit(&m_ActionStructOutputPin,ActionStruct,cur_time)); if(m_bDebugModeEnabled) LOG_WARNING(cString::Format("SCM: ActionStruct successfully transmitted to filters.")); #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << "SCM: ActionStruct successfully transmitted to filters." << std::endl; #endif RETURN_NOERROR; }
tResult StateControlManagementSlim::JumpToStep(tUInt32 scmStepID){ __synchronized_obj(CritSectionCurrentScmState); tUInt32 stepCount = m_SCMstructureList[i16CurrentScmManeuverID].Steps.size(); if (scmStepID < stepCount){ i16CurrentScmStepID = scmStepID; }else{ #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << std::endl << "### --- " << std::endl << "SCM ERROR: ERROR in JumpStep(). Index exceeds." << std::endl; #endif RETURN_AND_LOG_ERROR_STR(ERR_INVALID_INDEX, cString::Format("SCM: ERROR in JumpStep(). Index exceeds.")); } RETURN_NOERROR; }
tResult LightMessageLogger::AppendToLog(LightMessageLogger::logfile_message message_to_append) { __synchronized_obj(criticalSection_FileLogAccess); if(message_to_append.car_name != "" && message_to_append.message != "") { // insert last received message logfile_content.content.push_back(message_to_append); // get system time time_t rawtime; struct tm * timeinfo; time(&rawtime); timeinfo = localtime(&rawtime); char dateAndTime[80]; strftime(dateAndTime, 80, "%H:%M:%S", timeinfo); logfile_content.content[logfile_content.content.size()-1].time = cString(dateAndTime); fstream chat_file; chat_file.open("/home/aadc/AADC/utilities/Kuer/data.json", ios::out | ios::trunc); // write file Header chat_file << logfile_content.header_meta; chat_file << " \"counter\": \"" << new_content_counter << "\""; chat_file << logfile_content.header; // write file Content for(tUInt32 i = 0; i < logfile_content.content.size(); i++) { chat_file << " {\n \"time\": \"" << logfile_content.content[i].time << "\", \n" " \"name\": \"" << logfile_content.content[i].car_name << "\", \n" " \"message\": \"" << logfile_content.content[i].message << "\"\n }"; if (i < (logfile_content.content.size() - 1)) { chat_file << ", \n"; } } // write file footer chat_file << logfile_content.footer; chat_file.close(); new_content_counter = new_content_counter + 3; } RETURN_NOERROR; }
tResult LightMessageLogger::OnAsyncPinEvent(IPin* pSource, tInt nEventCode, tInt nParam1, tInt nParam2, IMediaSample* pMediaSample) { RETURN_IF_POINTER_NULL(pMediaSample); RETURN_IF_POINTER_NULL(pSource); __synchronized_obj(criticalSection_OnPinEvent); if (nEventCode == IPinEventSink::PE_MediaSampleReceived) { if (pSource == &actionInput) { TActionStruct::ActionSub actionSub_tmp; actionSub_tmp = tActionStruct_object.Read_Action(pMediaSample, F_LIGHT_MESSAGE_LOGGER); ProcessAction(actionSub_tmp); } } RETURN_NOERROR; }
tFloat32 YawToSteer::GetFloat(IMediaSample *mediaSample) { __synchronized_obj(iosync); tFloat32 value = 0.0f; { __adtf_sample_read_lock_mediadescription(descriptionSignalValue, mediaSample, pCoderInput); // get the IDs for the items in the media sample if (!m_bIDsSignalSet) { pCoderInput->GetID("f32Value", m_szIDSignalF32Value); m_bIDsSignalSet = tTrue; } //get values from media sample pCoderInput->Get(m_szIDSignalF32Value, (tVoid *) &value); } return value; }
tResult cSensorAnalyzer::ProcessWheelSample(IMediaSample* pMediaSample, SensorDefinition::wheelSensor wheelSensorType) { __synchronized_obj(m_oProcessWheelDataCritSection); //write values with zero tUInt32 ui32Tach = 0; tInt8 i8Direction = 0; { // focus for sample read lock // read-out the incoming Media Sample __adtf_sample_read_lock_mediadescription(m_pDescriptionWheelData,pMediaSample,pCoderInput); // get the IDs for the items in the media sample if(!m_bIDsWheelDataSet) { pCoderInput->GetID("i8WheelDir", m_szIDWheelDataI8WheelDir); pCoderInput->GetID("ui32WheelTach", m_szIDWheelDataUi32WheelTach); pCoderInput->GetID("ui32ArduinoTimestamp", m_szIDWheelDataArduinoTimestamp); m_bIDsWheelDataSet = tTrue; } //get values from media sample pCoderInput->Get(m_szIDWheelDataUi32WheelTach, (tVoid*)&ui32Tach); pCoderInput->Get(m_szIDWheelDataI8WheelDir, (tVoid*)&i8Direction); //LOG_INFO(cString::Format("test %f, %d",ui32Tach,i8Direction)); //emit signal to gui switch (wheelSensorType) { case SensorDefinition::wheelLeft: emit SensorDataChanged(LIST_WHEEL_TACH_LEFT, static_cast<tFloat>(ui32Tach)); emit SensorDataChanged(LIST_WHEEL_DIR_LEFT, static_cast<tFloat>(i8Direction)); break; case SensorDefinition::wheelRight: emit SensorDataChanged(LIST_WHEEL_TACH_LEFT, static_cast<tFloat>(ui32Tach)); emit SensorDataChanged(LIST_WHEEL_DIR_LEFT, static_cast<tFloat>(i8Direction)); break; } } RETURN_NOERROR; }
tResult cSensorAnalyzer::ProcessVoltageSample(IMediaSample* pMediaSample, SensorDefinition::voltageSensor voltageSensor) { __synchronized_obj(m_oProcessVoltageDataCritSection); //write values with zero tFloat32 f32value = 0; { // focus for sample read lock // read-out the incoming Media Sample __adtf_sample_read_lock_mediadescription(m_pDescriptionVoltData,pMediaSample,pCoderInput); // get the IDs for the items in the media sample if(!m_bIDsVoltageSet) { pCoderInput->GetID("f32Value", m_szIDVoltageF32Value); pCoderInput->GetID("ui32ArduinoTimestamp", m_szIDVoltageArduinoTimestamp); m_bIDsVoltageSet = tTrue; } //get values from media sample pCoderInput->Get(m_szIDVoltageF32Value, (tVoid*)&f32value); //emit signal to gui switch (voltageSensor) { case SensorDefinition::measurementCircuit: emit SensorDataChanged(LIST_VOLTAGE_MEASUREMENT, static_cast<float>(f32value)); break; case SensorDefinition::speedCntrlCircuit: emit SensorDataChanged(LIST_VOLTAGE_SPEEDCTR, static_cast<float>(f32value)); break; default: break; } } RETURN_NOERROR; }
void StateControllerNew::SendCurrentState() { if (tControllerMode::Jury == controllerMode) { __synchronized_obj(transmitLock); tManeuver::ManeuverEnum maneuver = tManeuver::M_UNKNOWN; if (tCarState::Ready == carState || tCarState::Running == carState) { cString currentManeuverString = sectorList[sectionListIndex].maneuverList[maneuverListIndex].action; maneuver = ConvertManeuver(currentManeuverString); } logger.Log(cString::Format("Jury: CarState: %s, Maneuver: %s", tCarState::ToString(carState).c_str(), tManeuver::ToString(maneuver).c_str()).GetPtr()); SendEnum(carStateOutput, static_cast<tInt>(carState)); SendEnum(maneuverOutput, static_cast<tInt>(maneuver)); stateCar stateCar = Convert(carState); tInt16 maneuverId = tInt16(currentManeuverID); SendValue(driveStructOutput, stateCar, maneuverId); } }
LightMessageLogger::logfile LightMessageLogger::GetLogContent() { __synchronized_obj(criticalSection_FileLogAccess); return logfile_content; }
// ------------------------------------------------------------------------------------------------- tResult SensorPackageFilter::OnPinEvent(IPin* source, tInt event_code, tInt param1, tInt param2, IMediaSample* media_sample) { // ------------------------------------------------------------------------------------------------- RETURN_IF_POINTER_NULL(source); RETURN_IF_POINTER_NULL(media_sample); // Create a synchronizer, that enters the critical section whenever possible. If a previous // thread is still inside the critical section, all proceeding threads have to wait for the // first to leave. __synchronized_obj(critical_section_); if (event_code == IPinEventSink::PE_MediaSampleReceived) { tFloat32 sensor_value = 0; tUInt32 time_stamp = 0; { __adtf_sample_read_lock_mediadescription(sensor_data_description_, media_sample, coder); coder->Get("f32Value", (tVoid*) &sensor_value); coder->Get("ui32ArduinoTimestamp", (tVoid*) &time_stamp); } if (source == &ir_long_front_center_input_pin_) { ir_l_fc_.add(sensor_value); x_ &= 0b1111111111110; } else if (source == &ir_long_front_left_input_pin_) { ir_l_fl_.add(sensor_value); x_ &= 0b1111111111101; } else if (source == &ir_long_front_right_input_pin_) { ir_l_fr_.add(sensor_value); x_ &= 0b1111111111011; } // IR Short sensors else if (source == &ir_short_front_center_input_pin_) { ir_s_fc_.add(sensor_value); x_ &= 0b1111111110111; } else if (source == &ir_short_front_left_input_pin_) { ir_s_fl_.add(sensor_value); x_ &= 0b1111111101111; } else if (source == &ir_short_front_right_input_pin_) { ir_s_fr_.add(sensor_value); x_ &= 0b1111111011111; } else if (source == &ir_short_left_input_pin_) { ir_s_l_.add(sensor_value); x_ &= 0b1111110111111; } else if (source == &ir_short_right_input_pin_) { ir_s_r_.add(sensor_value); x_ &= 0b1111101111111; } else if (source == &ir_short_rear_center_input_pin_) { ir_s_rc_.add(sensor_value); x_ &= 0b1111011111111; } else if (source == &us_front_left_input_pin_) { us_f_l_.add(sensor_value); x_ &= 0b1110111111111; } else if (source == &us_front_right_input_pin_) { us_f_r_.add(sensor_value); x_ &= 0b1101111111111; } else if (source == &us_rear_left_input_pin_) { us_r_l_.add(sensor_value); x_ &= 0b1011111111111; } else if (source == &us_rear_right_input_pin_) { us_r_r_.add(sensor_value); x_ &= 0b0111111111111; } if (!x_) { if (GetPropertyBool("debug")) LOG_INFO("Transmit sensor package"); transmitSensorPackage(time_stamp); x_ = 0b1111111111111; } else { } } RETURN_NOERROR; }
tResult StateControlManagementSlim::ChangeCurrentActivityLvlMode(tInt8 newMode){ __synchronized_obj(CritSectionCurrentActivityLvlMode); i8CurrentActLvlMode = newMode; RETURN_NOERROR; }
tInt8 StateControlManagementSlim::CheckCurrentActivityLvlMode(){ __synchronized_obj(CritSectionCurrentActivityLvlMode); return i8CurrentActLvlMode; }
tResult cJuryTransmitter::Run(tInt nActivationCode, const tVoid* pvUserData, tInt szUserDataSize, ucom::IException** __exception_ptr/* =NULL */) { if (nActivationCode == IRunnable::RUN_TIMER) { //not aus timer if (pvUserData==&m_hTimerNotAusCounter) { m_hTimerNotAusCounter++; RETURN_IF_FAILED(sendEmergencyStop()); // the signal was transmitted three times if (m_hTimerNotAusCounter >= 3 && m_hTimerNotAus) { __synchronized_obj(m_oCriticalSectionTimerNotAus); // Destroy the timer tResult nResult = _kernel->TimerDestroy(m_hTimerNotAus); if (IS_FAILED(nResult)) THROW_ERROR(nResult); } } //start event timer if (pvUserData==&m_hTimerStartCounter) { m_hTimerStartCounter++; RETURN_IF_FAILED(sendJuryStruct(action_START,m_Start_entry_id)); // the signal was transmitted three times if (m_hTimerStartCounter >= 3 && m_hTimerStart) { __synchronized_obj(m_oCriticalSectionTimerStart); // Destroy the timer tResult nResult = _kernel->TimerDestroy(m_hTimerStart); if (IS_FAILED(nResult)) THROW_ERROR(nResult); } } //request ready event timer if (pvUserData==&m_hTimerRequestReadyCounter) { m_hTimerRequestReadyCounter++; RETURN_IF_FAILED(sendJuryStruct(action_GETREADY,m_Request_Ready_entry_id)); // the signal was transmitted three times if (m_hTimerRequestReadyCounter >= 3 && m_hTimerRequestReady) { __synchronized_obj(m_oCriticalSectionTimerRequestReady); // Destroy the timer tResult nResult = _kernel->TimerDestroy(m_hTimerRequestReady); if (IS_FAILED(nResult)) THROW_ERROR(nResult); } } //stop event timer if (pvUserData==&m_hTimerStopCounter) { m_hTimerStopCounter++; RETURN_IF_FAILED(sendJuryStruct(action_STOP,m_Stop_entry_id)); // the signal was transmitted three times if (m_hTimerStopCounter >= 3 && m_hTimerStop) { __synchronized_obj(m_oCriticalSectionTimerStop); // Destroy the timer tResult nResult = _kernel->TimerDestroy(m_hTimerStop); if (IS_FAILED(nResult)) THROW_ERROR(nResult); } } } return cBaseQtFilter::Run(nActivationCode, pvUserData, szUserDataSize, __exception_ptr); }