@@ -599,6 +599,8 class ParamWriter(Operation): | |||
|
599 | 599 | |
|
600 | 600 | currentDay = None |
|
601 | 601 | |
|
602 | lastTime = None | |
|
603 | ||
|
602 | 604 | def __init__(self): |
|
603 | 605 | |
|
604 | 606 | Operation.__init__(self) |
@@ -792,16 +794,29 class ParamWriter(Operation): | |||
|
792 | 794 | grp.create_dataset(self.metadataList[i], data=getattr(self.dataOut, self.metadataList[i])) |
|
793 | 795 | return |
|
794 | 796 | |
|
795 |
def |
|
|
797 | def timeFlag(self): | |
|
798 | currentTime = self.dataOut.utctime | |
|
796 | 799 | |
|
797 | timeTuple = time.localtime(self.dataOut.utctime) | |
|
800 | if self.lastTime is None: | |
|
801 | self.lastTime = currentTime | |
|
802 | ||
|
803 | #Day | |
|
804 | timeTuple = time.localtime(currentTime) | |
|
798 | 805 | dataDay = timeTuple.tm_yday |
|
799 | 806 | |
|
800 | if dataDay == self.currentDay: | |
|
801 | return False | |
|
807 | #Time | |
|
808 | timeDiff = currentTime - self.lastTime | |
|
802 | 809 | |
|
810 | #Si el dia es diferente o si la diferencia entre un dato y otro supera la hora | |
|
811 | if dataDay != self.currentDay: | |
|
803 | 812 | self.currentDay = dataDay |
|
804 | 813 | return True |
|
814 | elif timeDiff > 3*60*60: | |
|
815 | self.lastTime = currentTime | |
|
816 | return True | |
|
817 | else: | |
|
818 | self.lastTime = currentTime | |
|
819 | return False | |
|
805 | 820 | |
|
806 | 821 | def setNextFile(self): |
|
807 | 822 | |
@@ -916,7 +931,7 class ParamWriter(Operation): | |||
|
916 | 931 | |
|
917 | 932 | def putData(self): |
|
918 | 933 | |
|
919 |
if self.blockIndex == self.blocksPerFile or self. |
|
|
934 | if self.blockIndex == self.blocksPerFile or self.timeFlag(): | |
|
920 | 935 | self.setNextFile() |
|
921 | 936 | |
|
922 | 937 | # if not self.firsttime: |
General Comments 0
You need to be logged in to leave comments.
Login now