年月日 位数修复

server
esea_info 3 years ago
parent 2f77cd771e
commit 867b283209
  1. BIN
      data/2023/03/20/37/info.bin
  2. BIN
      data/2023/03/20/37/sensor.bin
  3. 27
      handheld.py

Binary file not shown.

Binary file not shown.

@ -390,9 +390,9 @@ class Handheld(object):
def getNewFolderFromOldFolder( self, ) -> Path: def getNewFolderFromOldFolder( self, ) -> Path:
# 服务器上转移后的模式 # 服务器上转移后的模式
tmp_folder = self.old_folder.parent.parent tmp_folder = self.old_folder.parent.parent
path_tuple = ("20"+str(self.info_dict['year']) path_tuple = ("20"+f"{self.info_dict['year']:02d}"
,str(self.info_dict['month']) ,f"{self.info_dict['month']:02d}"
,str(self.info_dict['day']) ,f"{self.info_dict['day']:02d}"
,self.old_folder.parts[-1] ) ,self.old_folder.parts[-1] )
self.new_folder =tmp_folder.joinpath(*path_tuple) self.new_folder =tmp_folder.joinpath(*path_tuple)
self.mydir.setBaseDir(self.new_folder) self.mydir.setBaseDir(self.new_folder)
@ -412,6 +412,12 @@ class Handheld(object):
+ str(self.info_dict['hour']) + ':' \ + str(self.info_dict['hour']) + ':' \
+ str(self.info_dict['minute']) + ':' \ + str(self.info_dict['minute']) + ':' \
+ str(self.info_dict['second']) + 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 return ret
pass pass
@ -490,12 +496,7 @@ class Handheld(object):
self.hhp.setMode(1) self.hhp.setMode(1)
self.current_measure_time = self.getCurrentMeasureTimeFromInfoDict() self.current_measure_time = self.getCurrentMeasureTimeFromInfoDict()
self.ymdhms = "20"+ str(self.info_dict['year']) + '_' \ self.get_ymdhms()
+ 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.output_path 定位到 /data/output 目录? # self.output_path 定位到 /data/output 目录?
self.output_path = OUTPUT_DIR.joinpath( self.ymdhms) self.output_path = OUTPUT_DIR.joinpath( self.ymdhms)
@ -624,6 +625,14 @@ class Handheld(object):
self.hhb.write_buf(buf) self.hhb.write_buf(buf)
pass 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,) : def getTimeFnameFromInfoDict(self,) :
ymdhms = "20"+ str(self.info_dict['year']) + '_' \ ymdhms = "20"+ str(self.info_dict['year']) + '_' \
+ str(self.info_dict['month']) + '_' \ + str(self.info_dict['month']) + '_' \

Loading…
Cancel
Save