Skip to content

Commit

Permalink
clean vine3d
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Jul 30, 2024
1 parent 0963bb8 commit ce4e978
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 145 deletions.
6 changes: 2 additions & 4 deletions bin/VINE3D/VINE3D.pro
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,20 @@ SOURCES += \
../CRITERIA3D/shared/project3D.cpp \
../CRITERIA3D/shared/dialogWaterFluxesSettings.cpp \
atmosphere.cpp \
dataHandler.cpp \
disease.cpp \
main.cpp \
modelCore.cpp \
plant.cpp \
vine3DShell.cpp \
waterBalance.cpp \
vine3DProject.cpp \
mainWindow.cpp
mainWindow.cpp \
main.cpp


HEADERS += \
../CRITERIA3D/shared/project3D.h \
../CRITERIA3D/shared/dialogWaterFluxesSettings.h \
atmosphere.h \
dataHandler.h \
disease.h \
modelCore.h \
plant.h \
Expand Down
12 changes: 9 additions & 3 deletions bin/VINE3D/atmosphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
#include <QString>
#include <QFile>

//cout
#include <iostream>

#include "interpolation.h"
#include "interpolationCmd.h"
#include "solarRadiation.h"
#include "dataHandler.h"
#include "atmosphere.h"
#include "vine3DProject.h"
#include "commonConstants.h"
Expand All @@ -17,8 +19,6 @@
#include "transmissivity.h"
#include "spatialControl.h"

//cout
#include <iostream>


bool isDataPresent(Vine3DProject* myProject, meteoVariable myVar, Crit3DTime myDateTime)
Expand Down Expand Up @@ -154,6 +154,12 @@ bool vine3DInterpolationDem(Vine3DProject* myProject, meteoVariable myVar,
}


float getTimeStepFromHourlyInterval(int myHourlyIntervals)
{
return 3600. / ((float)myHourlyIntervals);
}


bool vine3DInterpolationDemRadiation(Vine3DProject* myProject, const Crit3DTime& myCrit3DTime, bool isLoadData)
{
bool myResult = false;
Expand Down
4 changes: 2 additions & 2 deletions bin/VINE3D/atmosphere.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#ifndef CRIT3DDATE_H
#include "crit3dDate.h"
#endif
#ifndef METEOPOINT_H
#include "meteoPoint.h"
#ifndef METEO_H
#include "meteo.h"
#endif

class Vine3DProject;
Expand Down
99 changes: 0 additions & 99 deletions bin/VINE3D/dataHandler.cpp

This file was deleted.

19 changes: 0 additions & 19 deletions bin/VINE3D/dataHandler.h

This file was deleted.

3 changes: 2 additions & 1 deletion bin/VINE3D/disease.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
#include "project.h"
#include "meteo.h"
#include "atmosphere.h"
#include "dataHandler.h"
#include "commonConstants.h"
#include "utilities.h"

#include <iostream>


#define MAXPOINTS 4096
#define VEGETATIVESTART 90
#define VEGETATIVEEND 270
Expand Down
2 changes: 2 additions & 0 deletions bin/VINE3D/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
#include <QMessageBox>
#include <QtGui>
#include <QApplication>

#include "commonConstants.h"
#include "vine3DProject.h"
#include "mainWindow.h"


Vine3DProject myProject;


int main(int argc, char *argv[])
{
// set modality (default: GUI)
Expand Down
6 changes: 2 additions & 4 deletions bin/VINE3D/modelCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
#include "waterBalance.h"
#include "crit3dDate.h"
#include "meteo.h"
#include "dataHandler.h"
#include "solarRadiation.h"
#include "grapevine.h"
#include "atmosphere.h"
#include "utilities.h"


extern Vine3DProject myProject;

// [Pa] default atmospheric pressure at sea level
#define PRESS 101325

bool setSoilProfileCrop(Vine3DProject* myProject, int row, int col, Crit3DModelCase* modelCase)
{
Expand Down Expand Up @@ -157,7 +155,7 @@ bool modelDailyCycle(bool isInitialState, Crit3DDate myDate, int nrHours,
double(myProject->hourlyMeteoMaps->mapHourlyPrec->value[row][col]),
double(myProject->hourlyMeteoMaps->mapHourlyRelHum->value[row][col]),
double(myProject->hourlyMeteoMaps->mapHourlyWindScalarInt->value[row][col]),
PRESS))
SEA_LEVEL_PRESSURE))
{
myProject->errorString = grapevineError(myCurrentTime, row, col, "Weather data missing");
return(false);
Expand Down
8 changes: 1 addition & 7 deletions bin/VINE3D/modelCore.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
#ifndef MODELCORE_H
#define MODELCORE_H

#ifndef QSTRING_H
#include <QString>
#endif
#ifndef QDATETIME_H
#include <QDateTime>
#endif
#ifndef CRIT3DDATE_H
#include "crit3dDate.h"
#endif

class Vine3DProject;
struct TstatePlant;
class QString;

bool assignIrrigation(Vine3DProject* myProject, Crit3DTime myTime);

Expand Down
74 changes: 73 additions & 1 deletion bin/VINE3D/plant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "basicMath.h"
#include "interpolation.h"
#include "plant.h"
#include "dataHandler.h"
#include "vine3DProject.h"
#include "commonConstants.h"

Expand Down Expand Up @@ -423,5 +422,78 @@ bool updateThermalSum(Vine3DProject* myProject, QDate myDate)
}
}
}

