# Path: rtlsdr_scanner/constants.py
# SAMPLE_RATE = 2e6


import datetime
import json
import math
import os
import pkg_resources
import socket
import sys
import time
import serial.tools.list_ports
from math import radians, sin, cos, asin, sqrt
from threading import Thread
from rtlsdr_scanner.constants import SAMPLE_RATE
    return val + 1


def calc_samples(dwell):
    samples = dwell * SAMPLE_RATE
    samples = next_2_to_pow(int(samples))
    return samples


def get_dwells():
    dwells = ["8 ms", 0.008,
              "16 ms", 0.016,
              "32 ms", 0.032,
              "65 ms", 0.065,
              "131 ms", 0.131,
              "262 ms", 0.262,
              "524 ms", 0.524,
              "1 s", 1.048,
              "2 s", 2.097,
              "4 s", 4.194,
              "8 s", 8.388]

    if sys.platform == 'linux' or sys.platform == "linux2":
        del dwells[-4:]

    return dwells


def calc_real_dwell(dwell):
    samples = calc_samples(dwell)

# Path: rtlsdr_scanner/constants.py
# SAMPLE_RATE = 2e6


# Path: rtlsdr_scanner/misc.py
import datetime
import json
import math
import os
import pkg_resources
import socket
import sys
import time
import serial.tools.list_ports
from math import radians, sin, cos, asin, sqrt
from threading import Thread
from rtlsdr_scanner.constants import SAMPLE_RATE

    return val + 1


def calc_samples(dwell):
    samples = dwell * SAMPLE_RATE
    samples = next_2_to_pow(int(samples))
    return samples


def get_dwells():
    dwells = ["8 ms", 0.008,
              "16 ms", 0.016,
              "32 ms", 0.032,
              "65 ms", 0.065,
              "131 ms", 0.131,
              "262 ms", 0.262,
              "524 ms", 0.524,
              "1 s", 1.048,
              "2 s", 2.097,
              "4 s", 4.194,
              "8 s", 8.388]

    if sys.platform == 'linux' or sys.platform == "linux2":
        del dwells[-4:]

    return dwells


def calc_real_dwell(dwell):
    samples = calc_samples(dwell)

    dwellReal = samples / SAMPLE_RATE