Skip to content

Commit

Permalink
remove extra ens
Browse files Browse the repository at this point in the history
  • Loading branch information
MAnn223 committed Jul 22, 2024
1 parent 15909ec commit 6bccbe6
Showing 1 changed file with 2 additions and 52 deletions.
54 changes: 2 additions & 52 deletions src/ensembles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ static void SS_ensemble07Init(DeploymentSchedule_t* pDeployment);
static void SS_ensemble08Func(DeploymentSchedule_t* pDeployment);
static void SS_ensemble08Init(DeploymentSchedule_t* pDeployment);

static void SS_ensemble01Func(DeploymentSchedule_t* pDeployment);
static void SS_ensemble01Init(DeploymentSchedule_t* pDeployment);

static void SS_fwVerInit(DeploymentSchedule_t* pDeployment);
static void SS_fwVerFunc(DeploymentSchedule_t* pDeployment);

Expand Down Expand Up @@ -57,17 +54,12 @@ typedef struct Ensemble07_eventData_
uint32_t accumulateCount;
}Ensemble07_eventData_t;

typedef struct Ensemble01_eventData_
{
double temperature;
int16_t water;
uint32_t accumulateCount;
}Ensemble01_eventData_t;


static Ensemble10_eventData_t ensemble10Data;
static Ensemble07_eventData_t ensemble07Data;
static Ensemble08_eventData_t ensemble08Data;
static Ensemble01_eventData_t ensemble01Data;


static void SS_ensemble10Init(DeploymentSchedule_t* pDeployment)
{
Expand All @@ -87,12 +79,6 @@ static void SS_ensemble08Init(DeploymentSchedule_t* pDeployment)
pDeployment->state.pData = &ensemble08Data;
}

static void SS_ensemble01Init(DeploymentSchedule_t* pDeployment)
{
memset(&ensemble01Data, 0, sizeof(Ensemble01_eventData_t));
pDeployment->state.pData = &ensemble01Data;
}

static void SS_ensemble10Func(DeploymentSchedule_t* pDeployment)
{
float temp;
Expand Down Expand Up @@ -273,43 +259,7 @@ static void SS_ensemble08Func(DeploymentSchedule_t* pDeployment)
}

}
static void SS_ensemble01Func(DeploymentSchedule_t* pDeployment)
{
float temp;
uint8_t water;
Ensemble01_eventData_t* pData = (Ensemble01_eventData_t*) pDeployment->state.pData;
#pragma pack(push, 1)
struct{
EnsembleHeader_t header;
Ensemble08_data_t ensData;
}ens;
#pragma pack(pop)

// obtain measurements
temp = pSystemDesc->pTempSensor->getTemp();

// accumulate measurements
pData->temperature += temp;
pData->accumulateCount++;

// Report accumulated measurements
if(pData->accumulateCount == pDeployment->measurementsToAccumulate)
{
water = pData->water / pDeployment->measurementsToAccumulate;
temp = pData->temperature / pDeployment->measurementsToAccumulate;
if(water == false)
{
temp -= 100;
}

ens.header.elapsedTime_ds = Ens_getStartTime(pDeployment->state.deploymentStartTime);
ens.header.ensembleType = ENS_TEMP_TIME;
ens.ensData.rawTemp = N_TO_B_ENDIAN_2(temp / 0.0078125);

pSystemDesc->pRecorder->putData(ens);
memset(pData, 0, sizeof(Ensemble01_eventData_t));
}
}
static void SS_fwVerInit(DeploymentSchedule_t* pDeployment)
{
(void) pDeployment;
Expand Down

0 comments on commit 6bccbe6

Please sign in to comment.