How to get the maximum rate (frequency) at which a slider can be moved?

gornvix

I want to determine the rate (frequency) at which a slider can be moved in a MFC based Visual C++ program (using Visual Studio 2012). So how do I get the appropriate polling rate programmatically?

Here is the code I use for capturing the slider value:

void CMainDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
// catches slider horizontal scrolling events
{
    double val;
    ScopeGuardMutex guard(&m_mutex);
    val = (double)(((CSliderCtrl *)pScrollBar)->GetPos()) / (double)SLD_MAX;
    rec->param = val;
    CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}

If this value cannot be determined programmatically then is there an approximate value e.g. 100Hz?

gornvix

I have realised that I was not approaching this problem in the right way. The rate at which the slider value is changed is not important, rather what is important is the rate at which the slider value is followed. The two rates are independent. Assuming the parameter being controlled by the slider is in the range 0 to 1, the rate at which the slider value is followed (r) and the maximum frequency (f) at which the value is allowed to change are what should be used in a slew rate limiter to calculate the maximum step size (s), as follows:

s = 2 * f / r

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to get Maximum CPU frequency

What is maximum rate at which message can be pushed to aws sqs?

Why slider handle can not be moved?

how to calculate the CAN bus baud rate from the Tq and clock frequency ?

Mouse polling rate or frequency rate. Which should I choose?

How to get all issues which I moved to "Resolved"

How can my cpu frequency be above maximum MHz value in lscpu?

Get value of slider while it's being moved?

How to get the sublist which has the maximum length

How to get minimum and maximum value from a `rangpicker` for price slider?

Vuetify - restrict minimum value a slider can be moved to in v-slider

How can i change slider's maximum value according to another slider

How can i get tags for multiple imag views with Touches moved?

How to get the value of slider which defined inside screen widget in kivy

How to get the parent of the Bootstrap slider which triggers the change event

how to update the maximum value of a slider?

How can you get RDP access to a non-domain Windows headless server which has been moved to a new network and defaulted to public on the new network?

Is it possible to have a button which can be moved

Can rxjs control the maximum frequency of a function call?

Get maximum frequency item with its corresponding number

How can I make a combination array which contains maximum length?

How to limit the area in which an object can be moved to the boundaries of another view with pan gestures?

How to handle time sliders in JavaScript which can be moved from both left and right

How to get Maximum points scored by which player in each year?

How to Get the index of the Element which is Maximum in the List <T>

HOW GET ELEMENT which has the maximum childs in XPATH?

How can I get learning rate during training with AdamOptimizer?? (Tensorflow)

How to read every value of a UISlider regardless of how quickly the slider is moved?

Can winsxs be moved and if so how?

TOP Ranking

HotTag

Archive