@wysota I think he means that when a button is clicked that graph which is otherwise moving on the time axist stops to advance hence "freeze", and I imagine, once "released" the graph should continue from its current position (as if it continued to move in the background).
@OP
One way might be that when you want to "freeze" you can simply set a flag, and check that flag in Timer_Single_ECG_1_Timeout ().
Like this:
void GraphArea_Single_ECG_1::Timer_Single_ECG_1_Timeout ()
{
if(!m_bFreeze){ //m_bFreeze is a bool which gets true when you pressed a button for freeze or some other way to trigger freeze.
if( !Array_ECG_1_Data.isEmpty())
{
Single_ECG_1_Current_Graph_data = Array_ECG_1_Data.takeFirst() + 100;
}
X_Position++;
if(X_Position > Graph_Width)
X_Position=0;
}
this->update();
}
void GraphArea_Single_ECG_1::Timer_Single_ECG_1_Timeout ()
{
if(!m_bFreeze){ //m_bFreeze is a bool which gets true when you pressed a button for freeze or some other way to trigger freeze.
if( !Array_ECG_1_Data.isEmpty())
{
Single_ECG_1_Current_Graph_data = Array_ECG_1_Data.takeFirst() + 100;
}
X_Position++;
if(X_Position > Graph_Width)
X_Position=0;
}
this->update();
}
To copy to clipboard, switch view to plain text mode
Bookmarks