1099 int m_fr_total = ((ricom->nx + ricom->skip_row) * ricom->ny + ricom->skip_img) * ricom->rep;
1101 std::ofstream run_script(
"run_script.py");
1102 run_script <<
"from merlin_interface.merlin_interface import MerlinInterface" << std::endl;
1103 run_script <<
"m = MerlinInterface(tcp_ip = \"" << ricom->socket.ip <<
"\" , tcp_port=" << merlin->com_port <<
")" << std::endl;
1104 run_script <<
"m.hvbias = " << merlin->hvbias << std::endl;
1105 run_script <<
"m.threshold0 = " << merlin->threshold0 << std::endl;
1106 run_script <<
"m.threshold1 = " << merlin->threshold1 << std::endl;
1107 run_script <<
"m.continuousrw = " << (int)merlin->continuousrw << std::endl;
1108 run_script <<
"m.counterdepth = " << ricom->camera.depth << std::endl;
1109 run_script <<
"m.acquisitiontime = " << merlin->dwell_time << std::endl;
1110 run_script <<
"m.acquisitionperiod = " << merlin->dwell_time << std::endl;
1111 run_script <<
"m.numframestoacquire = " << m_fr_total + 1 << std::endl;
1112 run_script <<
"m.fileenable = " << (
int)merlin->save << std::endl;
1113 run_script <<
"m.runheadless = " << (int)merlin->headless << std::endl;
1114 run_script <<
"m.fileformat = " << (
int)merlin->raw * 2 << std::endl;
1115 run_script <<
"m.triggerstart = " << merlin->trigger << std::endl;
1116 run_script <<
"m.startacquisition()";
1119 std::string command = python_path +
" run_script.py";
1120 int r = std::system(command.c_str());
1123 std::cout <<
"main::run_connection_script: Cannot execute python run_script. Shell exited with code " << r << std::endl;