# Path: sensbiotk/io/iofox_deprec.py
# LSM303DLHC_ACC_SCALE = {'2g': 0x00, '4g': 0x10, '8g': 0x20, '16g': 0x30}
# LSM303DLHC_MAG_SCALE = {'1_3gauss': 0x20, '1_9gauss': 0x40, '2_5gauss': 0x60,
#                         '4_0gauss': 0x80, '4_7gauss': 0xA0, '5_6gauss': 0xC0,
#                         '8_1gauss': 0xE0}
# L3G4200D_SCALE = {'250dps': 0x00, '500dps': 0x10, '2000dps': 0x30}
# SCALE = {'ref_g': 9.81, 'time': 1e-3,
#          'acc': 2.0e-2, 'mag_xy': (1.0 / 670.0), 'mag_z': (1.0 / 600.0),
#          'press': 1.0 / 4096.0 / 1000.0, 'temp': 1.0 / 480.0,
#          'offset_temp': 22.5}
# SEP = "\t"
# def _get_acc_scale():
# def _get_magxy_scale():
# def _get_gyr_scale():
# def _get_time(rawval):
# def _get_acc(rawval):
# def _get_mag(rawval):
# def _get_gyr(rawval):
# def _get_press(rawval):
# def _get_temp(rawval):
# def _set_time_scale(val):
# def _set_acc_scale(val):
# def _set_mag_scale(val):
# def _set_gyr_scale(val):
# def _write_imu_header(fid, binfilename):
# def _write_imu_data(fid, data):
# def _write_presst_header(fid, binfilename):
# def _write_presst_data(fid, data):
# def convert_fox_rawfile(binfilename, imufilename, presstfilename):
# def info_fox_rawfile(binfilename):
# def load_foximu_csvfile(filename):
# def load_foxpresst_csvfile(filename):
# def save_foximu_csvfile(accfilename, time, acc, mag, gyr, separator=SEP):


import numpy as np
import filecmp
from sensbiotk.io import iofox_deprec as fox
from nose.tools import assert_equal
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""
Tests Unit for iofox module
"""



# pylint:disable= I0011, E1101
# E1101 no-member false positif


def test_load():
    """ Test loading files
    """

    # read and convert HIGPS01.RAW with convert_fox_rawfile
    resp = fox.convert_fox_rawfile("data/imutest_deprec.raw",
                                   "tmpdata/imutest_deprec_imu.csv",
                                   "tmpdata/imutest_deprec_presst.csv")
    yield assert_equal, resp, "OK"

    resp = filecmp.cmp("tmpdata/imutest_deprec_imu.csv", "data/imutest_deprec_imu.csv")
    yield assert_equal, resp, True
    resp = filecmp.cmp("tmpdata/imutest_deprec_presst.csv", "data/imutest_deprec_presst.csv")
    yield assert_equal, resp, True

    # read data/output_imu.csv with load_foximu_csvfile
    [time, acc, mag, gyr] = \

# Path: sensbiotk/io/iofox_deprec.py
# LSM303DLHC_ACC_SCALE = {'2g': 0x00, '4g': 0x10, '8g': 0x20, '16g': 0x30}
# LSM303DLHC_MAG_SCALE = {'1_3gauss': 0x20, '1_9gauss': 0x40, '2_5gauss': 0x60,
#                         '4_0gauss': 0x80, '4_7gauss': 0xA0, '5_6gauss': 0xC0,
#                         '8_1gauss': 0xE0}
# L3G4200D_SCALE = {'250dps': 0x00, '500dps': 0x10, '2000dps': 0x30}
# SCALE = {'ref_g': 9.81, 'time': 1e-3,
#          'acc': 2.0e-2, 'mag_xy': (1.0 / 670.0), 'mag_z': (1.0 / 600.0),
#          'press': 1.0 / 4096.0 / 1000.0, 'temp': 1.0 / 480.0,
#          'offset_temp': 22.5}
# SEP = "\t"
# def _get_acc_scale():
# def _get_magxy_scale():
# def _get_gyr_scale():
# def _get_time(rawval):
# def _get_acc(rawval):
# def _get_mag(rawval):
# def _get_gyr(rawval):
# def _get_press(rawval):
# def _get_temp(rawval):
# def _set_time_scale(val):
# def _set_acc_scale(val):
# def _set_mag_scale(val):
# def _set_gyr_scale(val):
# def _write_imu_header(fid, binfilename):
# def _write_imu_data(fid, data):
# def _write_presst_header(fid, binfilename):
# def _write_presst_data(fid, data):
# def convert_fox_rawfile(binfilename, imufilename, presstfilename):
# def info_fox_rawfile(binfilename):
# def load_foximu_csvfile(filename):
# def load_foxpresst_csvfile(filename):
# def save_foximu_csvfile(accfilename, time, acc, mag, gyr, separator=SEP):


# Path: sensbiotk/tests/test_iofox_deprec.py
import numpy as np
import filecmp
from sensbiotk.io import iofox_deprec as fox
from nose.tools import assert_equal

#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""
Tests Unit for iofox module
"""



# pylint:disable= I0011, E1101
# E1101 no-member false positif


def test_load():
    """ Test loading files
    """

    # read and convert HIGPS01.RAW with convert_fox_rawfile
    resp = fox.convert_fox_rawfile("data/imutest_deprec.raw",
                                   "tmpdata/imutest_deprec_imu.csv",
                                   "tmpdata/imutest_deprec_presst.csv")
    yield assert_equal, resp, "OK"

    resp = filecmp.cmp("tmpdata/imutest_deprec_imu.csv", "data/imutest_deprec_imu.csv")
    yield assert_equal, resp, True
    resp = filecmp.cmp("tmpdata/imutest_deprec_presst.csv", "data/imutest_deprec_presst.csv")
    yield assert_equal, resp, True

    # read data/output_imu.csv with load_foximu_csvfile
    [time, acc, mag, gyr] = \

        fox.load_foximu_csvfile("data/imutest_deprec_imu.csv")