const CameraConfig = { obj_current_camera: null, init: () => { // Initialized on demand when a camera is selected }, show: (obj_camera) => { CameraConfig.obj_current_camera = obj_camera; let obj_label = document.getElementById("label_selected_camera"); obj_label.textContent = obj_camera.str_name; let obj_container = document.getElementById("container_camera_config"); obj_container.innerHTML = ""; let str_html = "" + '
' + '
' + ' ' + ' ' + "
" + '
' + ' ' + ' ' + "
" + '
' + ' ' + ' ' + "
" + '
' + ' ' + ' ' + "
" + '
' + ' ' + ' ' + "
" + '
' + ' ' + ' " + "
" + '
' + ' " + "
" + "
"; obj_container.innerHTML = str_html; CameraConfig._bind_events(); }, _bind_events: () => { let obj_btn_apply = document.getElementById("btn_apply_config"); obj_btn_apply.addEventListener("click", () => { CameraConfig._apply(); }); }, _apply: () => { let obj_cam = CameraConfig.obj_current_camera; if (!obj_cam) { return; } obj_cam.nb_resolution_x = parseInt(document.getElementById("input_res_x").value, 10) || 1920; obj_cam.nb_resolution_y = parseInt(document.getElementById("input_res_y").value, 10) || 1080; let nb_parsed_start = parseInt(document.getElementById("input_frame_start").value, 10); obj_cam.nb_frame_start = isNaN(nb_parsed_start) ? 1 : nb_parsed_start; let nb_parsed_end = parseInt(document.getElementById("input_frame_end").value, 10); obj_cam.nb_frame_end = isNaN(nb_parsed_end) ? 250 : nb_parsed_end; let nb_parsed_step = parseInt(document.getElementById("input_frame_step").value, 10); obj_cam.nb_frame_step = isNaN(nb_parsed_step) || nb_parsed_step < 1 ? 1 : nb_parsed_step; obj_cam.str_format = document.getElementById("select_format").value; ConsoleLog.add("Config appliquee pour " + obj_cam.str_name); }, clear: () => { CameraConfig.obj_current_camera = null; let obj_label = document.getElementById("label_selected_camera"); obj_label.textContent = "-"; let obj_container = document.getElementById("container_camera_config"); obj_container.innerHTML = '
Selectionnez une camera
'; }, };