| 1060 | } |
| 1061 | |
| 1062 | void SamplingBar::on_collect_mode() |
| 1063 | { |
| 1064 | QString iconPath = GetIconPath(); |
| 1065 | QAction *act = qobject_cast<QAction *>(sender()); |
| 1066 | |
| 1067 | if (act == _action_single) |
| 1068 | { |
| 1069 | _session->set_collect_mode(COLLECT_SINGLE); |
| 1070 | |
| 1071 | if (_device_agent->is_demo()){ |
| 1072 | _device_agent->set_config_string(SR_CONF_PATTERN_MODE, "protocol"); |
| 1073 | _session->broadcast_msg(DSV_MSG_DEMO_OPERATION_MODE_CHNAGED); |
| 1074 | } |
| 1075 | } |
| 1076 | else if (act == _action_repeat) |
| 1077 | { |
| 1078 | if (_device_agent->is_stream_mode() || _device_agent->is_demo()) |
| 1079 | { |
| 1080 | _session->set_repeat_intvl(0.1); |
| 1081 | _session->set_collect_mode(COLLECT_REPEAT); |
| 1082 | } |
| 1083 | else{ |
| 1084 | pv::dialogs::Interval interval_dlg(this); |
| 1085 | |
| 1086 | interval_dlg.set_interval(_session->get_repeat_intvl()); |
| 1087 | interval_dlg.exec(); |
| 1088 | |
| 1089 | if (interval_dlg.is_done()) |
| 1090 | { |
| 1091 | _session->set_repeat_intvl(interval_dlg.get_interval()); |
| 1092 | _session->set_collect_mode(COLLECT_REPEAT); |
| 1093 | |
| 1094 | } |
| 1095 | } |
| 1096 | |
| 1097 | if (_device_agent->is_demo()){ |
| 1098 | _device_agent->set_config_string(SR_CONF_PATTERN_MODE, "random"); |
| 1099 | _session->broadcast_msg(DSV_MSG_DEMO_OPERATION_MODE_CHNAGED); |
| 1100 | } |
| 1101 | } |
| 1102 | else if (act == _action_loop) |
| 1103 | { |
| 1104 | _session->set_collect_mode(COLLECT_LOOP); |
| 1105 | |
| 1106 | if (_device_agent->is_demo()){ |
| 1107 | _device_agent->set_config_string(SR_CONF_PATTERN_MODE, "random"); |
| 1108 | _session->broadcast_msg(DSV_MSG_DEMO_OPERATION_MODE_CHNAGED); |
| 1109 | } |
| 1110 | } |
| 1111 | |
| 1112 | update_mode_icon(); |
| 1113 | } |
| 1114 | |
| 1115 | void SamplingBar::update_device_list() |
| 1116 | { |
nothing calls this directly
no test coverage detected