00001 // 繝�繝シ繧ソ譬シ邏�/繝輔ぃ繧、繝ォ蜃コ蜉帙け繝ゥ繧ケ 00002 // 2011/02/20 Yuki YOKOKURA 00003 // 00004 // 繝�繝シ繧ソ繧剃ク�譎ら噪縺ォ譬シ邏阪@�シ靴SV/TAB蛹コ蛻�繧灰AT繝輔ぃ繧、繝ォ縺ィ縺励※蜃コ蜉帙@縺セ縺吶�� 00005 // 00006 // Copyright (C) 2011 Yuki YOKOKURA 00007 // This program is free software; 00008 // you can redistribute it and/or modify it under the terms of the GNU General Public License 00009 // as published by the Free Software Foundation; either version 3 of the License, or any later version. 00010 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00011 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 // See the GNU General Public License for more details <http://www.gnu.org/licenses/>. 00013 // Besides, you can negotiate about other options of licenses instead of GPL. 00014 // If you would like to get other licenses, please contact us<yuki@katsura.sd.keio.ac.jp>. 00015 00016 #ifndef DATASTORAGE 00017 #define DATASTORAGE 00018 00019 #include <fstream> 00020 00021 namespace ARCS { // ARCS蜷榊燕遨コ髢� 00022 enum SaveType { 00023 STRG_FORMAT_CSV, // CSV繝輔ぃ繧、繝ォ縺ィ縺励※菫晏ュ� 00024 STRG_FORMAT_DAT, // DAT(繧ソ繝門玄蛻�繧�)繝輔ぃ繧、繝ォ縺ィ縺励※菫晏ュ� 00025 }; 00026 00027 class DataStorage { 00028 private: 00029 DataStorage(const DataStorage&); // 繧ウ繝斐�シ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ菴ソ逕ィ遖∵ュ「 00030 const DataStorage& operator=(const DataStorage&); // 莉」蜈・貍皮ョ怜ュ蝉スソ逕ィ遖∵ュ「 00031 const unsigned int N; // 譬シ邏阪☆繧句、画焚縺ョ謨ー 00032 const unsigned long Ts; // [ns] 繧オ繝ウ繝励Μ繝ウ繧ー譎る俣 00033 const double Tend; // [s] 菫晏ュ倥☆繧区凾髢� 00034 const unsigned long tlen; // 菫晏ュ倥☆繧玖ヲ∫エ�謨ー 00035 double** Data; // 繝�繝シ繧ソ譬シ邏咲畑螟画焚 00036 unsigned long count; // 隕∫エ�謨ー繧ォ繧ヲ繝ウ繧ソ 00037 00038 public: 00039 DataStorage(const unsigned int NumOfVar, const unsigned long SmplTime, const double SaveTime); 00040 // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ NumOfVar�シ帛、画焚縺ョ謨ー�シ郡mplTime�シ媼ns] 蛻カ蠕。蜻ィ譛滂シ郡aveTime�シ媼s] 菫晏ュ俶凾髢� 00041 ~DataStorage(); // 繝�繧ケ繝医Λ繧ッ繧ソ 00042 void PutData(double* Value, unsigned int NumOfVar); // 繝�繝シ繧ソ縺ョ譬シ邏� Value�シ帙ョ繝シ繧ソ蛟、�シ君umOfVar�シ帛、画焚縺ョ謨ー 00043 bool SaveDataFile(const char* const FileName, const SaveType FileType); 00044 // CSV/DAT繝輔ぃ繧、繝ォ縺ョ菫晏ュ� FileName�シ帙ヵ繧。繧、繝ォ蜷搾シ熊ileType�シ帙ヵ繧。繧、繝ォ蠖「蠑擾シ梧綾繧雁�、�シ孚rue=螳御コ��シ掲alse=螟ア謨� 00045 void ClearCounter(void); // 隕∫エ�謨ー繧ォ繧ヲ繝ウ繧ソ繧偵け繝ェ繧「 00046 }; 00047 } 00048 00049 #endif 00050 00051 00052