void avgVariableDataValues(int athleteSelected) { foreach (StartPageSessionData sessionData in _sessionDataList) { _initialSummary = addSessionData(_initialSummary, sessionData.StartInitialData); _finalSummary = addSessionData(_finalSummary, sessionData.StartFinalData); _modelSummary = addSessionData(_modelSummary, sessionData.StartModelData); } _initialSummary = avgVairableData(_initialSummary, _initialCount); _finalSummary = avgVairableData(_finalSummary, _finalCount); _modelSummary = avgVairableData(_modelSummary, _modelCount); }
StartInitialData addSessionData(StartInitialData inVariableData, StartInitialData newVariableData) { inVariableData.SetFrontBlockDistanceI += newVariableData.SetFrontBlockDistanceI; inVariableData.SetRearBlockDistanceI += newVariableData.SetRearBlockDistanceI; inVariableData.SetFrontULAngleI += newVariableData.SetFrontULAngleI; inVariableData.SetRearULAngleI += newVariableData.SetRearULAngleI; inVariableData.SetFrontLLAngleI += newVariableData.SetFrontLLAngleI; inVariableData.SetRearLLAngleI += newVariableData.SetRearLLAngleI; inVariableData.SetTrunkAngleI += newVariableData.SetTrunkAngleI; inVariableData.SetCOGDistanceI += newVariableData.SetCOGDistanceI; inVariableData.BCRearFootClearanceTimeI += newVariableData.BCRearFootClearanceTimeI; inVariableData.BCFrontFootClearanceTimeI += newVariableData.BCFrontFootClearanceTimeI; inVariableData.BCRearLLAngleTakeoffI += newVariableData.BCRearLLAngleTakeoffI; inVariableData.BCFrontLLAngleTakeoffI += newVariableData.BCFrontLLAngleTakeoffI; inVariableData.BCTrunkAngleTakeoffI += newVariableData.BCTrunkAngleTakeoffI; inVariableData.BCLLAngleACI += newVariableData.BCLLAngleACI; inVariableData.BCAirTimeI += newVariableData.BCAirTimeI; inVariableData.BCStrideLengthI += newVariableData.BCStrideLengthI; inVariableData.Step1COGDistanceI += newVariableData.Step1COGDistanceI; inVariableData.Step1LLAngleTakeoffI += newVariableData.Step1LLAngleTakeoffI; inVariableData.Step1TrunkAngleTakeoffI += newVariableData.Step1TrunkAngleTakeoffI; inVariableData.Step1LLAngleACI += newVariableData.Step1LLAngleACI; inVariableData.Step1GroundTimeI += newVariableData.Step1GroundTimeI; inVariableData.Step1AirTimeI += newVariableData.Step1AirTimeI; inVariableData.Step1StrideLengthI += newVariableData.Step1StrideLengthI; inVariableData.Step2COGDistanceI += newVariableData.Step2COGDistanceI; inVariableData.Step2LLAngleTakeoffI += newVariableData.Step2LLAngleTakeoffI; inVariableData.Step2TrunkAngleTakeoffI += newVariableData.Step2TrunkAngleTakeoffI; inVariableData.Step2LLAngleACI += newVariableData.Step2LLAngleACI; inVariableData.Step2GroundTimeI += newVariableData.Step2GroundTimeI; inVariableData.Step2AirTimeI += newVariableData.Step2AirTimeI; inVariableData.Step2StrideLengthI += newVariableData.Step2StrideLengthI; inVariableData.Step3COGDistanceI += newVariableData.Step3COGDistanceI; inVariableData.TimeTo3mI += newVariableData.TimeTo3mI; inVariableData.TimeTo5mI += newVariableData.TimeTo5mI; return(inVariableData); }
string anyVairableDataZero(StartInitialData inVarirableData, int totalCount, string _type) { string listOfVariableWithZero = ""; //MissingVariableStart MISSV = new MissingVariableStart(); if (totalCount > 1) { if (inVarirableData.SetFrontBlockDistanceI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "SetFrontBlockDistance"; missingVariableStar.Add(MISSV); } if (inVarirableData.SetRearBlockDistanceI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "SetRearBlockDistance"; missingVariableStar.Add(MISSV); } if (inVarirableData.SetFrontULAngleI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "SetFrontULAngle"; missingVariableStar.Add(MISSV); } if (inVarirableData.SetRearULAngleI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "SetRearULAngle"; missingVariableStar.Add(MISSV); } if (inVarirableData.SetFrontLLAngleI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "SetFrontLLAngle"; missingVariableStar.Add(MISSV); } if (inVarirableData.SetRearLLAngleI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "SetFrontBlockDistance"; missingVariableStar.Add(MISSV); } if (inVarirableData.SetTrunkAngleI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "SetTrunkAngle"; missingVariableStar.Add(MISSV); } if (inVarirableData.SetCOGDistanceI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "SetCOGDistance"; missingVariableStar.Add(MISSV); } if (inVarirableData.BCRearFootClearanceTimeI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "BCRearFootClearanceTime"; missingVariableStar.Add(MISSV); } if (inVarirableData.BCFrontFootClearanceTimeI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "BCFrontFootClearanceTime"; missingVariableStar.Add(MISSV); } if (inVarirableData.BCRearLLAngleTakeoffI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "BCRearLLAngleTakeoff"; missingVariableStar.Add(MISSV); } if (inVarirableData.BCFrontLLAngleTakeoffI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "BCFrontLLAngleTakeoff"; missingVariableStar.Add(MISSV); } if (inVarirableData.BCTrunkAngleTakeoffI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "SetFrontBlockDistance"; missingVariableStar.Add(MISSV); } if (inVarirableData.BCLLAngleACI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "BCLLAngleAC"; missingVariableStar.Add(MISSV); } if (inVarirableData.BCAirTimeI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "BCAirTime"; missingVariableStar.Add(MISSV); } //if (inVarirableData.BCStrideLengthI == 0) //{ // listOfVariableWithZero = "BC Stride Length"; // sendNotFoundEmail("This varibale has 0 value ...!" + listOfVariableWithZero, listOfVariableWithZero); //} if (inVarirableData.Step1COGDistanceI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step1COGDistance"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step1LLAngleTakeoffI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step1LLAngleTakeoff"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step1TrunkAngleTakeoffI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step1TrunkAngleTakeoff"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step1LLAngleACI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step1LLAngleAC"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step1GroundTimeI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step1GroundTime"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step1AirTimeI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); listOfVariableWithZero = "Step1AirTime"; MISSV.type = _type; MISSV.variableName = "SetFrontBlockDistance"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step1StrideLengthI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step1StrideLength"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step2COGDistanceI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step2COGDistance"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step2LLAngleTakeoffI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step2LLAngleTakeoff"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step2TrunkAngleTakeoffI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.variableName = "Step2TrunkAngleTakeoff"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step2LLAngleACI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step2LLAngleAC"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step2GroundTimeI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step2GroundTime"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step2AirTimeI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step2AirTime"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step2StrideLengthI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step2StrideLength"; missingVariableStar.Add(MISSV); } if (inVarirableData.Step3COGDistanceI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "Step3COGDistance"; missingVariableStar.Add(MISSV); } if (inVarirableData.TimeTo3mI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "TimeTo3m"; missingVariableStar.Add(MISSV); } if (inVarirableData.TimeTo5mI == 0) { MissingVariableStart MISSV = new MissingVariableStart(); MISSV.type = _type; MISSV.variableName = "TimeTo5m"; missingVariableStar.Add(MISSV); } } return(listOfVariableWithZero); }
StartInitialData avgVairableData(StartInitialData inVariableData, int totalCount) { if (totalCount > 1) { inVariableData.SetFrontBlockDistanceI = roundDecimal(inVariableData.SetFrontBlockDistanceI / totalCount); inVariableData.SetRearBlockDistanceI = roundDecimal(inVariableData.SetRearBlockDistanceI / totalCount); inVariableData.SetFrontULAngleI = roundInteger((decimal)inVariableData.SetFrontULAngleI / totalCount); inVariableData.SetRearULAngleI = roundInteger((decimal)inVariableData.SetRearULAngleI / totalCount); inVariableData.SetFrontLLAngleI = roundInteger((decimal)inVariableData.SetFrontLLAngleI / totalCount); inVariableData.SetRearLLAngleI = roundInteger((decimal)inVariableData.SetRearLLAngleI / totalCount); inVariableData.SetTrunkAngleI = roundInteger((decimal)inVariableData.SetTrunkAngleI / totalCount); inVariableData.SetCOGDistanceI = roundDecimal(inVariableData.SetCOGDistanceI / totalCount); inVariableData.BCRearFootClearanceTimeI = roundDecimal(inVariableData.BCRearFootClearanceTimeI / totalCount); inVariableData.BCFrontFootClearanceTimeI = roundDecimal(inVariableData.BCFrontFootClearanceTimeI / totalCount); inVariableData.BCRearLLAngleTakeoffI = roundInteger((decimal)inVariableData.BCRearLLAngleTakeoffI / totalCount); inVariableData.BCFrontLLAngleTakeoffI = roundInteger((decimal)inVariableData.BCFrontLLAngleTakeoffI / totalCount); inVariableData.BCTrunkAngleTakeoffI = roundInteger((decimal)inVariableData.BCTrunkAngleTakeoffI / totalCount); inVariableData.BCLLAngleACI = roundInteger((decimal)inVariableData.BCLLAngleACI / totalCount); inVariableData.BCAirTimeI = roundDecimal(inVariableData.BCAirTimeI / totalCount); inVariableData.BCStrideLengthI = roundDecimal(inVariableData.BCStrideLengthI / totalCount); inVariableData.Step1COGDistanceI = roundDecimal(inVariableData.Step1COGDistanceI / totalCount); inVariableData.Step1LLAngleTakeoffI = roundInteger((decimal)inVariableData.Step1LLAngleTakeoffI / totalCount); inVariableData.Step1TrunkAngleTakeoffI = roundInteger((decimal)inVariableData.Step1TrunkAngleTakeoffI / totalCount); inVariableData.Step1LLAngleACI = roundInteger((decimal)inVariableData.Step1LLAngleACI / totalCount); inVariableData.Step1GroundTimeI = roundDecimal(inVariableData.Step1GroundTimeI / totalCount); inVariableData.Step1AirTimeI = roundDecimal(inVariableData.Step1AirTimeI / totalCount); inVariableData.Step1StrideLengthI = roundDecimal(inVariableData.Step1StrideLengthI / totalCount); inVariableData.Step2COGDistanceI = roundDecimal(inVariableData.Step2COGDistanceI / totalCount); inVariableData.Step2LLAngleTakeoffI = roundInteger((decimal)inVariableData.Step2LLAngleTakeoffI / totalCount); inVariableData.Step2TrunkAngleTakeoffI = roundInteger((decimal)inVariableData.Step2TrunkAngleTakeoffI / totalCount); inVariableData.Step2LLAngleACI = roundInteger((decimal)inVariableData.Step2LLAngleACI / totalCount); inVariableData.Step2GroundTimeI = roundDecimal(inVariableData.Step2GroundTimeI / totalCount); inVariableData.Step2AirTimeI = roundDecimal(inVariableData.Step2AirTimeI / totalCount); inVariableData.Step2StrideLengthI = roundDecimal(inVariableData.Step2StrideLengthI / totalCount); inVariableData.Step3COGDistanceI = roundDecimal(inVariableData.Step3COGDistanceI / totalCount); inVariableData.TimeTo3mI = roundDecimal(inVariableData.TimeTo3mI / totalCount); inVariableData.TimeTo5mI = roundDecimal(inVariableData.TimeTo5mI / totalCount); } else { inVariableData.SetFrontBlockDistanceI = 0; inVariableData.SetRearBlockDistanceI = 0; inVariableData.SetFrontULAngleI = 0; inVariableData.SetRearULAngleI = 0; inVariableData.SetFrontLLAngleI = 0; inVariableData.SetRearLLAngleI = 0; inVariableData.SetTrunkAngleI = 0; inVariableData.SetCOGDistanceI = 0; inVariableData.BCRearFootClearanceTimeI = 0; inVariableData.BCFrontFootClearanceTimeI = 0; inVariableData.BCRearLLAngleTakeoffI = 0; inVariableData.BCFrontLLAngleTakeoffI = 0; inVariableData.BCTrunkAngleTakeoffI = 0; inVariableData.BCLLAngleACI = 0; inVariableData.BCAirTimeI = 0; inVariableData.BCStrideLengthI = 0; inVariableData.Step1COGDistanceI = 0; inVariableData.Step1LLAngleTakeoffI = 0; inVariableData.Step1TrunkAngleTakeoffI = 0; inVariableData.Step1LLAngleACI = 0; inVariableData.Step1GroundTimeI = 0; inVariableData.Step1AirTimeI = 0; inVariableData.Step1StrideLengthI = 0; inVariableData.Step2COGDistanceI = 0; inVariableData.Step2LLAngleTakeoffI = 0; inVariableData.Step2TrunkAngleTakeoffI = 0; inVariableData.Step2LLAngleACI = 0; inVariableData.Step2GroundTimeI = 0; inVariableData.Step2AirTimeI = 0; inVariableData.Step2StrideLengthI = 0; inVariableData.Step3COGDistanceI = 0; inVariableData.TimeTo3mI = 0; inVariableData.TimeTo5mI = 0; } return(inVariableData); }