fix imager bug

This commit is contained in:
Romain Bazile 2020-12-03 16:29:12 +01:00
parent 668b4c0a35
commit d9aab5fc0b
4 changed files with 14 additions and 7 deletions

View file

@ -42,16 +42,16 @@
"info": ""
},
{
"id": "1371dec5.76e671",
"id": "9daf9e2b.019fc",
"type": "tab",
"label": "Settings",
"label": "Administration",
"disabled": false,
"info": ""
},
{
"id": "9daf9e2b.019fc",
"id": "1371dec5.76e671",
"type": "tab",
"label": "Administration",
"label": "Settings",
"disabled": false,
"info": ""
},
@ -2712,7 +2712,7 @@
"order": 9,
"width": 0,
"height": 0,
"format": "<div>\n <table style=\"text-align: center; width:100%\">\n <tr style=\"vertical-align: top\">\n <td>\n <h2>Sample</h2><br>\n <strong>project:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_project\"></span><br>\n <strong>ship:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_ship\"></span><br>\n <strong>operator:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_operator\"></span><br>\n <strong>id:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_id\"></span><br>\n <strong>sampling gear:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_sampling_gear\"></span><br>\n <strong>concentrated volume:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_concentrated_sample_volume\"></span><br>\n <strong>gear net opening:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_gear_net_opening\"></span><br></td>\n <td>\n <h2>Acquisition</h2><br>\n <strong>id:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_id\"></span><br>\n <strong>instrument:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_instrument\"></span><br>\n <strong>instrument id:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_instrument_id\"></span><br>\n <strong>camera:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_camera\"></span><br>\n <strong>celltype:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_celltype\"></span><br>\n <strong>minimum mesh:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_minimum_mesh\"></span><br>\n <strong>maximum mesh:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_maximum_mesh\"></span><br>\n <strong>min esd:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_min_esd\"></span><br>\n <strong>max esd:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_max_esd\"></span><br>\n <strong>volume:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_volume\"></span><br>\n <strong>magnification:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_magnification\"></span><br>\n <strong>fnumber objective:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_fnumber_objective\"></span><br>\n <strong>software:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_software\"></span><br>\n <strong>flowrate:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sug_flowrate\"></span><br></td>\n </tr>\n <tr style=\"vertical-align: top\">\n <td>\n <h2>Object</h2><br>\n <strong>latitude:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_lat\"></span><br>\n <strong>longitude:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_lon\"></span><br>\n <strong>latitude end:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_lat_end\"></span><br>\n <strong>longitude end:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_lon_end\"></span><br>\n <strong>date:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_date\"></span><br>\n <strong>time:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_time\"></span><br>\n <strong>date end:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_date_end\"></span><br>\n <strong>time end:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_time_end\"></span><br>\n <strong>depth min:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_depth_min\"></span><br>\n <strong>depth max:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_depth_max\"></span><br></td>\n <td>\n <h2>Process</h2><br>\n <strong>pixel:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.process_pixel\"></span><br>\n <strong>id:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.process_id\"></span></td>\n </tr>\n </table>\n</div>",
"format": "<div>\n <table style=\"text-align: center; width:100%\">\n <tr style=\"vertical-align: top\">\n <td>\n <h2>Sample</h2><br>\n <strong>project:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_project\"></span><br>\n <strong>ship:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_ship\"></span><br>\n <strong>operator:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_operator\"></span><br>\n <strong>id:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_id\"></span><br>\n <strong>sampling gear:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_sampling_gear\"></span><br>\n <strong>concentrated volume:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_concentrated_sample_volume\"></span><br>\n <strong>gear net opening:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.sample_gear_net_opening\"></span><br></td>\n <td>\n <h2>Acquisition</h2><br>\n <strong>id:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_id\"></span><br>\n <strong>instrument:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_instrument\"></span><br>\n <strong>instrument id:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_instrument_id\"></span><br>\n <strong>camera:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_camera\"></span><br>\n <strong>celltype:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_celltype\"></span><br>\n <strong>minimum mesh:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_minimum_mesh\"></span><br>\n <strong>maximum mesh:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_maximum_mesh\"></span><br>\n <strong>min esd:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_min_esd\"></span><br>\n <strong>max esd:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_max_esd\"></span><br>\n <strong>volume:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_volume\"></span><br>\n <strong>magnification:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_magnification\"></span><br>\n <strong>fnumber objective:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_fnumber_objective\"></span><br>\n <strong>software:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.acq_software\"></span><br>\n </tr>\n <tr style=\"vertical-align: top\">\n <td>\n <h2>Object</h2><br>\n <strong>latitude:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_lat\"></span><br>\n <strong>longitude:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_lon\"></span><br>\n <strong>latitude end:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_lat_end\"></span><br>\n <strong>longitude end:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_lon_end\"></span><br>\n <strong>date:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_date\"></span><br>\n <strong>time:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_time\"></span><br>\n <strong>date end:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_date_end\"></span><br>\n <strong>time end:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_time_end\"></span><br>\n <strong>depth min:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_depth_min\"></span><br>\n <strong>depth max:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.object_depth_max\"></span><br></td>\n <td>\n <h2>Process</h2><br>\n <strong>pixel:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.process_pixel\"></span><br>\n <strong>id:</strong> <span id=\"max_size\" ng-bind-html=\"msg.payload.config.process_id\"></span></td>\n </tr>\n </table>\n</div>",
"storeOutMessages": false,
"fwdInMessages": false,
"resendOnRefresh": false,
@ -3522,7 +3522,7 @@
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "Encapsulate config",
"func": "msg.payload = {\n\t\"action\": \"update_config\",\n\t\"config\": {\n \t\"description\": {\n \t\t\"sample_project\": \"Project's name\",\n \t\t\"sample_id\": \"Sample ID\",\n \t\t\"sample_uuid\": \"Sample UUID (Autogenerated)\",\n \t\t\"sample_ship\": \"Ship's name\",\n \t\t\"sample_operator\": \"Operator's name\",\n \t\t\"sample_sampling_gear\": \"Sampling gear used\",\n \t\t\"sample_concentrated_sample_volume\": \"Volume of concentrated sample, in mL\",\n \t\t\"acq_id\": \"Acquisition ID\",\n \t\t\"acq_uuid\": \"Acquisition UUID (Autogenerated)\",\n \t\t\"acq_instrument\": \"Instrument type\",\n \t\t\"acq_instrument_id\": \"Instrument ID\",\n \t\t\"acq_celltype\": \"Flow cell dimension thickness, in µm\",\n \t\t\"acq_minimum_mesh\": \"Minimum filtration mesh size, in µm\",\n \t\t\"acq_maximum_mesh\": \"Maximum filtration mesh size, in µm\",\n \t\t\"acq_min_esd\": \"\",\n \t\t\"acq_max_esd\": \"\",\n \t\t\"acq_volume\": \"Imaged volume, in mL\",\n \t\t\"acq_magnification\": \"Optical magnification\",\n \t\t\"acq_fnumber_objective\": \"Focal length of the objective, in mm\",\n \t\t\"acq_camera_name\": \"Name of the camera used\",\n \t\t\"acq_nb_frame\": \"Number of picture taken\",\n \"acq_local_datetime\": \"Instrument local datetime\",\n \"acq_camera_resolution\": \"Resolution of the images\",\n \"acq_camera_iso\": \"ISO Number of the images\",\n \"acq_camera_shutter_speed\": \"Shutter speed of the images, in µs\",\n \t\t\"object_date\": \"Sample collection date (or beginning if using a net)\",\n \t\t\"object_time\": \"Sample collection time (or beginning if using a net)\",\n \t\t\"object_lat\": \"Sample collection latitude (or beginning if using a net)\",\n \t\t\"object_lon\": \"Sample collection longitude (or beginning if using a net)\",\n \t\t\"object_depth_min\": \"Sample collection minimal depth, in m\",\n \t\t\"object_depth_max\": \"Sample collection maximum depth, in m\",\n \t\t\"process_pixel\": \"Pixel imaging resolution, in µm/pixel\",\n \t\t\"process_id\": \"Segmentation ID\",\n \t\t\"process_uuid\": \"Segmentation UUID (Autogenerated)\",\n \t\t\"sample_gear_net_opening\": \"Sample mouth opening dimension, in mm\",\n \t\t\"object_date_end\": \"Sample end collection date when using a net\",\n \t\t\"object_time_end\": \"Sample end collection time when using a net\",\n \t\t\"object_lat_end\": \"Sample end collection latitude when using a net\",\n \t\t\"object_lon_end\": \"Sample end collection longitude when using a net\",\n \t},\n\t\t\"sample_project\": global.get(\"sample_project\"),\n\t\t\"sample_id\": global.get(\"sample_id\"),\n\t\t\"sample_ship\": global.get(\"sample_ship\"),\n\t\t\"sample_operator\": global.get(\"sample_operator\"),\n\t\t\"sample_sampling_gear\": global.get(\"sample_sampling_gear\"),\n\t\t\"sample_concentrated_sample_volume\": global.get(\"sample_concentrated_sample_volume\"),\n\n\t\t\"acq_id\": global.get(\"acq_id\"),\n\t\t\"acq_instrument\": global.get(\"acq_instrument\"),\n\t\t\"acq_instrument_id\": global.get(\"acq_instrument_id\"),\n\t\t\"acq_celltype\": global.get(\"acq_celltype\"),\n\t\t\"acq_minimum_mesh\": global.get(\"acq_minimum_mesh\"),\n\t\t\"acq_maximum_mesh\": global.get(\"acq_maximum_mesh\"),\n\t\t\"acq_min_esd\": global.get(\"acq_min_esd\"),\n\t\t\"acq_max_esd\": global.get(\"acq_max_esd\"),\n\t\t\"acq_volume\": global.get(\"acq_volume\"),\n\t\t\"acq_magnification\": global.get(\"magnification\"),\n\t\t\"acq_fnumber_objective\": global.get(\"acq_fnumber_objective\"),\n\t\t\"acq_camera_name\": global.get(\"acq_camera_name\"),\n\t\t\"acq_nb_frame\": global.get(\"nb_frame\"),\n\n\t\t\"object_date\": global.get(\"object_date\"),\n\t\t\"object_time\": global.get(\"object_time\"),\n\t\t\"object_lat\": global.get(\"object_lat\"),\n\t\t\"object_lon\": global.get(\"object_lon\"),\n\t\t\"object_depth_min\": global.get(\"object_depth_min\"),\n\t\t\"object_depth_max\": global.get(\"object_depth_max\"),\n\n\t\t\"process_pixel\": global.get(\"process_pixel\"),\n\t\t\"process_id\": global.get(\"process_id\")\n\t}\n};\n\nif (msg.payload.config.sample_sampling_gear == \"net\") {\n\tmsg.payload.config = { ...msg.payload.config ,\n\t\t\t\"sample_gear_net_opening\": global.get(\"sample_gear_net_opening\"),\n\t\t\t\"object_date_end\": global.get(\"object_date_end\"),\n\t\t\t\"object_time_end\": global.get(\"object_time_end\"),\n\t\t\t\"object_lat_end\": global.get(\"object_lat_end\"),\n\t\t\t\"object_lon_end\": global.get(\"object_lon_end\")\n\t};\n}\nreturn msg;",
"func": "msg.payload = {\n\t\"action\": \"update_config\",\n\t\"config\": {\n \t\"description\": {\n \t\t\"sample_project\": \"Project's name\",\n \t\t\"sample_id\": \"Sample ID\",\n \t\t\"sample_uuid\": \"Sample UUID (Autogenerated)\",\n \t\t\"sample_ship\": \"Ship's name\",\n \t\t\"sample_operator\": \"Operator's name\",\n \t\t\"sample_sampling_gear\": \"Sampling gear used\",\n \t\t\"sample_concentrated_sample_volume\": \"Volume of concentrated sample, in mL\",\n \t\t\"acq_id\": \"Acquisition ID\",\n \t\t\"acq_uuid\": \"Acquisition UUID (Autogenerated)\",\n \t\t\"acq_instrument\": \"Instrument type\",\n \t\t\"acq_instrument_id\": \"Instrument ID\",\n \t\t\"acq_celltype\": \"Flow cell dimension thickness, in µm\",\n \t\t\"acq_minimum_mesh\": \"Minimum filtration mesh size, in µm\",\n \t\t\"acq_maximum_mesh\": \"Maximum filtration mesh size, in µm\",\n \t\t\"acq_min_esd\": \"\",\n \t\t\"acq_max_esd\": \"\",\n \t\t\"acq_volume\": \"Imaged volume, in mL\",\n \t\t\"acq_magnification\": \"Optical magnification\",\n \t\t\"acq_fnumber_objective\": \"Focal length of the objective, in mm\",\n \t\t\"acq_camera_name\": \"Name of the camera used\",\n \t\t\"acq_nb_frame\": \"Number of picture taken\",\n \"acq_local_datetime\": \"Instrument local datetime\",\n \"acq_camera_resolution\": \"Resolution of the images\",\n \"acq_camera_iso\": \"ISO Number of the images\",\n \"acq_camera_shutter_speed\": \"Shutter speed of the images, in µs\",\n \t\t\"object_date\": \"Sample collection date (or beginning if using a net)\",\n \t\t\"object_time\": \"Sample collection time (or beginning if using a net)\",\n \t\t\"object_lat\": \"Sample collection latitude (or beginning if using a net)\",\n \t\t\"object_lon\": \"Sample collection longitude (or beginning if using a net)\",\n \t\t\"object_depth_min\": \"Sample collection minimal depth, in m\",\n \t\t\"object_depth_max\": \"Sample collection maximum depth, in m\",\n \t\t\"process_pixel\": \"Pixel imaging resolution, in µm/pixel\",\n \t\t\"process_id\": \"Segmentation ID\",\n \t\t\"process_uuid\": \"Segmentation UUID (Autogenerated)\",\n \t\t\"sample_gear_net_opening\": \"Sample mouth opening dimension, in mm\",\n \t\t\"object_date_end\": \"Sample end collection date when using a net\",\n \t\t\"object_time_end\": \"Sample end collection time when using a net\",\n \t\t\"object_lat_end\": \"Sample end collection latitude when using a net\",\n \t\t\"object_lon_end\": \"Sample end collection longitude when using a net\",\n \t},\n\t\t\"sample_project\": global.get(\"sample_project\"),\n\t\t\"sample_id\": global.get(\"sample_id\"),\n\t\t\"sample_ship\": global.get(\"sample_ship\"),\n\t\t\"sample_operator\": global.get(\"sample_operator\"),\n\t\t\"sample_sampling_gear\": global.get(\"sample_sampling_gear\"),\n\t\t\"sample_concentrated_sample_volume\": global.get(\"sample_concentrated_sample_volume\"),\n\n\t\t\"acq_id\": global.get(\"acq_id\"),\n\t\t\"acq_instrument\": global.get(\"acq_instrument\"),\n\t\t\"acq_instrument_id\": global.get(\"acq_instrument_id\"),\n\t\t\"acq_celltype\": global.get(\"acq_celltype\"),\n\t\t\"acq_minimum_mesh\": global.get(\"acq_minimum_mesh\"),\n\t\t\"acq_maximum_mesh\": global.get(\"acq_maximum_mesh\"),\n\t\t\"acq_min_esd\": global.get(\"acq_min_esd\"),\n\t\t\"acq_max_esd\": global.get(\"acq_max_esd\"),\n\t\t\"acq_volume\": global.get(\"acq_volume\"),\n\t\t\"acq_magnification\": global.get(\"magnification\"),\n\t\t\"acq_fnumber_objective\": global.get(\"acq_fnumber_objective\"),\n\t\t\"acq_camera\": global.get(\"acq_camera\"),\n\t\t\"acq_nb_frame\": global.get(\"nb_frame\"),\n\n\t\t\"object_date\": global.get(\"object_date\"),\n\t\t\"object_time\": global.get(\"object_time\"),\n\t\t\"object_lat\": global.get(\"object_lat\"),\n\t\t\"object_lon\": global.get(\"object_lon\"),\n\t\t\"object_depth_min\": global.get(\"object_depth_min\"),\n\t\t\"object_depth_max\": global.get(\"object_depth_max\"),\n\n\t\t\"process_pixel\": global.get(\"process_pixel\"),\n\t\t\"process_id\": global.get(\"process_id\")\n\t}\n};\n\nif (msg.payload.config.sample_sampling_gear == \"net\") {\n\tmsg.payload.config = { ...msg.payload.config ,\n\t\t\t\"sample_gear_net_opening\": global.get(\"sample_gear_net_opening\"),\n\t\t\t\"object_date_end\": global.get(\"object_date_end\"),\n\t\t\t\"object_time_end\": global.get(\"object_time_end\"),\n\t\t\t\"object_lat_end\": global.get(\"object_lat_end\"),\n\t\t\t\"object_lon_end\": global.get(\"object_lon_end\")\n\t};\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",

View file

@ -38,6 +38,12 @@ function special(){
sudo ln -s /etc/nginx/sites-available/gallery.conf /etc/nginx/sites-enabled/gallery.conf
sudo nginx -t && sudo systemctl reload nginx
fi
if ![[ -f "/etc/nginx/sites-available/img.conf" ]]; then
${log} "Getting rid of the old nginx config"
sudo rm /etc/nginx/sites-available/img.conf
sudo rm /etc/nginx/sites-enabled/img.conf
sudo nginx -t && sudo systemctl reload nginx
fi
}
${log} "Updating the main repository"

View file

@ -662,6 +662,7 @@ class ImagerProcess(multiprocessing.Process):
)
# Reset the counter to 0
self.__img_done = 0
self.__img_goal = 0
# Change state towards stop
self.__imager.change(planktoscope.imager_state_machine.Stop)
planktoscope.light.error()

View file

@ -42,7 +42,7 @@ class Imaging(ImagerState):
""" State of getting ready to start """
name = "imaging"
allowed = ["waiting"]
allowed = ["waiting", "stop"]
class Waiting(ImagerState):