def update_season_end_date(end_date): query = f"Update SystemInputTags set DefaultValue = \"{end_date}\" where Description=\"BatSeasonEndDate\"" execute_database_query(query) query = f"Update MultipleSeasonDefaultValues set EndTimePeriod = \"{end_date}\" where EnableForPeriod=\"True\"" execute_database_query(query) end_date_datetime = datetime.datetime.strptime( f"{end_date}/{datetime.datetime.now().year}", "%m/%d/%Y") timedelta = datetime.timedelta(days=1) row = DatabaseInteractor.read_database_query(( "select rowid from MultipleSeasonDefaultValues where EnableForPeriod =\"True\"" )) + 1 next_start_date = (end_date_datetime + timedelta).strftime("%m/%d") query = f"Update MultipleSeasonDefaultValues set StartTimePeriod = \"{next_start_date}\" where rowid=\"{row}\"" execute_database_query(query)
def update_utc(utc): query = f"Update SystemInputTags set DefaultValue = \"{utc}\" where Description=\"UTCOffset\"" execute_database_query(query)
def update_longtitude(lon): query = f"Update SystemInputTags set DefaultValue = \"{lon}\" where Description=\"Lon\"" execute_database_query(query)
def update_latitude(lat): query = f"Update SystemInputTags set DefaultValue = \"{lat}\" where Description=\"Lat\"" execute_database_query(query)
def update_site_name(site_name): query = f"Update SystemInputTags set DefaultValue = \"{site_name}\" where Description=\"SitePrefix\"" execute_database_query(query)
def only_one_met_tower_at_site(num_met_tower): if num_met_tower == '1': query = f"Delete from MetTowerInputTags where MetId==\"Met2\"" execute_database_query(query) query = f"Delete from MetTowerOutputTags where MetId==\"Met2\"" execute_database_query(query)