예제 #1
0
    def show_proto_sniff_dialog(self):
        pm = self.project_manager
        signal = None
        for proto in self.compare_frame_controller.protocol_list:
            signal = proto.signal
            if signal:
                break

        if signal:
            bit_len = signal.bit_len
            mod_type = signal.modulation_type
            tolerance = signal.tolerance
            noise = signal.noise_threshold
            center = signal.qad_center
        else:
            bit_len = 100
            mod_type = 1
            tolerance = 5
            noise = 0.001
            center = 0.02

        psd = ProtocolSniffDialogController(pm,
                                            noise,
                                            center,
                                            bit_len,
                                            tolerance,
                                            mod_type,
                                            parent=self)
        if psd.has_empty_device_list:
            Errors.no_device()
            psd.close()
        else:
            psd.protocol_accepted.connect(
                self.compare_frame_controller.add_sniffed_protocol_messages)
            psd.show()
예제 #2
0
    def show_proto_sniff_dialog(self):
        pm = self.project_manager
        signal = next(
            (proto.signal
             for proto in self.compare_frame_controller.protocol_list), None)

        bit_len = signal.bit_len if signal else 100
        mod_type = signal.modulation_type if signal else 1
        tolerance = signal.tolerance if signal else 5
        noise = signal.noise_threshold if signal else 0.001
        center = signal.qad_center if signal else 0.02

        psd = ProtocolSniffDialogController(
            pm,
            noise,
            center,
            bit_len,
            tolerance,
            mod_type,
            self.compare_frame_controller.decodings,
            encoding_index=self.compare_frame_controller.ui.cbDecoding.
            currentIndex(),
            parent=self)

        if psd.has_empty_device_list:
            Errors.no_device()
            psd.close()
        else:
            psd.recording_parameters.connect(pm.set_recording_parameters)
            psd.protocol_accepted.connect(
                self.compare_frame_controller.add_sniffed_protocol_messages)
            psd.show()
예제 #3
0
    def show_proto_sniff_dialog(self):
        pm = self.project_manager
        signal = None
        for proto in self.compare_frame_controller.protocol_list:
            signal = proto.signal
            if signal:
                break

        if signal:
            bit_len = signal.bit_len
            mod_type = signal.modulation_type
            tolerance = signal.tolerance
            noise = signal.noise_threshold
            center = signal.qad_center
        else:
            bit_len = 100
            mod_type = 1
            tolerance = 5
            noise = 0.001
            center = 0.02

        psd = ProtocolSniffDialogController(pm.frequency,
                                            pm.sample_rate,
                                            pm.bandwidth,
                                            pm.gain,
                                            pm.device,
                                            noise,
                                            center,
                                            bit_len,
                                            tolerance,
                                            mod_type,
                                            parent=self)
        psd.protocol_accepted.connect(
            self.compare_frame_controller.add_sniffed_protocol_messages)
        psd.show()
    def __get_sniff_dialog(self):
        sniff_dialog = ProtocolSniffDialogController(self.form.project_manager, self.signal.noise_threshold,
                                                     self.signal.qad_center,
                                                     self.signal.bit_len, self.signal.tolerance,
                                                     self.signal.modulation_type,
                                                     self.form.compare_frame_controller.decodings,
                                                     testing_mode=True, parent=self.form)
        if self.SHOW:
            sniff_dialog.show()

        return sniff_dialog
예제 #5
0
    def __get_sniff_dialog(self):
        sniff_dialog = ProtocolSniffDialogController(self.form.project_manager, self.signal.noise_threshold,
                                                     self.signal.qad_center,
                                                     self.signal.bit_len, self.signal.tolerance,
                                                     self.signal.modulation_type,
                                                     self.form.compare_frame_controller.decodings,
                                                     testing_mode=True, parent=self.form)
        if self.SHOW:
            sniff_dialog.show()

        return sniff_dialog
예제 #6
0
    def show_proto_sniff_dialog(self):
        pm = self.project_manager
        signal = next((proto.signal for proto in self.compare_frame_controller.protocol_list), None)

        bit_len = signal.bit_len          if signal else 100
        mod_type = signal.modulation_type if signal else 1
        tolerance = signal.tolerance      if signal else 5
        noise = signal.noise_threshold    if signal else 0.001
        center = signal.qad_center        if signal else 0.02

        psd = ProtocolSniffDialogController(pm, noise, center, bit_len, tolerance, mod_type,
                                            self.compare_frame_controller.decodings,
                                            encoding_index=self.compare_frame_controller.ui.cbDecoding.currentIndex(),
                                            parent=self)

        if psd.has_empty_device_list:
            Errors.no_device()
            psd.close()
        else:
            psd.recording_parameters.connect(pm.set_recording_parameters)
            psd.protocol_accepted.connect(self.compare_frame_controller.add_sniffed_protocol_messages)
            psd.show()