Commit 34d966ff authored by Fardale's avatar Fardale

[tv/gen_conf] add sid_list

parent 1ecd9a5a
......@@ -5,6 +5,7 @@ type tnt = {
card:int;
freq:int;
channel:int;
sid_list:int list option;
}
type polarity = Vertical | Horizontal | Left_circular | Right_circular
......@@ -19,10 +20,11 @@ type sat = {
freq:int;
pol:polarity;
srate:int;
sid_list:int list option;
}
let make_tnt d card channel =
{card; freq = 306000 + 8000 * channel + d * 166; channel}
{card; freq = 306000 + 8000 * channel + d * 166; channel; sid_list = None}
(*TNT*)
let r1 = make_tnt 1 0 35
......@@ -34,10 +36,10 @@ let r6 = make_tnt 1 9 32
let r7 = make_tnt 1 10 37
(*SAT*)
let sat1 = {card = 4; freq = 10847; pol = Vertical; srate = 23000}
let sat2 = {card = 5; freq = 10773; pol = Horizontal; srate = 22000}
let sat3 = {card = 6; freq = 11344; pol = Vertical; srate = 27500}
let sat4 = {card = 7; freq = 11126; pol = Vertical; srate = 22000}
let sat1 = {card = 4; freq = 10847; pol = Vertical; srate = 23000; sid_list = None}
let sat2 = {card = 5; freq = 10773; pol = Horizontal; srate = 22000; sid_list = None}
let sat3 = {card = 6; freq = 11344; pol = Vertical; srate = 27500; sid_list = None}
let sat4 = {card = 7; freq = 11126; pol = Vertical; srate = 22000; sid_list = None}
(* Qui host la tv *)
let host = "cochon"
......@@ -103,8 +105,13 @@ dont_send_scrambled=1
#
# ---------- MUTLICAST ----------
multicast_ipv6=1
%s
"
let template_sid_list = Printf.sprintf "# ---------- SID LIST ----------
# List of sid to stream
autoconf_sid_list=%s"
(* Template conf tuning pour le SAT *)
let template_tuning_sat = Printf.sprintf "#The polarisation (can be h, v, l, r)
pol=%s
......@@ -112,17 +119,19 @@ pol=%s
srate=%i
";;
(* Si on est pas sur le bon serveur ça ne marche pas *)
if not (host = Unix.gethostname ()) then begin
prerr_endline (Printf.sprintf "Script à lancer sur %s" host);
exit 1
end
let gen_conf_tnt (tnt:tnt) = template tnt.card tnt.freq "" "TNT"
(match tnt.sid_list with
| None -> ""
| Some l -> template_sid_list
(List.fold_left (fun s sid -> s ^ " " ^ (string_of_int sid)) "" l))
let gen_conf_sat (sat:sat) =
template sat.card sat.freq
(template_tuning_sat(string_of_pol sat.pol) sat.srate) "SAT"
(match sat.sid_list with
| None -> ""
| Some l -> template_sid_list
(List.fold_left (fun s sid -> s ^ " " ^ (string_of_int sid)) "" l))
let write_conf card conf =
let oc = open_out (conf_file card) in
......@@ -130,7 +139,14 @@ let write_conf card conf =
close_out oc
;;
List.iter (fun (tnt:tnt) ->
write_conf tnt.card (gen_conf_tnt tnt)) transpondeur_tnt;
List.iter (fun (sat:sat) ->
write_conf sat.card (gen_conf_sat sat)) transpondeur_sat;
let () =
(* Si on est pas sur le bon serveur ça ne marche pas *)
if not (host = Unix.gethostname ()) then begin
prerr_endline (Printf.sprintf "Script à lancer sur %s" host);
exit 1
end;
List.iter (fun (tnt:tnt) ->
write_conf tnt.card (gen_conf_tnt tnt)) transpondeur_tnt;
List.iter (fun (sat:sat) ->
write_conf sat.card (gen_conf_sat sat)) transpondeur_sat;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment