From 25a895d6836f37f58a45e79f5828bba3e45f4bc4 Mon Sep 17 00:00:00 2001 From: En Shih Date: Tue, 17 May 2016 00:04:23 +0800 Subject: [PATCH] Release 2016/5/17 --- cfsr/convert/main.cpp | 10 ++++----- html/index.html | 12 ++++++----- html/src/main.js | 48 +++++++++++++++++++++++++++++++++++-------- 3 files changed, 51 insertions(+), 19 deletions(-) diff --git a/cfsr/convert/main.cpp b/cfsr/convert/main.cpp index 82221e5..96d1939 100644 --- a/cfsr/convert/main.cpp +++ b/cfsr/convert/main.cpp @@ -6,16 +6,16 @@ int main() { - SetConsoleOutputCP(65001); + SetConsoleOutputCP(950); printf( "\n" - "*************** csv->CFSR檔案轉換程式 ***************\n" + "*************** csv->CFSRɮഫ{ ***************\n" " 2016/5/16\n" - " En Shih (石恩)\n" + " En Shih (ۮ)\n" "\n\n"); - printf("檔案轉換中,請稍候\n\n"); + printf("ɮഫAеy... ...\n\n"); for (int i=1; i<=12; i++) { @@ -25,7 +25,7 @@ int main() convertCFSR(CFSR_V, i); } - printf("檔案轉換完畢\n"); + printf("ɮഫ\n"); return 0; } diff --git a/html/index.html b/html/index.html index ff98a63..0691667 100644 --- a/html/index.html +++ b/html/index.html @@ -143,9 +143,11 @@
- 1979~2009 平均資料
- 1979~2009 連續資料
- 單年資料: + 1979~2009 平均資料
+ + + 單年資料: 1979
+ 單年資料: 1982
起始日期: @@ -177,8 +179,8 @@
- -
+ +
專案:
diff --git a/html/src/main.js b/html/src/main.js index 68e4067..022ffe7 100644 --- a/html/src/main.js +++ b/html/src/main.js @@ -1,6 +1,6 @@ "use strict"; -var container, controls, info, outputlist, doConnect, icolor, iyear, heading, project; +var container, controls, info, outputlist, doConnect, icolor, iyear, heading, project, dataset_avg, dataset_1979, dataset_1982; var startdate, enddate, days; var wsClient; var voyage = []; @@ -21,6 +21,10 @@ function main() heading = document.getElementById("heading"); project = document.getElementById("project"); + dataset_avg = document.getElementById("dataset_avg"); + dataset_1979 = document.getElementById("dataset_1979"); + dataset_1982 = document.getElementById("dataset_1982"); + //alert(icolor.value); wsClient = new WsClient(); @@ -32,20 +36,38 @@ function main() function setParam(e) { if(e.name) wsClient.send(e.name + "= " + e.value); - if(e == iyear) - { - startdate.min = e.value + "-01-01"; - startdate.value = e.value + "-01-01"; - startdate.max = (e.value+1) + "-12-31"; - setDays(); - wsClient.send(startdate.name + "= " + startdate.value); - } + if(e == heading) { if(heading.value<0) heading.value = Number(heading.value) + 360; heading.value = heading.value%360; wsClient.send("dir= " + Math.sin(heading.value*Math.PI/180.0) + " " + Math.cos(heading.value*Math.PI/180.0)); } + + var year; + if (dataset_avg.checked) + { + wsClient.send("dataset= 2"); year = 9999; + } + if (dataset_1979.checked) + { + wsClient.send("dataset= 2"); year = 1979; + } + if (dataset_1982.checked) + { + wsClient.send("dataset= 2"); year = 1982; + } + + if(e == dataset_avg || e == dataset_1979 || e == dataset_1982) + { + startdate.min = year + "-01-01"; + startdate.value = year + "-01-01"; + startdate.max = (year+1) + "-12-31"; + setDays(); + enddate.min = startdate.value; + enddate.max = (year+1) + "-12-31"; + wsClient.send(startdate.name + "= " + startdate.value); + } } function setStartDate() { setEndDate(); enddate.min = startdate.value; if (new Date(enddate.value).getTime() < new Date(startdate.value).getTime()) enddate.value = startdate.value; setParam(enddate); } function setEndDate() { days.value = Math.ceil((new Date(enddate.value).getTime() - new Date(startdate.value).getTime())/86400000); setParam(days); } @@ -72,4 +94,12 @@ function newRecord() project.innerHTML = projectName; wsClient.send("project= " + projectName); } + + for (var n=0; n