Beispiel #1
0
    def draw_throughput_figure(self, path, ap_ssid, draw_type):  # type: (str, str, str) -> str
        """
        :param path: folder to save figure. make sure the folder is already created.
        :param ap_ssid: ap ssid string or a list of ap ssid string
        :param draw_type: "att" or "rssi"
        :return: file_name
        """
        if draw_type == 'rssi':
            type_name = 'RSSI'
            data = self.throughput_by_rssi
            range_list = self.RSSI_RANGE
        elif draw_type == 'att':
            type_name = 'Att'
            data = self.throughput_by_att
            range_list = self.ATT_RANGE
        else:
            raise AssertionError('draw type not supported')
        if isinstance(ap_ssid, list):
            file_name = 'ThroughputVs{}_{}_{}.html'.format(type_name, self.proto, self.direction)
        else:
            file_name = 'ThroughputVs{}_{}_{}.html'.format(type_name, self.proto, self.direction)

        LineChart.draw_line_chart(os.path.join(path, file_name),
                                  'Throughput Vs {} ({} {})'.format(type_name, self.proto, self.direction),
                                  '{} (dbm)'.format(type_name),
                                  'Throughput (Mbps)',
                                  data, range_list)
        return file_name
Beispiel #2
0
    def draw_throughput_figure(self, path, ap_ssid, draw_type):
        """
        :param path: folder to save figure. make sure the folder is already created.
        :param ap_ssid: ap ssid string or a list of ap ssid string
        :param draw_type: "att" or "rssi"
        :return: file_name
        """
        if draw_type == "rssi":
            type_name = "RSSI"
            data = self.throughput_by_rssi
            range_list = self.RSSI_RANGE
        elif draw_type == "att":
            type_name = "Att"
            data = self.throughput_by_att
            range_list = self.ATT_RANGE
        else:
            raise AssertionError("draw type not supported")
        if isinstance(ap_ssid, list):
            file_name = "ThroughputVs{}_{}_{}_{}.html".format(type_name, self.proto, self.direction,
                                                              hash(ap_ssid)[:6])
        else:
            file_name = "ThroughputVs{}_{}_{}_{}.html".format(type_name, self.proto, self.direction, ap_ssid)

        LineChart.draw_line_chart(os.path.join(path, file_name),
                                  "Throughput Vs {} ({} {})".format(type_name, self.proto, self.direction),
                                  "{} (dbm)".format(type_name),
                                  "Throughput (Mbps)",
                                  data, range_list)
        return file_name
    def draw_throughput_figure(self, path, ap_ssid, draw_type):
        """
        :param path: folder to save figure. make sure the folder is already created.
        :param ap_ssid: ap ssid string or a list of ap ssid string
        :param draw_type: "att" or "rssi"
        :return: file_name
        """
        if draw_type == "rssi":
            type_name = "RSSI"
            data = self.throughput_by_rssi
        elif draw_type == "att":
            type_name = "Att"
            data = self.throughput_by_att
        else:
            raise AssertionError("draw type not supported")
        if isinstance(ap_ssid, list):
            file_name = "ThroughputVs{}_{}_{}_{}.png".format(type_name, self.proto, self.direction,
                                                             hash(ap_ssid)[:6])
            data_list = [self._convert_to_draw_format(data[_ap_ssid], _ap_ssid)
                         for _ap_ssid in ap_ssid]
        else:
            file_name = "ThroughputVs{}_{}_{}_{}.png".format(type_name, self.proto, self.direction, ap_ssid)
            data_list = [self._convert_to_draw_format(data[ap_ssid], ap_ssid)]

        LineChart.draw_line_chart(os.path.join(path, file_name),
                                  "Throughput Vs {} ({} {})".format(type_name, self.proto, self.direction),
                                  "Throughput (Mbps)",
                                  "{} (dbm)".format(type_name),
                                  data_list)
        return file_name
Beispiel #4
0
 def draw_rssi_vs_att_figure(self, path, ap_ssid):
     """
     :param path: folder to save figure. make sure the folder is already created.
     :param ap_ssid: ap to use
     :return: file_name
     """
     if isinstance(ap_ssid, list):
         file_name = 'AttVsRSSI_{}.html'.format(hash(ap_ssid)[:6])
     else:
         file_name = 'AttVsRSSI_{}.html'.format(ap_ssid)
     LineChart.draw_line_chart(os.path.join(path, file_name), 'Att Vs RSSI',
                               'Att (dbm)', 'RSSI (dbm)', self.att_rssi_map,
                               self.ATT_RANGE)
     return file_name
 def draw_rssi_vs_att_figure(self, path, ap_ssid):
     """
     :param path: folder to save figure. make sure the folder is already created.
     :param ap_ssid: ap to use
     :return: file_name
     """
     if isinstance(ap_ssid, list):
         file_name = "AttVsRSSI_{}.png".format(hash(ap_ssid)[:6])
         data_list = [self._convert_to_draw_format(self.att_rssi_map[_ap_ssid], _ap_ssid)
                      for _ap_ssid in ap_ssid]
     else:
         file_name = "AttVsRSSI_{}.png".format(ap_ssid)
         data_list = [self._convert_to_draw_format(self.att_rssi_map[ap_ssid], ap_ssid)]
     LineChart.draw_line_chart(os.path.join(path, file_name),
                               "Att Vs RSSI",
                               "Att (dbm)",
                               "RSSI (dbm)",
                               data_list)
     return file_name