From b5a9d3646ba15c4a4895f04f66c96fb2ba60c9fe Mon Sep 17 00:00:00 2001
From: Carl Philipp Klemm <philipp@uvos.xyz>
Date: Mon, 6 May 2024 11:29:41 +0200
Subject: [PATCH] skip some msurements on devices where paramters dont vary

---
 expirament.cpp | 27 ++++++++++++++++++---------
 expirament.h   |  2 +-
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/expirament.cpp b/expirament.cpp
index 3cee48c..538967b 100644
--- a/expirament.cpp
+++ b/expirament.cpp
@@ -89,10 +89,21 @@ bool Expirament::run(size_t startstep, size_t substep)
 	return true;
 }
 
-bool Expirament::takeMesurements()
+bool Expirament::takeMesurements(bool onlyTVariing)
 {
 	for(size_t i = 0; i < coinCells->size(); ++i)
 	{
+		if(onlyTVariing)
+		{
+			switch(i)
+			{
+				case 0 ... 10:
+					break;
+				default:
+					Log(Log::INFO)<<"Skipping EIS for cell "<<i<<" as we are only mesureing cells with varieng temperature";
+					continue;
+			}
+		}
 		std::stringstream userstrss;
 		std::stringstream filenamess;
 
@@ -141,7 +152,7 @@ bool Expirament::heatMeasureSeq(float fraction)
 	std::this_thread::sleep_for(std::chrono::seconds(120));
 
 	Log(Log::INFO)<<"Takeing mesurements";
-	ret = takeMesurements();
+	ret = takeMesurements(fraction != 0.0f);
 	if(!ret)
 	{
 		Log(Log::ERROR)<<"Takeing mesurements failed in globalsetp "<<globalstep;
@@ -248,13 +259,13 @@ void Expirament::setTemperatures(float fraction)
 				coinCells->at(i)->setTemperature(35+10*fraction);
 				break;
 			case 11 ... 13:
-				coinCells->at(i)->setTemperature(35+10*fraction);
+				coinCells->at(i)->setTemperature(35);
 				break;
 			case 14 ... 17:
-				coinCells->at(i)->setTemperature(55);
+				coinCells->at(i)->setTemperature(45);
 				break;
 			case 18 ... 20:
-				coinCells->at(i)->setTemperature(35);
+				coinCells->at(i)->setTemperature(55);
 				break;
 			default:
 				break;
@@ -285,8 +296,7 @@ bool Expirament::charge(float fraction, bool all)
 			switch(i)
 			{
 				case 0 ... 3:
-				case 7 ... 10:
-				case 14 ... 17:
+				case 7 ... 20:
 				{
 					bool ret = coinCells->at(i)->setConnected(true);
 					if(!ret)
@@ -350,8 +360,7 @@ bool Expirament::capacityMesureCycle()
 		switch(i)
 		{
 			case 0 ... 3:
-			case 7 ... 10:
-			case 14 ... 17:
+			case 7 ... 20:
 				ret = chargeCellToVoltage(i, coinCells->at(i)->getFullVoltage(),
 				                    "single_cell_charge_"+std::to_string(getGlobalstep())+"_");
 				if(!ret)
diff --git a/expirament.h b/expirament.h
index a09ff76..56cce8c 100644
--- a/expirament.h
+++ b/expirament.h
@@ -31,7 +31,7 @@ private:
 
 	void setTemperatures(float fraction);
 
-	bool takeMesurements();
+	bool takeMesurements(bool onlyTVariing = false);
 
 	bool heatMeasureSeq(float fraction);
 
-- 
GitLab