diff --git a/data/2023/03/20/37/info.bin b/data/2023/03/20/37/info.bin new file mode 100644 index 0000000..aff7373 Binary files /dev/null and b/data/2023/03/20/37/info.bin differ diff --git a/data/2023/03/20/37/sensor.bin b/data/2023/03/20/37/sensor.bin new file mode 100644 index 0000000..84c1b09 Binary files /dev/null and b/data/2023/03/20/37/sensor.bin differ diff --git a/handheld.py b/handheld.py index 433b7eb..203c051 100644 --- a/handheld.py +++ b/handheld.py @@ -390,9 +390,9 @@ class Handheld(object): def getNewFolderFromOldFolder( self, ) -> Path: # 服务器上转移后的模式 tmp_folder = self.old_folder.parent.parent - path_tuple = ("20"+str(self.info_dict['year']) - ,str(self.info_dict['month']) - ,str(self.info_dict['day']) + path_tuple = ("20"+f"{self.info_dict['year']:02d}" + ,f"{self.info_dict['month']:02d}" + ,f"{self.info_dict['day']:02d}" ,self.old_folder.parts[-1] ) self.new_folder =tmp_folder.joinpath(*path_tuple) self.mydir.setBaseDir(self.new_folder) @@ -412,6 +412,12 @@ class Handheld(object): + str(self.info_dict['hour']) + ':' \ + str(self.info_dict['minute']) + ':' \ + str(self.info_dict['second']) + # ret = "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}" return ret pass @@ -490,12 +496,7 @@ class Handheld(object): self.hhp.setMode(1) self.current_measure_time = self.getCurrentMeasureTimeFromInfoDict() - 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 定位到 /data/output 目录? self.output_path = OUTPUT_DIR.joinpath( self.ymdhms) @@ -624,6 +625,14 @@ class Handheld(object): self.hhb.write_buf(buf) pass + 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 getTimeFnameFromInfoDict(self,) : ymdhms = "20"+ str(self.info_dict['year']) + '_' \ + str(self.info_dict['month']) + '_' \