const tuning = []; /** * 測定時刻指定フォーム・操作ボタン作成 */ function make_select_form() { var date = new Date(); const y = date.getFullYear(); const m = date.getMonth() + 1; const d = date.getDate(); const h = date.getHours(); const ii = date.getMinutes(); var html_code = '
'; html_code += ' '; html_code += ':'; html_code += ''; html_code += '
'; html_code += ' '; html_code += ' '; html_code += ' '; html_code += ' '; html_code += ' '; html_code += '

'; document.getElementById('select_date').innerHTML = html_code; $(function () { $('#date').datepicker(); }); } /** * 測定時刻操作ボタン押下時の処理 * @param {number} flag 1: 30分前後ボタンを押した 2:30分前後以外のボタンを押した * @param {number} value 変動させる値 */ function change_date(flag, value) { var now_date = new Date(); if (now_date.getTime() - load_date.getTime() >= 30 * 60 * 1000) { update(); } const date = document.getElementById('date').value; const hour = document.getElementById('hours').value; const minute = document.getElementById('minutes').value; str = date + ' ' + ('0' + hour).slice(-2) + ':' + ('0' + minute).slice(-2) + ':00'; var dt = new Date(str); switch (flag) { case 1: dt.setHours(dt.getHours() + value); break; case 2: dt.setMinutes(dt.getMinutes() + 30 * value); break; } if (dt.getTime() - now_date.getTime() > -60 * 1000) { dt.setTime(now_date.getTime()); } const y = dt.getFullYear(); const m = dt.getMonth() + 1; const d = dt.getDate(); const h = dt.getHours(); const ii = dt.getMinutes(); document.getElementById('date').value = y + '/' + ('0' + m).slice(-2) + '/' + ('0' + d).slice(-2); document.getElementById('hours').value = ('0' + h).slice(-2); document.getElementById('minutes').value = ('0' + ii).slice(-2); display_table(true, '', p_mode); var val; if (dt.getTime() < now_date.getTime()) { val = false; } else { val = true; } for (var i = 3; i < 6; i++) { var btn_id = 'btn' + i; document.getElementById(btn_id).disabled = val; } } /** * 表の表示 * @param {boolean} flag テキストボックスの日付を参照するかしないか * @param {string} buoy 測点名 * @param {number} mode 0:一般公開用 1:関係者専用 */ function display_table(flag, buoy, mode) { // 表の表示 var str = ''; const err = 'Err'; if (flag) { const date = document.getElementById('date').value; const hour = document.getElementById('hours').value; const minute = document.getElementById('minutes').value; str = date + ' ' + ('0' + hour).slice(-2) + ':' + ('0' + minute).slice(-2) + ':59'; } else { var date = new Date(); date.setMinutes(date.getMinutes() + 30); const year = date.getFullYear(); const month = date.getMonth() + 1; const day = date.getDate(); const hour = date.getHours(); const minute = date.getHours(); str = '' + year + '/' + ('0' + month).slice(-2) + '/' + ('0' + day).slice(-2) + ' ' + ('0' + hour).slice(-2) + ':' + ('0' + minute).slice(-2) + ':59'; } extract_suishitsu_data(str); var html_code = ''; html_code += ''; for (var i = 0; i < suishitsu_list.length; i++) { var kome = ''; /* if(suishitsu_list[i] == "三浦") { kome = "
休止中"; } */ if (tuning.indexOf(suishitsu_list[i]) != -1) kome = '
機器調整中'; if (buoy == suishitsu_list[i]) { html_code += ''; } else { html_code += ''; } } html_code += ''; for (var i = 0; i < suishitsu_list.length; i++) { if( typeof suishitsu[i] === "undefined" ){ // Add html_code += ''; continue; } if (buoy == suishitsu_list[i]) { html_code += ''; } else { html_code += ''; } } html_code += ''; html_code += ''; html_code += ''; for (var i = 0; i < suishitsu_list.length; i++) { if( typeof suishitsu[i] === "undefined" ){ // Add html_code += ''; continue; } if (suishitsu[i] == -1) { html_code += ''; continue; } if (suishitsu[i][2] != 'Err') { if (mode == 0) { var value = round_data(suishitsu[i][2], 1); } else { var value = suishitsu[i][2]; } } else { if (!sensor_list[suishitsu_list[i]][2]) { var value = 'NA'; } else { var value = err; } } if (buoy == suishitsu_list[i]) { html_code += ''; } else { html_code += ''; } } html_code += ''; for (var i = 1; i < deep_list.length; i++) { html_code += ''; for (var j = 0; j < suishitsu_list.length; j++) { if( typeof suishitsu[j] === "undefined" ){ // Add continue; } if (suishitsu[j] == -1) continue; var value; switch (deep_list[i]) { case '10m': if (!sensor_list[suishitsu_list[j]][6]) { value = 'NA'; break; } //value = (parseFloat(suishitsu[j][6]) + parseFloat(suishitsu[j][10])) / 2; value = 0; var count = 0; if (suishitsu[j][6] != 'Err') { value += parseFloat(suishitsu[j][6]); count++; } if (suishitsu[j][10] != 'Err') { value += parseFloat(suishitsu[j][10]); count++; } if (count == 0) { value = err; } else { value /= count; value = '' + value; value = round_data(value, 3); if (mode == 0) { value = round_data(value, 1); } } break; case '20m': if (!sensor_list[suishitsu_list[j]][13]) { value = 'NA'; break; } value = suishitsu[j][13]; if (value == 'Err') { value = err; } else { if (mode == 0) { value = round_data(value, 1); } } break; } if (buoy == suishitsu_list[j]) { html_code += ''; } else { html_code += ''; } } html_code += ''; } html_code += ''; html_code += ''; for (var i = 0; i < suishitsu_list.length; i++) { if( typeof suishitsu[i] === "undefined" ){ // Add continue; } if (suishitsu[i] == -1) continue; if (!sensor_list[suishitsu_list[i]][3]) { value = 'NA'; } else { var value = suishitsu[i][3]; if (value == 'Err') { value = err; } else { if (mode == 0) { value = round_data(value, 1); } } } if (buoy == suishitsu_list[i]) { html_code += ''; } else { html_code += ''; } } html_code += ''; for (var i = 1; i < cr_deep.length; i++) { html_code += ''; for (var j = 0; j < suishitsu_list.length; j++) { if( typeof suishitsu[j] === "undefined" ){ // Add continue; } if (suishitsu[j] == -1) continue; if (!sensor_list[suishitsu_list[j]][3 + i * 4]) { value = 'NA'; } else { var value = suishitsu[j][3 + i * 4]; if (value == 'Err') { value = err; } else { if (mode == 0) { value = round_data(value, 1); } } } if (buoy == suishitsu_list[j]) { html_code += ''; } else { html_code += ''; } } html_code += ''; } html_code += ''; html_code += ''; for (var i = 0; i < suishitsu_list.length; i++) { if( typeof suishitsu[i] === "undefined" ){ // Add continue; } if (suishitsu[i] == -1) continue; if (!sensor_list[suishitsu_list[i]][4]) { value = 'NA'; } else { var value = suishitsu[i][4]; if (value == 'Err') { value = err; } else { if (mode == 0) { value = round_data(value, 1); } } } if (buoy == suishitsu_list[i]) { html_code += ''; } else { html_code += ''; } } html_code += ''; for (var i = 1; i < cr_deep.length; i++) { html_code += ''; for (var j = 0; j < suishitsu_list.length; j++) { if( typeof suishitsu[j] === "undefined" ){ // Add continue; } if (suishitsu[j] == -1) continue; if (!sensor_list[suishitsu_list[j]][4 + i * 4]) { value = 'NA'; } else { var value = suishitsu[j][4 + i * 4]; if (value == 'Err') { value = err; } else { if (mode == 0) { value = round_data(value, 1); } } } if (buoy == suishitsu_list[j]) { html_code += ''; } else { html_code += ''; } } html_code += ''; } html_code += ''; html_code += ''; for (var i = 0; i < suishitsu_list.length; i++) { if( typeof suishitsu[i] === "undefined" ){ // Add continue; } if (suishitsu[i] == -1) continue; if (!sensor_list[suishitsu_list[i]][11]) { value = 'NA'; } else { var value = suishitsu[i][11]; if (value == 'Err') { value = err; } else { if (mode == 0) { value = round_data(value, 0); } } } if (buoy == suishitsu_list[i]) { html_code += ''; } else { html_code += ''; } } html_code += ''; for (var i = 1; i < do_deep.length; i++) { html_code += ''; for (var j = 0; j < suishitsu_list.length; j++) { if( typeof suishitsu[j] === "undefined" ){ // Add continue; } if (suishitsu[j] == -1) continue; if (!sensor_list[suishitsu_list[j]][11 + i * 3]) { value = 'NA'; } else { var value = suishitsu[j][11 + i * 3]; if (value == 'Err') { value = err; } else { if (mode == 0) { value = round_data(value, 0); } } } if (buoy == suishitsu_list[j]) { html_code += ''; } else { html_code += ''; } } html_code += ''; } html_code += ''; html_code += ''; for (var i = 0; i < suishitsu_list.length; i++) { if( typeof suishitsu[i] === "undefined" ){ // Add continue; } if (suishitsu[i] == -1) continue; var value = cal_ao(suishitsu[i], do_deep[0], i); if (value != err && value != 'NA') { if (mode == 0) { value = round_data(value, 2); } } if (buoy == suishitsu_list[i]) { html_code += ''; } else { html_code += ''; } } html_code += ''; for (var i = 1; i < do_deep.length; i++) { html_code += ''; for (var j = 0; j < suishitsu_list.length; j++) { if( typeof suishitsu[j] === "undefined" ){ // Add continue; } if (suishitsu[j] == -1) continue; var value = cal_ao(suishitsu[j], do_deep[i], j); if (value != err && value != 'NA') { if (mode == 0) { value = round_data(value, 2); } } if (buoy == suishitsu_list[j]) { html_code += ''; } else { html_code += ''; } } html_code += ''; } if (mode == 1) { html_code += ''; for (var i = 0; i < suishitsu_list.length; i++) { if( typeof suishitsu[i] === "undefined" ){ // Add continue; } if (suishitsu[i] == -1) continue; var value = (parseFloat(suishitsu[i][5]) + parseFloat(suishitsu[i][9]) + parseFloat(suishitsu[i][12]) + parseFloat(suishitsu[i][15])) / 4; value = Math.round(value * 1000) / 1000; value = '' + value; if (value.indexOf('.') == -1) { for (var j = 0; j < 3; j++) { value += '0'; } } else { var sp = value.split('.'); if (sp[1].length < 3) { for (var j = 3; j > sp[1].length; j--) sp[1] += '0'; } value = sp[0] + '.' + sp[1]; } if (buoy == suishitsu_list[i]) { html_code += ''; } else { html_code += ''; } } } document.getElementById('suishitsu_table').innerHTML = html_code; }
場所' + suishitsu_list[i] + kome + '' + suishitsu_list[i] + kome + '
測定日時---
---
' + suishitsu[i][0] + '
' + suishitsu[i][1] + '
' + suishitsu[i][0] + '
' + suishitsu[i][1] + '
水温[℃]' + deep_list[0] + '欠測欠測' + value + '' + value + '
' + deep_list[i] + '' + value + '' + value + '
クロロフィル[ppb]' + cr_deep[0] + '' + value + '' + value + '
' + cr_deep[i] + '' + value + '' + value + '
濁度[FTU]' + cr_deep[0] + '' + value + '' + value + '
' + cr_deep[i] + '' + value + '' + value + '
溶存酸素飽和率[%]' + do_deep[0] + '' + value + '' + value + '
' + do_deep[i] + '' + value + '' + value + '
溶存酸素量[㎎/ℓ]' + do_deep[0] + '' + value + '' + value + '
' + do_deep[i] + '' + value + '' + value + '
電源電圧[V]' + value + '' + value + '