########################################################################### # # Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # @file set_RTCs.py # # @date 05-Aug-2020 # @author S. Nash # # @brief This script sets the RTC (clock) for the HD and DG to the current # date and time. # ############################################################################ import sys sys.path.append("..") from dialin.hd.hemodialysis_device import HD from dialin.dg.dialysate_generator import DG from time import sleep from time import time from time import localtime if __name__ == "__main__": # create an HD object called hd hd = HD() # create a DG object called dg dg = DG() sleep(2) current_time_stamp = time() current_time = localtime(current_time_stamp) print(current_time) hd.rtc.cmd_set_rtc_time_and_date(current_time.tm_sec, current_time.tm_min, current_time.tm_hour, current_time.tm_mday, current_time.tm_mon, current_time.tm_year) #TODO - set DG clock when supported