return true;
}


QString getVarNameFromPlantVariable(plantVariable myVar)
{
if (myVar == tartaricAcidVar)
return "tartaricAcid";
else if (myVar == wineYieldVar)
return "wineYield";
else if (myVar == pHBerryVar)
return "pHBerry";
else if (myVar == brixBerryVar)
return "brixBerry";
else if (myVar == brixMaximumVar)
return "brixMaximum";
else if (myVar == deltaBrixVar)
return "deltabrix";
else if (myVar == daysAfterBloomVar)
return "daysAfterBloom";
else if (myVar == cumulatedBiomassVar)
return "totalBiomass";
else if (myVar == daysFromFloweringVar)
return "daysFromFlowering";
else if (myVar == isHarvestedVar)
return "isHarvested";
else if (myVar == fruitBiomassVar)
return "fruitBiomass";
else if (myVar == shootLeafNumberVar)
return "shootLeafNumber";
else if (myVar == meanTemperatureLastMonthVar)
return "meanTLastMonth";
else if (myVar == chillingUnitsVar)
return "chillingUnits";
else if (myVar == forceStateBudBurstVar)
return "forceStBudBurst";
else if (myVar == forceStateVegetativeSeasonVar)
return "forceStVegSeason";
else if (myVar == stageVar)
return "phenoPhase";
else if (myVar == cumRadFruitsetVerVar)
return "cumRadFSVeraison";
else if (myVar == leafAreaIndexVar)
return "leafAreaIndex";
else if (myVar == transpirationStressVar)
return "vineStress";
else if (myVar == transpirationVineyardVar)
return "transpirationVine";
else if (myVar == transpirationGrassVar)
return "transpirationGrass";
else if (myVar == degreeDaysFromFirstMarchVar)
return "degreeDaysFromFirstMarch";
else if (myVar == degreeDays10FromBudBurstVar)
return "degreeDaysFromBudBurst";
else if (myVar == degreeDaysAtFruitSetVar)
return "degreeDaysAtFruitSet";
else if (myVar == powderyCurrentColoniesVar)
return "powderyCurrentColonies";
else if (myVar == powderyAICVar)
return "powderyAIC";
else if (myVar == powderyCOLVar)
return "powderyCOL";
else if (myVar == powderyINFRVar)
return "powderyINFR";
else if (myVar == powderySporulatingColoniesVar)
return "powderyTSCOL";
else if (myVar == powderyPrimaryInfectionRiskVar)
return "powderyPIR";
else if (myVar == fruitBiomassIndexVar)
return "fruitBiomassIndex";
else
return "";
}

3 changes: 2 additions & 1 deletion bin/VINE3D/plant.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "gis.h"
#endif


class Vine3DProject;

struct TstatePlant;
Expand Down Expand Up @@ -102,4 +101,6 @@

bool updateThermalSum(Vine3DProject* myProject, QDate myDate);

QString getVarNameFromPlantVariable(plantVariable myVar);

#endif
Loading

0 comments on commit ce4e978

Please sign in to comment.