| 1144 | } |
| 1145 | |
| 1146 | bool DsoSignal::mouse_press(int right, const QPoint pt) |
| 1147 | { |
| 1148 | int y = get_y(); |
| 1149 | const QRectF vDial_rect = get_rect(DSO_VDIAL, y, right); |
| 1150 | const QRectF chEn_rect = get_rect(DSO_CHEN, y, right); |
| 1151 | const QRectF acdc_rect = get_rect(DSO_ACDC, y, right); |
| 1152 | const QRectF auto_rect = get_rect(DSO_AUTO, y, right); |
| 1153 | const QRectF x1_rect = get_rect(DSO_X1, y, right); |
| 1154 | const QRectF x10_rect = get_rect(DSO_X10, y, right); |
| 1155 | const QRectF x100_rect = get_rect(DSO_X100, y, right); |
| 1156 | |
| 1157 | if (chEn_rect.contains(pt)) { |
| 1158 | if (session->get_device()->is_file() == false && !_en_lock) { |
| 1159 | set_enable(!enabled()); |
| 1160 | } |
| 1161 | return true; |
| 1162 | } |
| 1163 | else if (enabled()) { |
| 1164 | if (vDial_rect.contains(pt) && pt.x() > vDial_rect.center().x()) { |
| 1165 | if (pt.y() > vDial_rect.center().y()) |
| 1166 | go_vDialNext(true); |
| 1167 | else |
| 1168 | go_vDialPre(true); |
| 1169 | } |
| 1170 | else if (session->get_device()->is_file() == false && acdc_rect.contains(pt)) { |
| 1171 | if (session->get_device()->is_hardware_logic()) |
| 1172 | set_acCoupling((get_acCoupling()+1)%2); |
| 1173 | else |
| 1174 | set_acCoupling((get_acCoupling()+1)%2); |
| 1175 | } |
| 1176 | else if (auto_rect.contains(pt)) { |
| 1177 | if (session->get_device()->is_hardware()) |
| 1178 | auto_start(); |
| 1179 | } |
| 1180 | else if (x1_rect.contains(pt)) { |
| 1181 | set_factor(1); |
| 1182 | _view->dso_factor_updated(); |
| 1183 | } |
| 1184 | else if (x10_rect.contains(pt)) { |
| 1185 | set_factor(10); |
| 1186 | _view->dso_factor_updated(); |
| 1187 | } |
| 1188 | else if (x100_rect.contains(pt)) { |
| 1189 | set_factor(100); |
| 1190 | _view->dso_factor_updated(); |
| 1191 | } |
| 1192 | else { |
| 1193 | return false; |
| 1194 | } |
| 1195 | |
| 1196 | return true; |
| 1197 | } |
| 1198 | return false; |
| 1199 | } |
| 1200 | |
| 1201 | bool DsoSignal::mouse_wheel(int right, const QPoint pt, const int shift) |
| 1202 | { |
nothing calls this directly
no test coverage detected