##// END OF EJS Templates
Task #487: Vista de Operacion...
Task #487: Vista de Operacion git-svn-id: http://jro-dev.igp.gob.pe/svn/jro_hard/radarsys/trunk/webapp@77 aa17d016-51d5-4e8b-934c-7b2bbb1bbe71

File last commit:

r51:884ae042d9ee
r56:89f0d8586d56
Show More
files.py
66 lines | 1.2 KiB | text/x-python | PythonLexer
'''
Created on Feb 8, 2016
@author: Miguel Urco
'''
import string
import data
def read_rc_file(fp):
"""
Function to extract the parameters from a text file with the next format:
Input:
File with the next content:
Phase Adjust Register 1
-----------------------
00000000
00000000
.....
-----------------------
Frequency Tuning Word 1
-----------------------
00110101
01111111
11111111
11111111
10100000
00000000
Output:
Return configuration parameters for DDS: multiplier, frequency, phase, amplitude, etc.
"""
registers = ""
for this_line in fp:
this_line = str.strip(this_line)
if not str.isdigit(this_line):
continue
if len(this_line) != 8:
continue
registers += chr(string.atoi(this_line,2))
parms = data.rc_str_to_dict(registers)
return parms
def read_json_file(fp):
kwargs = {}
return kwargs
def write_cr_file(filename):
pass
def write_json_file(filename):
pass