forked from Ivasoft/DSView
Add a status for start/stop the device
This commit is contained in:
@@ -97,6 +97,7 @@ namespace pv
|
||||
_view_data = NULL;
|
||||
_capture_data = NULL;
|
||||
_is_stream_mode = false;
|
||||
_is_action = false;
|
||||
|
||||
_data_list.push_back(new SessionData());
|
||||
_data_list.push_back(new SessionData());
|
||||
@@ -443,6 +444,14 @@ namespace pv
|
||||
}
|
||||
|
||||
bool SigSession::start_capture(bool instant)
|
||||
{
|
||||
_is_action = true;
|
||||
int ret = action_start_capture(instant);
|
||||
_is_action = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool SigSession::action_start_capture(bool instant)
|
||||
{
|
||||
assert(_callback);
|
||||
|
||||
@@ -644,6 +653,14 @@ namespace pv
|
||||
}
|
||||
|
||||
bool SigSession::stop_capture()
|
||||
{
|
||||
_is_action = true;
|
||||
int ret = action_stop_capture();
|
||||
_is_action = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool SigSession::action_stop_capture()
|
||||
{
|
||||
if (!_is_working)
|
||||
return false;
|
||||
|
||||
@@ -413,6 +413,10 @@ public:
|
||||
void init_signals();
|
||||
void delay_prop_msg(QString strMsg);
|
||||
|
||||
inline bool is_doing_action(){
|
||||
return _is_action;
|
||||
}
|
||||
|
||||
private:
|
||||
void set_cur_samplelimits(uint64_t samplelimits);
|
||||
void set_cur_snap_samplerate(uint64_t samplerate);
|
||||
@@ -447,10 +451,12 @@ private:
|
||||
|
||||
void capture_init();
|
||||
void nodata_timeout();
|
||||
void feed_timeout();
|
||||
|
||||
void feed_timeout();
|
||||
void clear_decode_result();
|
||||
void attach_data_to_signal(SessionData *data);
|
||||
|
||||
bool action_start_capture(bool instant);
|
||||
bool action_stop_capture();
|
||||
|
||||
//IMessageListener
|
||||
void OnMessage(int msg);
|
||||
@@ -549,6 +555,7 @@ private:
|
||||
COLLECT_OPT_MODE _opt_mode;
|
||||
bool _is_stream_mode;
|
||||
QString _strMsg;
|
||||
bool _is_action;
|
||||
|
||||
|
||||
ISessionCallback *_callback;
|
||||
|
||||
@@ -857,6 +857,11 @@ namespace pv
|
||||
// start or stop capture
|
||||
void SamplingBar::on_run_stop()
|
||||
{
|
||||
if (_session->is_doing_action()){
|
||||
dsv_info("Task is busy.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_session->is_working())
|
||||
{
|
||||
_run_stop_action->setEnabled(false);
|
||||
@@ -921,6 +926,11 @@ namespace pv
|
||||
return;
|
||||
}
|
||||
|
||||
if (_session->is_doing_action()){
|
||||
dsv_info("Task is busy.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_session->is_working())
|
||||
{
|
||||
_instant_action->setEnabled(false);
|
||||
|
||||
Reference in New Issue
Block a user