/** Write an unknown control code into the BNEP not understood control response @internalComponent */ void RBnepNotUnderstoodResponseControl::SetUnknownControlType (TUint8 aUnknownControlType) { LOG_FUNC TPckgBuf<TUint8> controlType(static_cast<TUint8>(EBnepControlCommandNotUnderstood)); TPckgBuf<TUint8> unknownControlType(aUnknownControlType); CopyIn(controlType, KControlTypeOffset); CopyIn(unknownControlType, KUnknownControlTypeResponseFieldOffset); DUMPFRAME(_L8("RBnepNotUnderstoodResponseControl")); }
String AccessibilityMediaControl::controlTypeName() const { DEFINE_STATIC_LOCAL(const String, mediaEnterFullscreenButtonName, (ASCIILiteral("EnterFullscreenButton"))); DEFINE_STATIC_LOCAL(const String, mediaExitFullscreenButtonName, (ASCIILiteral("ExitFullscreenButton"))); DEFINE_STATIC_LOCAL(const String, mediaMuteButtonName, (ASCIILiteral("MuteButton"))); DEFINE_STATIC_LOCAL(const String, mediaPlayButtonName, (ASCIILiteral("PlayButton"))); DEFINE_STATIC_LOCAL(const String, mediaSeekBackButtonName, (ASCIILiteral("SeekBackButton"))); DEFINE_STATIC_LOCAL(const String, mediaSeekForwardButtonName, (ASCIILiteral("SeekForwardButton"))); DEFINE_STATIC_LOCAL(const String, mediaRewindButtonName, (ASCIILiteral("RewindButton"))); DEFINE_STATIC_LOCAL(const String, mediaReturnToRealtimeButtonName, (ASCIILiteral("ReturnToRealtimeButton"))); DEFINE_STATIC_LOCAL(const String, mediaUnMuteButtonName, (ASCIILiteral("UnMuteButton"))); DEFINE_STATIC_LOCAL(const String, mediaPauseButtonName, (ASCIILiteral("PauseButton"))); DEFINE_STATIC_LOCAL(const String, mediaStatusDisplayName, (ASCIILiteral("StatusDisplay"))); DEFINE_STATIC_LOCAL(const String, mediaCurrentTimeDisplay, (ASCIILiteral("CurrentTimeDisplay"))); DEFINE_STATIC_LOCAL(const String, mediaTimeRemainingDisplay, (ASCIILiteral("TimeRemainingDisplay"))); DEFINE_STATIC_LOCAL(const String, mediaShowClosedCaptionsButtonName, (ASCIILiteral("ShowClosedCaptionsButton"))); DEFINE_STATIC_LOCAL(const String, mediaHideClosedCaptionsButtonName, (ASCIILiteral("HideClosedCaptionsButton"))); switch (controlType()) { case MediaEnterFullscreenButton: return mediaEnterFullscreenButtonName; case MediaExitFullscreenButton: return mediaExitFullscreenButtonName; case MediaMuteButton: return mediaMuteButtonName; case MediaPlayButton: return mediaPlayButtonName; case MediaSeekBackButton: return mediaSeekBackButtonName; case MediaSeekForwardButton: return mediaSeekForwardButtonName; case MediaRewindButton: return mediaRewindButtonName; case MediaReturnToRealtimeButton: return mediaReturnToRealtimeButtonName; case MediaUnMuteButton: return mediaUnMuteButtonName; case MediaPauseButton: return mediaPauseButtonName; case MediaStatusDisplay: return mediaStatusDisplayName; case MediaCurrentTimeDisplay: return mediaCurrentTimeDisplay; case MediaTimeRemainingDisplay: return mediaTimeRemainingDisplay; case MediaShowClosedCaptionsButton: return mediaShowClosedCaptionsButtonName; case MediaHideClosedCaptionsButton: return mediaHideClosedCaptionsButtonName; default: break; } return String(); }
String AccessibilityMediaTimeDisplay::accessibilityDescription() const { DEFINE_STATIC_LOCAL(const String, currentTimeDisplay, ("CurrentTimeDisplay")); DEFINE_STATIC_LOCAL(const String, timeRemainingDisplay, ("TimeRemainingDisplay")); if (controlType() == MediaCurrentTimeDisplay) return localizedMediaControlElementString(currentTimeDisplay); return localizedMediaControlElementString(timeRemainingDisplay); }
synthv1_controls::Key synthv1widget_control::controlKey (void) const { synthv1_controls::Key key; const synthv1_controls::Type ctype = controlType(); const unsigned short channel = controlChannel(); key.status = ctype | (channel & 0x1f); key.param = controlParam(); return key; }
void DXLJointInterface::relax() { if(controlType() == CT_TORQUE) { dxl_write_word(id(), REG_GOAL_TORQUE, 1); sleep(3); } dxl_write_word(id(), REG_TORQUE_ENABLE, 0); dxl_write_word(id(), REG_TORQUE_LIMIT, 1023); m_currentVelocity = 0; m_currentAcc = 0; }
bool AccessibilityMediaControl::accessibilityIsIgnored() const { if (!m_renderer || !m_renderer->style() || m_renderer->style()->visibility() != VISIBLE || controlType() == MediaTimelineContainer) return true; return false; }
void DXLJointInterface::process() { switch(controlType()) { case CT_POSITION: { int goalTicks = m_goalPosition / TICKS_TO_RAD; dxl_write_word(id(), REG_GOAL_POSITION, goalTicks + m_tickOffset); } break; case CT_VELOCITY: { int velTicks = m_goalSpeed / VEL_TO_RAD_PER_S; if(velTicks < 0) { velTicks = (1 << 10) | (-velTicks); } dxl_write_word(id(), REG_MOVING_SPEED, velTicks); } break; case CT_TORQUE: { int torqueTicks = m_goalTorque / TORQUE_TO_NM; if(torqueTicks < 0) { torqueTicks = (1 << 10) | (-torqueTicks); } if(torqueTicks == 0) torqueTicks = 1; dxl_write_word(id(), REG_GOAL_TORQUE, torqueTicks); } break; } // int torqueTicks = 1023.0 * (m_torqueLimit / 4.4); // at 12V // if(torqueTicks > 1023) // torqueTicks = 1023; // printf("torque: %4d\n", torqueTicks); // // dxl_write_word(id(), 34, torqueTicks); dxl_set_txpacket_id(id()); dxl_set_txpacket_instruction(INST_READ); dxl_set_txpacket_length(2 + 2); dxl_set_txpacket_parameter(0, 36); // start address: present pos dxl_set_txpacket_parameter(1, 6); // #bytes dxl_txrx_packet(); if(dxl_get_rxpacket_length() != 6+2) { fprintf(stderr, "DXL: Got malformed read answer\n"); return; } int currentTicks = (dxl_get_rxpacket_parameter(1) << 8) | dxl_get_rxpacket_parameter(0); m_currentPosition = TICKS_TO_RAD * (currentTicks - m_tickOffset); double lastVel = m_currentVelocity; int velTicks = (dxl_get_rxpacket_parameter(3) << 8) | dxl_get_rxpacket_parameter(2); if(velTicks & (1 << 10)) velTicks = -(velTicks & 1023); m_currentVelocity = VEL_TO_RAD_PER_S * velTicks; int loadTicks = (dxl_get_rxpacket_parameter(5) << 8) | dxl_get_rxpacket_parameter(4); if(loadTicks & (1 << 10)) loadTicks = -(loadTicks & 1023); m_currentLoad = (1.0 / 1023.0) * loadTicks; int current = dxl_read_word(id(), 68) - 2048; m_currentCurrent = 0.0045 * current; m_currentAcc = (m_currentVelocity - lastVel) / 0.02; }