Browse Source

Add 2-Year and 5-Year Timespan

JDierkse 10 months ago
parent
commit
7be3ea94d1
2 changed files with 3 additions and 1 deletions
  1. 1 1
      DataInterface/DataCondenser.cpp
  2. 2 0
      DataInterface/GraphClient.cpp

+ 1 - 1
DataInterface/DataCondenser.cpp

@@ -359,7 +359,7 @@ void DataCondenser::CleanData(const RRA::type& rra)
 	std::string table = GetDestinationTable(rra);
 	std::string table = GetDestinationTable(rra);
 	int periodInSeconds = static_cast<int>(rra) * 400;
 	int periodInSeconds = static_cast<int>(rra) * 400;
 	if (rra == RRA::Yearly)
 	if (rra == RRA::Yearly)
-		periodInSeconds *= 5;
+		periodInSeconds *= 10;
 
 
 	int timestamp = DateTime::GetTimestamp() + DateTime::GetUTCOffset() - periodInSeconds;
 	int timestamp = DateTime::GetTimestamp() + DateTime::GetUTCOffset() - periodInSeconds;
 
 

+ 2 - 0
DataInterface/GraphClient.cpp

@@ -37,6 +37,8 @@ nlohmann::json GraphClient::GetGraphData(int deviceId, const std::vector<int>& d
 			table = "datalog-monthly";
 			table = "datalog-monthly";
 			break;
 			break;
 		case DataStorage::Timespan::Year:
 		case DataStorage::Timespan::Year:
+		case DataStorage::Timespan::_2_Year:
+		case DataStorage::Timespan::_5_Year:
 			table = "datalog-yearly";
 			table = "datalog-yearly";
 			break;
 			break;
 		default:
 		default: