Tested.
| "selectthree" { IDENT Select3}
| "rdtable" { IDENT Rdtable}
| "rwtable" { IDENT Rwtable}
+| "button" { IDENT Button}
+| "checkbox" { IDENT Checkbox}
+| "vslider" { IDENT Vslider}
+| "hslider" { IDENT Hslider}
+| "vgroup" { IDENT Vgroup}
+| "hgroup" { IDENT Hgroup}
+| "tgroup" { IDENT Tgroup}
+| "hbargraph" { IDENT Hbargraph}
+| "vbargraph" { IDENT Vbargraph}
+| "nentry" { IDENT Nentry}
+| "attach" { IDENT Attach}
| ['0'-'9']+ as a { CONST a }
| '.' { POINT }
let () = print_endline(" Done. (duration: " ^ (string_of_float (toc2 -. tic2)) ^ "s.)") in
- let () = print_string(" Faustine -> Evaluating...") in
+ let () = print_string(" Faustine -> Constructing signals...") in
let tic3 = Sys.time () in
let output = proc#eval input in
let toc3 = Sys.time () in
let () = print_endline(" Done. (duration: " ^ (string_of_float (toc3 -. tic3)) ^ "s.)") in
- let () = print_string(" Faustine -> Calculating...") in
+ let () = print_string(" Faustine -> Evaluating...") in
let tic4 = Sys.time () in
let data = output#output !time_max in
let rates = output#frequency in
else if (isBoxISum(box, t1, t2, t3)) fout << "sum(" << boxpp(t1) << ", " << boxpp(t2) << ") {" << boxpp(t3) << "}";
else if (isBoxIProd(box, t1, t2, t3)) fout << "prod(" << boxpp(t1) << ", " << boxpp(t2) << ") {" << boxpp(t3) << "}";
+/*
// user interface
else if (isBoxButton(box, label)) fout << "button(" << tree2str(label) << ')';
else if (isBoxCheckbox(box, label)) fout << "checkbox(" << tree2str(label) << ')';
<< boxpp(max) << ", "
<< boxpp(step)<< ')';
}
+*/
+
+ // user interface ----------- Edited by Haisheng WANG for Faustine, 16/09/2013.
+ else if (isBoxButton(box, label)) fout << "button";
+ else if (isBoxCheckbox(box, label)) fout << "checkbox";
+ else if (isBoxVSlider(box, label, cur, min, max, step)) {
+ fout << "vslider";
+ }
+ else if (isBoxHSlider(box, label, cur, min, max, step)) {
+ fout << "hslider";
+ }
+ else if (isBoxVGroup(box, label, t1)) {
+ fout << "vgroup";
+ }
+ else if (isBoxHGroup(box, label, t1)) {
+ fout << "hgroup";
+ }
+ else if (isBoxTGroup(box, label, t1)) {
+ fout << "tgroup";
+ }
+ else if (isBoxHBargraph(box, label, min, max)) {
+ fout << "hbargraph";
+ }
+ else if (isBoxVBargraph(box, label, min, max)) {
+ fout << "vbargraph";
+ }
+ else if (isBoxNumEntry(box, label, cur, min, max, step)) {
+ fout << "nentry";
+ }
+ // end user interface
+
else if (isNil(box)) {
fout << "()" ;
}
| Rwtable -> self#beam_of_ident n
((input#get.(0))#rwtable input#get.(1)
input#get.(2) input#get.(3) input#get.(4))
+ | other ->
+ let err_message = "GUI not supported: "
+ ^ (string_of_symbol other) ^ "." in
+ raise (Process_error err_message)
end;;
class virtual process_binary =
|Select2 -> ((3, 1), 0, "Select2")
|Select3 -> ((4, 1), 0, "Select3")
|Rdtable -> ((3, 1), rdtable_memory_length, "Rdtalbe")
- |Rwtable -> ((5, 1), rwtable_memory_length, "Rwtable");;
+ |Rwtable -> ((5, 1), rwtable_memory_length, "Rwtable")
+ |Button -> ((0, 1), 0, "Button")
+ |Checkbox -> ((0, 1), 0, "Checkbox")
+ |Vslider -> ((0, 1), 0, "Vslider")
+ |Hslider -> ((0, 1), 0, "Hslider")
+ |Vgroup -> ((0, 1), 0, "Vgroup")
+ |Hgroup -> ((0, 1), 0, "Hgroup")
+ |Tgroup -> ((0, 1), 0, "Tgroup")
+ |Hbargraph -> ((0, 1), 0, "Hbargraph")
+ |Vbargraph -> ((0, 1), 0, "Vbargraph")
+ |Nentry -> ((0, 1), 0, "Nentry")
+ |Attach -> ((2, 1), 0, "Attach") ;;
let dimension_of_symbol : symbol -> int * int =
fun (s : symbol) ->
| Select3
| Rdtable
| Rwtable
+ | Button
+ | Checkbox
+ | Vslider
+ | Hslider
+ | Vgroup
+ | Hgroup
+ | Tgroup
+ | Hbargraph
+ | Vbargraph
+ | Nentry
+ | Attach
type faust_exp =
Const of basic