From 834a2ac707a6253893a67ec0b650a1702a7d54bc Mon Sep 17 00:00:00 2001 From: esea_info Date: Fri, 14 Apr 2023 15:47:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B4=E6=9C=88=E6=97=A5=20=E4=BD=8D?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- awrams.py | 21 +++++++++++-------- ...7_12_20_13.csv => 2022_08_17_12_20_13.csv} | 0 ..._info.txt => 2022_08_17_12_20_13_info.txt} | 0 3 files changed, 12 insertions(+), 9 deletions(-) rename data/2022/8/17/17/{2022_8_17_12_20_13.csv => 2022_08_17_12_20_13.csv} (100%) rename data/2022/8/17/17/{2022_8_17_12_20_13_info.txt => 2022_08_17_12_20_13_info.txt} (100%) diff --git a/awrams.py b/awrams.py index 2a714a9..72b97ea 100644 --- a/awrams.py +++ b/awrams.py @@ -571,12 +571,7 @@ class AWRAMS(object): self.output_path = OUTPUT_DIR self.current_filepath = fpath self.current_measure_time = self.hhp.getCurrentMeasureTimeFromPath(fpath) - self.ymdhms = "20"+ str(self.info_dict['year']) + '_' \ - + str(self.info_dict['month']) + '_' \ - + str(self.info_dict['day']) + '_' \ - + str(self.info_dict['hour']) + '_' \ - + str(self.info_dict['minute']) + '_' \ - + str(self.info_dict['second']) + self.get_ymdhms() self.output_path = self.output_path.joinpath( self.ymdhms ) log.debug(f"current_measure_time: {self.current_measure_time}", __name__, "dealOneHandheldMeasurement") @@ -585,6 +580,14 @@ class AWRAMS(object): self.real_wavelength = self.getWavelenthDict() self.dealOneGroup() + def get_ymdhms(self, ): + self.ymdhms = "20"+ f"{self.info_dict['year']:02d}" + '_' \ + + f"{self.info_dict['month']:02d}" + '_' \ + + f"{self.info_dict['day']:02d}" + '_' \ + + f"{self.info_dict['hour']:02d}" + '_' \ + + f"{self.info_dict['minute']:02d}" + '_' \ + + f"{self.info_dict['second']:02d}" + def dealOneMeasurement_Online(self, ): '''handheld一次测量包含多组数据''' # 调用handheldbuf 处理,将一组数据提交出来 @@ -593,7 +596,7 @@ class AWRAMS(object): # 当前文件名 self.output_path = self.new_folder # self.current_measure_time = self.hhp.getCurrentMeasureTimeFromPath(fpath) - self.ymdhms = self.getTimeFnameFromInfoDict() + self.get_ymdhms() # getBuf self.get_sensor_buf() @@ -739,14 +742,14 @@ class AWRAMS(object): self.mydir.setHeader( self.wavelength.tolist(), TOKEN, "device_id_"+str(self.device_id) ) header = self.mydir.header_str - save_path_csv = self.new_folder.joinpath(time_name + SAVE_EXT_NAME) + save_path_csv = self.new_folder.joinpath(self.ymdhms + SAVE_EXT_NAME) data_str = "" for k in self.res.keys(): self.mydir.setContent(self.res[k].tolist(),TOKEN,k ) data_str = data_str + NEWLINE + self.mydir.content_str save_path_csv.write_text(header+data_str) - path_info_txt = self.new_folder.joinpath( time_name + "_info.txt" ) + path_info_txt = self.new_folder.joinpath( self.ymdhms + "_info.txt" ) self.save_dict_to_file( self.info_dict, path_info_txt ) self.do_retrieve() diff --git a/data/2022/8/17/17/2022_8_17_12_20_13.csv b/data/2022/8/17/17/2022_08_17_12_20_13.csv similarity index 100% rename from data/2022/8/17/17/2022_8_17_12_20_13.csv rename to data/2022/8/17/17/2022_08_17_12_20_13.csv diff --git a/data/2022/8/17/17/2022_8_17_12_20_13_info.txt b/data/2022/8/17/17/2022_08_17_12_20_13_info.txt similarity index 100% rename from data/2022/8/17/17/2022_8_17_12_20_13_info.txt rename to data/2022/8/17/17/2022_08_17_12_20_13_info.txt