Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Calculos Etr 5 Metodos PDF
Calculos Etr 5 Metodos PDF
Programa
para el clculo
de las necesidades hdricas
de los cultivos
Programa
para el clculo
de las necesidades hdricas
de los cultivos
AGRADECIMIENTOS.
RESUMEN.
El aumento del consumo de agua para la agricultura origina un conflicto con las
necesidades de consumo urbanas e industriales.
Los clculos mediante este mtodo, sin ser complicados, son muy laboriosos y
llevan a la necesidad de utilizar herramientas de ayuda para realizarlos.
El resultado ha sido un programa que realiza el clculo del agua necesaria para
un cultivo, mediante el mtodo del balance hdrico propuesto por la FAO. Se
tienen en cuenta los aspectos ms importantes del balance hdrico: localizacin
del cultivo, caractersticas del cultivo, datos meteorolgicos, tipo de suelo, tipo de
agua de riego, tipo de riego, y programacin del riego.
Palabras claves: agricultura - cultivo - regado - necesidad hdrica - balance
hdrico - informtica.
RESUM.
La utilitzaci de l'aigua a l'agricultura ha contribut a un augment molt important de
la producci en aquests ltims anys.
L'augment del consum d'aigua per a l'agricultura origina un conflicte amb les
necessitats de consum urbanes i industrials.
Per tant, la necessitat d'arribar a fer un consum equilibrat s fonamental. Per tal
d'arribar a aconseguir-ho es poden fer servir mtodes per estimar l'aigua
necessria per a les plantes.
Els clculs mitjantant aquest mtode, sense que siguin complicats, sn molt
laboriosos i comporten la necessitat de fer servir eines d'ajut per realitzar-los.
La informtica s una eina que pot ajudar a realitzar els clculs d'una manera
rpida i efica. Aix mateix, es converteix en un instrument de simulaci per
adoptar estratgies canviants.
SUMMARY.
In recent times, water use for agricultural purposes has contributed to a dramatic
increase in production.
One of the methods discussed in this work is the FAO water balance-based
method, which measures water incomes and outputs for the whole system of airsoil-plant.
Calculations obtained with this method are not complicated but they are really
laborious. Thus, some calculating tools become necessary.
Computers are useful, rapid tools to undertake these calculations. They may be
also employed as simulation instruments to adopt changing strategies.
The result has been a program based on the FAO water balance method to
determine the quantity of water required by a crop. The major factors of this
method crop location, crop features, weather data, soil type, water type for
irrigation, irrigation type and irrigation schedulinghave been considered.
Indice
NDICE.
1.Introduccin
10
11
13
14
1.3.1. Descripcin
14
17
18
19
19
21
23
24
24
25
26
27
29
30
37
40
41
1.4.4.1. Clima
41
42
42
43
44
44
44
45
Indice
46
46
47
48
49
51
52
53
53
54
54
55
55
56
59
1.6.2.
1.6.3.
60
1.6.4.
60
1.6.5.
61
63
63
1.6.6.
2. Objetivos
65
3. Material y mtodos
67
3.1. Material
68
3.2. Mtodos
68
Indice
4. Resultados y discusin
70
72
4.2. Programa
73
4.2.1. Diseo
74
74
4.2.3. Finca
75
4.2.4. Cultivo
76
4.2.5. Meteorologa
79
4.2.6. Suelo
82
84
85
86
4.2.10. Resultados
88
5. Conclusines
89
6. Bibliografa
91
7. Anejos
93
94
107
124
7. Anejo 4.
157
157
160
161
162
1. Introduccin
1. INTRODUCCIN.
10
1. Introduccin
1. INTRODUCCIN.
11
1. Introduccin
Por este motivo, no es extrao que el uso agrcola del agua produzca tensiones
con los otros usos del agua: el urbano y el industrial. Estas tensiones se agudizan
en periodos crticos: verano y en pocas de sequa y, sobre todo, en zonas
deficitarias (zona mediterrnea).
Nadal expone que para una correcta utilizacin del agua por parte del agricultor,
han de estar presentes varios aspectos: un uso eficiente en la aplicacin del riego,
una correcta programacin del momento y de la dosis de riego y un coeficiente de
uniformidad lo ms alto posible (Nadal et alter, 1995).
12
1. Introduccin
Las vas que permiten realizar un consumo equilibrado de agua son varias:
Los conductos de distribucin del exterior de la explotacin: se ha de exigir y
conseguir que los conductos se construyan con las mnimas prdidas posibles
(prdidas por filtracin en embalses, falta de eficiencia en la distribucin,
prdidas por evaporacin, etctera).
Mecanismos de distribucin en el interior de la explotacin: es vlido el
mismo principio que para el anterior punto.
Programacin del riego: se ha de regar en el momento adecuado y con la
dosis precisa (segn la necesidad del cultivo).
Eficiencia en la aplicacin: se ha de seleccionar el sistema de riego ms
eficiente posible y dotarlo de los medios necesarios para poder aumentar esa
eficiencia.
Uniformidad: se ha de procurar que la uniformidad sea elevada, evitando as
tener que aumentar las dosis para impedir zonas con dficit hdrico.
13
1. Introduccin
1.3.1. Descripcin.
14
1. Introduccin
15
1. Introduccin
16
1. Introduccin
17
1. Introduccin
Martn Santa Olalla et alter(1993), cita tres mtodos para determinar el punto
ptimo de riego:
18
1. Introduccin
Se basa en la medicin del balance hdrico que resulta de sumar las entradas de
agua y de restar las salidas de sta.
Al resultado del balance se le llama variacin de la reserva de agua en el suelo y
es su valor el que determina el riego.
Las entradas de agua se deben a las precipitaciones (Pe), a la ascensin capilar
(Ge) y a la escorrenta superficial de salida (EsS)
Las salidas de agua se deben a la evapotranspiracin (ET), a la percolacin
profunda (Pp) y a la escorrenta superficial de entrada (EsE).
(Pe + Ge + EsS ) - (ET+Pp+EsE) + w
19
1. Introduccin
El agua til (AU) es la cantidad de agua que existe entre la capacidad de campo
(CC) y el punto de marchitez (PM).
AU = CC PM
En la prctica agronmica, el hecho de que el margen de w est situado entre la
capacidad de campo y el punto de marchitamiento, no es sinnimo de que no
haya habido reduccin del rendimiento en el cultivo; se ha de buscar un valor en
el que no haya reduccin del rendimiento. A este valor se le llama nivel de
agotamiento permisible (NAP) y es el que corresponde al comienzo de la
disminucin de la tasa de evapotranspiracin. Quedando el intervalo de humedad
disponible en un punto que hay entre la capacidad de campo y el punto de
marchitamiento:
NAP = f * AU
20
1. Introduccin
Existe otra estrategia de riego, que no es objeto de este trabajo, pero que se va a
definir por considerar que tiene un futuro muy prometedor para zonas con dficits
hidrulicos estacionales o incluso anuales. A esta estrategia se la denomina riego
deficitario controlado (RDC) y se est aplicando puntualmente en algunas zonas
de clima mediterrneo (Levante murciano, Sur de Francia, etctera).
Las estrategias sobre las que se basa el RDC son las siguientes:
- Perodos crticos en el cultivo. Se centra en suministrar agua en aquellos
estados fenolgicos que puedan condicionar la produccin y/o la calidad de la
cosecha. Cada cultivo tiene sus perodos crticos.
- Crecimiento vegetativo y del fruto. Se basa en evitar un exceso de vigor que
pueda inducir a una mayor demanda hdrica en estados fenolgicos
posteriores. En estos cultivos podra ser interesante aportar al estado
fenolgico de crecimiento del fruto el agua ahorrada anteriormente. En algunos
cultivos, el crecimiento del fruto es un periodo crtico en cuanto al dficit
21
1. Introduccin
22
1. Introduccin
Por ser un mtodo generalista, sus autores admiten que hay que ser crticos con
los resultados obtenidos y, en la medida de lo posible, variar los datos para
adecuarlos a nuestras necesidades.
Desde la publicacin de FAO-24 han pasado unos 25 aos. A pesar del tiempo
transcurrido, este mtodo sigue utilizndose ampliamente en todo el mundo.
Lgicamente, muchos de los aspectos de FAO-24 han quedado en desuso, se
han modificado o se han ampliado con nuevos datos o clculos.
23
1. Introduccin
A continuacin, se exponen los datos mnimos para cada una de las cinco
determinaciones:
24
1. Introduccin
Tabla 1: Datos necesarios para calcular la ETo.
Mtodo
Temperatura
Humedad
Viento
Insolacin
Radiacin
Evaporacin
Condiciones
Locales
Blaney-Criddle
Radiacin
(*)
Penman
(*)
Cubeta clase A
Penman-Monteith
(*)
* datos medidos
0 datos estimados
(*) datos cuando se dispone de ellos
- No se necesita
1.4.1.1.1. Blaney-Criddle.
Para determinar la ETo [mm dia-1], la figura 1 del anejo 1 se presentan 9 grficos
en funcin de 3 tipos de humedad relativa mnima y de 3 tipos de porcentajes
25
1. Introduccin
medios de horas diurnas del da sobre las horas diurnas anuales. Cada uno de
estos 9 grficos contiene 3 rectas, correspondientes a 3 tipos de velocidad de
viento diurnos.
1.4.1.1.2. Radiacin.
donde: ETo
Rs
Rs = a + b Ra
N
donde: a
Ra
26
1. Introduccin
Para determinar la ETo [mm d-1], se utiliza la figura 2 del anejo 1. En el que
presenta1 4 grficos en funcin de 4 tipos de humedad relativa media. Cada uno
de los grficos presenta 4 rectas en funcin de la velocidad del viento diurno.
Estas rectas relacionan el clculo WRs con la ETo.
Pizarro (1996) desaconseja la utilizacin de este mtodo; afirma que slo tiene
validez en zonas hmedas. Martn de Santa Olalla et alter(1993) afirma que este
mtodo es una simplificacin del mtodo Penman.
1.4.1.1.3. Penman.
Eo =
Rn +
Ea
+
+
donde: Eo
Rn
Ea
27
1. Introduccin
Ea = 0,35(1 + 0,0092U2 )(
es ea )
donde: U2
es
ea
donde: ETo
c
1-W
Rn
es
ea
presin actual de vapor del aire [mb]. Vase tabla 8 del anejo 1.
f(U)
U
f (U) = 0,271 + 2
100
donde: f(U)
U2
donde: Rn
Rns
Rnl
28
1. Introduccin
Ra
donde: Rns
n
R nl = f (t )f (ed)f
N
donde: Rnl
f(t)
f(ed)
f(n/N)l
Con este mtodo se miden los efectos integrados de la radiacin, del viento, de la
temperatura y de la humedad.
29
1. Introduccin
ETo
Epan
Kp
1.4.1.1.5. Penman-Monteith.
30
1. Introduccin
Tabla2. Sumario de estadsticas y su ranking para varios mtodos de estimacin mensual de la
evapotranspiracin.
Ranking
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Method (1)
Penman-Monteith
1982 Kimberly-Penman
FAO-PPP-17 Penman
Penman (1963)
Penman (1963), VPD #3
1972 Kimberly-Penman
FAO-24 Radiation
FAO-24 Blaney-Criddle
FAO-24 Penman (c=1)
Jansen-Haise
Hargreaves et al. (1985)
Businger-van Bavel
FAO-24 Corrected Penman
FAO-24 Pan
SCS Blaney-Criddle
Christiansen pan
Pan evaporation
Turc
Priestley-Taylor
Thornthwaite
All Months
% (2)
101
107
111
106
113
112
114
108
121
85
108
121
127
100
101
92
118
90
85
79
SEE (3)
0.36
0.53
0.66
0.57
0.67
0.74
0.73
0.68
0.91
0.84
0.88
1.10
1.16
0.92
1.16
0.95
1.34
1.30
1.29
1.68
b (4)
1.00
0.95
0.93
0.99
0.93
0.93
0.91
0.95
0.88
1.11
1.00
0.87
0.82
0.94
0.99
1.03
0.82
1.20
1.22
1.24
r (5)
0.99
0.98
0.97
0.97
0.97
0.96
0.97
0.96
0.96
0.95
0.93
0.92
0.96
0.92
0.87
0.91
0.92
0.89
0.90
0.78
Peak Month
ASEE (6)
0.36
0.49
0.56
0.57
0.57
0.67
0.59
0.64
0.65
0.71
0.88
0.90
0.65
0.88
1.15
0.94
0.87
1.07
1.02
1.47
%
97
107
105
99
105
102
110
106
111
83
101
110
122
95
103
88
113
85
86
79
SEE
0.52
0.79
0.72
0.95
0.77
0.72
0.88
0.98
0.84
1.44
1.47
1.19
1.53
1.58
1.31
1.88
1.82
2.26
2.34
2.69
B
1.03
0.96
0.99
1.07
1.00
1.03
0.95
0.98
0.95
1.15
1.07
0.97
0.86
1.03
1.05
1.11
0.88
1.31
1.28
1.41
R
0.99
0.96
0.97
0.96
0.96
0.97
0.96
0.94
0.96
0.92
0.87
0.91
0.93
0.82
0.89
0.78
0.83
0.84
0.78
0.79
Weigh
ted
SEE
(7)
ASEE
0.47
0.73
0.72
0.81
0.77
0.70
0.78
0.97
0.76
1.06
1.39
1.16
1.00
1.57
1.26
1.73
1.56
1.49
1.72
1.70
0.40
0.59
0.66
0.67
0.68
0.72
0.73
0.76
0.82
0.95
1.05
1.08
1.10
1.11
1.20
1.21
1.35
1.46
1.48
1.84
NOTES
(1) All equation estimates have been adjusted for the reference crop of the lysimeter.
(2) Average percentage of lysimeter measurements.
(3) Standard error of estimate for ET estimates in mm d-1 that have not been adjusted by regression.
(4) Regression coefficient (slope) for regression through the origin of lysimeter versus equation estimates.
(5) Correlation coefficient for regression through the origin of lysimeter versus equation estimates.
(6) Standard error of estimate for ET estimates in mm d-1 that have been adjusted by regression through the origin.
(7) Weighted standard error of estimate calculated as 0.7(0.67(Col. 4)+0.33(Col. 7) + 0.3(0.67(Col.9)+0.33(Col. 12).
31
1. Introduccin
donde:
R1
0,5LAI
rc
R1
LAI
En una reunin que realizaron los expertos de la FAO en 1990 adoptaron el mtodo
Penman-Monteith
como
nuevo
estndar
en
la
determinacin
de
la
evapotranspiracin.
Estos expertos determinaron que, ante la falta de datos sobre la resistencia de los
cultivos, se poda calcular la ETo por el mtodo Penman-Monteith suponiendo los
siguientes valores:
Altura del cultivo igual a 12 cm (hc=0,12 m).
Resistencia de la cubierta vegetal igual a 70 s/m (rc =70s/m).
Albedo igual a 0,23 (=0,23).
32
1. Introduccin
ETo =
900
U2 (e a e d )
T + 273
+ (1+ 0.34 U2 )
0,408Rn +
Rn
U2
donde: ETo
(ea-ed) :
R n = R ns R nl
:
Rns
Rnl
donde: Rn
n
Rns = 0,77(0.25 + 0.50 ) Ra
N
:
Ra
donde: Rns
33
1. Introduccin
N = 7,64 s
donde: N
ws
dr
ws
latitud [rad].
s = cos 1 ( tg( l) tg( d) )
donde: ws
latitud [rad].
donde: d
nmero de da del ao .
dr = 1 + 0,033 cos(0,0172J)
donde: dr
J
nmero de da del ao .
34
1. Introduccin
Mes
JDIA = 275
30 + Dia 2
9
donde: JDIA
Mes
Dia
Mes
n
+ 0.1) (0.34 - 0.14 ed ) ( T4maxima + T4minima)
N
ed
donde: Rnl
Tmaxima :
Tminima :
HR
50
e
donde: ed
a ( tmin
media
+
)
50
e
a ( tmax
ea(tmin) :
ea(tmin) :
HRdmedia:
35
1. Introduccin
e a = 0,6108e
donde: ea
17 ,27 T
T + 237 ,3
temperatura [C].
donde: y
P
Cl
constante psicromtrica [kPa C -1].
Cl
donde: P
( 273 + T ) 0. 0065alt
P = 101,3
273 + T
alt
altitud [m].
Cl = 2,501 (2,36110 3 T)
calor latente de vaporizacin [MJ kg-1].
= 0,00163
5, 26
donde: Cl
T
=
donde: A
4098e a
(T + 273,3 )2
ea
36
1. Introduccin
1.4.2.
ETo
ETc
Los factores que pueden influir en el coeficiente de cultivo son: las caractersticas
del cultivo, la fecha de siembra o plantacin, el ritmo de desarrollo del cultivo, la
duracin del perodo vegetativo, la humedad relativa, el viento, etctera.
FACTORES
Cubierta vegetal
Heladas
Humedad
Viento
Edad
Frecuencia riegos o lluvias
Textura del suelo
TIPO DE CULTIVO
A B D E F G H L
P P
P
P
P P P P
P
P P P P
P P
P P
P
P
P
P
P
Tipos de cultivo
Leyenda:
A = Cultivos extensivos y de hortalizas
B = Arroz
C = Caa de Azcar
D = Alfalfa
E = Arboles caducifolios y de nuez
F = Ctricos
G = Uva
H = Banana
I = Hierbas acuticas
J = Caf
K = T
L = Suelos desnudos
37
1. Introduccin
Los cultivos de caa de azcar [c], hierbas acuticas (I), caf (J) y t (K) se han
omitido por no tener mucho inters en Espaa.
38
1. Introduccin
b) arroz.
Para nuestro pas se considera que el cultivo del arroz se desarrolla en la estacin
seca, aunque en otros lugares del mundo puede ser en la estacin hmeda.
f) ctricos.
Los ctricos se presentan con valores de Kc mensual.
Los valores de Kc dependen de: tipo de ctrico, mes de cultivo, tipo de cubierta
vegetal y edad de la plantacin.
39
1. Introduccin
g) uva.
La uva se presenta con valores de Kc mensual.
Los valores de Kc dependen de: mes de cultivo, tipo de helada, tipo de viento y
humedad relativa.
h) pltano
El pltano se presenta con valores de Kc mensual.
Los valores de Kc dependen de: tipo de estacin, mes de cultivo, tipo de viento y
humedad relativa.
1.4.3.
40
1. Introduccin
1.4.4.1. Clima.
41
1. Introduccin
42
1. Introduccin
Kl = 1,34A
Decroix
Kl = 0,1 +A
Hoare
Kl = 0,5A + 0,5
Keller
Kl = 0,85A + 0,15
Siendo;
Kl : coeficiente de localizacin
A : fraccin rea sombreada
43
1. Introduccin
1.4.5.
Balance hdrico.
44
1. Introduccin
La lluvia efectiva es la parte de agua de lluvia que llega a la zona de las races; el
resto se pierde por evaporacin en la zona area, por percolacin o por
escorrenta.
Pe
precipitacin [mm/mes]
porcentaje [%]
Pe
: precipitacin [mm/mes]
Pe
: precipitacin [mm/mes]
45
1. Introduccin
Pe
precipitacin [mm/mes]
A1
B1
C1
A2
B2
C2
- No se considera.
En algunos casos no se considera por ser cultivos en invernadero o porque no
interesa tener en cuenta la precipitacin.
Es el agua que pasa a los horizontes profundos y no est al abasto de las races.
Depende del tipo de suelo. Los suelos ligeros (arenosos) tendrn una mayor
percolacin que los suelos pesados (arcillosos).
46
1. Introduccin
47
1. Introduccin
Hay autores que indican una cierta relacin entre la textura del suelo y los valores
de CC y PM. Yage (1996) cita dos frmulas que relacionan la textura con la CC y
el PM, pero aconseja utilizarlas cuando no se disponga de anlisis. En el captulo
2 del anejo 4 se exponen las dos frmulas.
FAO-24 relaciona las clases texturales con la tensin de humedad del suelo y con
el porcentaje de humedad del suelo, a la vez que dice que el punto de
marchitamiento corresponde a una tensin de humedad de 16 atm. y la CC a una
tensin de humedad de 0,2-0,3 atm.
1.4.6.
48
1. Introduccin
Para que no haya reduccin de la ET, y por tanto, reduccin del rendimiento en el
cultivo, es necesario regar antes de que se llegue al punto de marchitamiento.
Este punto se ha estimado para cada cultivo y proporciona un valor que
corresponde a la reserva fcilmente utilizable (RFU).
Siendo:
RFU
CC
PM
NAP
1.4.7.
Lavado de sales.
El efecto osmtico de las sales disueltas en el agua sobre las races, hace que las
plantas tengan que hacer un esfuerzo adicional para absorber agua. Adems del
potencial hdrico han de vencer el potencial osmtico.
49
1. Introduccin
LR
CEa
5CEs CEa
: Requerimiento de lavado .
CEa
2MaxCEs
LR
: Requerimiento de lavado .
CEa
50
1. Introduccin
Como puede verse, existe una relacin entre la concentracin de sal en el suelo y
la produccin obtenida.
donde
CEs
CE0%
1.4.8.
Eficiencia de la aplicacin.
La eficiencia en la aplicacin suele ser muy baja en los riegos por gravedad y muy
buena en los riegos localizados.
51
1. Introduccin
1.4.9.
Cuando Ea < Fl, se aplicar la Ea. Siendo la necesidad bruta de riego la siguiente
(Nb):
Nb =
siendo
Nn
Ea
Nb
Nn
Ea
: Eficiencia en la aplicacin .
Cuando Ea > Fl, se aplicar la Fl. Siendo la necesidad bruta de riego la siguiente
(Nb):
Nb =
siendo
Nn
Fl
Nb
Nn
Fl
: Fraccin de lavado .
52
1. Introduccin
Cada cultivo tiene unos perodos crticos con respecto a la tensin de humedad
del suelo; stos son debidos a las propias caractersticas de los cultivos.
En algunos casos, la falta de agua puede comportar una mejora en la calidad de
la produccin. En otros casos, el cultivo prefiere suelos hmedos.
53
1. Introduccin
La relacin es la siguiente:
1
donde
Ya
: Produccin
Ya
ETa
= Ky 1
Ym
ETm
obtenida
en
funcin
de
la
cantidad
Km
ETa
ETm
1.4.10.2.Momento de riego.
La dosis a aplicar depende del gasto que haya hecho el cultivo en un perodo
concreto y de la variacin de la reserva de agua en el suelo.
La dosis variar en funcin del porcentaje de agua que tenga la RFU al inicio del
riego y del porcentaje de agua que tenga al final del mismo.
54
1. Introduccin
Todo cultivo tiene una reserva inicial de agua en el suelo en funcin de lo que ha
llovido anteriormente, de un prerriego inicial. En los cultivos plurianuales, la
reserva inicial de agua en la programacin ha de ser la misma que tena en la
anterior programacin.
55
1. Introduccin
El anlisis es una tarea que requiere a tcnicos en informtica pero que tambin
implica a tcnicos de otras disciplinas. El analista, como su nombre indica, ha de
analizar cmo le llegar la informacin, cmo tratar esta informacin, cmo se
enva la informacin procesada, de qu herramientas dispone, etctera.
56
1. Introduccin
se ofrece, tanto por el monitor como por la impresora. Uno de los lenguajes
visuales ms extendidos es el lenguaje Visual-Basic. La palabra BASIC hace
referencia a que en su origen parta de las instrucciones del lenguaje BASIC
(Beginens All-Purpuse Symbolic Instrucions Code) que resultaba ser un lenguaje
muy popular por facilidad de uso.
57
1. Introduccin
se
58
1. Introduccin
Daylet.
Realizado por la Universidad de Cranfield (UK).
Existe una variante del programa, publicado por la misma universidad, que realiza
el clculo de la ETo para una serie de datos meteorolgicos. Esta variante del
programa se llama ET.
Vase figura 1 en el anejo 2.
1.6.2. Programa para el clculo de la evapotranspiracin del cultivo.
Fao.Pmon.xls
Es
una
hoja
de
clculo
que
sirve
para
evaluar
mensualmente
la
1. Introduccin
El programa ha sido realizado por el Dr. Saxton y existe una edicin en castellano.
Es de libre distribucin en la direccin:
"http://www.wiz.uni-kassel.de/kww/irrisoft/manage/manage_i.html".
Vase figura 6 del anejo 2.
60
1. Introduccin
ReqRiego.xls
Es un programa en forma de hoja de clculo para evaluar las necesidades
hdricas mensuales de los cultivos mediante el mtodo Penman.
61
1. Introduccin
CROPWAT
Es un programa para el clculo de las necesidades hdricas de los cultivos por el
mtodo Penman-Monteith combinado (FAO, 1990) que se nutre de datos
meteorolgicos medios mensuales y de los datos de cultivo que tiene
almacenados. En todo momento es posible modificar los datos a travs de su
men.
Ha sido realizado por la FAO. Existe una versin antigua (5.7) en castellano y dos
versiones en ingles: la versin 7.0 y la versin Windows. La versin de Windows
est en fase de prueba y algunas de sus opciones no estn disponibles.
Se puede obtener gratuitamente en www.fao.org. La versin en castellano (5.7) va
incorporada en el volumen 46 de Riegos y Drenajes.
PACREG
Es un programa para el clculo de las necesidades hdricas de los cultivos pero
presume calculada la ETo del cultivo. El programa puede recoger los datos
meteorolgicos obtenidos a travs del programa PACREG.
62
1. Introduccin
En la direccin http://www.wiz.uni-kassel.de/kww/irrisoft/manage/manage_i.html
se pueden encontrar programas destinados a la irrigacin. Alguno de los
programas son de libre distribucin pero otros son comerciales. Alguno de los
programas comerciales se puede probar por un perodo determinado.
Vase figura 17 del anejo 2.
63
1. Introduccin
INCA (Irrigation Network Control & Analysis)
I W R ( Irrigation Water Requirements
LANDSCAPE WATER MANAGEMENT SOFTWARE (Auditing & Budgeting) Mac
PET (potential evapotranspiration, Macintosh)
Microweather 94 (Evapotranspiration, crop microclimate simulation, climate, soil)
P E T (Potential Evapotranspiration)
POT._EVAPO. (Potential Evapotranspiration)
PRORIEGO (Available only in Spanish - sorry)
REF-ET (Reference evapotranspiration)
REQRIEGO (Reference evapotranspiration and crop water requirements)
SPACTEACH (Soil/plant water dynamics)
THE WATER AND PLANT RELATIONSHIP (Relationship, water in plants, photosynthesis )
UCA ( Unit Command Area Simulation Model )
WATER MANAGEMENT UTILITIES (Water management - irrigation system design)
WATERMGT (Water Management - CD Rom)
WATROP ( Irrigation Sytem Uniformity on Crop Yield )
64
2. Objetivos
2. OBJETIVOS.
65
2. Objetivos
2. OBJETIVOS.
66
3. Material y mtodos
3. MATERIAL Y MTODO
67
3. Material y mtodos
3.1. MATERIAL.
3.2. MTODO.
El mtodo utilizado para la realizar el programa programacin se ha basado en
una programacin clsica, apoyada en mdulos que coinciden con las entradas
de datos (clima, suelo, etc.) pero con un aspecto visual para el usuario.
68
3. Material y mtodos
69
4. Resultados y discusin
4. RESULTADOS Y DISCUSIN
70
4. Resultados y discusin
4. RESULTADOS Y DISCUSION.
El resultado ha sido un programa con funcionamiento modular, que calcula las
necesidades hdricas cuando detecta que todos los datos estn introducidos.
El diseo comienza con un nombre que identifica el grupo de datos que se van a
introducir.
Por ltimo, se encuentra el mdulo de clculo que realiza las operaciones y las
muestra por pantalla.
71
4. Resultados y discusin
El nexo de unin entre cada uno de los ficheros suele ser el nombre del diseo,
excepto en los ficheros que se encuentran en la parte superior. Estos ficheros
estn unidos por el tipo de informacin.
72
4. Resultados y discusin
4.2. PROGRAMA.
Los mdulos disponibles en el programa son:
- Diseo.
- Mantenimiento de tablas.
- Finca.
- Cultivo.
- Clima.
- Suelo.
- Agua de riego.
- Tipo de riego.
- Programacin del riego.
- Resultados.
Si la aplicacin no est conforme con algn dato entrado, surge una pantalla de
formato pequeo que informa de la accin incorrecta.
73
4. Resultados y discusin
4. 2. 1. Diseo.
4.2.2.Mantenimiento de tablas.
El mantenimiento de tablas est contenido en el men Diseo Agronmico.
Sirve para dar de alta, modificar o eliminar datos correspondientes a las tablas del
programa. Vase figura 5 del anejo 3. Los datos que se entren por este mdulo
pasarn a estar disponibles para la toda aplicacin
74
4. Resultados y discusin
Estas tablas son: nombre de cultivo, Kc del cultivo, das de cultivo, raz del cultivo,
fraccin de agotamiento permisible del cultivo, meteorologa, tipo de textura y
sistemas de riego. En la figura 6 del anejo 3 se puede ver el acceso a la tabla de
sistemas de riego.
4.2. 3. Finca.
Por este mdulo se introducirn los datos referentes a la finca y el tipo de datos
meteorolgicos. Algunos de los datos no tienen relevancia para el clculo de las
necesidades hdricas, pero es necesario disponer de una pequea referencia.
Vase figura 7 del anejo 3.
75
4. Resultados y discusin
Una vez que se hayan introducido estos datos se podr pulsar Aceptar para que
los datos se graben.
4. 2. 4. Cultivo.
76
4. Resultados y discusin
77
4. Resultados y discusin
78
4. Resultados y discusin
Fecha de plantacin. En los cultivos anuales se introducir la fecha (mes-diaao) correspondiente y se introducir el primer da del ao para el resto de
cultivos (01-01-xxxx), siendo xxxx el valor del ao correspondiente.
Una vez que se hayan introducido estos datos se podr pulsar Aceptar para que
los datos se graben.
4.2.5. Meteorologa.
El mdulo Meteorologa est en el men de Entrada de Datos.
En
este
mdulo
se
introducirn
los
datos
referentes
los
valores
4. Resultados y discusin
El calendario mensual dispone de los doce meses del ao. De tal manera, que al
pulsar sobre cualquier mes se activar la pantalla de entrada de datos.
80
4. Resultados y discusin
81
4. Resultados y discusin
4. 2. 6. Suelo.
Arena Arcilla
[%]
[%]
Limo Densidad
[%] Aparente
[g/cm3]
Infiltracin Eficiencia
[mm/hora]
Lavado
[%]
Fuente
ARCILLOSO
18
65
17
1,19
3,8
30
YAGE
ARCILLOSO-ARENOSO
50
45
1,34
70
ESTIMADA
ARCILLOSO-LIMOSO
48
46
1,30
50
YAGE
ARENOSO
94
1,70
19
100
YAGE
ARENOSO-FRANCO
83
10
1,66
17
90
YAGE
FRANCO
41
19
40
1,51
8,9
70
YAGE
FRANCO-ARCILLOSO
33
35
32
1,40
6,4
60
YAGE
FRANCO-ARCILLOSO-ARENOSO
60
28
12
1,45
12
80
ESTIMADA
FRANCO-ARCILLOSO-LIMOSO
10
35
55
1,40
12
60
ESTIMADA
FRANCO-ARENOSO
65
10
25
1,60
16
80
YAGE
FRANCO-LIMOSO
20
15
65
1,51
7,6
60
YAGE
LIMOSO
86
1,51
60
YAGE
82
4. Resultados y discusin
83
4. Resultados y discusin
4. 2. 7. Agua de riego.
84
4. Resultados y discusin
4. 2. 8. Tipo de riego.
En un
importante. Sera el lugar para entrar las caractersticas del sistema de riego:
caudal de los emisores, disposicin de los emisores, laterales de riego, etctera.
85
4. Resultados y discusin
86
4. Resultados y discusin
87
4. Resultados y discusin
4. 2. 10. Resultados.
En este mdulo se realizan los clculos y se visualizan los datos (vase figura 19
del anejo 3).
Cuando se han efectuado los clculos, se activan dos iconos: Balance hdrico,
Riegos a efectuar. Al pulsar sobre alguno de estos dos iconos se activa la
informacin correspondiente.
Balance Hdrico. Se abre una pantalla en un tratamiento de textos que nos
informa del balance hdrico a lo largo del cultivo. Se puede ver un ejemplo en la
figura 20 del anejo 3.
Al final del balance hdrico se hace un resumen.
Riegos a efectuar. Se abre una pantalla en un tratamiento de textos que nos
informa de los riegos a efectuar a lo largo del cultivo. Se puede ver un ejemplo en
la figura 21 del anejo 3.
88
5. Conclusiones
5. CONCLUSIONES.
89
5. Conclusiones
5. CONCLUSIONES .
90
6. Bibliografa
6. BIBLIOGRAFA
91
6. Bibliografa
6. BIBLIOGRAFA.
COROMINAS, J. 1997. El regado en el umbral del siglo XXI: Plan Nacional de
Regados y Plan de Regados de Andaluca. Nmero: 90. Pginas: 22-37. Riegos
y Drenajes XXI.
COROMINAS, J. 1997. El regado en el umbral del siglo XXI: Plan Nacional de
Regados y Plan de Regados de Andaluca. Nmero: 91. Pginas: 46-55. Riegos
y Drenajes XXI.
DOORENBOS, J. y PRUITT, W.O. . 1977. Las necesidades de agua de los
cultivos. FAO-24. F.A.O. 194 pp.
FUENTES YAGE, J.L. . 1996. Tcnicas de riego. M.A.P.A. 471 pp.
GENERALITAT DE CATALUNYA. 1997. PACCOM. Manual de l'usuari.Generalitat
de Catalunya . D.A.R.P. 19 pp.
GENERALITAT DE CATALUNYA.1997.PACREG. Programa de reg localizat i per
superficie (versio 3.0). Manual de l'usuari. Generalitat de Catalunya. D.A.R.P. 48
pp.
M. STEIN, THOMAS. 1998. Irrisoft.
http://www.wiz.uni-kassel.de/kww/irrisoft/manage/manage_i.html
MARTIN DE SANTA OLALLA, F. y DE JUAN VALERO, J.A. . 1993. Agronoma
del riego. Ediciones Mundi-Prensa. 730 pp.
NADAL, E. Y LACASA, M. 1995. El agua y el regado en el futuro del mundo rural.
M.A.P.A. . 130 pp.
PIZARRO, F. . 1996. Riegos localizados de alta frecuencia (RLAF) goteo,
microaspersin, exudacion. Ediciones Mundi-Prensa. 513 pp.
SEGURA, P. Y ZAPATA, M. . 1995. Riego deficitario controlado. Ediciones MundiPrensa. 188 pp.
SMITH, M. . 1993. CROPWAT. Programa de ordenador para planificar y manejar
el riego. FAO-46. F.A.O. 133 pp.
SMITH, M. .1990. Revised FAO Methodology for Crop Water Requirements.
http://www.fao.org/ag/agl/aglw/webpub/REVPUB.htm. 70 pp.
VALIENTE, M., MONTERO, J., ORTEGA, J.F y TARJUELO, J.M. . 1998 .
Recomendaciones para un eficiente diseo y manejo del riego. Nmero: 97.
Pginas: 39-47. Riegos y Drenajes XXI.
92
7. Anejos
7. ANEJOS.
93
7. Anejo 1
94
7. Anejo 1
95
7. Anejo 1
96
7. Anejo 1
97
7. Anejo 1
98
7. Anejo 1
99
7. Anejo 1
100
7. Anejo 1
101
7. Anejo 1
102
7. Anejo 1
103
7. Anejo 1
104
7. Anejo 1
105
7. Anejo 1
106
7. Anejo 2
107
7. Anejo 2
108
7. Anejo 2
109
7. Anejo 2
Aeroterm
Month
Dayno
Soldeclin
Omega
Dr
Ra
N
Rns
f(n/N)
sigma(Tx_Tn)
emissivity
Rbo
LWR
Rn (Rns-Rl)
G
Rn-G
Rad Term
Rad Term(-G)
ETcomb
ET (-G)
-1
110
7. Anejo 2
6,00
ETo mm/day
5,00
4,00
3,00
2,00
1,00
0,00
JAN
FEB
MAR
APR
MAY
JUN
ETo (-G)
JUL
AUG
SEP
OCT
NOV
DEC
ETo
111
7. Anejo 2
112
7. Anejo 2
Dia : 21/11/98
113
7. Anejo 2
114
7. Anejo 2
115
7. Anejo 2
7. Anejo 2
Kc vs meses del ao
1,400
1,200
1,000
Kc
0,800
0,600
Serie1
0,400
0,200
0,000
0
10
11
12
-0,200
meses del ao
117
7. Anejo 2
i----------------------------------------------------------
----------------------------------------------------------
+----------------------------------------------------------
5. Regulacin de la impresora
6. Seleccin de directorios
+----------------------------------------------------------
+----------------------------------------------------------+
Su opcin ?
118
7. Anejo 2
____________________________________________________________________________
____________________________________________________________________________
____ Men general ___________________+----------------------------------+___
____ ------------ ___________________ 0 Fi
___
_____________________________________ 1 Fitxer de cultius
___
_____________________________________ 2 Dades de la parcella
___
_____________________________________ 3 Reg per superfcie
___
_____________________________________ 4 Reg localitzat
___
_____________________________________ 5 Fitxer climtic dades reals
___
_____________________________________ 6 Fitxer climtic dades mitjanes___
_____________________________________ 7 Opcions especials
___
_____________________________________+----------------------------------+___
____________________________________________________________________________
DARP (GENERALITAT CATALUNYA)
Dia : 17/10/98
119
7. Anejo 2
120
7. Anejo 2
121
7. Anejo 2
122
7. Anejo 2
123
7. Anejo 3
Fraccin Agotami.
Cultivos
Datos
Finca
Prof. Races
Datos
Cultivo
Tolerancia Sal
Das Cultivo
Datos
Climticos
Datos
Suelo
Texturas Suelo
Clima
Datos
Agua Riego
PROGRAMACIN
Sistemas Riego
Tipo Riego
Programacin
Riego
LEYENDA
Entrada/Visualizacin de datos
Clculos
Fichero
BALANCE HDRICO
Proceso
Decisin
Decisin
Listado
BALANCE HDRICO
RIEGOS
124
7. Anejo 3
125
7. Anejo 3
126
7. Anejo 3
127
7. Anejo 3
128
7. Anejo 3
129
7. Anejo 3
130
7. Anejo 3
131
7. Anejo 3
132
7. Anejo 3
133
7. Anejo 3
134
7. Anejo 3
135
7. Anejo 3
136
7. Anejo 3
137
7. Anejo 3
138
7. Anejo 3
139
7. Anejo 3
140
7. Anejo 3
141
7. Anejo 3
142
7. Anejo 3
28/11/98
19:23:55
Programacin........................................:
Finca...............................................:
Poblacin...........................................:
Provincia...........................................:
Latitud [g,m,s].....................................:
Longitud [g,m,s]....................................:
Altitud [m].........................................:
Superficie [m2].....................................:
Cultivo.............................................:
Fraccin agua disponible en el suelo................:
Clase textural......................................:
Densidad aparente [g/cm3]...........................:
Capacidad de Campo [% peso].........................:
Punto de Marchitamiento [%peso].....................:
Sistema Riego.......................................:
Eficiencia en la aplicacin [%].....................:
Caudal instalacin riego [m3/parcela]...............:
Conductividad agua de riego [dS/m)..................:
Eficiencia en el lavado de sales [%]................:
Rendimiento mnimo deseado debido a salinidad [%]...:
Fecha Plantacin/Inicio.............................:
Momento de Riego. Agotamiento de la RFU [%].........:
Intervalo de riego [das]...........................:
Dosis de riego. Recarga de la RFU [%]...............:
Nivel de agua de la RFU al inicio [%]...............:
Fecha
---------01-01-1998
02-01-1998
03-01-1998
04-01-1998
05-01-1998
06-01-1998
07-01-1998
08-01-1998
ETo
[mm]
----0,97
0,85
1,75
2,03
0,50
0,49
1,13
0,32
Kc
Kl
---0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
---0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
ETcKl P.E.
Raices F.A. R.F.U. Reserva d.n. d.b. D.B.
tiempoI tiempoC
[mm] [mm]
[cm]
[mm]
[mm]
[mm] [mm] [m3/par] [horas] [hora]
----- ------ ------ ---- ------ ------- ----- ----- -------- ------- ------0,57
6,24
60 0,35
28,5
5,67 0,00 0,00
0,0
0,0
0,0
0,51
6,08
60 0,35
28,5
11,24 0,00 0,00
0,0
0,0
0,0
1,04 24,10
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
1,20
0,00
60 0,35
28,5
27,33 0,00 0,00
0,0
0,0
0,0
0,30
4,06
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,29 31,20
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,67
0,93
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,19
7,80
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
143
7. Anejo 3
Fecha
---------09-01-1998
10-01-1998
11-01-1998
12-01-1998
13-01-1998
14-01-1998
15-01-1998
16-01-1998
17-01-1998
18-01-1998
19-01-1998
20-01-1998
21-01-1998
22-01-1998
23-01-1998
24-01-1998
25-01-1998
26-01-1998
27-01-1998
28-01-1998
29-01-1998
30-01-1998
31-01-1998
01-02-1998
02-02-1998
03-02-1998
04-02-1998
05-02-1998
06-02-1998
07-02-1998
08-02-1998
09-02-1998
10-02-1998
11-02-1998
12-02-1998
13-02-1998
14-02-1998
15-02-1998
16-02-1998
17-02-1998
18-02-1998
19-02-1998
ETo
[mm]
----1,16
2,03
1,05
1,21
0,50
1,07
1,41
1,13
0,79
1,29
0,60
1,32
1,10
1,19
0,97
0,91
1,03
1,18
0,72
1,32
0,75
1,41
0,79
1,32
0,97
1,65
1,39
1,32
1,75
1,63
1,48
1,50
1,38
1,68
1,92
2,79
2,04
4,48
1,85
1,65
1,42
1,71
Kc
Kl
---0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
---0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
ETcKl P.E.
Raices F.A. R.F.U. Reserva d.n. d.b. D.B.
tiempoI tiempoC
[mm] [mm]
[cm]
[mm]
[mm]
[mm] [mm] [m3/par] [horas] [hora]
----- ------ ------ ---- ------ ------- ----- ----- -------- ------- ------0,69
0,31
60 0,35
28,5
28,53 0,38 0,57
5,7
6,5
0,5
1,20
0,00
60 0,35
28,5
27,34 0,00 0,00
0,0
0,0
0,0
0,62
0,00
60 0,35
28,5
28,53 1,82 2,78
27,8
0,3
2,3
0,72
0,16
60 0,35
28,5
27,98 0,00 0,00
0,0
0,0
0,0
0,30
0,16
60 0,35
28,5
28,53 0,69 1,05
10,5
0,1
0,9
0,63
0,16
60 0,35
28,5
28,06 0,00 0,00
0,0
0,0
0,0
0,83
0,00
60 0,35
28,5
28,53 1,31 1,99
19,9
0,2
1,7
0,67
0,00
60 0,35
28,5
27,86 0,00 0,00
0,0
0,0
0,0
0,47
6,56
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,76
0,16
60 0,35
28,5
27,93 0,00 0,00
0,0
0,0
0,0
0,36
2,96
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,78
1,09
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,65
0,16
60 0,35
28,5
28,53 0,49 0,75
7,5
8,5
0,6
0,70
0,62
60 0,35
28,5
28,45 0,00 0,00
0,0
0,0
0,0
0,58
4,21
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,54
3,28
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,61
5,46
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,70
0,00
60 0,35
28,5
27,83 0,00 0,00
0,0
0,0
0,0
0,42
0,16
60 0,35
28,5
28,53 0,96 1,47
14,7
0,2
1,2
0,78
0,16
60 0,35
28,5
27,91 0,00 0,00
0,0
0,0
0,0
0,44
9,04
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,83
0,16
60 0,35
28,5
27,86 0,00 0,00
0,0
0,0
0,0
0,47
0,16
60 0,35
28,5
28,53 0,98 1,50
15,0
0,2
1,2
0,78
0,00
60 0,35
28,5
27,75 0,00 0,00
0,0
0,0
0,0
0,57
0,16
60 0,35
28,5
28,53 1,20 1,82
18,2
0,2
1,5
0,98
1,40
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,82
0,00
60 0,35
28,5
28,53 0,82 1,26
12,6
0,1
1,0
0,78
0,16
60 0,35
28,5
27,91 0,00 0,00
0,0
0,0
0,0
1,03
0,00
60 0,35
28,5
28,53 1,66 2,53
25,3
0,3
2,1
0,97
0,16
60 0,35
28,5
27,73 0,00 0,00
0,0
0,0
0,0
0,88
0,16
60 0,35
28,5
28,53 1,53 2,33
23,3
0,3
1,9
0,89
0,16
60 0,35
28,5
27,80 0,00 0,00
0,0
0,0
0,0
0,82
0,16
60 0,35
28,5
28,53 1,39 2,12
21,2
0,2
1,8
0,99
0,16
60 0,35
28,5
27,70 0,00 0,00
0,0
0,0
0,0
1,14
0,00
60 0,35
28,5
28,53 1,97 3,00
30,0
0,3
2,5
1,65
0,00
60 0,35
28,5
26,88 0,00 0,00
0,0
0,0
0,0
1,21
0,00
60 0,35
28,5
28,53 2,86 4,36
43,6
0,5
3,6
2,66
2,34
60 0,35
28,5
28,22 0,00 0,00
0,0
0,0
0,0
1,09
0,00
60 0,35
28,5
28,53 1,41 2,15
21,5
0,2
1,8
0,98
0,00
60 0,35
28,5
27,56 0,00 0,00
0,0
0,0
0,0
0,84
0,00
60 0,35
28,5
28,53 1,82 2,77
27,7
0,3
2,3
1,01
0,00
60 0,35
28,5
27,52 0,00 0,00
0,0
0,0
0,0
144
7. Anejo 3
Fecha
---------20-02-1998
21-02-1998
22-02-1998
23-02-1998
24-02-1998
25-02-1998
26-02-1998
27-02-1998
28-02-1998
01-03-1998
02-03-1998
03-03-1998
04-03-1998
05-03-1998
06-03-1998
07-03-1998
08-03-1998
09-03-1998
10-03-1998
11-03-1998
12-03-1998
13-03-1998
14-03-1998
15-03-1998
16-03-1998
17-03-1998
18-03-1998
19-03-1998
20-03-1998
21-03-1998
22-03-1998
23-03-1998
24-03-1998
25-03-1998
26-03-1998
27-03-1998
28-03-1998
29-03-1998
30-03-1998
31-03-1998
01-04-1998
02-04-1998
ETo
[mm]
----1,85
1,35
1,18
1,12
1,58
2,00
3,63
2,33
1,73
1,26
1,52
1,20
1,45
1,43
1,53
2,00
2,70
2,60
2,54
3,03
2,52
2,48
2,45
2,46
2,46
2,37
3,15
6,14
2,96
2,40
2,29
2,26
3,22
1,65
2,83
2,81
2,94
2,30
2,78
2,17
2,43
2,81
Kc
Kl
---0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,75
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
---0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
ETcKl P.E.
Raices F.A. R.F.U. Reserva d.n. d.b. D.B.
tiempoI tiempoC
[mm] [mm]
[cm]
[mm]
[mm]
[mm] [mm] [m3/par] [horas] [hora]
----- ------ ------ ---- ------ ------- ----- ----- -------- ------- ------1,09
0,00
60 0,35
28,5
28,53 2,11 3,21
32,1
0,4
2,7
0,80
0,16
60 0,35
28,5
27,90 0,00 0,00
0,0
0,0
0,0
0,70
0,00
60 0,35
28,5
28,53 1,34 2,04
20,4
0,2
1,7
0,66
0,00
60 0,35
28,5
27,87 0,00 0,00
0,0
0,0
0,0
0,94
0,16
60 0,35
28,5
28,53 1,44 2,19
21,9
0,2
1,8
1,18
0,00
60 0,35
28,5
27,35 0,00 0,00
0,0
0,0
0,0
2,15
0,00
60 0,35
28,5
28,53 3,34 5,08
50,8
0,6
4,2
1,38
0,00
60 0,35
28,5
27,16 0,00 0,00
0,0
0,0
0,0
1,03
0,00
60 0,35
28,5
28,53 2,41 3,66
36,6
0,4
3,1
0,79
0,00
60 0,35
28,5
27,74 0,00 0,00
0,0
0,0
0,0
0,96
0,16
60 0,35
28,5
28,53 1,59 2,43
24,3
0,3
2,0
0,76
0,16
60 0,35
28,5
27,94 0,00 0,00
0,0
0,0
0,0
0,92
0,00
60 0,35
28,5
28,53 1,52 2,31
23,1
0,3
1,9
0,90
0,00
60 0,35
28,5
27,63 0,00 0,00
0,0
0,0
0,0
0,97
0,00
60 0,35
28,5
28,53 1,87 2,84
28,4
0,3
2,4
1,27
0,00
60 0,35
28,5
27,27 0,00 0,00
0,0
0,0
0,0
1,71
0,16
60 0,35
28,5
28,53 2,81 4,28
42,8
0,5
3,6
1,64
0,00
60 0,35
28,5
26,89 0,00 0,00
0,0
0,0
0,0
1,60
0,00
60 0,35
28,5
28,53 3,25 4,94
49,4
0,6
4,1
1,91
0,00
60 0,35
28,5
26,62 0,00 0,00
0,0
0,0
0,0
1,59
0,00
60 0,35
28,5
28,53 3,51 5,34
53,4
0,6
4,5
1,57
0,00
60 0,35
28,5
26,97 0,00 0,00
0,0
0,0
0,0
1,55
0,00
60 0,35
28,5
28,53 3,12 4,75
47,5
0,5
4,0
1,55
0,00
60 0,35
28,5
26,98 0,00 0,00
0,0
0,0
0,0
1,55
0,00
60 0,35
28,5
28,53 3,11 4,74
47,4
0,5
3,9
1,49
0,00
60 0,35
28,5
27,04 0,00 0,00
0,0
0,0
0,0
1,99
0,00
60 0,35
28,5
28,53 3,48 5,30
53,0
0,6
4,4
3,88
0,00
60 0,35
28,5
24,65 0,00 0,00
0,0
0,0
0,0
1,87
0,00
60 0,35
28,5
28,53 5,75 8,77
87,7
1,0
7,3
1,52
0,00
60 0,35
28,5
27,02 0,00 0,00
0,0
0,0
0,0
1,45
0,00
60 0,35
28,5
28,53 2,97 4,52
45,2
0,5
3,8
1,43
0,00
60 0,35
28,5
27,10 0,00 0,00
0,0
0,0
0,0
2,03
0,62
60 0,35
28,5
28,53 2,84 4,33
43,3
0,5
3,6
1,04
0,00
60 0,35
28,5
27,50 0,00 0,00
0,0
0,0
0,0
1,79
0,00
60 0,35
28,5
28,53 2,83 4,31
43,1
0,5
3,6
1,78
0,00
60 0,35
28,5
26,76 0,00 0,00
0,0
0,0
0,0
1,86
0,00
60 0,35
28,5
28,53 3,63 5,53
55,3
0,6
4,6
1,45
0,00
60 0,35
28,5
27,08 0,00 0,00
0,0
0,0
0,0
1,75
0,00
60 0,35
28,5
28,53 3,21 4,89
48,9
0,5
4,1
1,37
0,00
60 0,35
28,5
27,16 0,00 0,00
0,0
0,0
0,0
1,54
0,00
60 0,35
28,5
28,53 2,91 4,43
44,3
0,5
3,7
1,78
0,00
60 0,35
28,5
26,76 0,00 0,00
0,0
0,0
0,0
145
7. Anejo 3
Fecha
---------03-04-1998
04-04-1998
05-04-1998
06-04-1998
07-04-1998
08-04-1998
09-04-1998
10-04-1998
11-04-1998
12-04-1998
13-04-1998
14-04-1998
15-04-1998
16-04-1998
17-04-1998
18-04-1998
19-04-1998
20-04-1998
21-04-1998
22-04-1998
23-04-1998
24-04-1998
25-04-1998
26-04-1998
27-04-1998
28-04-1998
29-04-1998
30-04-1998
01-05-1998
02-05-1998
03-05-1998
04-05-1998
05-05-1998
06-05-1998
07-05-1998
08-05-1998
09-05-1998
10-05-1998
11-05-1998
12-05-1998
13-05-1998
14-05-1998
ETo
[mm]
----3,01
3,92
3,52
3,40
2,51
1,88
3,17
3,48
3,38
3,99
3,08
3,32
3,14
3,07
1,13
1,05
1,74
0,48
3,49
3,65
3,58
2,79
3,42
2,91
3,34
4,81
6,14
4,37
4,20
3,81
3,25
3,84
4,88
6,98
3,02
4,02
4,08
3,04
2,56
2,36
3,27
3,75
Kc
Kl
---0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
---0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
ETcKl P.E.
Raices F.A. R.F.U. Reserva d.n.
[mm] [mm]
[cm]
[mm]
[mm]
[mm]
----- ------ ------ ---- ------ ------- ----1,90
0,00
60 0,35
28,5
28,53 3,68
2,48
0,00
60 0,35
28,5
26,06 0,00
2,23
0,00
60 0,35
28,5
28,53 4,70
2,15
0,00
60 0,35
28,5
26,38 0,00
1,59
0,00
60 0,35
28,5
28,53 3,74
1,19
0,00
60 0,35
28,5
27,35 0,00
2,00
0,00
60 0,35
28,5
28,53 3,19
2,20
0,16
60 0,35
28,5
26,50 0,00
2,14
0,00
60 0,35
28,5
28,53 4,18
2,52
0,00
60 0,35
28,5
26,01 0,00
1,94
0,00
60 0,35
28,5
28,53 4,47
2,10
0,00
60 0,35
28,5
26,44 0,00
1,99
0,16
60 0,35
28,5
28,53 3,92
1,94
0,00
60 0,35
28,5
26,60 0,00
0,71
2,80
60 0,35
28,5
28,53 0,00
0,67
7,64
60 0,35
28,5
28,53 0,00
1,10
0,78
60 0,35
28,5
28,53 0,32
0,30 24,60
60 0,35
28,5
28,53 0,00
2,20
0,00
60 0,35
28,5
28,53 2,20
2,30
0,00
60 0,35
28,5
26,23 0,00
2,26
0,00
60 0,35
28,5
28,53 4,57
1,76
0,00
60 0,35
28,5
26,77 0,00
2,16
0,00
60 0,35
28,5
28,53 3,92
1,84
0,16
60 0,35
28,5
26,86 0,00
2,11
0,00
60 0,35
28,5
28,53 3,79
3,04
0,00
60 0,35
28,5
25,50 0,00
3,88
0,00
60 0,35
28,5
28,53 6,92
2,76
0,00
60 0,35
28,5
25,77 0,00
2,65
0,00
60 0,35
28,5
28,53 5,41
2,40
0,00
60 0,35
28,5
26,13 0,00
2,05
0,00
60 0,35
28,5
28,53 4,46
2,43
0,16
60 0,35
28,5
26,27 0,00
3,08
0,00
60 0,35
28,5
28,53 5,35
4,41
0,00
60 0,35
28,5
24,12 0,00
1,91
0,62
60 0,35
28,5
28,53 5,70
2,54
0,00
60 0,35
28,5
25,99 0,00
2,58
0,00
60 0,35
28,5
28,53 5,12
1,92
0,00
60 0,35
28,5
26,61 0,00
1,62
0,00
60 0,35
28,5
28,53 3,54
1,49
0,00
60 0,35
28,5
27,04 0,00
2,06
0,00
60 0,35
28,5
28,53 3,56
2,37
0,31
60 0,35
28,5
26,48 0,00
d.b. D.B.
tiempoI tiempoC
[mm] [m3/par] [horas] [hora]
----- -------- ------- ------5,61
56,1
0,6
4,7
0,00
0,0
0,0
0,0
7,16
71,6
0,8
6,0
0,00
0,0
0,0
0,0
5,69
56,9
0,6
4,7
0,00
0,0
0,0
0,0
4,85
48,5
0,5
4,0
0,00
0,0
0,0
0,0
6,36
63,6
0,7
5,3
0,00
0,0
0,0
0,0
6,81
68,1
0,8
5,7
0,00
0,0
0,0
0,0
5,98
59,8
0,7
5,0
0,00
0,0
0,0
0,0
0,00
0,0
0,0
0,0
0,00
0,0
0,0
0,0
0,49
4,9
5,5
0,4
0,00
0,0
0,0
0,0
3,36
33,6
0,4
2,8
0,00
0,0
0,0
0,0
6,96
69,6
0,8
5,8
0,00
0,0
0,0
0,0
5,98
59,8
0,7
5,0
0,00
0,0
0,0
0,0
5,78
57,8
0,6
4,8
0,00
0,0
0,0
0,0
10,54
105,4
1,2
8,8
0,00
0,0
0,0
0,0
8,25
82,5
0,9
6,9
0,00
0,0
0,0
0,0
6,79
67,9
0,8
5,7
0,00
0,0
0,0
0,0
8,15
81,5
0,9
6,8
0,00
0,0
0,0
0,0
8,68
86,8
1,0
7,2
0,00
0,0
0,0
0,0
7,80
78,0
0,9
6,5
0,00
0,0
0,0
0,0
5,39
53,9
0,6
4,5
0,00
0,0
0,0
0,0
5,42
54,2
0,6
4,5
0,00
0,0
0,0
0,0
146
7. Anejo 3
Fecha
---------15-05-1998
16-05-1998
17-05-1998
18-05-1998
19-05-1998
20-05-1998
21-05-1998
22-05-1998
23-05-1998
24-05-1998
25-05-1998
26-05-1998
27-05-1998
28-05-1998
29-05-1998
30-05-1998
31-05-1998
01-06-1998
02-06-1998
03-06-1998
04-06-1998
05-06-1998
06-06-1998
07-06-1998
08-06-1998
09-06-1998
10-06-1998
11-06-1998
12-06-1998
13-06-1998
14-06-1998
15-06-1998
16-06-1998
17-06-1998
18-06-1998
19-06-1998
20-06-1998
21-06-1998
22-06-1998
23-06-1998
24-06-1998
25-06-1998
ETo
[mm]
----1,76
3,65
3,87
3,69
3,12
5,84
3,91
4,12
4,33
1,69
5,21
6,20
5,18
5,01
5,35
3,07
2,23
2,34
3,78
5,04
2,00
5,07
5,56
2,32
5,34
5,21
4,61
5,32
4,66
4,82
6,51
5,30
3,17
2,81
3,56
4,30
5,16
4,83
3,85
6,17
5,37
4,24
Kc
Kl
---0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
---0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
ETcKl P.E.
Raices F.A. R.F.U. Reserva d.n.
[mm] [mm]
[cm]
[mm]
[mm]
[mm]
----- ------ ------ ---- ------ ------- ----1,11
0,93
60 0,35
28,5
28,53 2,24
2,31
0,00
60 0,35
28,5
26,23 0,00
2,45
1,24
60 0,35
28,5
28,53 3,51
2,33
0,00
60 0,35
28,5
26,20 0,00
1,97
0,00
60 0,35
28,5
28,53 4,30
3,69
0,00
60 0,35
28,5
24,84 0,00
2,47
1,87
60 0,35
28,5
28,53 4,29
2,60
0,00
60 0,35
28,5
25,93 0,00
2,74
0,00
60 0,35
28,5
28,53 5,34
1,07
0,16
60 0,35
28,5
27,63 0,00
3,29
6,40
60 0,35
28,5
28,53 0,00
3,92
0,00
60 0,35
28,5
24,62 0,00
3,28
0,00
60 0,35
28,5
28,53 7,19
3,16
0,00
60 0,35
28,5
25,37 0,00
3,38
0,00
60 0,35
28,5
28,53 6,54
1,94
0,00
60 0,35
28,5
26,60 0,00
1,41
5,93
60 0,35
28,5
28,53 0,00
1,57
1,40
60 0,35
28,5
28,36 0,00
2,54
0,00
60 0,35
28,5
28,53 2,71
3,38
0,00
60 0,35
28,5
25,15 0,00
1,34
3,75
60 0,35
28,5
28,53 0,98
3,40
0,00
60 0,35
28,5
25,13 0,00
3,73
0,00
60 0,35
28,5
28,53 7,13
1,55
0,93
60 0,35
28,5
27,91 0,00
3,58
0,00
60 0,35
28,5
28,53 4,21
3,50
0,00
60 0,35
28,5
25,04 0,00
3,09
0,00
60 0,35
28,5
28,53 6,59
3,57
0,00
60 0,35
28,5
24,96 0,00
3,13
0,00
60 0,35
28,5
28,53 6,70
3,23
0,00
60 0,35
28,5
25,30 0,00
4,37
0,00
60 0,35
28,5
28,53 7,60
3,56
0,00
60 0,35
28,5
24,98 0,00
2,13
0,00
60 0,35
28,5
28,53 5,69
1,88
0,00
60 0,35
28,5
26,65 0,00
2,39
0,62
60 0,35
28,5
28,53 3,65
2,88
0,00
60 0,35
28,5
25,65 0,00
3,46
0,00
60 0,35
28,5
28,53 6,35
3,24
0,00
60 0,35
28,5
25,29 0,00
2,58
0,00
60 0,35
28,5
28,53 5,82
4,14
0,00
60 0,35
28,5
24,39 0,00
3,61
0,00
60 0,35
28,5
28,53 7,75
2,84
0,00
60 0,35
28,5
25,69 0,00
d.b. D.B.
tiempoI tiempoC
[mm] [m3/par] [horas] [hora]
----- -------- ------- ------3,41
34,1
0,4
2,8
0,00
0,0
0,0
0,0
5,35
53,5
0,6
4,5
0,00
0,0
0,0
0,0
6,56
65,6
0,7
5,5
0,00
0,0
0,0
0,0
6,54
65,4
0,7
5,4
0,00
0,0
0,0
0,0
8,14
81,4
0,9
6,8
0,00
0,0
0,0
0,0
0,00
0,0
0,0
0,0
0,00
0,0
0,0
0,0
10,95
109,6
1,2
9,1
0,00
0,0
0,0
0,0
9,97
99,7
1,1
8,3
0,00
0,0
0,0
0,0
0,00
0,0
0,0
0,0
0,00
0,0
0,0
0,0
4,13
41,3
0,5
3,4
0,00
0,0
0,0
0,0
1,49
14,9
0,2
1,2
0,00
0,0
0,0
0,0
10,86
108,7
1,2
9,1
0,00
0,0
0,0
0,0
6,41
64,1
0,7
5,3
0,00
0,0
0,0
0,0
10,04
100,4
1,1
8,4
0,00
0,0
0,0
0,0
10,20
102,1
1,1
8,5
0,00
0,0
0,0
0,0
11,58
115,8
1,3
9,7
0,00
0,0
0,0
0,0
8,67
86,7
1,0
7,2
0,00
0,0
0,0
0,0
5,56
55,6
0,6
4,6
0,00
0,0
0,0
0,0
9,67
96,7
1,1
8,1
0,00
0,0
0,0
0,0
8,87
88,7
1,0
7,4
0,00
0,0
0,0
0,0
11,80
118,0
1,3
9,8
0,00
0,0
0,0
0,0
147
7. Anejo 3
Fecha
---------26-06-1998
27-06-1998
28-06-1998
29-06-1998
30-06-1998
01-07-1998
02-07-1998
03-07-1998
04-07-1998
05-07-1998
06-07-1998
07-07-1998
08-07-1998
09-07-1998
10-07-1998
11-07-1998
12-07-1998
13-07-1998
14-07-1998
15-07-1998
16-07-1998
17-07-1998
18-07-1998
19-07-1998
20-07-1998
21-07-1998
22-07-1998
23-07-1998
24-07-1998
25-07-1998
26-07-1998
27-07-1998
28-07-1998
29-07-1998
30-07-1998
31-07-1998
01-08-1998
02-08-1998
03-08-1998
04-08-1998
05-08-1998
06-08-1998
ETo
[mm]
----4,68
2,77
1,60
3,74
4,44
4,49
4,29
4,67
2,45
6,20
5,27
5,59
6,03
3,46
3,97
5,41
4,70
4,94
4,33
5,80
5,02
5,90
5,42
5,58
3,71
4,63
5,39
4,18
5,26
5,74
5,44
4,40
4,62
4,67
4,89
5,78
4,79
4,81
4,84
3,86
3,14
3,60
Kc
Kl
---0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
---0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
ETcKl P.E.
Raices F.A. R.F.U. Reserva d.n.
[mm] [mm]
[cm]
[mm]
[mm]
[mm]
----- ------ ------ ---- ------ ------- ----3,14
0,78
60 0,35
28,5
28,53 5,20
1,86
0,00
60 0,35
28,5
26,68 0,00
1,07 28,20
60 0,35
28,5
28,53 0,00
2,51
0,00
60 0,35
28,5
26,02 0,00
2,98
0,00
60 0,35
28,5
28,53 5,49
3,02
0,00
60 0,35
28,5
25,52 0,00
2,88
0,16
60 0,35
28,5
28,53 5,74
3,13
0,16
60 0,35
28,5
25,56 0,00
1,64
6,40
60 0,35
28,5
28,53 0,00
4,16
0,00
60 0,35
28,5
24,37 0,00
3,54
0,00
60 0,35
28,5
28,53 7,71
3,75
0,00
60 0,35
28,5
24,78 0,00
4,05
0,00
60 0,35
28,5
28,53 7,80
2,32
1,40
60 0,35
28,5
27,61 0,00
2,67
0,31
60 0,35
28,5
28,53 3,28
3,63
0,00
60 0,35
28,5
24,90 0,00
3,16
0,00
60 0,35
28,5
28,53 6,79
3,31
0,00
60 0,35
28,5
25,22 0,00
2,91
0,00
60 0,35
28,5
28,53 6,22
3,90
0,00
60 0,35
28,5
24,64 0,00
3,37
0,00
60 0,35
28,5
28,53 7,26
3,96
0,00
60 0,35
28,5
24,58 0,00
3,64
0,00
60 0,35
28,5
28,53 7,60
3,74
0,00
60 0,35
28,5
24,79 0,00
2,49
0,00
60 0,35
28,5
28,53 6,23
3,11
0,00
60 0,35
28,5
25,43 0,00
3,62
0,00
60 0,35
28,5
28,53 6,73
2,81
0,16
60 0,35
28,5
25,89 0,00
3,53
0,00
60 0,35
28,5
28,53 6,18
3,85
0,00
60 0,35
28,5
24,68 0,00
3,65
0,00
60 0,35
28,5
28,53 7,51
2,96
0,00
60 0,35
28,5
25,58 0,00
3,11
0,00
60 0,35
28,5
28,53 6,06
3,13
0,00
60 0,35
28,5
25,40 0,00
3,28
0,00
60 0,35
28,5
28,53 6,42
3,88
0,00
60 0,35
28,5
24,65 0,00
3,22
0,00
60 0,35
28,5
28,53 7,10
3,23
0,00
60 0,35
28,5
25,30 0,00
3,25
0,00
60 0,35
28,5
28,53 6,48
2,59
0,93
60 0,35
28,5
26,87 0,00
2,11
1,87
60 0,35
28,5
28,53 1,90
2,42
0,31
60 0,35
28,5
26,43 0,00
d.b. D.B.
tiempoI tiempoC
[mm] [m3/par] [horas] [hora]
----- -------- ------- ------7,93
79,3
0,9
6,6
0,00
0,0
0,0
0,0
0,00
0,0
0,0
0,0
0,00
0,0
0,0
0,0
8,37
83,7
0,9
7,0
0,00
0,0
0,0
0,0
8,74
87,4
1,0
7,3
0,00
0,0
0,0
0,0
0,00
0,0
0,0
0,0
0,00
0,0
0,0
0,0
11,74
117,4
1,3
9,8
0,00
0,0
0,0
0,0
11,88
118,8
1,3
9,9
0,00
0,0
0,0
0,0
4,99
49,9
0,6
4,2
0,00
0,0
0,0
0,0
10,34
103,5
1,2
8,6
0,00
0,0
0,0
0,0
9,48
94,8
1,1
7,9
0,00
0,0
0,0
0,0
11,06
110,7
1,2
9,2
0,00
0,0
0,0
0,0
11,57
115,7
1,3
9,6
0,00
0,0
0,0
0,0
9,50
95,0
1,1
7,9
0,00
0,0
0,0
0,0
10,24
102,5
1,2
8,5
0,00
0,0
0,0
0,0
9,41
94,1
1,1
7,8
0,00
0,0
0,0
0,0
11,44
114,4
1,3
9,5
0,00
0,0
0,0
0,0
9,24
92,4
1,0
7,7
0,00
0,0
0,0
0,0
9,78
97,8
1,1
8,1
0,00
0,0
0,0
0,0
10,81
108,2
1,2
9,0
0,00
0,0
0,0
0,0
9,88
98,8
1,1
8,2
0,00
0,0
0,0
0,0
2,89
28,9
0,3
2,4
0,00
0,0
0,0
0,0
148
7. Anejo 3
Fecha
---------07-08-1998
08-08-1998
09-08-1998
10-08-1998
11-08-1998
12-08-1998
13-08-1998
14-08-1998
15-08-1998
16-08-1998
17-08-1998
18-08-1998
19-08-1998
20-08-1998
21-08-1998
22-08-1998
23-08-1998
24-08-1998
25-08-1998
26-08-1998
27-08-1998
28-08-1998
29-08-1998
30-08-1998
31-08-1998
01-09-1998
02-09-1998
03-09-1998
04-09-1998
05-09-1998
06-09-1998
07-09-1998
08-09-1998
09-09-1998
10-09-1998
11-09-1998
12-09-1998
13-09-1998
14-09-1998
15-09-1998
16-09-1998
17-09-1998
ETo
[mm]
----4,43
4,56
4,88
3,15
4,95
4,94
4,74
4,69
4,86
3,71
4,19
3,27
4,40
4,62
4,65
4,94
4,76
4,76
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
4,62
Kc
Kl
---0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
---0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
ETcKl P.E.
Raices F.A. R.F.U. Reserva d.n. d.b. D.B.
tiempoI tiempoC
[mm] [mm]
[cm]
[mm]
[mm]
[mm] [mm] [m3/par] [horas] [hora]
----- ------ ------ ---- ------ ------- ----- ----- -------- ------- ------2,97
0,78
60 0,35
28,5
28,53 4,30 6,55
65,5
0,7
5,5
3,06
0,00
60 0,35
28,5
25,48 0,00 0,00
0,0
0,0
0,0
3,28
0,00
60 0,35
28,5
28,53 6,34 9,65
96,5
1,1
8,0
2,12 18,40
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
3,32
0,16
60 0,35
28,5
28,53 3,16 4,82
48,2
0,5
4,0
3,32
0,00
60 0,35
28,5
25,22 0,00 0,00
0,0
0,0
0,0
3,18
0,00
60 0,35
28,5
28,53 6,50 9,90
99,0
1,1
8,3
3,15
0,00
60 0,35
28,5
25,39 0,00 0,00
0,0
0,0
0,0
3,26
0,00
60 0,35
28,5
28,53 6,41 9,77
97,7
1,1
8,1
2,49
0,16
60 0,35
28,5
26,20 0,00 0,00
0,0
0,0
0,0
2,81
0,00
60 0,35
28,5
28,53 5,14 7,83
78,3
0,9
6,5
2,19
0,00
60 0,35
28,5
26,34 0,00 0,00
0,0
0,0
0,0
2,96
0,00
60 0,35
28,5
28,53 5,15 7,85
78,5
0,9
6,5
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
3,12
0,00
60 0,35
28,5
28,53 6,22 9,48
94,8
1,1
7,9
3,32
0,00
60 0,35
28,5
25,22 0,00 0,00
0,0
0,0
0,0
3,20
0,00
60 0,35
28,5
28,53 6,52 9,93
99,3
1,1
8,3
3,20
0,00
60 0,35
28,5
25,34 0,00 0,00
0,0
0,0
0,0
3,10
0,00
60 0,35
28,5
28,53 6,30 9,60
96,0
1,1
8,0
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
3,10
0,00
60 0,35
28,5
28,53 6,20 9,45
94,5
1,1
7,9
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
3,10
0,00
60 0,35
28,5
28,53 6,20 9,45
94,5
1,1
7,9
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
3,10
0,00
60 0,35
28,5
28,53 6,20 9,45
94,5
1,1
7,9
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
3,10
0,00
60 0,35
28,5
28,53 6,20 9,45
94,5
1,1
7,9
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
3,10
0,00
60 0,35
28,5
28,53 6,20 9,45
94,5
1,1
7,9
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
3,10
0,00
60 0,35
28,5
28,53 6,20 9,45
94,5
1,1
7,9
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
3,10
0,00
60 0,35
28,5
28,53 6,20 9,45
94,5
1,1
7,9
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
3,10
0,00
60 0,35
28,5
28,53 6,20 9,45
94,5
1,1
7,9
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
3,10
0,00
60 0,35
28,5
28,53 6,20 9,45
94,5
1,1
7,9
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
3,10
0,00
60 0,35
28,5
28,53 6,20 9,45
94,5
1,1
7,9
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
3,10
0,00
60 0,35
28,5
28,53 6,20 9,45
94,5
1,1
7,9
3,10
0,00
60 0,35
28,5
25,43 0,00 0,00
0,0
0,0
0,0
149
7. Anejo 3
Fecha
---------18-09-1998
19-09-1998
20-09-1998
21-09-1998
22-09-1998
23-09-1998
24-09-1998
25-09-1998
26-09-1998
27-09-1998
28-09-1998
29-09-1998
30-09-1998
01-10-1998
02-10-1998
03-10-1998
04-10-1998
05-10-1998
06-10-1998
07-10-1998
08-10-1998
09-10-1998
10-10-1998
11-10-1998
12-10-1998
13-10-1998
14-10-1998
15-10-1998
16-10-1998
17-10-1998
18-10-1998
19-10-1998
20-10-1998
21-10-1998
22-10-1998
23-10-1998
24-10-1998
25-10-1998
26-10-1998
27-10-1998
28-10-1998
29-10-1998
ETo
[mm]
----2,59
3,32
3,10
3,23
3,15
3,07
1,91
0,56
3,15
3,10
1,07
1,07
1,07
1,07
1,07
1,07
1,07
1,07
1,07
1,07
1,07
1,07
1,07
1,07
1,07
1,07
1,07
1,07
2,59
2,59
2,59
2,59
2,59
2,59
2,59
2,59
2,59
2,43
1,64
1,61
0,34
1,67
Kc
Kl
---0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
0,85
---0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
ETcKl P.E.
Raices F.A. R.F.U. Reserva d.n. d.b. D.B.
tiempoI tiempoC
[mm] [mm]
[cm]
[mm]
[mm]
[mm] [mm] [m3/par] [horas] [hora]
----- ------ ------ ---- ------ ------- ----- ----- -------- ------- ------1,74
0,00
60 0,35
28,5
28,53 4,84 7,37
73,7
0,8
6,1
2,23
0,00
60 0,35
28,5
26,31 0,00 0,00
0,0
0,0
0,0
2,08
0,00
60 0,35
28,5
28,53 4,30 6,56
65,6
0,7
5,5
2,17
0,00
60 0,35
28,5
26,37 0,00 0,00
0,0
0,0
0,0
2,11
0,93
60 0,35
28,5
28,53 3,35 5,10
51,0
0,6
4,3
2,06
0,00
60 0,35
28,5
26,47 0,00 0,00
0,0
0,0
0,0
1,28
0,47
60 0,35
28,5
28,53 2,87 4,37
43,7
0,5
3,6
0,38 13,00
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
2,12
0,00
60 0,35
28,5
28,53 2,12 3,22
32,2
0,4
2,7
2,08
0,00
60 0,35
28,5
26,45 0,00 0,00
0,0
0,0
0,0
0,72
0,00
60 0,35
28,5
28,53 2,80 4,26
42,6
0,5
3,6
0,72
0,00
60 0,35
28,5
27,82 0,00 0,00
0,0
0,0
0,0
0,72
0,00
60 0,35
28,5
28,53 1,43 2,19
21,9
0,2
1,8
0,72
0,00
60 0,35
28,5
27,82 0,00 0,00
0,0
0,0
0,0
0,72
0,00
60 0,35
28,5
28,53 1,43 2,19
21,9
0,2
1,8
0,72
0,00
60 0,35
28,5
27,82 0,00 0,00
0,0
0,0
0,0
0,72
0,00
60 0,35
28,5
28,53 1,43 2,19
21,9
0,2
1,8
0,72
0,00
60 0,35
28,5
27,82 0,00 0,00
0,0
0,0
0,0
0,72
0,00
60 0,35
28,5
28,53 1,43 2,19
21,9
0,2
1,8
0,72
0,00
60 0,35
28,5
27,82 0,00 0,00
0,0
0,0
0,0
0,72
0,00
60 0,35
28,5
28,53 1,43 2,19
21,9
0,2
1,8
0,72
0,00
60 0,35
28,5
27,82 0,00 0,00
0,0
0,0
0,0
0,72
0,00
60 0,35
28,5
28,53 1,43 2,19
21,9
0,2
1,8
0,72
0,00
60 0,35
28,5
27,82 0,00 0,00
0,0
0,0
0,0
0,72
0,00
60 0,35
28,5
28,53 1,43 2,19
21,9
0,2
1,8
0,72
0,00
60 0,35
28,5
27,82 0,00 0,00
0,0
0,0
0,0
0,72
0,00
60 0,35
28,5
28,53 1,43 2,19
21,9
0,2
1,8
0,72
0,00
60 0,35
28,5
27,82 0,00 0,00
0,0
0,0
0,0
1,74
0,00
60 0,35
28,5
28,53 2,46 3,74
37,4
0,4
3,1
1,74
0,00
60 0,35
28,5
26,80 0,00 0,00
0,0
0,0
0,0
1,74
0,00
60 0,35
28,5
28,53 3,48 5,30
53,0
0,6
4,4
1,74
0,00
60 0,35
28,5
26,80 0,00 0,00
0,0
0,0
0,0
1,74
0,00
60 0,35
28,5
28,53 3,48 5,30
53,0
0,6
4,4
1,74
0,00
60 0,35
28,5
26,80 0,00 0,00
0,0
0,0
0,0
1,74
0,00
60 0,35
28,5
28,53 3,48 5,30
53,0
0,6
4,4
1,74
0,00
60 0,35
28,5
26,80 0,00 0,00
0,0
0,0
0,0
1,74
0,00
60 0,35
28,5
28,53 3,48 5,30
53,0
0,6
4,4
1,63
0,00
60 0,35
28,5
26,91 0,00 0,00
0,0
0,0
0,0
1,10
0,00
60 0,35
28,5
28,53 2,73 4,16
41,6
0,5
3,5
1,08
1,09
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,23 42,30
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
1,12
0,00
60 0,35
28,5
27,41 0,00 0,00
0,0
0,0
0,0
150
7. Anejo 3
Fecha
---------30-10-1998
31-10-1998
01-11-1998
02-11-1998
03-11-1998
04-11-1998
05-11-1998
06-11-1998
07-11-1998
08-11-1998
09-11-1998
10-11-1998
11-11-1998
12-11-1998
13-11-1998
14-11-1998
15-11-1998
16-11-1998
17-11-1998
18-11-1998
19-11-1998
20-11-1998
21-11-1998
22-11-1998
23-11-1998
24-11-1998
25-11-1998
26-11-1998
27-11-1998
28-11-1998
29-11-1998
30-11-1998
01-12-1998
02-12-1998
03-12-1998
04-12-1998
05-12-1998
06-12-1998
07-12-1998
08-12-1998
09-12-1998
10-12-1998
ETo
[mm]
----1,69
1,76
1,57
0,92
0,25
1,35
0,87
2,31
1,97
2,36
2,36
1,98
1,85
1,86
0,77
1,25
1,20
1,19
1,06
0,51
1,99
1,77
0,37
2,02
1,62
1,02
0,76
0,72
1,25
0,71
2,15
4,04
1,17
2,15
1,58
0,81
1,81
1,18
0,72
0,88
0,89
0,72
Kc
Kl
---0,85
0,85
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
---0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
ETcKl P.E.
Raices F.A. R.F.U. Reserva d.n. d.b. D.B.
tiempoI tiempoC
[mm] [mm]
[cm]
[mm]
[mm]
[mm] [mm] [m3/par] [horas] [hora]
----- ------ ------ ---- ------ ------- ----- ----- -------- ------- ------1,13
0,00
60 0,35
28,5
28,53 2,25 3,43
34,3
0,4
2,9
1,18
0,00
60 0,35
28,5
27,36 0,00 0,00
0,0
0,0
0,0
0,99
0,00
60 0,35
28,5
28,53 2,17 3,31
33,1
0,4
2,8
0,58
2,34
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,16
1,09
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,85
0,16
60 0,35
28,5
27,84 0,00 0,00
0,0
0,0
0,0
0,55
0,00
60 0,35
28,5
28,53 1,24 1,89
18,9
0,2
1,6
1,46
0,47
60 0,35
28,5
27,55 0,00 0,00
0,0
0,0
0,0
1,25
0,00
60 0,35
28,5
28,53 2,23 3,40
34,0
0,4
2,8
1,49
0,00
60 0,35
28,5
27,04 0,00 0,00
0,0
0,0
0,0
1,49
0,00
60 0,35
28,5
28,53 2,98 4,54
45,4
0,5
3,8
1,25
0,00
60 0,35
28,5
27,29 0,00 0,00
0,0
0,0
0,0
1,17
0,93
60 0,35
28,5
28,53 1,48 2,26
22,6
0,3
1,9
1,18
0,00
60 0,35
28,5
27,36 0,00 0,00
0,0
0,0
0,0
0,49
0,00
60 0,35
28,5
28,53 1,66 2,54
25,4
0,3
2,1
0,79
0,00
60 0,35
28,5
27,74 0,00 0,00
0,0
0,0
0,0
0,76
0,16
60 0,35
28,5
28,53 1,39 2,12
21,2
0,2
1,8
0,75
0,00
60 0,35
28,5
27,78 0,00 0,00
0,0
0,0
0,0
0,67
0,00
60 0,35
28,5
28,53 1,42 2,17
21,7
0,2
1,8
0,32
0,16
60 0,35
28,5
28,37 0,00 0,00
0,0
0,0
0,0
1,26
0,00
60 0,35
28,5
28,53 1,42 2,16
21,6
0,2
1,8
1,12
0,00
60 0,35
28,5
27,41 0,00 0,00
0,0
0,0
0,0
0,23
3,90
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
1,28
0,16
60 0,35
28,5
27,42 0,00 0,00
0,0
0,0
0,0
1,02
0,00
60 0,35
28,5
28,53 2,14 3,26
32,6
0,4
2,7
0,64
0,00
60 0,35
28,5
27,89 0,00 0,00
0,0
0,0
0,0
0,48
6,24
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,45 13,60
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,79
0,78
60 0,35
28,5
28,53 1,00 1,52
0,2
1,7
1,3
0,45
0,16
60 0,35
28,5
28,24 0,00 0,00
0,0
0,0
0,0
1,36
0,31
60 0,35
28,5
28,53 1,34 2,04
20,4
0,2
1,7
2,55
0,62
60 0,35
28,5
26,60 0,00 0,00
0,0
0,0
0,0
0,74
0,00
60 0,35
28,5
28,53 2,67 4,07
40,7
0,5
3,4
1,36
0,00
60 0,35
28,5
27,18 0,00 0,00
0,0
0,0
0,0
1,00
0,00
60 0,35
28,5
28,53 2,36 3,59
35,9
0,4
3,0
0,51
7,80
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
1,14 12,40
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,74
0,00
60 0,35
28,5
27,79 0,00 0,00
0,0
0,0
0,0
0,45
0,00
60 0,35
28,5
28,53 1,20 1,82
18,2
0,2
1,5
0,56
0,00
60 0,35
28,5
27,98 0,00 0,00
0,0
0,0
0,0
0,56
0,00
60 0,35
28,5
28,53 1,12 1,70
17,0
0,2
1,4
0,46
0,00
60 0,35
28,5
28,08 0,00 0,00
0,0
0,0
0,0
151
7. Anejo 3
Fecha
---------11-12-1998
12-12-1998
13-12-1998
14-12-1998
15-12-1998
16-12-1998
17-12-1998
18-12-1998
19-12-1998
20-12-1998
21-12-1998
22-12-1998
23-12-1998
24-12-1998
25-12-1998
26-12-1998
27-12-1998
28-12-1998
29-12-1998
30-12-1998
31-12-1998
ETo
[mm]
----0,58
0,63
1,22
0,61
1,15
0,20
5,10
0,17
0,45
1,41
0,99
0,69
2,41
0,65
0,89
1,12
2,31
1,49
0,70
0,38
0,52
Kc
Kl
---0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
0,80
---0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
0,79
ETcKl P.E.
Raices F.A. R.F.U. Reserva d.n. d.b. D.B.
tiempoI tiempoC
[mm] [mm]
[cm]
[mm]
[mm]
[mm] [mm] [m3/par] [horas] [hora]
----- ------ ------ ---- ------ ------- ----- ----- -------- ------- ------0,36
0,00
60 0,35
28,5
28,53 0,82 1,25
12,5
0,1
1,0
0,40
3,90
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,77
0,00
60 0,35
28,5
28,53 0,77 1,18
11,8
0,1
1,0
0,39
0,00
60 0,35
28,5
28,15 0,00 0,00
0,0
0,0
0,0
0,73
0,00
60 0,35
28,5
28,53 1,11 1,70
17,0
0,2
1,4
0,13
9,84
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
3,22
6,24
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,10
2,65
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,28
0,00
60 0,35
28,5
28,53 0,28 0,43
4,3
4,8
0,4
0,89
0,31
60 0,35
28,5
27,96 0,00 0,00
0,0
0,0
0,0
0,63
0,00
60 0,35
28,5
28,53 1,20 1,83
18,3
0,2
1,5
0,44
0,00
60 0,35
28,5
28,10 0,00 0,00
0,0
0,0
0,0
1,53
0,16
60 0,35
28,5
28,53 1,80 2,75
27,5
0,3
2,3
0,41
0,00
60 0,35
28,5
28,12 0,00 0,00
0,0
0,0
0,0
0,56
0,00
60 0,35
28,5
28,53 0,97 1,48
14,8
0,2
1,2
0,71
0,62
60 0,35
28,5
28,45 0,00 0,00
0,0
0,0
0,0
1,46
0,16
60 0,35
28,5
28,53 1,39 2,12
21,2
0,2
1,8
0,94
0,00
60 0,35
28,5
27,60 0,00 0,00
0,0
0,0
0,0
0,44
0,00
60 0,35
28,5
28,53 1,38 2,10
21,0
0,2
1,8
0,24
0,31
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
0,33
9,20
60 0,35
28,5
28,53 0,00 0,00
0,0
0,0
0,0
671
384
162
594
905
9038
152
7. Anejo 3
---------------------------------------------------------------------------------NOTAS:
- Cuando el intervalo de riego est en blanco, no se tiene en cuenta.
- ETo [mm] = Evapotranspiracin de referencia.
- Kc
= Constante de cultivo.
- Kl
= Coeficiente de localizacin. Slo en riego localizado.
- ETcKl [mm]= Evapotranspiracin de cultivo por coeficiente de localizacin
- P.E. [cm]= Lluvia efectiva (vase mtodo aplicado)
- Races [cm] = Profundidad efectiva de las races
- R.F.U. [mm] = Volumen de agua mximo de la Reserva Fcilmente Utilizable (RFU)
- Reserva [mm] = Volumen de agua existente en la RFU al final del da
- d.n. [mm] = Dosis neta de riego
- d.b. [mm] = Dosis bruta de riego
- D.B. [m3/parcela] = Dosis bruta de riego a aplicar en la parcela
- tiempoI [horas] = Tiempo mnimo previsto de riego debido a la infiltracin
- tiempoC [horas] = Tiempo mnimo previsto de riego debido al Caudal
- De las dos cifras anteriores, la mayor de ellas ser el tiempo mnimo de riego
----------------------------------------------------------------------------------
153
7. Anejo 3
28/11/98
19:28:13
Programacin........................................:
Finca...............................................:
Poblacin...........................................:
Provincia...........................................:
Latitud [g,m,s].....................................:
Longitud [g,m,s]....................................:
Altitud [m].........................................:
Superficie [m2].....................................:
Cultivo.............................................:
Fraccin agua disponible en el suelo................:
Clase textural......................................:
Densidad aparente [g/cm3]...........................:
Capacidad de Campo [% peso].........................:
Punto de Marchitamiento [%peso].....................:
Sistema Riego.......................................:
Eficiencia en la aplicacin [%].....................:
Caudal instalacin riego [m3/parcela]...............:
Conductividad agua de riego [dS/m]..................:
Eficiencia en el lavado de sales [%]................:
Rendimiento mnimo deseado debido a salinidad [%]...:
Fecha Plantacin/Inicio.............................:
Momento de Riego. Agotamiento de la RFU [%].........:
Intervalo de riego [das]...........................:
Dosis de riego. Recarga de la RFU [%]...............:
Nivel de agua de la RFU al inicio [%]...............:
Fecha
---------01-04-1998
25-04-1998
04-05-1998
08-05-1998
12-05-1998
16-05-1998
20-05-1998
24-05-1998
d.n.
[mm]
----5,67
5,52
6,60
6,62
7,80
8,93
10,10
11,27
d.b. D.B.
tiempoI tiempoF
[mm] [m3/par] [horas] [hora]
----- -------- ------- ------17,80
178,1
1,2
1,8
17,34
173,5
1,2
1,7
20,72
207,3
1,4
2,1
20,81
208,1
1,4
2,1
24,50
245,1
1,6
2,5
28,06
280,6
1,9
2,8
31,75
317,5
2,1
3,2
35,45
354,5
2,4
3,5
MAIZ (LLEIDA,MENSUAL)
El maizal
Lleida
Lleida
41 37' 49'' N
0 35' 50'' E
190
10000
MAIZ (GRANO)
0,4
FRANCO
1,51
19
10
ASPERSION (CLIMA SECO)
67
100
3
70
100
01-04-1998
100
100
0
Notas
--------------------------Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
154
7. Anejo 3
Fecha
---------27-05-1998
30-05-1998
02-06-1998
05-06-1998
08-06-1998
11-06-1998
14-06-1998
17-06-1998
20-06-1998
23-06-1998
26-06-1998
29-06-1998
01-07-1998
03-07-1998
05-07-1998
07-07-1998
09-07-1998
11-07-1998
13-07-1998
15-07-1998
17-07-1998
19-07-1998
21-07-1998
23-07-1998
25-07-1998
27-07-1998
29-07-1998
31-07-1998
03-08-1998
07-08-1998
12-08-1998
18-08-1998
27-08-1998
d.n.
[mm]
----8,81
10,02
11,74
12,97
13,32
14,46
13,92
13,92
13,92
13,92
13,92
13,92
11,17
13,05
13,05
13,05
13,05
13,05
13,05
13,05
13,05
13,05
13,05
13,05
13,05
13,05
13,05
13,81
15,52
19,37
22,10
23,41
28,74
d.b. D.B.
tiempoI tiempoF
[mm] [m3/par] [horas] [hora]
----- -------- ------- ------27,68
276,8
1,8
2,8
31,49
315,0
2,1
3,1
36,91
369,1
2,5
3,7
40,77
407,7
2,7
4,1
41,87
418,8
2,8
4,2
45,46
454,7
3,0
4,5
43,75
437,6
2,9
4,4
43,75
437,6
2,9
4,4
43,75
437,6
2,9
4,4
43,75
437,6
2,9
4,4
43,75
437,6
2,9
4,4
43,75
437,6
2,9
4,4
35,10
351,1
2,3
3,5
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
41,03
410,4
2,7
4,1
43,40
434,0
2,9
4,3
48,79
487,9
3,3
4,9
60,90
609,1
4,1
6,1
69,46
694,7
4,6
6,9
73,57
735,8
4,9
7,4
90,35
903,5
6,0
9,0
Nmero de Riegos...................:
Total dosis neta [mm]..............:
Total dosis bruta [mm].............:
Total dosis bruta [m3/parcela].....:
Notas
--------------------------Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
Se aplica lavado de sales.
41
534
1679
16793
----------------------------------------------------------------------------------
155
7. Anejo 3
NOTAS:
- Cuando el intervalo de riego est en blanco, no se tiene en cuenta.
- d.n. [mm] = Dosis neta de riego
- d.b. [mm] = Dosis bruta de riego
- D.B. [m3/parcela] = Dosis bruta de riego a aplicar en la parcela
- tiempoI [horas] = Tiempo mnimo previsto de riego debido a la infiltracin
- tiempoC [horas] = Tiempo mnimo previsto de riego debido al Caudal
- De las dos cifras anteriores, la mayor de ellas ser el tiempo mnimo de riego
----------------------------------------------------------------------------------
156
7. Anejo 4
7. ANEJO 4.
1. CLCULO DEL Kc INICIAL
Para calcular el Kc inicial en los cultivos extensivos y de huerta se dispone de 5
curvas que relacionan la ETo y la frecuencia re riegos (o lluvias) con el KC.
Se ha extrado los valores de Kc a partir de datos de ETo de 0,5 en 0,5 mm para
las cinco curva. En la tabla 1, se puede ver los valores de Kc.
Tabla 1. Valores de Kc para distintas frecuencias de riegos/lluvias y ETo.
Frecuencia de riegos lluvias
(4 das)
(7 das)
(10 das)
ETo [mm]
(2 das)
0,50
1,08
0,98
0,81
0,65
(20 das)
0,49
1,00
1,05
0,95
0,76
0,61
0,44
1,50
1,03
0,91
0,71
0,56
0,41
2,00
1,00
0,86
0,66
0,51
0,37
2,50
0,97
0,83
0,62
0,46
0,34
3,00
0,95
0,79
0,57
0,43
0,31
3,50
0,93
0,76
0,54
0,40
0,27
4,00
0,91
0,72
0,51
0,36
0,26
4,50
0,90
0,70
0,48
0,34
0,24
5,00
0,88
0,66
0,46
0,32
0,23
5,50
0,86
0,63
0,43
0,30
0,21
6,00
0,84
0,61
0,42
0,28
0,20
6,50
0,83
0,58
0,40
0,26
0,18
7,00
0,82
0,57
0,38
0,25
0,18
7,50
0,81
0,56
0,37
0,24
0,17
8,00
0,80
0,54
0,36
0,23
0,16
8,50
0,79
0,53
0,34
0,22
0,16
9,00
0,78
0,52
0,34
0,22
0,16
9,50
0,77
0,51
0,33
0,21
0,15
10,00
0,77
0,50
0,32
0,20
0,15
157
7. Anejo 4
R2 = 0,9958
Utilizamos la tabla.
Kc MAYOR Kc MENOR
siendo:
Kc
: Kc que se busca.
KcMAYOR
KcMENOR
: das de riego.
158
7. Anejo 4
[6 - 4] * [-------------]
] = 0,60
[7 - 4]
159
7. Anejo 4
Siendo:
CC : Humedad gravimtrica en la capacidad de campo [%].
PM : Humedad gravimtrica en el punto de marchitamiento [%].
Ac
Li
Ac
160
7. Anejo 4
161
7. Anejo 5
162
7. Anejo 5
RIEGOS1.BAS
' Vctor Yusta. Dicembre-1998
Attribute VB_Name = "Riegos1"
Option Explicit
Global gsDatabase As String
Global gsConnect As String
Global gsRecordsource As String
Global NombreProgramacion As String * 50
Public MenuInicial As String
Public ValorControl As Control
Public ValorTabla As String
Public BaseDeDatos As Database
Public fMenu As Recordset
Public fProgramacion As Recordset
Public fProgramacionClima As Recordset
Public fCultivos As Recordset
Public fCultivosKc As Recordset
Public fCultivosRaices As Recordset
Public fCultivosSal As Recordset
Public fCultivosFraccion As Recordset
Public fCultivosDias As Recordset
Public fBalanceHidrico As Recordset
Public fTexturas As Recordset
Public Const NBaseDeDatos As String = "C:\Riegos\Riegos.mdb"
Public Const NProgramacion As String = "Programacion"
Public Const NProgramacionClima As String = "ProgramacionClima"
Public Const NMenu As String = "Menu"
Public Const NCultivosKc As String = "CultivosKc"
Public Const NCultivosRaices As String = "CultivosRaices"
Public Const NCultivosSal As String = "CultivosSal"
Public Const NCultivosFraccion As String = "CultivosFraccion"
Public Const NCultivosDias As String = "CultivosDias"
Public Const NCultivosNombre As String = "CultivosNombre"
Public Const NBalanceHidrico As String = "BalanceHidrico"
Public Const NTexturas As String = "Texturas"
Public Sub BaseDatos()
Set BaseDeDatos = OpenDatabase(NBaseDeDatos)
Set fMenu = BaseDeDatos.OpenRecordset(NMenu, dbOpenTable)
Set fProgramacion = BaseDeDatos.OpenRecordset(NProgramacion, dbOpenTable)
Set fProgramacionClima = BaseDeDatos.OpenRecordset(NProgramacionClima, dbOpenTable)
Set fCultivosKc = BaseDeDatos.OpenRecordset(NCultivosKc, dbOpenTable)
Set fCultivosRaices = BaseDeDatos.OpenRecordset(NCultivosRaices, dbOpenTable)
Set fCultivosSal = BaseDeDatos.OpenRecordset(NCultivosSal, dbOpenTable)
Set fCultivosFraccion = BaseDeDatos.OpenRecordset(NCultivosFraccion, dbOpenTable)
Set fCultivosDias = BaseDeDatos.OpenRecordset(NCultivosDias, dbOpenTable)
Set fBalanceHidrico = BaseDeDatos.OpenRecordset(NBalanceHidrico, dbOpenTable)
Set fTexturas = BaseDeDatos.OpenRecordset(NTexturas, dbOpenTable)
End Sub
Public Function LeerFichero(nTabla As String, nIndice As String, nBusca As String, nCampo As String) As String
' Esta funcion lee ficheros de una base de datos indexada
' Pide: Nombre de la tabla, Nombre del indice,Valor buscado y Nombre del campo del cual devolver su valor
Dim BaseTablas As Database
Dim Tabla As Recordset
Set BaseTablas = OpenDatabase(NBaseDeDatos)
Set Tabla = BaseTablas.OpenRecordset(nTabla, dbOpenTable)
Tabla.Index = nIndice
Tabla.MoveFirst
Tabla.Seek "=", nBusca
If Tabla.NoMatch = False Then 'Registro encontrado
LeerFichero = IIf(IsNull(Tabla(nCampo)), "", Tabla(nCampo))
'LeerFichero = Tabla(nCampo)
Else
LeerFichero = "?"
End If
End Function
Public Function NoNulo(Dato)
' Sustituye el dato Null por Cadena Vacia
NoNulo = IIf(IsNull(Dato), "", Dato)
End Function
Public Function LeerMSJ(Valor As String)
' Lee mensajes en la tabla (TablaMensajes)
If Idioma = "CS" Then
LeerMSJ = LeerFichero("TablaMensajes", "Orden", Valor, "TextoMensaje")
163
7. Anejo 5
Else
LeerMSJ = LeerFichero("TablaMensajes", "Orden", Valor, "TexteMissatge")
End If
End Function
Public Function CargaPantalla(NombreForm As Form)
NombreForm.Top = 0
NombreForm.Left = 0
NombreForm.Height = 8600
NombreForm.Width = 12000
End Function
Public Function Numeros(tp As Integer) As Integer
If (tp < 48 Or tp > 57) And tp <> 8 Then
Numeros = 0
Else
Numeros = tp
End If
End Function
Public Function Numerico(Valor As String) As Integer
Numerico = Val(Trim(Valor))
End Function
Public Sub DibujaMensaje(NomForm)
NomForm.Mensaje.Height = 330
NomForm.Mensaje.Left = 105
NomForm.Mensaje.Top = 7980
NomForm.Mensaje.Width = 11775
End Sub
Public Sub DibujaPanelComandos(NomForm)
NomForm.PanelComandos.Height = 960
NomForm.PanelComandos.Left = 0
NomForm.PanelComandos.Top = 0
NomForm.PanelComandos.Width = 11985
End Sub
Public Function CursorOcupado(NombreForm As Form)
NombreForm.MousePointer = 11
End Function
Public Function CursorLibre(NombreForm As Form)
NombreForm.MousePointer = 0
End Function
Function CarNum(Variable As String) As Double
' entrada "4,21323" y sale 4.21323
Dim Frase
Frase = ""
Dim num
For num = 1 To Len(Trim(Variable))
Dim a
a = Mid$(Variable, num, 1)
If a = "," Then a = "."
Frase = Frase + a
Next num
CarNum = Val(Frase)
End Function
Function NumCar(Variable As Double) As String
Dim Inter
Inter = Trim(Str(Variable))
If (Variable > 0 And Variable < 1) Then
Inter = "0" + Trim(Str(Variable))
End If
If (Variable > -1 And Variable < 0) Then
Variable = Variable * -1
Inter = "-0" + Trim(Str(Variable))
End If
Dim Frase
Frase = ""
Dim num
For num = 1 To Len(Trim(Inter))
Dim a
a = Mid$(Inter, num, 1)
If a = "." Then a = ","
Frase = Frase + a
Next num
NumCar = Frase
End Function
164
7. Anejo 5
RIEGOS2.BAS
' Vctor Yusta. Dicembre-1998
Attribute VB_Name = "Riegos2"
Option Explicit
Public Const Pi As Double = 3.14159265358979
Public Function CalculaNumeroDias(DesdeFecha As Date, HastaFecha As Date) As Double
''DiaAno = DateDiff("d", Fecha1, Fecha2) + 1
CalculaNumeroDias = DateSerial(Year(HastaFecha), Month(HastaFecha), Day(HastaFecha)) DateSerial(Year(DesdeFecha), Month(DesdeFecha), Day(DesdeFecha))
'+ 1
End Function
Public Function GraRad() As Double
GraRad = Pi / 180
End Function
Public Function RadGra() As Double
RadGra = 180 / Pi
End Function
Public Function Seno(Valor As Double) As Double
Seno = Sin(Valor * GraRad())
End Function
Public Function Coseno(Valor As Double) As Double
Coseno = Cos(Valor * GraRad())
End Function
Public Function Tangente(Valor As Double) As Double
Tangente = Tan(Valor * GraRad())
End Function
Public Function ArcoSeno(Valor As Double) As Double
If (-Valor * Valor + 1) = 0 Then
ArcoSeno = Int(Atn(1E+99) * RadGra())
Else
ArcoSeno = Atn(Valor / Sqr(-Valor * Valor + 1)) * RadGra()
End If
End Function
Public Function ArcoCoseno(Valor As Double) As Double
If (-Valor * Valor + 1) = 0 Then
ArcoCoseno = 0
Else
ArcoCoseno = Atn(-Valor / Sqr(-Valor * Valor + 1)) * RadGra() + 2 * Atn(1) * RadGra()
End If
If Valor = 0 Then
ArcoCoseno = 90
End If
End Function
Public Function ArcoCosenoRad(Valor As Double) As Double
If Valor = 1 Then
ArcoCosenoRad = 0
Else
ArcoCosenoRad = Atn(-Valor / Sqr(-Valor * Valor + 1)) + 2 * Atn(1)
End If
End Function
Public Function ArcCosRad(Valor As Double) As Double
ArcCosRad = Atn(-Valor / Sqr(-Valor * Valor + 1)) + 2 * Atn(1)
End Function
Public Function SexCen(Valor As String) As Double
SexCen = Val(Mid(Valor, 1, 2)) + (Val(Mid(Valor, 4, 2)) / 60)
End Function
Public Function CenSex(Valor As Double) As String
CenSex = Str(Int(Valor)) & "" + Str((Valor - Int(Valor)) * 60) & "'"
End Function
Public Function LOG10(Valor As Double) As Double
LOG10 = Log(Valor) / Log(10#)
End Function
165
7. Anejo 5
RIEGOS.FRM
' Vctor Yusta. Dicembre-1998
Option Explicit
Private Sub Form_Load()
Call CargaPantalla(Me)
BaseDatos
Call CargaMenu
Show
DoEvents
End Sub
Private Sub Form_Terminate()
SalirProyecto
End Sub
Private Sub Form_Unload(Cancel As Integer)
Cancel = SalirProyecto
End Sub
Function SalirProyecto()
Dim Pregunta
Pregunta = MsgBox(" Quieres salir del programa? ", vbYesNo, "Salida")
If Pregunta = vbYes Then
Cls
End
End If
SalirProyecto = 1
End Function
Private Function CargaMenu()
Dim MenuCaption(9)
Dim FormaCaption(99)
Dim Num1
Dim Num2
fMenu.MoveFirst
Do While Not fMenu.EOF()
If fMenu("Numero") < 10 Then
MenuCaption(fMenu("Numero")) = fMenu("Menu")
Else
FormaCaption(fMenu("Numero")) = fMenu("Menu")
End If
fMenu.MoveNext
Loop
For Num1 = 1 To 9
If Trim(MenuCaption(Num1)) = "" Then
Me.Menu(Num1).Visible = False
Else
Me.Menu(Num1).Caption = MenuCaption(Num1)
For Num2 = 1 To 9
If Trim(FormaCaption((Num1 * 10) + Num2)) = "" Then
Me.Forma((Num1 * 10) + Num2).Visible = False
Else
Me.Forma((Num1 * 10) + Num2).Caption = FormaCaption((Num1 * 10) + Num2) + " " + NombreProgramacion
If LeerFichero("Menu", "Orden", ((Num1 * 10) + Num2), "Existe") <> "SI" Then Me.Forma((Num1 * 10) +
Num2).Enabled = False
If ((Num1 * 10) + Num2) > 20 And ((Num1 * 10) + Num2) < 39 Then
Me.Forma((Num1 * 10) + Num2).Enabled = False
End If
End If
Next Num2
End If
Next Num1
End Function
Private Sub Forma_Click(Index As Integer)
fMenu.Index = "Orden"
fMenu.MoveFirst
fMenu.Seek "=", Index
If fMenu.NoMatch = True Then 'Registro NO encontrado
MsgBox ("Este programa no existe")
Else
If NoNulo(fMenu("Existe")) <> "SI" Then
MsgBox ("Este programa no existe")
Else
CargarPrograma (Index)
Index = 0
End If
End If
166
7. Anejo 5
End Sub
Private Sub CargarPrograma(Numero)
On Error Resume Next
If Numero = 11 Then Load Riegos11
If Numero = 12 Then Load Riegos12
If Numero = 19 Then SalirProyecto
If Numero = 21 Then Load Riegos21
If Numero = 22 Then Load Riegos22
If Numero = 23 Then Load Riegos23
If Numero = 24 Then Load Riegos24
If Numero = 25 Then Load Riegos25
If Numero = 26 Then Load Riegos26
If Numero = 27 Then Load Riegos27
If Numero = 31 Then Load Riegos31
End Sub
167
7. Anejo 5
RIEGOS00.FRM
' Vctor Yusta. Dicembre-1998
VERSION 5.00
Object = "DBGRID32.OCX"
Option Explicit
Dim msSortCol As String
Dim mbCtrlKey As Integer
Private Sub Form_Load()
Dim bParmQry As Integer
Dim qdfTmp As QueryDef
On Error GoTo LoadErr
'Para hacer
'gsDatabase es una cadena global que necesita
'establecerse en el procedimiento startup de la aplicacin
Data1.DatabaseName = gsDatabase
'gsRecordSource es una cadena global que necesita
'en el procedimiento que carga este formulario
Data1.RecordSource = gsRecordsource
Data1.Connect = gsConnect
Data1.RecordsetType = 1 'dynaset
Data1.Options = 0
Data1.Refresh
If Len(Data1.RecordSource) > 50 Then
Me.Caption = "SQL Statement"
Else
Me.Caption = Data1.RecordSource
End If
Exit Sub
LoadErr:
MsgBox "Error:" & Err & " " & Err.Description
Unload Me
End Sub
Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdFilter_Click()
On Error GoTo FilterErr
Dim recRecordset1 As Recordset, recRecordset2 As Recordset
Dim sFilterStr As String
If Data1.RecordsetType = vbRSTypeTable Then
Beep
MsgBox "Imposible filtrar un recordset de tipo Table", 48
Exit Sub
End If
Set recRecordset1 = Data1.Recordset
'Copia el conjunto de resultados
sFilterStr = InputBox("Escriba la expresin de filtro:")
If Len(sFilterStr) = 0 Then Exit Sub
Screen.MousePointer = vbHourglass
recRecordset1.Filter = sFilterStr
Set recRecordset2 = recRecordset1.OpenRecordset(recRecordset1.Type) 'Establece el filtro
Set Data1.Recordset = recRecordset2
'Asigna de nuevo al objeto Recordset original
Screen.MousePointer = vbDefault
Exit Sub
FilterErr:
Screen.MousePointer = vbDefault
MsgBox "Error:" & Err & " " & Err.Description
Exit Sub
End Sub
Private Sub cmdRefresh_Click()
On Error GoTo RefErr
Data1.Recordset.Requery
Exit Sub
RefErr:
MsgBox "Error:" & Err & " " & Err.Description
Exit Sub
End Sub
Private Sub cmdSort_Click()
On Error GoTo SortErr
Dim recRecordset1 As Recordset, recRecordset2 As Recordset
Dim SortStr As String
If Data1.RecordsetType = vbRSTypeTable Then
Beep
MsgBox "Imposible ordenar un recordset de tipo Table", 48
168
7. Anejo 5
Exit Sub
End If
Set recRecordset1 = Data1.Recordset
'Copia el recordset
If Len(msSortCol) = 0 Then
SortStr = InputBox("Escriba la cadena de orden:")
If Len(SortStr) = 0 Then Exit Sub
Else
SortStr = msSortCol
End If
Screen.MousePointer = vbHourglass
recRecordset1.Sort = SortStr
'Establece el orden
Set recRecordset2 = recRecordset1.OpenRecordset(recRecordset1.Type)
Set Data1.Recordset = recRecordset2
Screen.MousePointer = vbDefault
Exit Sub
SortErr:
Screen.MousePointer = vbDefault
MsgBox "Error:" & Err & " " & Err.Description
Exit Sub
End Sub
Private Sub Form_Resize()
On Error Resume Next
If Me.WindowState <> 1 Then
grdDataGrid.Height = Me.Height - (425 + picButtons.Height)
End If
End Sub
Private Sub grdDataGrid_BeforeDelete(Cancel As Integer)
If MsgBox("Desea eliminar la fila actual?", vbYesNo + vbQuestion) <> vbYes Then
Cancel = True
End If
End Sub
Private Sub grdDataGrid_BeforeUpdate(Cancel As Integer)
If MsgBox("Desea realizar los cambios?", vbYesNo + vbQuestion) <> vbYes Then
Cancel = True
End If
End Sub
Private Sub grdDataGrid_HeadClick(ByVal ColIndex As Integer)
'Ahora se ordena por esta columna
If Data1.RecordsetType = vbRSTypeTable Then Exit Sub
'Comprueba el uso de la tecla Ctrl para sentido descendente
If mbCtrlKey Then
msSortCol = "[" & Data1.Recordset(ColIndex).Name & "] desc"
mbCtrlKey = 0 'reset it
Else
msSortCol = "[" & Data1.Recordset(ColIndex).Name & "]"
End If
cmdSort_Click
msSortCol = vbNullString 'Lo restablece
End Sub
Private Sub grdDataGrid_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
mbCtrlKey = Shift
End Sub
169
7. Anejo 5
RIEGOS11.FRM
' Vctor Yusta. Dicembre-1998
Object ="TABCTL32.OCX"
Object ="THREED32.OCX"
Object ="DBLIST32.OCX"
Option Explicit
Dim num
Private Sub Form_Load()
'Call CargaPantalla(Me)
BaseDatos
Me.Caption = LeerFichero("Menu", "Orden", 11, "Titulo") + " " + NombreProgramacion
Call DibujaMensaje(Me)
Call DibujaPanelComandos(Me)
Show
Tabla.Tab = 0
Posiciona (0)
Mensaje.Caption = "Escoge una de las tres opciones"
End Sub
Private Sub Comando_Click(Index As Integer)
Select Case Index
Case 0
SalirForm
Case 2
AnalizaTabla
Case 4
Dim Pregunta
Pregunta = MsgBox("Quieres borrar la programacin: " + RTrim(NombreProgramacion), 1, "BORRANDO
PROGRAMACIN")
If Pregunta = vbOK Then
BorrarProgramacion (NombreProgramacion)
End If
Comando(2).Visible = False
Comando(4).Visible = False
End Select
End Sub
Function BorrarProgramacion(vNombre As String)
BaseDeDatos.Execute "DELETE * FROM BalanceHidrico WHERE NombreProgramacion = '" & vNombre & "' ;"
BaseDeDatos.Execute "DELETE * FROM ProgramacionClima WHERE NombreProgramacion = '" & vNombre & "' ;"
BaseDeDatos.Execute "DELETE * FROM Programacion WHERE NombreProgramacion = '" & vNombre & "' ;"
Call MostrarInformacion
Data1.Refresh
DBList1.Refresh
DBList1.SetFocus
End Function
Private Sub AnalizaTabla()
Select Case Tabla.Tab
Case 0
If Trim(UCase(Entrada(0).Text)) = "" Then
Posiciona (0)
MsgBox ("Has de entrar algn nombre de diseo agronmico")
Else
If Trim(LeerFichero("Programacion", "Programacion", Trim(UCase(Entrada(0).Text)), "NombreProgramacion")) =
UCase(Entrada(0).Text) Then
Posiciona (0)
MsgBox ("Este diseo ya existe")
Else
NombreProgramacion = UCase(Entrada(0).Text)
fProgramacion.AddNew
fProgramacion("NombreProgramacion") = NombreProgramacion
fProgramacion.Update
Riegos.Caption = "Programacin de riegos" + " " + NombreProgramacion
For num = 21 To 29
Riegos.Forma(num).Enabled = True
Next num
Riegos.Forma(31).Enabled = True
Riegos.Forma(32).Enabled = True
SalirForm
End If
End If
Case 1
NombreProgramacion = DBList1.Text
Riegos.Caption = "Programacin de riegos" + " " + NombreProgramacion
For num = 21 To 29
170
7. Anejo 5
Riegos.Forma(num).Enabled = True
Next num
Riegos.Forma(31).Enabled = True
Riegos.Forma(32).Enabled = True
SalirForm
End Select
End Sub
Private Sub Entrada_KeyPress(Index As Integer, KeyAscii As Integer)
Select Case Index
Case 0
If Len(Trim(Entrada(Index))) > 0 Then
Comando(2).Visible = True
End If
Case 1
If Len(Trim(Entrada(Index))) > 0 Then
Comando(2).Visible = True
End If
Case 2
Print "Aqui ponemos la rutina de guardar como"
End Select
End Sub
Private Sub SalirForm()
Unload Me
Load Riegos
End Sub
Private Sub DBList1_Click()
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", DBList1.Text
NombreProgramacion = DBList1.Text
Mensaje.Caption = "Cliquea en las opciones de arriba"
If fProgramacion.NoMatch = False Then 'Registro encontrado
Muestra1.Caption = NoNulo(fProgramacion("Descripcion"))
Muestra2.Caption = NoNulo(fProgramacion("NombreFinca"))
Muestra3.Caption = NoNulo(fProgramacion("Poblacion"))
Muestra4.Caption = NoNulo(fProgramacion("Provincia"))
Muestra5.Caption = NoNulo(fProgramacion("Clima"))
Muestra6.Caption = NoNulo(fProgramacion("SuperficieFinca"))
End If
If RTrim(NombreProgramacion) <> "." Then
Comando(2).Visible = True
Comando(4).Visible = True
End If
End Sub
Private Sub DBList1_DblClick()
NombreProgramacion = DBList1.Text
Riegos.Caption = Riegos.Caption
Dim num
For num = 21 To 29
Riegos.Forma(num).Enabled = True
Next num
Riegos.Forma(31).Enabled = True
Riegos.Forma(32).Enabled = True
Riegos.Caption = "Programacin de riegos" + " " + NombreProgramacion
SalirForm
End Sub
Private Sub Tabla_Click(PreviousTab As Integer)
If Tabla.Tab = 0 Then
Comando(2).Visible = False
Comando(4).Visible = False
Mensaje.Caption = "Entra un nombre nuevo"
End If
Posiciona (0)
If Tabla.Tab = 1 Then
Call MostrarInformacion
Mensaje.Caption = "Escoge algn diseo, cliqueando con el ratn"
DBList1.SetFocus
End If
'If Tabla.Tab = 2 Then Entrada(1).SetFocus
End Sub
Private Sub MostrarInformacion()
Dim Busca
Busca = ""
171
7. Anejo 5
Busca = Busca + "SELECT * "
Busca = Busca + "FROM Programacion "
Busca = Busca + "WHERE "
Busca = Busca + "NombreProgramacion <> '.' "
Busca = Busca + "ORDER BY "
Busca = Busca + "NombreProgramacion ;"
Dim Consulta As Recordset
Set Consulta = BaseDeDatos.OpenRecordset(Busca)
If Consulta.RecordCount <> 0 Then
Data1.DatabaseName = "C:\Riegos\Riegos.mdb" 'NombreBaseDeDatos
Data1.RecordsetType = 1
Data1.RecordSource = Busca
Data1.Refresh
Else
MsgBox ("No hay informacin")
SalirForm
End If
End Sub
Sub Posiciona(Lugar As Integer)
Me.Entrada(Lugar).SelStart = 0
Me.Entrada(Lugar).SelLength = Len(Entrada(Lugar))
Me.Entrada(Lugar).SetFocus
End Sub
172
7. Anejo 5
RIEGOS12.FRM
' Vctor Yusta. Dicembre-1998
Object = "THREED32.OCX"
Option Explicit
Dim num
Dim Tablas(20) As String
Private Sub Form_Load()
Tablas(0) = "CultivosNombre"
Tablas(1) = "CultivosKc"
Tablas(2) = "CultivosDias"
Tablas(3) = "CultivosRaices"
Tablas(4) = "CultivosFraccion"
Tablas(5) = "Sal"
Tablas(6) = "Meteorologia"
Tablas(7) = "Texturas"
Tablas(8) = "SistemasRiego"
BaseDatos
Me.Caption = LeerFichero("Menu", "Orden", 12, "Titulo") + " " + NombreProgramacion
Call DibujaMensaje(Me)
Call DibujaPanelComandos(Me)
Frame1.Visible = True
Show
Mensaje.Caption = "Pulsa sobre cualquier tabla"
End Sub
Private Sub Ficheros_Click(Index As Integer)
Dim NombreTabla: NombreTabla = Tablas(Index)
' Select Case Index
' Case 0
' NombreTabla = "CultivosNombre"
' Case 1
' NombreTabla = "CultivosSal"
' Case 2
' NombreTabla = "CultivosSal"
' Case 3
' NombreTabla = "CultivosSal"
' Case 4
' NombreTabla = "CultivosSal"
' Case 5
' NombreTabla = "CultivosSal"
' Case 6
' NombreTabla = "CultivosSal"
' Case 7
' NombreTabla = "CultivosSal"
' End Select
Dim Busca: Busca = ""
Dim Consulta As Recordset
Busca = Busca + "SELECT * "
Busca = Busca + "FROM " & NombreTabla & " "
Busca = Busca + " ;"
Set Consulta = BaseDeDatos.OpenRecordset(Busca)
If Consulta.RecordCount <> 0 Then
Data2.DatabaseName = "C:\Riegos\Riegos.mdb" 'NombreBaseDeDatos
Data2.RecordsetType = 1
Data2.RecordSource = Busca
Data2.Refresh
Dim F As New Riegos00
Set F.Data1.Recordset = Data2.Recordset
F.Caption = Me.Caption & " Grid"
F.Show
End If
End Sub
Private Sub Comando_Click(Index As Integer)
Select Case Index
Case 0
SalirForm
End Select
End Sub
Private Sub SalirForm()
Unload Me
Load Riegos
End Sub
Private Sub MostrarInformacion()
Dim Busca
173
7. Anejo 5
Busca = ""
Busca = Busca + "SELECT * "
Busca = Busca + "FROM Programacion "
Busca = Busca + "WHERE "
Busca = Busca + "NombreProgramacion <> '.' "
Busca = Busca + "ORDER BY "
Busca = Busca + "NombreProgramacion ;"
Dim Consulta As Recordset
Set Consulta = BaseDeDatos.OpenRecordset(Busca)
If Consulta.RecordCount <> 0 Then
Data1.DatabaseName = "C:\Riegos\Riegos.mdb" 'NombreBaseDeDatos
Data1.RecordsetType = 1
Data1.RecordSource = Busca
Data1.Refresh
Else
MsgBox ("No hay informacin")
SalirForm
End If
End Sub
174
7. Anejo 5
RIEGOS21.FRM
' Vctor Yusta. Dicembre-1998
Object ="THREED32.OCX"
Option Explicit
Dim Atras
Dim Mensajes(20) As String
Dim Alertas(20) As String
Dim Campos(20) As String
Dim ExisteFichero As String
Private Sub Form_Load()
Campos(0) = "A030"
Mensajes(1) = "Entra una pequea descripcin de la finca"
Mensajes(2) = "Entra el nombre de la finca"
Mensajes(3) = "Entra el nombre de la poblacin"
Mensajes(4) = "Entra el nombre de la provincia"
Mensajes(5) = "Entra los grados de latitud del lugar"
Mensajes(6) = "Entra los minutos de latitud del lugar"
Mensajes(7) = "Entra los segundos de latitud del lugar"
Mensajes(8) = "Entra la latitud del lugar"
Mensajes(9) = "Entra los grados de longitud del lugar"
Mensajes(10) = "Entra los minutos de longitud del lugar"
Mensajes(11) = "Entra los segundos de longitud del lugar"
Mensajes(12) = "Entra la longitud del lugar"
Mensajes(13) = "Entra la altitud"
Mensajes(14) = "Clima: (M)ensual estimado (D)iario real"
Mensajes(15) = "Entra la superficie de la finca en m2"
Alertas(0) = ""
Alertas(1) = "Entra la descripcin"
Alertas(2) = "Entra el nombre"
Alertas(3) = "Entra la poblacin"
Alertas(4) = "Entra la provincia"
Alertas(5) = "El valor de los grados de latitud van de 0 a 180"
Alertas(6) = "El valor de los minutos de latitud van de 0 a 59"
Alertas(7) = "El valor de los segundos de latitud van de 0 a 59"
Alertas(8) = "El valor de la latitud es N o S"
Alertas(9) = "El valor de los grados de longitud van de 0 a 180"
Alertas(10) = "El valor de los minutos de longitud van de 0 a 59"
Alertas(11) = "El valor de los segundos de longitud van de 0 a 59"
Alertas(12) = "El valor de la longitud es E u O"
Alertas(13) = "La altitud va de 0 a 3000 metros"
Alertas(14) = "Ha de ser M o D"
Alertas(15) = "Entra la superficie de la finca"
Call CargaPantalla(Me)
BaseDatos
Me.Caption = LeerFichero("Menu", "Orden", Val(Right(Me.Name, 2)), "Titulo") + " " + NombreProgramacion
Call DibujaMensaje(Me)
Call DibujaPanelComandos(Me)
Show
Entrada(0).Text = NombreProgramacion
Comando(0).Visible = True
Mensaje.Caption = Mensajes(1)
CargarDatos
Posiciona (1)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Salir
End Sub
Private Sub Salir()
Unload Me
Load Riegos
End Sub
Private Sub Entrada_KeyPress(Index As Integer, KeyAscii As Integer)
'Print KeyAscii
Dim Pregunta
Dim Tecla
Dim tp As Integer
Dim Cadena As String
tp = KeyAscii
If KeyAscii = 13 Or KeyAscii = 9 And Atras = 0 Then Tecla = 1
Atras = 0
Cadena = Trim(Entrada(Index).Text)
Select Case Index
Case 1 ' Nombre de la Finca
175
7. Anejo 5
If Tecla = 1 Then
If Cadena = "" Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 2 ' Nombre de la Finca
If Tecla = 1 Then
If Cadena = "" Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1):
Posiciona (Index + 1)
End If
End If
Case 3 ' Nombre de la Finca
If Tecla = 1 Then
If Cadena = "" Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 4 ' Nombre de la Finca
If Tecla = 1 Then
If Cadena = "" Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 5 ' grados latitud
KeyAscii = Numeros(tp)
If Tecla = 1 Then
If Numerico(Cadena) < 0 Or Numerico(Cadena) > 180 Or Len(Cadena) = 0 Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 6 ' grados latitud
KeyAscii = Numeros(tp)
If Tecla = 1 Then
If Numerico(Cadena) < 0 Or Numerico(Cadena) > 59 Or Len(Cadena) = 0 Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 7 ' grados latitud
KeyAscii = Numeros(tp)
If Tecla = 1 Then
If Numerico(Cadena) < 0 Or Numerico(Cadena) > 59 Or Len(Cadena) = 0 Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 8 ' grados latitud
176
7. Anejo 5
Cadena = UCase(Cadena)
Entrada(Index).Text = Cadena
If Tecla = 1 Then
If Cadena <> "N" And Cadena <> "S" Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 9 ' grados latitud
KeyAscii = Numeros(tp)
If Tecla = 1 Then
If Numerico(Cadena) < 0 Or Numerico(Cadena) > 180 Or Len(Cadena) = 0 Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 10 ' grados latitud
KeyAscii = Numeros(tp)
If Tecla = 1 Then
If Numerico(Cadena) < 0 Or Numerico(Cadena) > 59 Or Len(Cadena) = 0 Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 11 ' grados latitud
KeyAscii = Numeros(tp)
If Tecla = 1 Then
If Numerico(Cadena) < 0 Or Numerico(Cadena) > 59 Or Len(Cadena) = 0 Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 12 ' grados latitud
Cadena = UCase(Cadena)
Entrada(Index).Text = Cadena
If Tecla = 1 Then
If Cadena <> "E" And Cadena <> "O" Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 13 ' grados latitud
KeyAscii = Numeros(tp)
If Tecla = 1 Then
If Numerico(Cadena) < 0 Or Numerico(Cadena) > 3000 Or Len(Cadena) = 0 Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 14 ' datos climaticos
Cadena = UCase(Cadena)
Entrada(Index).Text = Cadena
If Tecla = 1 Then
If Cadena <> "M" And Cadena <> "D" Then
Pregunta = MsgBox(Alertas(Index))
177
7. Anejo 5
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(Index + 1)
Posiciona (Index + 1)
End If
End If
Case 15 ' superficie de la finca
KeyAscii = Numeros(tp)
If Tecla = 1 Then
If Numerico(Cadena) < 0 Or Len(Cadena) = 0 Then
Pregunta = MsgBox(Alertas(Index))
Posiciona (Index)
Else
Mensaje.Caption = Mensajes(0)
Comando(5).Visible = True
Posiciona (1)
End If
End If
End Select
End Sub
Private Sub Entrada_DblClick(Index As Integer)
Select Case Index
'Case 8
End Select
End Sub
Private Sub Comando_Click(Index As Integer)
Select Case Index
Case 0 ' Salida del formulario
Salir
Case 5 ' Salida del formulario
Call GrabarDatos
Unload Me
End Select
End Sub
Private Sub Entrada_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
'Print KeyCode, Shift
If Index > 1 And KeyCode = 38 Then
Posiciona (Index - 1)
End If
If Index > 0 And KeyCode = 9 And Shift = 1 Then
If Index - 1 < 1 Then Index = 16
Posiciona (Index - 1)
Atras = 1
End If
End Sub
Private Sub CargarDatos()
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Call MoverFP("NombreProgramacion", Entrada(0))
Call MoverFP("Descripcion", Entrada(1))
Call MoverFP("NombreFinca", Entrada(2))
Call MoverFP("Poblacion", Entrada(3))
Call MoverFP("Provincia", Entrada(4))
Call MoverFP("LatitudGrados", Entrada(5))
Call MoverFP("LatitudMinutos", Entrada(6))
Call MoverFP("LatitudSegundos", Entrada(7))
Call MoverFP("Latitud", Entrada(8))
Call MoverFP("LongitudGrados", Entrada(9))
Call MoverFP("LongitudMinutos", Entrada(10))
Call MoverFP("LongitudSegundos", Entrada(11))
Call MoverFP("Longitud", Entrada(12))
Call MoverFP("Altitud", Entrada(13))
Call MoverFP("Clima", Entrada(14))
Call MoverFP("SuperficieFinca", Entrada(15))
ExisteFichero = "SI"
Else
ExisteFichero = "NO"
End If
End Sub
Private Sub GrabarDatos()
If ExisteFichero = "NO" Then
178
7. Anejo 5
fProgramacion.AddNew
Else
fProgramacion.Edit
End If
Call MoverPF("NombreProgramacion", Entrada(0))
Call MoverPF("Descripcion", Entrada(1))
Call MoverPF("NombreFinca", Entrada(2))
Call MoverPF("Poblacion", Entrada(3))
Call MoverPF("Provincia", Entrada(4))
Call MoverPF("LatitudGrados", Entrada(5))
Call MoverPF("LatitudMinutos", Entrada(6))
Call MoverPF("LatitudSegundos", Entrada(7))
Call MoverPF("Latitud", Entrada(8))
Call MoverPF("LongitudGrados", Entrada(9))
Call MoverPF("LongitudMinutos", Entrada(10))
Call MoverPF("LongitudSegundos", Entrada(11))
Call MoverPF("Longitud", Entrada(12))
Call MoverPF("Altitud", Entrada(13))
Call MoverPF("Clima", Entrada(14))
Call MoverPF("SuperficieFinca", Entrada(15))
fProgramacion("Pantalla21") = "T"
fProgramacion.Update
End Sub
Private Sub Entrada_GotFocus(Index As Integer)
End Sub
Private Sub MoverFP(Campo As String, Pantalla)
Pantalla.Text = NoNulo(fProgramacion(Campo))
End Sub
Private Sub MoverPF(Campo As String, Pantalla)
fProgramacion(Campo) = Pantalla.Text
End Sub
Sub Posiciona(Lugar As Integer)
Me.Entrada(Lugar).SelStart = 0
Me.Entrada(Lugar).SelLength = Len(Entrada(Lugar))
Me.Entrada(Lugar).SetFocus
End Sub
179
7. Anejo 5
RIEGOS22.FRM
' Vctor Yusta. Dicembre-1998
Object ="THREED32.OCX"
Object ="DBLIST32.OCX"
Option Explicit
'Dim Atras
Dim Mensajes(41) As String
Dim Alertas(41) As String
Dim ValorControl As Control
Dim ValorTabla As String
Dim Indice As Integer
Dim Atras As Integer
Dim Campos(41) As String
Dim ExisteFichero As String
Dim QueMes
Dim vColor
Dim Tierra(20)
Private Sub Form_Load()
Indice = 1
Mensajes(1) = "Entra el nombre de cultivio, o cliquea en opciones de cultivo"
Mensajes(2) = "Entra la cantidad de Arcilla (%)"
Mensajes(3) = "Entra la cantidad de Limo (%)"
Mensajes(4) = "Cliquea a la derecha, si quieres escoger textura"
Mensajes(5) = "Entra la capacidad de campo (% suelo seco)"
Mensajes(6) = "Entra el punto de marchitez(% suelo seco)"
Mensajes(7) = "Entra los segundos de latitud del lugar"
Mensajes(8) = "Entra la Kc de la fase Inicial []"
Mensajes(9) = "Entra la Kc de la fase de media []"
Mensajes(10) = "Entra la Kc de la fase Final []"
Mensajes(11) = "Entra el nmero de das de ste intrvalo [das]"
Mensajes(12) = "Entra el nmero de das de ste intrvalo [das]"
Mensajes(13) = "Entra el nmero de das de ste intrvalo [das]"
Mensajes(14) = "Entra el nmero de das de ste intrvalo [das]"
Mensajes(15) = "Entra la profundidad efectiva de las races [cm]"
Mensajes(16) = "Entra la profundidad efectiva de las races [cm]"
Mensajes(17) = "Entra la profundidad efectiva de las races [cm]"
Mensajes(18) = "Entra el Kc del mes de Enero []"
Mensajes(19) = "Entra el Kc del mes de Febrero []"
Mensajes(20) = "Entra el Kc del mes de Marzo []"
Mensajes(21) = "Entra el Kc del mes de Abril []"
Mensajes(22) = "Entra el Kc del mes de Mayo []"
Mensajes(23) = "Entra el Kc del mes de Junio []"
Mensajes(24) = "Entra el Kc del mes de Julio []"
Mensajes(25) = "Entra el Kc del mes de Agosto []"
Mensajes(26) = "Entra el Kc del mes de Septiembre []"
Mensajes(27) = "Entra el Kc del mes de Octubre []"
Mensajes(28) = "Entra el Kc del mes de Noviembre []"
Mensajes(29) = "Entra el Kc del mes de Diciembre []"
Mensajes(30) = "Entra la profundidad efectiva de las races [cm]"
Mensajes(31) = "Entra la fraccin de agua disponible en el suelo []"
Mensajes(32) = "Entra la toleracia a sales del suelo para una produccin del 100% [dS/cm]"
Mensajes(33) = "Entra la toleracia a sales del agua para una produccin del 100% [dS/cm]"
Mensajes(34) = "Entra la toleracia a sales del suelo para una produccin del 90% [dS/cm]"
Mensajes(35) = "Entra la toleracia a sales del agua para una produccin del 90% [dS/cm]"
Mensajes(36) = "Entra la toleracia a sales del suelo para una produccin del 75% [dS/cm]"
Mensajes(37) = "Entra la toleracia a sales del agua para una produccin del 75% [dS/cm]"
Mensajes(38) = "Entra la toleracia a sales del suelo para una produccin del 50% [dS/cm]"
Mensajes(39) = "Entra la toleracia a sales del agua para una produccin del 50% [dS/cm]"
Mensajes(40) = "Entra la mxima toleracia a sales del suelo [dS/cm]"
Mensajes(41) = "Entra la fecha de plantacin o siembra (anuales). En prurianuales 01-01-ao [dd-mm-aaaa]"
Alertas(0) = ""
Alertas(1) = "Entra la descripcin"
Alertas(2) = "Entra el nombre"
Alertas(3) = "Entra la poblacin"
Alertas(4) = "Entra la provincia"
Alertas(5) = "El valor de los grados de latitud van de 0 a 180"
Alertas(6) = "El valor de los minutos de latitud van de 0 a 59"
Alertas(7) = "El valor de los segundos de latitud van de 0 a 59"
Alertas(8) = "El valor de la latitud es N o S"
Alertas(9) = "El valor de los grados de longitud van de 0 a 180"
Alertas(10) = "El valor de los minutos de longitud van de 0 a 59"
Alertas(11) = "El valor de los segundos de longitud van de 0 a 59"
Alertas(12) = "El valor de la longitud es E u O"
180
7. Anejo 5
Alertas(13) = "La altitud va de 0 a 3000 metros"
Alertas(14) = "El nmero de cultivos va de 1 5"
Call CargaPantalla(Me)
BaseDatos
Me.Caption = LeerFichero("Menu", "Orden", 22, "Titulo") + " " + NombreProgramacion
Call DibujaMensaje(Me)
Call DibujaPanelComandos(Me)
Show
Entrada(0).Text = NombreProgramacion
Mensaje.Caption = Mensajes(1)
CargarDatos
Posiciona (1)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Salir
End Sub
Private Sub Salir()
Unload Me
Load Riegos
End Sub
Private Sub Comando_Click(Index As Integer)
Select Case Index
Case 0 ' Salida del formulario
Salir
Case 5 ' Salida del formulario
Call GrabarDatos
Unload Me
End Select
End Sub
Private Sub CargarDatos()
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Call MoverFP("NombreProgramacion", Entrada(0))
Call MoverFP("Cultivo", Entrada(1))
Call MoverFP("Tipo", Entrada(2))
Call MoverFP("Hierba", Entrada(3))
Call MoverFP("Heladas", Entrada(4))
Call MoverFP("Humedad", Entrada(5))
Call MoverFP("Vientos", Entrada(6))
Call MoverFP("Edad", Entrada(7))
Call MoverFP("KcI", Entrada(8))
Call MoverFP("KcM", Entrada(9))
Call MoverFP("KcF", Entrada(10))
Call MoverFP("DiasI", Entrada(11))
Call MoverFP("DiasD", Entrada(12))
Call MoverFP("DiasM", Entrada(13))
Call MoverFP("DiasF", Entrada(14))
Call MoverFP("RaicesI", Entrada(15))
Call MoverFP("RaicesM", Entrada(16))
Call MoverFP("RaicesF", Entrada(17))
Call MoverFP("Kc01", Entrada(18))
Call MoverFP("Kc02", Entrada(19))
Call MoverFP("Kc03", Entrada(20))
Call MoverFP("Kc04", Entrada(21))
Call MoverFP("Kc05", Entrada(22))
Call MoverFP("Kc06", Entrada(23))
Call MoverFP("Kc07", Entrada(24))
Call MoverFP("Kc08", Entrada(25))
Call MoverFP("Kc09", Entrada(26))
Call MoverFP("Kc10", Entrada(27))
Call MoverFP("Kc11", Entrada(28))
Call MoverFP("Kc12", Entrada(29))
Call MoverFP("Raices", Entrada(30))
Call MoverFP("Fraccion", Entrada(31))
Call MoverFP("ECe100", Entrada(32))
Call MoverFP("ECw100", Entrada(33))
Call MoverFP("ECe90", Entrada(34))
Call MoverFP("ECw90", Entrada(35))
Call MoverFP("ECe75", Entrada(36))
Call MoverFP("ECw75", Entrada(37))
Call MoverFP("ECe50", Entrada(38))
181
7. Anejo 5
Call MoverFP("ECw50", Entrada(39))
Call MoverFP("MaxECe", Entrada(40))
Call MoverFP("FechaPlantacion", Entrada(41))
If fProgramacion("Tipo") = "A" Then
Frame1.Visible = True
Frame2.Visible = False
End If
If fProgramacion("Tipo") = "B" Then
Frame1.Visible = True
Frame2.Visible = False
End If
If fProgramacion("Tipo") = "D" Then
Frame1.Visible = True
Frame2.Visible = False
End If
If fProgramacion("Tipo") = "E" Then
Frame1.Visible = False
Frame2.Visible = True
End If
If fProgramacion("Tipo") = "F" Then
Frame1.Visible = False
Frame2.Visible = True
End If
If fProgramacion("Tipo") = "G" Then
Frame1.Visible = False
Frame2.Visible = True
End If
If fProgramacion("Tipo") = "H" Then
Frame1.Visible = False
Frame2.Visible = True
End If
If fProgramacion("Tipo") = "O" Then
Frame1.Visible = False
Frame2.Visible = True
End If
End If
End Sub
Private Sub GrabarDatos()
fProgramacion.Edit
fProgramacion("Cultivo") = Entrada(1).Text
fProgramacion("Tipo") = Entrada(2).Text
fProgramacion("Hierba") = Entrada(3).Text
fProgramacion("Heladas") = Entrada(4).Text
fProgramacion("Humedad") = Entrada(5).Text
fProgramacion("Vientos") = Entrada(6).Text
fProgramacion("Edad") = Entrada(7).Text
fProgramacion("KcI") = Entrada(8).Text
fProgramacion("KcM") = Entrada(9).Text
fProgramacion("KcF") = Entrada(10).Text
fProgramacion("DiasI") = Entrada(11).Text
fProgramacion("DiasD") = Entrada(12).Text
fProgramacion("DiasM") = Entrada(13).Text
fProgramacion("DiasF") = Entrada(14).Text
fProgramacion("RaicesI") = Entrada(15).Text
fProgramacion("RaicesM") = Entrada(16).Text
fProgramacion("RaicesF") = Entrada(17).Text
fProgramacion("Kc01") = Entrada(18).Text
fProgramacion("Kc02") = Entrada(19).Text
fProgramacion("Kc03") = Entrada(20).Text
fProgramacion("Kc04") = Entrada(21).Text
fProgramacion("Kc05") = Entrada(22).Text
fProgramacion("Kc06") = Entrada(23).Text
fProgramacion("Kc07") = Entrada(24).Text
fProgramacion("Kc08") = Entrada(25).Text
fProgramacion("Kc09") = Entrada(26).Text
fProgramacion("Kc10") = Entrada(27).Text
fProgramacion("Kc11") = Entrada(28).Text
fProgramacion("Kc12") = Entrada(29).Text
fProgramacion("Raices") = Entrada(30).Text
fProgramacion("Fraccion") = Entrada(31).Text
fProgramacion("ECe100") = Entrada(32).Text
fProgramacion("ECw100") = Entrada(33).Text
fProgramacion("ECe90") = Entrada(34).Text
182
7. Anejo 5
fProgramacion("ECw90") = Entrada(35).Text
fProgramacion("ECe75") = Entrada(36).Text
fProgramacion("ECw75") = Entrada(37).Text
fProgramacion("ECe50") = Entrada(38).Text
fProgramacion("ECw50") = Entrada(39).Text
fProgramacion("MaxECe") = Entrada(40).Text
fProgramacion("FechaPlantacion") = Entrada(41).Text
fProgramacion("Pantalla22") = "T"
fProgramacion.Update
End Sub
Private Sub MoverFP(Campo As String, Pantalla)
Pantalla.Text = NoNulo(fProgramacion(Campo))
End Sub
'*****************************************************************************************
Private Sub Entrada_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 9 Then
Atras = 1
End If
End Sub
Private Sub Entrada_KeyPress(Index As Integer, KeyAscii As Integer)
Select Case Index
Case 1: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "A", "", 50, 0, "N")
Case 2: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "A", "", 1, 0, "N")
Case 3: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "A", "", 1, 0, "N")
Case 4: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "A", "", 1, 0, "N")
Case 5: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "A", "", 1, 0, "N")
Case 6: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "A", "", 1, 0, "N")
Case 7: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "A", "", 1, 0, "N")
Case 8: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 2, "S")
Case 9: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 2, "S")
Case 10: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 2, "S")
Case 11: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 12: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 13: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 14: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 15: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 16: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 17: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 18: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 19: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 20: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 21: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 22: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 23: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 24: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 25: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 26: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 27: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 28: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 29: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 30: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 2, "S")
Case 31: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 1, "S")
Case 31: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 1, "S")
Case 32: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 1, "S")
Case 33: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 1, "S")
Case 34: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 1, "S")
Case 35: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 1, "S")
Case 36: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 1, "S")
Case 37: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 1, "S")
Case 38: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 1, "S")
Case 39: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 1, "S")
Case 40: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 1, "S")
Case 41: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "F", "N", 10, 1, "N")
Comando(5).Visible = True
End Select
End Sub
Function TrataCampo(FormaMe, Index, Campo As String, Tecla, tipo, Signo, Longitud, Decimales, Cero) As Integer
Dim EstaMal
Dim EstaMal1
Select Case tipo
Case "N" 'Comprobacin de Campo Numerico
If (Tecla < 48 Or Tecla > 57) And Tecla <> 8 Then
TrataCampo = 0
183
7. Anejo 5
Else
TrataCampo = Tecla
End If
If Tecla = 45 And Signo = "S" And Len(Campo) = 0 Then TrataCampo = 45
If Tecla = 8 Then TrataCampo = Tecla
If Tecla = 46 Then Tecla = 44
If Tecla = 44 Then TrataCampo = Tecla
Dim num
For num = 1 To Len(Campo)
If Mid(Campo, num, 1) = "," And Tecla = 44 Then
TrataCampo = 0
End If
Next num
If Len(Campo) = 0 And Tecla = 48 And Cero <> "S" Then
TrataCampo = 0
End If
If Len(Campo) = 1 And Campo = "0" And Cero <> "S" And Tecla = 48 Then
TrataCampo = 0
End If
If Decimales = 0 And TrataCampo = 46 Then
TrataCampo = 0
End If
If Decimales > 0 Then
Dim Flag
Dim CuentaDecimales
CuentaDecimales = 0
Flag = False
For num = 1 To Len(Campo)
If Flag = True Then CuentaDecimales = CuentaDecimales + 1
If Mid(Campo, num, 1) = "." Then
Flag = True
End If
Next num
If CuentaDecimales = Decimales Then
TrataCampo = 0
End If
End If
If Len(Campo) = Longitud And TrataCampo <> 8 Then
TrataCampo = 0
End If
Case "A" 'Tipo Alfanumerico
TrataCampo = Tecla
If Len(Campo) = Longitud And Tecla <> 8 Then
TrataCampo = 0
End If
Case "F" 'Tipo Fecha
If Len(Campo) = 2 And Tecla <> 45 And Tecla <> 8 And Tecla <> 13 Then
Tecla = 0
End If
If Len(Campo) = 5 And Tecla <> 45 And Tecla <> 8 And Tecla <> 13 Then
Tecla = 0
End If
If (Tecla < 48 Or Tecla > 57) And Tecla <> 8 Then
TrataCampo = 0
Else
TrataCampo = Tecla
End If
If Tecla = 8 Then TrataCampo = Tecla
If Tecla = 45 Then TrataCampo = Tecla
If Len(Campo) = Longitud And Tecla <> 8 Then TrataCampo = 0
If Len(Campo) > 8 And (Mid$(Campo, 3, 1) <> "-" Or Mid$(Campo, 6, 1) <> "-") And Tecla <> 8 Then
EstaMal = "S"
If Tecla = 13 Then
MsgBox ("La fecha es incorrecta. Formato:dd-mm-aaaa")
EstaMal1 = "S"
End If
Else
Dim estamal2
EstaMal = "N"
End If
If Len(Campo) > 0 And Len(Campo) < 10 And Tecla = 13 Then
EstaMal = "S"
If EstaMal1 <> "S" Then
184
7. Anejo 5
MsgBox ("La fecha es incorrecta. Formato:dd-mm-aaaa")
EstaMal1 = ""
End If
End If
End Select
If Tecla = 13 Then
If EstaMal = "S" Then
Posiciona (Indice)
Else
If Comprobacion(FormaMe, Indice, Campo, tipo) = "OK" Then
Call MoverCampo(FormaMe, "AD")
Else
Posiciona (Indice)
End If
End If
End If
If Tecla = 9 Then 'hacia atras
If Atras = 1 Then
Call MoverCampo(FormaMe, "AT")
Else
Call MoverCampo(FormaMe, "AD")
End If
End If
End Function
Private Sub MoverCampo(FormaMe, Como)
If Como = "AD" Then ' adelante
If Indice + 1 > 41 Then
Indice = 0
End If
Indice = Indice + 1
Do While Entrada(Indice).Enabled = False Or Entrada(Indice).Visible = False
Indice = Indice + 1
Loop
End If
If Como = "AT" Then 'atras
If Indice - 1 < 1 Then
Indice = 42
End If
Indice = Indice - 1
Do While Entrada(Indice).Enabled = False Or Entrada(Indice).Visible = False
Indice = Indice - 1
Loop
End If
Posiciona (Indice)
Me.Mensaje.Caption = Mensajes(Indice)
DoEvents
End Sub
Function Comprobacion(FormaMe, Indice, Campo As String, tipo)
Dim ValorN As Double
Comprobacion = "OK"
If tipo = "N" And Indice <> 8 Then
ValorN = CarNum(Campo)
End If
Select Case Indice
Case 1 '
If Campo = "" Then
MsgBox ("Entra el nombre del cultivo o esoge uno en opcioens")
Comprobacion = ""
End If
Case 31 '
If Trim(Entrada(2)) = "" Then
MsgBox ("Escoge un grupo de cultivo")
Comprobacion = ""
Else
'If Campo = "" Then
' MsgBox ("Entra algn valor")
' Comprobacion = ""
'End If
If ValorN = 0 Then
MsgBox ("Entra algn valor")
Comprobacion = ""
End If
If ValorN > 1 Then
185
7. Anejo 5
MsgBox ("Entra algn valor menor de 1 ")
Comprobacion = ""
End If
End If
End Select
End Function
Private Sub ComandoLista_Click(Index As Integer)
Select Case Index
Case 1
Set ValorControl = Entrada(Index)
ValorTabla = "CultivosNombre"
Call CargaDBLista(ValorControl, ValorTabla, "Cultivo")
Case 2
Set ValorControl = Entrada(Index)
ValorTabla = "2"
Call CargaLista(ValorControl, Index)
Case 3
Set ValorControl = Entrada(Index)
ValorTabla = "3"
Call CargaLista(ValorControl, Index)
Case 4
Set ValorControl = Entrada(Index)
ValorTabla = "4"
Call CargaLista(ValorControl, Index)
Case 5
Set ValorControl = Entrada(Index)
ValorTabla = "5"
Call CargaLista(ValorControl, Index)
Case 6
Set ValorControl = Entrada(Index)
ValorTabla = "6"
Call CargaLista(ValorControl, Index)
Case 7
Set ValorControl = Entrada(Index)
ValorTabla = "7"
Call CargaLista(ValorControl, Index)
End Select
Posiciona (1)
Indice = 1
DoEvents
End Sub
Private Sub CargaDBLista(Control, Fichero, Campo)
BorraDatos
Dim Consulta As Recordset
Set Consulta = BaseDeDatos.OpenRecordset("SELECT * FROM CultivosNombre ORDER BY Cultivo ;")
'Datos.DatabaseName = NBaseDeDatos
'Datos.RecordSource = NCultivosNombre
Set Datos.Recordset = Consulta
Datos.Refresh
DBLista.ZOrder 0
DBLista.Left = Entrada(1).Left 'Control.Left
DBLista.Top = Entrada(1).Top 'Control.Top
DBLista.Width = Entrada(1).Width 'Control.Width
DBLista.Height = 4000
DBLista.ListField = "Cultivo"
DBLista.Refresh
DBLista.Visible = True
End Sub
Private Sub DBLista_DblClick()
ValorControl.Text = DBLista.Text
DBLista.Visible = False
Posiciona (1)
End Sub
Private Sub CargaLista(Control, Index)
'ComandoLista(INDEX).Visible = False
Lista.ZOrder 0
Lista.Left = Control.Left
Lista.Top = Control.Top
'Lista.Width = Control.Width
Lista.Visible = True
Select Case Index
Case 2
Lista.Clear
186
7. Anejo 5
Lista.Width = 4000
Lista.Height = 5 * 400
Lista.AddItem "Cultivos extensivos y hortalizas"
Lista.AddItem "Arroz"
Lista.AddItem "Alfalfa"
Lista.AddItem "Arboles caducifolios y de nuez"
Lista.AddItem "Ctricos"
Lista.AddItem "Uva"
Lista.AddItem "Pltano"
'Lista.AddItem "Otros"
Case 3
Lista.Clear
Lista.AddItem "SI"
Lista.AddItem "NO"
Lista.Height = 2 * 400
Case 4
Lista.Clear
Lista.AddItem "HELADAS FUERTES"
Lista.AddItem "HELADAS DEBILES"
Lista.AddItem "SIN HELADAS"
Lista.Height = 2 * 400
Case 5
Lista.Clear
Lista.AddItem "ALTA"
Lista.AddItem "BAJA"
Lista.Height = 2 * 400
Case 6
Lista.Clear
Lista.AddItem "FUERTES"
Lista.AddItem "DEBILES"
Lista.Height = 2 * 400
Case 7
Lista.Clear
Lista.AddItem "JOVEN"
Lista.AddItem "MEDIO"
Lista.AddItem "ADULTO"
Lista.Height = 2 * 400
End Select
End Sub
Private Sub Lista_DblClick()
If ValorTabla = "2" Then
BorraKc
If Lista.Text = "Cultivos extensivos y hortalizas" Then ValorControl.Text = "A"
If Lista.Text = "Arroz" Then ValorControl.Text = "B"
If Lista.Text = "Alfalfa" Then ValorControl.Text = "D"
If Lista.Text = "Arboles caducifolios y de nuez" Then ValorControl.Text = "E"
If Lista.Text = "Ctricos" Then ValorControl.Text = "F"
If Lista.Text = "Uva" Then ValorControl.Text = "G"
If Lista.Text = "Pltano" Then ValorControl.Text = "H"
'If Lista.Text = "Otros" Then ValorControl.Text = "O"
DESACTIVATODO
If ValorControl = "A" Then
ACTIVA (5)
ACTIVA (6)
Frame1.Visible = True
Frame2.Visible = False
End If
If ValorControl = "B" Then
ACTIVA (5)
ACTIVA (6)
Frame1.Visible = True
Frame2.Visible = False
End If
If ValorControl = "D" Then
ACTIVA (5)
ACTIVA (6)
Frame1.Visible = True
Frame2.Visible = False
End If
If ValorControl = "E" Then
ACTIVA (3)
ACTIVA (4)
ACTIVA (5)
187
7. Anejo 5
ACTIVA (6)
ACTIVA (7)
Frame1.Visible = False
Frame2.Visible = True
End If
If ValorControl = "F" Then
ACTIVA (3)
ACTIVA (7)
Frame1.Visible = False
Frame2.Visible = True
End If
If ValorControl = "G" Then
ACTIVA (4)
ACTIVA (5)
ACTIVA (6)
Frame1.Visible = False
Frame2.Visible = True
End If
If ValorControl = "H" Then
ACTIVA (6)
ACTIVA (7)
Frame1.Visible = False
Frame2.Visible = True
End If
If ValorControl = "O" Then
Frame1.Visible = False
Frame2.Visible = True
End If
Posiciona (1)
End If
If ValorTabla = "3" Then
If Lista.Text = "SI" Then ValorControl.Text = "S"
If Lista.Text = "NO" Then ValorControl.Text = "N"
Posiciona (1)
End If
If ValorTabla = "4" Then
If Lista.Text = "HELADAS DEBILES" Then ValorControl.Text = "D"
If Lista.Text = "HELADAS FUERTES" Then ValorControl.Text = "F"
If Lista.Text = "SIN HELADAS" Then ValorControl.Text = "S"
Posiciona (1)
End If
If ValorTabla = "5" Then
If Lista.Text = "ALTA" Then ValorControl.Text = "A"
If Lista.Text = "BAJA" Then ValorControl.Text = "B"
Posiciona (1)
End If
If ValorTabla = "6" Then
If Lista.Text = "DEBILES" Then ValorControl.Text = "D"
If Lista.Text = "FUERTES" Then ValorControl.Text = "F"
Posiciona (1)
End If
If ValorTabla = "7" Then
If Lista.Text = "JOVEN" Then ValorControl.Text = "J"
If Lista.Text = "MEDIO" Then ValorControl.Text = "M"
If Lista.Text = "ADULTO" Then ValorControl.Text = "A"
Posiciona (1)
End If
Lista.Visible = False
' Proceso de recogida de datos
If (Entrada(2) = "A" And Entrada(5) <> "-" And Entrada(6) <> "-") Or _
(Entrada(2) = "B" And Entrada(5) <> "-" And Entrada(6) <> "-") Or _
(Entrada(2) = "D" And Entrada(5) <> "-" And Entrada(6) <> "-") Or _
(Entrada(2) = "E" And Entrada(3) <> "-" And Entrada(4) <> "-" And Entrada(5) <> "-" And Entrada(6) <> "-" And
Entrada(7) <> "-") Or _
(Entrada(2) = "F" And Entrada(3) <> "-" And Entrada(7) <> "-") Or _
(Entrada(2) = "G" And Entrada(4) <> "-" And Entrada(5) <> "-" And Entrada(6) <> "-") Or _
(Entrada(2) = "H" And Entrada(6) <> "-") Or _
(Entrada(2) = "O") Then
CargaKc
CargaDias
CargaRaices
CargaSal
CargaFraccion
188
7. Anejo 5
Comando(5).Visible = True
End If
End Sub
Function CargaKc()
fCultivosKc.Index = "ORDEN"
fCultivosKc.MoveFirst
fCultivosKc.Seek "=", Entrada(1).Text, Entrada(2).Text, Entrada(3).Text, Entrada(4).Text, Entrada(5).Text,
Entrada(6).Text, Entrada(7).Text
If fCultivosKc.NoMatch = False Then 'Registro encontrado
If Entrada(2) = "A" Or Entrada(2) = "B" Or Entrada(3) = "D" Then
Entrada(8) = fCultivosKc("KcI")
Entrada(9) = fCultivosKc("KcM")
Entrada(10) = fCultivosKc("KcF")
Else
Entrada(18) = NoNulo(fCultivosKc("Kc01"))
Entrada(19) = NoNulo(fCultivosKc("Kc02"))
Entrada(20) = NoNulo(fCultivosKc("Kc03"))
Entrada(21) = NoNulo(fCultivosKc("Kc04"))
Entrada(22) = NoNulo(fCultivosKc("Kc05"))
Entrada(23) = NoNulo(fCultivosKc("Kc06"))
Entrada(24) = NoNulo(fCultivosKc("Kc07"))
Entrada(25) = NoNulo(fCultivosKc("Kc08"))
Entrada(26) = NoNulo(fCultivosKc("Kc09"))
Entrada(27) = NoNulo(fCultivosKc("Kc10"))
Entrada(28) = NoNulo(fCultivosKc("Kc11"))
Entrada(29) = NoNulo(fCultivosKc("Kc12"))
End If
Else
BorraKc
End If
End Function
Function BorraDatos()
BorraKc
Dim num
For num = 31 To 41
Entrada(num) = ""
Next num
End Function
Function BorraKc()
Dim num
For num = 8 To 17
Entrada(num) = ""
Next num
For num = 18 To 30
Entrada(num) = ""
Next num
End Function
Function CargaRaices()
fCultivosRaices.Index = "ORDEN"
fCultivosRaices.MoveFirst
fCultivosRaices.Seek "=", Entrada(1).Text
If fCultivosRaices.NoMatch = False Then 'Registro encontrado
If Entrada(2) = "A" Or Entrada(2) = "B" Or Entrada(3) = "D" Then
Entrada(15) = fCultivosRaices("Raices")
Entrada(16) = fCultivosRaices("Raices")
Entrada(17) = fCultivosRaices("Raices")
Else
Entrada(30) = fCultivosRaices("Raices")
End If
End If
End Function
Function CargaDias()
fCultivosDias.Index = "ORDEN"
fCultivosDias.MoveFirst
fCultivosDias.Seek "=", Entrada(1).Text
If fCultivosDias.NoMatch = False Then 'Registro encontrado
If Entrada(2) = "A" Or Entrada(2) = "B" Or Entrada(3) = "D" Then
Entrada(11) = fCultivosDias("DiasI")
Entrada(12) = fCultivosDias("DiasD")
Entrada(13) = fCultivosDias("DiasM")
Entrada(14) = fCultivosDias("DiasF")
End If
End If
189
7. Anejo 5
End Function
Function CargaFraccion()
fCultivosFraccion.Index = "ORDEN"
fCultivosFraccion.MoveFirst
fCultivosFraccion.Seek "=", Entrada(1).Text
If fCultivosFraccion.NoMatch = False Then 'Registro encontrado
Entrada(31) = fCultivosFraccion("Fraccion")
End If
End Function
Function CargaSal()
fCultivosSal.Index = "ORDEN"
fCultivosSal.MoveFirst
fCultivosSal.Seek "=", Entrada(1).Text
If fCultivosSal.NoMatch = False Then 'Registro encontrado
Entrada(32) = fCultivosSal("ECe100")
Entrada(33) = fCultivosSal("ECw100")
Entrada(34) = fCultivosSal("ECe90")
Entrada(35) = fCultivosSal("ECw90")
Entrada(36) = fCultivosSal("ECe75")
Entrada(37) = fCultivosSal("ECw75")
Entrada(38) = fCultivosSal("ECe50")
Entrada(39) = fCultivosSal("ECw50")
Entrada(40) = fCultivosSal("MaxECe")
End If
End Function
Function DESACTIVATODO()
Dim num
For num = 3 To 7
Label(num).Visible = False
Entrada(num).Visible = False
ComandoLista(num).Visible = False
Entrada(num).Text = "-"
Next num
End Function
Function ACTIVA(Numero)
Label(Numero).Visible = True
Entrada(Numero).Visible = True
ComandoLista(Numero).Visible = True
End Function
Sub Posiciona(Lugar As Integer)
Me.Entrada(Lugar).SelStart = 0
Me.Entrada(Lugar).SelLength = Len(Entrada(Lugar))
Me.Entrada(Lugar).SetFocus
End Sub
190
7. Anejo 5
RIEGOS23.FRM
' Vctor Yusta. Dicembre-1998
Object ="THREED32.OCX"
Object ="DBLIST32.OCX"
Option Explicit
Dim Indice As Integer
Dim Atras As Integer
Dim Mensajes(20) As String
Dim Alertas(20) As String
Dim Campos(20) As String
Dim ExisteFichero As String
Dim QueMes
Dim vColor
Dim Mes
Dim Ano
Dim Dia
Dim TipoDatos
Dim NomMes(12)
Dim NumeroPicado
Private Sub Form_Load()
Mensajes(1) = "Entra la temperatura mxima"
Mensajes(2) = "Entra la temperatura mnima"
Mensajes(3) = "Entra la humedad mxima"
Mensajes(4) = "Entra la humedad mnima"
Mensajes(5) = "Entra la humedad media"
Mensajes(6) = "Entra el viento diario"
Mensajes(7) = "Entra la radiacin solar diaria"
Mensajes(8) = "Entra el nmero de horas de sol diarias"
Mensajes(9) = "Entra la precipitacin"
Call CargaPantalla(Me)
BaseDatos
Me.Caption = LeerFichero("Menu", "Orden", Val(Right(Me.Name, 2)), "Titulo") + " " + NombreProgramacion
Call DibujaMensaje(Me)
Call DibujaPanelComandos(Me)
Show
Comando(0).Visible = True
Atras = 0
Indice = 1
Mensaje.Caption = "Escoje una opcin"
CargarDatos
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
Load Riegos
'Salir
End Sub
Private Sub Salir()
Unload Me
Load Riegos
End Sub
Private Sub Comando_Click(Index As Integer)
Select Case Index
Case 0 ' Salida del formulario
Salir
Case 5 ' Salida del formulario
Call GrabarDatos
Unload Me
End Select
End Sub
Private Sub CargarDatos()
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
TipoDatos = fProgramacion("Clima")
Entrada(0).Text = fProgramacion("NombreProgramacion")
Else
TipoDatos = "M"
End If
End Sub
Private Sub GrabarDatos()
If ExisteFichero = "NO" Then
fProgramacion.AddNew
191
7. Anejo 5
Else
fProgramacion.Edit
End If
Call MoverPF("NombreProgramacion", Entrada(0))
Call MoverPF("Descripcion", Entrada(1))
Call MoverPF("NombreFinca", Entrada(2))
Call MoverPF("Poblacion", Entrada(3))
Call MoverPF("Provincia", Entrada(4))
Call MoverPF("LatitudGrados", Entrada(5))
Call MoverPF("LatitudMinutos", Entrada(6))
Call MoverPF("LatitudSegundos", Entrada(7))
Call MoverPF("Latitud", Entrada(8))
Call MoverPF("LongitudGrados", Entrada(9))
Call MoverPF("LongitudMinutos", Entrada(10))
Call MoverPF("LongitudSegundos", Entrada(11))
Call MoverPF("Longitud", Entrada(12))
Call MoverPF("Altitud", Entrada(13))
fProgramacion("Pantalla23") = "T"
fProgramacion.Update
If Right(Riegos.Forma(Val(Right(Me.Name, 2))).Caption, 1) <> ">" Then
Riegos.Forma(Val(Right(Me.Name, 2))).Caption = Riegos.Forma(Val(Right(Me.Name, 2))).Caption + " >"
End If
End Sub
'Private Sub Entrada_GotFocus(Index As Integer)
'End Sub
Private Sub MoverFP(Campo As String, Pantalla)
Pantalla.Text = NoNulo(fProgramacion(Campo))
End Sub
Private Sub MoverPF(Campo As String, Pantalla)
fProgramacion(Campo) = Pantalla.Text
End Sub
Private Sub Command1_Click()
Command1.Visible = False
Command2.Visible = False
If TipoDatos = "M" Or TipoDatos = "D" Then
Command1.Visible = False
Call EmpiezaPrograma
Else
MsgBox ("Ves al men de datos de la finca y entra el tipo de datos climticos")
End If
End Sub
Private Sub Command2_Click()
Command1.Visible = False
Command2.Visible = False
If TipoDatos = "M" Or TipoDatos = "D" Then
SSPanel1.Visible = True
ValorTabla = "ClimaMaestro"
Call CargaDBLista(ValorTabla, "Estacion")
Mensaje.Caption = "Cliquea en los datos de una estacin meteorolgica"
Else
MsgBox ("Ves al men de datos de la finca y entra el tipo de datos climticos")
End If
End Sub
Private Sub CargaDBLista(Fichero, Campo)
Dim Consulta As Recordset
Set Consulta = BaseDeDatos.OpenRecordset("SELECT * FROM ClimaMaestro WHERE Clima = '" & TipoDatos & "'
ORDER BY Estacion ;")
Set Datos.Recordset = Consulta
Datos.Refresh
DBLista.ZOrder 0
DBLista.ListField = "Estacion"
DBLista.Refresh
DBLista.Visible = True
End Sub
Private Sub DBLista_DblClick()
Dim Consulta As Recordset
Set Consulta = BaseDeDatos.OpenRecordset("SELECT * FROM ClimaDetalle WHERE Clima = '" & TipoDatos & "' and
Estacion = '" & DBLista.Text & "' ORDER BY Fecha ;")
If Consulta.RecordCount <> 0 Then
Consulta.MoveFirst
While Not Consulta.EOF
fProgramacionClima.Index = "PROGRAMACION"
fProgramacionClima.Seek "=", NombreProgramacion, Consulta("Fecha"), Consulta("Clima")
192
7. Anejo 5
If fProgramacionClima.NoMatch = False Then 'Registro encontrado
fProgramacionClima.Edit
Else
fProgramacionClima.AddNew
fProgramacionClima("NombreProgramacion") = NombreProgramacion
fProgramacionClima("Fecha") = Consulta("Fecha")
fProgramacionClima("Clima") = TipoDatos
fProgramacionClima("Color") = "V"
fProgramacionClima("TemperaturaMaxima") = Consulta("TemperaturaMaxima")
fProgramacionClima("TemperaturaMinima") = Consulta("TemperaturaMinima")
fProgramacionClima("Psicrometro") = Consulta("Psicrometro")
fProgramacionClima("HumedadMaxima") = Consulta("HumedadMaxima")
fProgramacionClima("HumedadMinima") = Consulta("HumedadMinima")
fProgramacionClima("HumedadMedia") = Consulta("HumedadMedia")
fProgramacionClima("Radiacion") = Consulta("Radiacion")
fProgramacionClima("RadiacionNeta") = Consulta("RadiacionNeta")
fProgramacionClima("HorasSol") = Consulta("HorasSol")
fProgramacionClima("Viento") = Consulta("Viento")
fProgramacionClima("Lluvia") = Consulta("Lluvia")
fProgramacionClima.Update
End If
Consulta.MoveNext
Wend
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
fProgramacion.Edit
fProgramacion("Pantalla23") = "T"
fProgramacion.Update
End If
End If
SSPanel1.Visible = False
Command1.Visible = True
Command2.Visible = True
End Sub
Private Sub EmpiezaPrograma()
Dim contador
Dim leecolor
Mes = Month(Date)
Ano = Year(Date)
CargaInicial
If TipoDatos = "D" Then
Mensaje.Caption = "Cliquea en un da y entra los datos meteorolgicos"
SSDiario.Visible = True
CalculaDias
For contador = 0 To 41
If SSPANEL2(contador).Visible = True Then
fProgramacionClima.Index = "PROGRAMACION"
fProgramacionClima.MoveFirst
Dim fechar
fechar = Trim((Str(Ano) + Right(Str(Mes + 100), 2) + Right(Str(Val(SSPANEL2(contador).Caption) + 100), 2)))
fProgramacionClima.Seek "=", NombreProgramacion, fechar, "D"
If fProgramacionClima.NoMatch = False Then 'Registro encontrado
leecolor = fProgramacionClima("Color")
Else
leecolor = "G"
End If
If leecolor = "G" Then SSPANEL2(contador).BackColor = &HC0C0C0
If leecolor = "V" Then SSPANEL2(contador).BackColor = &H80FF80
If leecolor = "R" Then SSPANEL2(contador).BackColor = &HFF&
End If
Next contador
End If
If TipoDatos = "M" Then
Mensaje.Caption = "Cliquea en un mes y entra los datos meteorolgicos"
SSMesario.Visible = True
TituloMes.Caption = "Entrada mensual" ' NomMes(Mes) + "-" + Str(Ano)
For contador = 1 To 12
fProgramacionClima.Index = "PROGRAMACION"
fProgramacionClima.MoveFirst
fProgramacionClima.Seek "=", NombreProgramacion, Right(Str(contador + 100), 2), "M"
If fProgramacionClima.NoMatch = False Then 'Registro encontrado
193
7. Anejo 5
leecolor = fProgramacionClima("Color")
Else
leecolor = "G"
End If
If leecolor = "G" Then SSMES(contador - 1).BackColor = &HC0C0C0
If leecolor = "V" Then SSMES(contador - 1).BackColor = &H80FF80
If leecolor = "R" Then SSMES(contador - 1).BackColor = &HFF&
Next contador
End If
End Sub
Private Sub Boton_Click(Index As Integer)
Select Case Index
Case 0
Mes = Mes - 1
If Mes = 0 Then
Mes = 12
Ano = Ano - 1
End If
Case 1
Ano = Ano - 1
Case 2
Ano = Ano + 1
Case 3
Mes = Mes + 1
If Mes = 13 Then
Mes = 1
Ano = Ano + 1
End If
End Select
CalculaDias
Dim contador
Dim leecolor
For contador = 0 To 41
If SSPANEL2(contador).Visible = True Then
fProgramacionClima.Index = "PROGRAMACION"
fProgramacionClima.MoveFirst
Dim fechar
fechar = Trim((Str(Ano) + Right(Str(Mes + 100), 2) + Right(Str(Val(SSPANEL2(contador).Caption) + 100), 2)))
fProgramacionClima.Seek "=", NombreProgramacion, fechar, "D"
If fProgramacionClima.NoMatch = False Then 'Registro encontrado
leecolor = fProgramacionClima("Color")
Else
leecolor = "G"
End If
If leecolor = "G" Then SSPANEL2(contador).BackColor = &HC0C0C0
If leecolor = "V" Then SSPANEL2(contador).BackColor = &H80FF80
If leecolor = "R" Then SSPANEL2(contador).BackColor = &HFF&
End If
Next contador
Titulo.Caption = Right(Str(Dia + 100), 2) + "-" + Right(Str(Mes + 100), 2) + "-" + Str(Ano)
End Sub
Private Sub ComandoAceptar_Click()
Comando(0).Visible = True
SSEntradaDatos.Visible = False
Titulo.Visible = False
'>> poner codigo de color segun datos
Dim QueColor
QueColor = Preguntacolor
If TipoDatos = "M" Then
SSMesario.Visible = True
SSMesario.Enabled = True
SSMES(NumeroPicado).BackColor = QueColor
GrabarDatosMes
End If
If TipoDatos = "D" Then
SSDiario.Visible = True
SSDiario.Enabled = True
SSPANEL2(NumeroPicado).BackColor = &H80FF80
GrabarDatosdia
End If
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
194
7. Anejo 5
If fProgramacion.NoMatch = False Then 'Registro encontrado
fProgramacion.Edit
fProgramacion("Pantalla23") = "T"
fProgramacion.Update
End If
'>> poner codigo de grabacion de datos
End Sub
Private Sub ComandoSalir_Click()
Comando(0).Visible = True
SSEntradaDatos.Visible = False
Titulo.Visible = False
If TipoDatos = "M" Then
SSMesario.Visible = True
SSMesario.Enabled = True
End If
If TipoDatos = "D" Then
SSDiario.Visible = True
SSDiario.Enabled = True
End If
End Sub
Private Sub CargaInicial()
NomMes(1) = "ENERO"
NomMes(2) = "FEBRERO"
NomMes(3) = "MARZO"
NomMes(4) = "ABRIL"
NomMes(5) = "MAYO"
NomMes(6) = "JUNIO"
NomMes(7) = "JULIO"
NomMes(8) = "AGOSTO"
NomMes(9) = "SEPTIEMBRE"
NomMes(10) = "OCTUBRE"
NomMes(11) = "NOVIEMBRE"
NomMes(12) = "DICIEMBRE"
End Sub
Private Sub CalculaDias()
Dim num
For num = 0 To 41
SSPANEL2(num).Caption = ""
SSPANEL2(num).Visible = False
'EntradaDato(Num).Text = ""
'EntradaDato(Num).Visible = False
Next num
Dim NumDias
Dim CadenaDias
SSPanel13.Caption = NomMes(Mes) + " - " + Str(Ano)
If (Ano = 4 * Int(Ano / 4) And Ano <> 100 * Int(Ano / 100)) Then
CadenaDias = "312931303130313130313031"
Else
CadenaDias = "312831303130313130313031"
End If
Dim MesCal
Dim AnoCal
Dim NumFil: NumFil = 0
Dim NumCol: NumCol = 0
Dim Numero: Numero = 0
Dim DiaMes: DiaMes = 0
NumDias = Val(Mid$(CadenaDias, (2 * Mes) - 1, 2))
For DiaMes = 1 To NumDias
MesCal = Mes
AnoCal = Ano
If Mes <= 2 Then
MesCal = MesCal + 12
AnoCal = AnoCal - 1
End If
Numero = DiaMes + 2 * MesCal + Int(0.6 * (MesCal + 1)) + AnoCal + Int(AnoCal / 4) - Int(AnoCal / 100) + Int(AnoCal /
400) + 2
Numero = (Int((Numero / 7 - Int(Numero / 7)) * 7 + 0.5)) + 1
If Numero < 3 Then
NumCol = Numero + 5
Else
NumCol = Numero - 2
End If
Dim Pos
195
7. Anejo 5
Pos = (NumFil * 7) + (NumCol - 1)
SSPANEL2(Pos).Visible = True
SSPANEL2(Pos).Caption = DiaMes
If NumCol = 7 Then
NumFil = NumFil + 1
End If
DoEvents
Next DiaMes
DoEvents
'>>leer los que estan cargados
End Sub
Private Sub SSMES_Click(Index As Integer)
Comando(0).Visible = False
SSDiario.Enabled = False
SSEntradaDatos.Visible = True
Call Apaga(3)
Call Apaga(4)
Call Enciende(5)
Posiciona (1)
QueMes = Index + 1
Titulo.Caption = NomMes(QueMes)
Titulo.Visible = True
NumeroPicado = Index
Check1_Click
Check2_Click
Posiciona (1)
Me.Mensaje.Caption = Mensajes(1)
'leedatos
fProgramacionClima.Index = "PROGRAMACION"
fProgramacionClima.MoveFirst
fProgramacionClima.Seek "=", NombreProgramacion, Right(Str(Index + 101), 2), "M"
If fProgramacionClima.NoMatch = False Then 'Registro encontrado
Entrada(1) = NoNulo(fProgramacionClima("TemperaturaMaxima"))
Entrada(2) = NoNulo(fProgramacionClima("TemperaturaMinima"))
Entrada(3) = NoNulo(fProgramacionClima("HumedadMaxima"))
Entrada(4) = NoNulo(fProgramacionClima("HumedadMinima"))
Entrada(5) = NoNulo(fProgramacionClima("HumedadMedia"))
Entrada(6) = NoNulo(fProgramacionClima("Viento"))
Entrada(7) = NoNulo(fProgramacionClima("RadiacionNeta"))
Entrada(8) = NoNulo(fProgramacionClima("HorasSol"))
Entrada(9) = NoNulo(fProgramacionClima("Lluvia"))
Check1.Value = 0: If fProgramacionClima("Psicrometro") = "S" Then Check1.Value = 1
Check2.Value = 0: If fProgramacionClima("Radiacion") = "S" Then Check2.Value = 1
Else
Dim contador
For contador = 1 To 9
Entrada(contador).Text = ""
Next contador
End If '-End Sub
Private Sub SSPANEL2_Click(Index As Integer)
Dia = SSPANEL2(Index).Caption
Dim Corte1 As String
Dim Corte2 As String
Corte1 = Str(Ano) + Right(Str(Mes + 100), 2) + Right(Str(Dia + 100), 2)
Corte2 = Mid(Date$, 7, 4) + Mid(Date$, 1, 2) + Mid(Date$, 4, 2)
If Val(Corte1) >= Val(Corte2) Then
MsgBox ("No se puede escoger una fecha mayor que la de ayer")
Else
SSDiario.Enabled = False
SSEntradaDatos.Visible = True
Titulo.Caption = Right(Str(Dia + 100), 2) + "-" + Right(Str(Mes + 100), 2) + "-" + Str(Ano)
Titulo.Visible = True
Posiciona (1)
NumeroPicado = Index
Check1_Click
Check2_Click
Me.Mensaje.Caption = Mensajes(1)
'lee datos
Dim contador
fProgramacionClima.Index = "PROGRAMACION"
fProgramacionClima.MoveFirst
Dim fechar
196
7. Anejo 5
fechar = Trim((Str(Ano) + Right(Str(Mes + 100), 2) + Right(Str(Val(Dia) + 100), 2)))
fProgramacionClima.Seek "=", NombreProgramacion, fechar, "D"
If fProgramacionClima.NoMatch = False Then 'Registro encontrado
Entrada(1) = NoNulo(fProgramacionClima("TemperaturaMaxima"))
Entrada(2) = NoNulo(fProgramacionClima("TemperaturaMinima"))
Entrada(3) = NoNulo(fProgramacionClima("HumedadMaxima"))
Entrada(4) = NoNulo(fProgramacionClima("HumedadMinima"))
Entrada(5) = NoNulo(fProgramacionClima("HumedadMedia"))
Entrada(6) = NoNulo(fProgramacionClima("Viento"))
Entrada(7) = NoNulo(fProgramacionClima("RadiacionNeta"))
Entrada(8) = NoNulo(fProgramacionClima("HorasSol"))
Entrada(9) = NoNulo(fProgramacionClima("Lluvia"))
Check1.Value = 0: If fProgramacionClima("Psicrometro") = "S" Then Check1.Value = 1
Check2.Value = 0: If fProgramacionClima("Radiacion") = "S" Then Check2.Value = 1
Else
For contador = 1 To 9
Entrada(contador).Text = ""
Next contador
End If '-End If
End Sub
'***********************************************************************
Private Sub Check1_Click()
If Check1.Value = 1 Then
Call Enciende(3)
Call Enciende(4)
Call Apaga(5)
End If
If Check1.Value = 0 Then
Call Apaga(3)
Call Apaga(4)
Call Enciende(5)
End If
Posiciona (1)
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
Call Enciende(7)
Call Apaga(8)
End If
If Check2.Value = 0 Then
Call Apaga(7)
Call Enciende(8)
End If
Posiciona (1)
End Sub
Private Sub Entrada_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 9 Then
Atras = 1
End If
End Sub
Private Sub Entrada_KeyPress(Index As Integer, KeyAscii As Integer)
Select Case Index
Case 1
KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "S", 5, 1)
Case 2
KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "S", 5, 1)
Case 3
KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0)
Case 4
KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0)
Case 5
KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0)
Case 6
KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 0)
Case 7
KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 5, 0)
Case 8
KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 5, 1)
Case 9
KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 6, 0)
End Select
End Sub
197
7. Anejo 5
Function TrataCampo(FormaMe, Index, Campo, Tecla, tipo, Signo, Longitud, Decimales) As Integer
Dim EstaMal
Dim EstaMal1
Select Case tipo
Case "N" 'Comprobacin de Campo Numerico
If (Tecla < 48 Or Tecla > 57) And Tecla <> 8 Then
TrataCampo = 0
Else
TrataCampo = Tecla
End If
If Tecla = 45 And Signo = "S" And Len(Campo) = 0 Then TrataCampo = 45
If Tecla = 8 Then TrataCampo = Tecla
If Tecla = 46 Then Tecla = 44
If Tecla = 44 Then TrataCampo = Tecla
Dim num
For num = 1 To Len(Campo)
If Mid(Campo, num, 1) = "," And Tecla = 44 Then
TrataCampo = 0
End If
Next num
If Len(Campo) = 0 And Tecla = 48 Then
TrataCampo = 0
End If
If Len(Campo) = 1 And Campo = "0" And Tecla = 48 Then
TrataCampo = 0
End If
If Decimales = 0 And TrataCampo = 46 Then
TrataCampo = 0
End If
If Decimales > 0 Then
Dim Flag
Dim CuentaDecimales
CuentaDecimales = 0
Flag = False
For num = 1 To Len(Campo)
If Flag = True Then CuentaDecimales = CuentaDecimales + 1
If Mid(Campo, num, 1) = "." Then
Flag = True
End If
Next num
If CuentaDecimales = Decimales Then
TrataCampo = 0
End If
End If
If Len(Campo) = Longitud And TrataCampo <> 8 Then
TrataCampo = 0
End If
Case "A" 'Tipo Alfanumerico
TrataCampo = Tecla
If Len(Campo) = Longitud And Tecla <> 8 Then
TrataCampo = 0
End If
Case "F" 'Tipo Fecha
If Len(Campo) = 2 And Tecla <> 45 And Tecla <> 8 And Tecla <> 13 Then
Tecla = 0
End If
If Len(Campo) = 5 And Tecla <> 45 And Tecla <> 8 And Tecla <> 13 Then
Tecla = 0
End If
If (Tecla < 48 Or Tecla > 57) And Tecla <> 8 Then
TrataCampo = 0
Else
TrataCampo = Tecla
End If
If Tecla = 8 Then TrataCampo = Tecla
If Tecla = 45 Then TrataCampo = Tecla
If Len(Campo) = Longitud And Tecla <> 8 Then TrataCampo = 0
If Len(Campo) > 8 And (Mid$(Campo, 3, 1) <> "-" Or Mid$(Campo, 6, 1) <> "-") And Tecla <> 8 Then
EstaMal = "S"
If Tecla = 13 Then
MsgBox ("La fecha es incorrecta. Formato:dd-mm-aaaa")
EstaMal1 = "S"
End If
198
7. Anejo 5
Else
Dim estamal2
EstaMal = "N"
End If
If Len(Campo) > 0 And Len(Campo) < 10 And Tecla = 13 Then
EstaMal = "S"
If EstaMal1 <> "S" Then
MsgBox ("La fecha es incorrecta. Formato:dd-mm-aaaa")
EstaMal1 = ""
End If
End If
End Select
If Tecla = 13 Then
If EstaMal = "S" Then
Posiciona (Indice)
Else
If Comprobacion(FormaMe, Indice, Campo, tipo) = "OK" Then
Call MoverCampo(FormaMe, "AD")
Else
Posiciona (Indice)
End If
End If
End If
If Tecla = 9 Then 'hacia atras
If Atras = 1 Then
Call MoverCampo(FormaMe, "AT")
Else
Call MoverCampo(FormaMe, "AD")
End If
End If
End Function
Function Apaga(Index)
Entrada(Index).Enabled = False
Entrada(Index).BackColor = &H8000000B
DoEvents
End Function
Function Enciende(Index)
Entrada(Index).Enabled = True
Entrada(Index).BackColor = &H80000005
DoEvents
End Function
Function Comprobacion(FormaMe, Indice, Campo, tipo)
Dim ValorN
Comprobacion = "OK"
If tipo = "N" Then
ValorN = Val(Campo)
End If
Select Case Indice
Case 1 'temperatura
If ValorN < -50 Or ValorN > 70 Then
MsgBox ("Que se puede cultivar con esta temperatura?")
Comprobacion = ""
End If
Case 2 'temperatura
If ValorN < -50 Or ValorN > 70 Then
MsgBox ("Que se puede cultivar con esta temperatura?")
Comprobacion = ""
End If
If ValorN > Val(FormaMe.Entrada(1)) Then
MsgBox ("La temperatura mnima no puede ser mayor que la mnima")
Comprobacion = ""
End If
Case 3 'humedad
If ValorN < 0 Or ValorN > 100 Then
MsgBox ("Entra correctamente la humedad")
Comprobacion = ""
End If
Case 4 'humedad
If ValorN < 0 Or ValorN > 100 Then
MsgBox ("Entra correctamente la humedad")
Comprobacion = ""
End If
If ValorN > Val(FormaMe.Entrada(3)) Then
199
7. Anejo 5
MsgBox ("La humedad mnima no puede ser mayor que la mnima")
Comprobacion = ""
End If
Case 5 'humedad
If ValorN < 0 Or ValorN > 100 Then
MsgBox ("Entra correctamente la humedad")
Comprobacion = ""
End If
Case 6 'viento
If ValorN < 0 Or ValorN > 3600 Then
MsgBox ("Entra correctamente el viento. Km/da")
Comprobacion = ""
End If
Case 7 'radiacion
If ValorN < 0 Then
MsgBox ("Entra correctamente la radiacin solar en MJ/m2perodo")
Comprobacion = ""
End If
Case 8 'Horas de sol
If ValorN < 0 Or ValorN > 24 Then
MsgBox ("Entra correctamente las horas de sol al da")
Comprobacion = ""
End If
Case 9 'Lluvia
If ValorN < 0 Or ValorN > 400 Then
MsgBox ("Entra correctamente la cantidad de lluvia en litros/m2periodo")
Comprobacion = ""
End If
End Select
End Function
Private Sub MoverCampo(FormaMe, Como)
If Como = "AD" Then ' adelante
If Indice + 1 > 9 Then 'antes 14
Indice = 0
End If
Indice = Indice + 1
Do While Entrada(Indice).Enabled = False Or Entrada(Indice).Visible = False
Indice = Indice + 1
Loop
End If
If Como = "AT" Then 'atras
If Indice - 1 < 1 Then
Indice = 10
End If
Indice = Indice - 1
Do While Entrada(Indice).Enabled = False Or Entrada(Indice).Visible = False
Indice = Indice - 1
Loop
End If
Posiciona (Indice)
Me.Mensaje.Caption = Mensajes(Indice)
DoEvents
End Sub
Function MoverFoco(Numero)
Posiciona (Numero)
End Function
Function Preguntacolor()
'Gris = &HC0C0C0
'Verde = &H80FF80
'Rojo = &HFF&
Preguntacolor = &HFF&
If Check1.Value = 1 And Check2.Value = 1 And _
Trim(Entrada(1)) = "" And _
Trim(Entrada(2)) = "" And _
Trim(Entrada(3)) = "" And _
Trim(Entrada(4)) = "" And _
Trim(Entrada(6)) = "" And _
Trim(Entrada(7)) = "" Then
Preguntacolor = &HC0C0C0
End If
If Check1.Value = 1 And Check2.Value = 1 And _
Trim(Entrada(1)) <> "" And _
Trim(Entrada(2)) <> "" And _
200
7. Anejo 5
Trim(Entrada(3)) <> "" And _
Trim(Entrada(4)) <> "" And _
Trim(Entrada(6)) <> "" And _
Trim(Entrada(7)) <> "" Then
Preguntacolor = &H80FF80
End If
If Check1.Value = 1 And Check2.Value = 0 And _
Trim(Entrada(1)) = "" And _
Trim(Entrada(2)) = "" And _
Trim(Entrada(3)) = "" And _
Trim(Entrada(4)) = "" And _
Trim(Entrada(6)) = "" And _
Trim(Entrada(8)) = "" Then
Preguntacolor = &HC0C0C0
End If
If Check1.Value = 1 And Check2.Value = 0 And _
Trim(Entrada(1)) <> "" And _
Trim(Entrada(2)) <> "" And _
Trim(Entrada(3)) <> "" And _
Trim(Entrada(4)) <> "" And _
Trim(Entrada(6)) <> "" And _
Trim(Entrada(8)) <> "" Then
Preguntacolor = &H80FF80
End If
If Check1.Value = 0 And Check2.Value = 1 And _
Trim(Entrada(1)) = "" And _
Trim(Entrada(2)) = "" And _
Trim(Entrada(5)) = "" And _
Trim(Entrada(6)) = "" And _
Trim(Entrada(7)) = "" Then
Preguntacolor = &HC0C0C0
End If
If Check1.Value = 0 And Check2.Value = 1 And _
Trim(Entrada(1)) <> "" And _
Trim(Entrada(2)) <> "" And _
Trim(Entrada(5)) <> "" And _
Trim(Entrada(6)) <> "" And _
Trim(Entrada(7)) <> "" Then
Preguntacolor = &H80FF80
End If
If Check1.Value = 0 And Check2.Value = 0 And _
Trim(Entrada(1)) = "" And _
Trim(Entrada(2)) = "" And _
Trim(Entrada(5)) = "" And _
Trim(Entrada(6)) = "" And _
Trim(Entrada(8)) = "" Then
Preguntacolor = &HC0C0C0
End If
If Check1.Value = 0 And Check2.Value = 0 And _
Trim(Entrada(1)) <> "" And _
Trim(Entrada(2)) <> "" And _
Trim(Entrada(5)) <> "" And _
Trim(Entrada(6)) <> "" And _
Trim(Entrada(8)) <> "" Then
Preguntacolor = &H80FF80
End If
If Preguntacolor = &HC0C0C0 Then vColor = "G"
If Preguntacolor = &H80FF80 Then vColor = "V"
If Preguntacolor = &HFF& Then vColor = "R"
End Function
Function GrabarDatosMes()
Dim ExisteFichero
fProgramacionClima.Index = "PROGRAMACION"
fProgramacionClima.MoveFirst
fProgramacionClima.Seek "=", NombreProgramacion, Right(Str(QueMes + 100), 2), TipoDatos
If fProgramacionClima.NoMatch = False Then 'Registro encontrado
ExisteFichero = "SI"
Else
ExisteFichero = "NO"
End If
If ExisteFichero = "NO" Then
fProgramacionClima.AddNew
Else
201
7. Anejo 5
fProgramacionClima.Edit
End If
fProgramacionClima("NombreProgramacion") = NombreProgramacion
fProgramacionClima("Fecha") = Right(Str(QueMes + 100), 2)
fProgramacionClima("Clima") = TipoDatos
fProgramacionClima("Color") = vColor
fProgramacionClima("TemperaturaMaxima") = Entrada(1)
fProgramacionClima("TemperaturaMinima") = Entrada(2)
If Check1.Value = 1 Then
fProgramacionClima("HumedadMaxima") = Entrada(3)
fProgramacionClima("HumedadMinima") = Entrada(4)
Else
fProgramacionClima("HumedadMedia") = Entrada(5)
End If
fProgramacionClima("Viento") = Entrada(6)
If Check2.Value = 1 Then
fProgramacionClima("RadiacionNeta") = Entrada(7)
Else
fProgramacionClima("HorasSol") = Entrada(8)
End If
fProgramacionClima("Lluvia") = Entrada(9)
fProgramacionClima("Psicrometro") = "N"
If Check1.Value = 1 Then
fProgramacionClima("Psicrometro") = "S"
End If
fProgramacionClima("Radiacion") = "N"
If Check2.Value = 1 Then
fProgramacionClima("Radiacion") = "S"
End If
fProgramacionClima.Update
End Function
Function GrabarDatosdia()
Dim ExisteFichero
fProgramacionClima.Index = "PROGRAMACION"
fProgramacionClima.MoveFirst
Dim fechar
fechar = Trim((Str(Ano) + Right(Str(Mes + 100), 2) + Right(Str(Val(Dia) + 100), 2)))
fProgramacionClima.Seek "=", NombreProgramacion, fechar, "D"
If fProgramacionClima.NoMatch = False Then 'Registro encontrado
ExisteFichero = "SI"
Else
ExisteFichero = "NO"
End If
If ExisteFichero = "NO" Then
fProgramacionClima.AddNew
Else
fProgramacionClima.Edit
End If
fProgramacionClima("NombreProgramacion") = NombreProgramacion
fProgramacionClima("Fecha") = fechar
fProgramacionClima("Clima") = TipoDatos
fProgramacionClima("Color") = vColor
fProgramacionClima("TemperaturaMaxima") = Entrada(1)
fProgramacionClima("TemperaturaMinima") = Entrada(2)
If Check1.Value = 1 Then
fProgramacionClima("HumedadMaxima") = Entrada(3)
fProgramacionClima("HumedadMinima") = Entrada(4)
Else
fProgramacionClima("HumedadMedia") = Entrada(5)
End If
fProgramacionClima("Viento") = Entrada(6)
If Check2.Value = 1 Then
fProgramacionClima("RadiacionNeta") = Entrada(7)
Else
fProgramacionClima("HorasSol") = Entrada(8)
End If
fProgramacionClima("Lluvia") = Entrada(9)
fProgramacionClima("Psicrometro") = "N"
If Check1.Value = 1 Then
fProgramacionClima("Psicrometro") = "S"
End If
fProgramacionClima("Radiacion") = "N"
If Check2.Value = 1 Then
202
7. Anejo 5
fProgramacionClima("Radiacion") = "S"
End If
fProgramacionClima.Update
End Function
Sub Posiciona(Lugar As Integer)
Me.Entrada(Lugar).SelStart = 0
Me.Entrada(Lugar).SelLength = Len(Entrada(Lugar))
Me.Entrada(Lugar).SetFocus
End Sub
203
7. Anejo 5
RIEGOS24.FRM
' Vctor Yusta. Dicembre-1998
Object ="THREED32.OCX"
Object ="DBLIST32.OCX"
Option Explicit
'Dim Atras
Dim Mensajes(41) As String
Dim Alertas(41) As String
Dim ValorControl As Control
Dim ValorTabla As String
Dim Indice As Integer
Dim Atras As Integer
Dim Campos(41) As String
Dim ExisteFichero As String
Dim QueMes
Dim vColor
Dim Tierra(20)
Private Sub Form_Load()
Indice = 1
Mensajes(1) = "Entra la cantidad de Arena (%)"
Mensajes(2) = "Entra la cantidad de Arcilla (%)"
Mensajes(3) = "Entra la cantidad de Limo (%)"
Mensajes(4) = "Cliquea a la derecha, si quieres escoger textura"
Mensajes(5) = "Entra la capacidad de campo (% suelo seco)"
Mensajes(6) = "Entra el punto de marchitez(% suelo seco)"
Mensajes(7) = "Entra los segundos de latitud del lugar"
Mensajes(8) = "Entra la latitud del lugar"
Mensajes(9) = "Entra los grados de longitud del lugar"
Mensajes(10) = "Entra los minutos de longitud del lugar"
Mensajes(11) = "Entra la densidad aparente"
Mensajes(13) = "Entra el porcentaje de pendiente"
Mensajes(14) = "Entra la infiltracin"
Mensajes(15) = "Entra el porcentaje de eficiencia en el lavado de sales"
Alertas(0) = ""
Alertas(1) = "Entra la descripcin"
Alertas(2) = "Entra el nombre"
Alertas(3) = "Entra la poblacin"
Alertas(4) = "Entra la provincia"
Alertas(5) = "El valor de los grados de latitud van de 0 a 180"
Alertas(6) = "El valor de los minutos de latitud van de 0 a 59"
Alertas(7) = "El valor de los segundos de latitud van de 0 a 59"
Alertas(8) = "El valor de la latitud es N o S"
Alertas(9) = "El valor de los grados de longitud van de 0 a 180"
Alertas(10) = "El valor de los minutos de longitud van de 0 a 59"
Alertas(11) = "El valor de los segundos de longitud van de 0 a 59"
Alertas(12) = "El valor de la longitud es E u O"
Alertas(13) = "La altitud va de 0 a 3000 metros"
Alertas(14) = "El nmero de cultivos va de 1 5"
Call CargaPantalla(Me)
BaseDatos
Me.Caption = LeerFichero("Menu", "Orden", 24, "Titulo") + " " + NombreProgramacion
Call DibujaMensaje(Me)
Call DibujaPanelComandos(Me)
Show
Entrada(0).Text = NombreProgramacion
Mensaje.Caption = Mensajes(1)
CargarDatos
Posiciona (1)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Salir
End Sub
Private Sub Salir()
Unload Me
Load Riegos
End Sub
Private Sub Comando_Click(Index As Integer)
Select Case Index
Case 0 ' Salida del formulario
Salir
Case 5 ' Salida del formulario
Call GrabarDatos
Unload Me
204
7. Anejo 5
End Select
End Sub
Private Sub CargarDatos()
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Call MoverFP("NombreProgramacion", Entrada(0))
Call MoverFP("Arena", Entrada(1))
Call MoverFP("Arcilla", Entrada(2))
Call MoverFP("Limo", Entrada(3))
Call MoverFP("TipoSuelo", Entrada(4))
Call MoverFP("CapacidadCampo", Entrada(5))
Call MoverFP("PuntoMarchitamiento", Entrada(6))
Call MoverFP("AguaDisponible", Entrada(7))
Call MoverFP("PesoSueloSeco", Entrada(8))
Call MoverFP("VolumenSueloSeco", Entrada(9))
Call MoverFP("DensidadReal", Entrada(10))
Call MoverFP("DensidadAparente", Entrada(11))
Call MoverFP("Porosidad", Entrada(12))
Call MoverFP("PendienteTerreno", Entrada(13))
Call MoverFP("TasaInfiltracion", Entrada(14))
Call MoverFP("EficienciaLavado", Entrada(15))
End If
End Sub
Private Sub GrabarDatos()
fProgramacion.Edit
fProgramacion("Arena") = Entrada(1).Text
fProgramacion("Arcilla") = Entrada(2).Text
fProgramacion("Limo") = Entrada(3).Text
fProgramacion("TipoSuelo") = Entrada(4).Text
fProgramacion("CapacidadCampo") = Entrada(5).Text
fProgramacion("PuntoMarchitamiento") = Entrada(6).Text
fProgramacion("AguaDisponible") = Entrada(7).Text
fProgramacion("PesoSueloSeco") = Entrada(8).Text
fProgramacion("VolumenSueloSeco") = Entrada(9).Text
fProgramacion("DensidadReal") = Entrada(10).Text
fProgramacion("DensidadAparente") = Entrada(11).Text
fProgramacion("Porosidad") = Entrada(12).Text
fProgramacion("PendienteTerreno") = Entrada(13).Text
fProgramacion("TasaInfiltracion") = Entrada(14).Text
fProgramacion("EficienciaLavado") = Entrada(15).Text
fProgramacion("Pantalla24") = "T"
fProgramacion.Update
End Sub
Private Sub MoverFP(Campo As String, Pantalla)
Pantalla.Text = NoNulo(fProgramacion(Campo))
End Sub
Private Sub ComandoLista_Click(Index As Integer)
Select Case Index
Case 1
ValorTabla = "Texturas"
Call CargaDBLista ' (ValorTabla, "Cultivo")
End Select
Posiciona (1)
Indice = 1
End Sub
Private Sub CargaDBLista() '(Fichero, Campo)
Dim Consulta As Recordset
Set Consulta = BaseDeDatos.OpenRecordset("SELECT * FROM Texturas ORDER BY Textura ;")
Set Datos.Recordset = Consulta
Datos.Refresh
DBLista.ZOrder 0
DBLista.Left = Entrada(4).Left 'Control.Left
DBLista.Top = Entrada(4).Top 'Control.Top
DBLista.Width = Entrada(4).Width 'Control.Width
DBLista.Height = 4000
DBLista.ListField = "Textura"
DBLista.Refresh
DBLista.Visible = True
End Sub
Private Sub DBLista_DblClick()
Entrada(4).Text = DBLista.Text
205
7. Anejo 5
Entrada(1) = LeerFichero("Texturas", "ORDEN", DBLista.Text, "Arena")
Entrada(2) = LeerFichero("Texturas", "ORDEN", DBLista.Text, "Arcilla")
Entrada(3) = LeerFichero("Texturas", "ORDEN", DBLista.Text, "Limo")
Entrada(8) = LeerFichero("Texturas", "ORDEN", DBLista.Text, "PesoSueloSeco")
Entrada(9) = LeerFichero("Texturas", "ORDEN", DBLista.Text, "VolumenSueloSeco")
Entrada(11) = LeerFichero("Texturas", "ORDEN", DBLista.Text, "DensidadAparente")
Entrada(10) = "2,65"
Entrada(15) = LeerFichero("Texturas", "ORDEN", DBLista.Text, "EficienciaLavado")
DBLista.Visible = False
Posiciona (1)
End Sub
'*****************************************************************************************
Private Sub Entrada_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 9 Then
Atras = 1
End If
End Sub
Private Sub Entrada_KeyPress(Index As Integer, KeyAscii As Integer)
Select Case Index
Case 1: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 2: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 3: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 4: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "A", "", 50, 0, "S")
Case 5: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 6: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 7: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 8: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 5, 2, "S")
Case 9: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 5, 2, "S")
Case 10: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 5, 2, "S")
Case 11: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 5, 0, "S")
Case 12: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 13: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 14: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 15: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Comando(5).Visible = True
End Select
End Sub
Function TrataCampo(FormaMe, Index, Campo, Tecla, tipo, Signo, Longitud, Decimales, Cero) As Integer
Dim EstaMal
Dim EstaMal1
Select Case tipo
Case "N" 'Comprobacin de Campo Numerico
If (Tecla < 48 Or Tecla > 57) And Tecla <> 8 Then
TrataCampo = 0
Else
TrataCampo = Tecla
End If
If Tecla = 45 And Signo = "S" And Len(Campo) = 0 Then TrataCampo = 45
If Tecla = 8 Then TrataCampo = Tecla
If Tecla = 46 Then Tecla = 44
If Tecla = 44 Then TrataCampo = Tecla
Dim num
For num = 1 To Len(Campo)
If Mid(Campo, num, 1) = "," And Tecla = 44 Then
TrataCampo = 0
End If
Next num
If Len(Campo) = 0 And Tecla = 48 And Cero <> "S" Then
TrataCampo = 0
End If
If Len(Campo) = 1 And Campo = "0" And Cero <> "S" And Tecla = 48 Then
TrataCampo = 0
End If
If Decimales = 0 And TrataCampo = 46 Then
TrataCampo = 0
End If
If Decimales > 0 Then
Dim Flag
Dim CuentaDecimales
CuentaDecimales = 0
Flag = False
For num = 1 To Len(Campo)
If Flag = True Then CuentaDecimales = CuentaDecimales + 1
206
7. Anejo 5
If Mid(Campo, num, 1) = "." Then
Flag = True
End If
Next num
If CuentaDecimales = Decimales Then
TrataCampo = 0
End If
End If
If Len(Campo) = Longitud And TrataCampo <> 8 Then
TrataCampo = 0
End If
Case "A" 'Tipo Alfanumerico
TrataCampo = Tecla
If Len(Campo) = Longitud And Tecla <> 8 Then
TrataCampo = 0
End If
Case "F" 'Tipo Fecha
If Len(Campo) = 2 And Tecla <> 45 And Tecla <> 8 And Tecla <> 13 Then
Tecla = 0
End If
If Len(Campo) = 5 And Tecla <> 45 And Tecla <> 8 And Tecla <> 13 Then
Tecla = 0
End If
If (Tecla < 48 Or Tecla > 57) And Tecla <> 8 Then
TrataCampo = 0
Else
TrataCampo = Tecla
End If
If Tecla = 8 Then TrataCampo = Tecla
If Tecla = 45 Then TrataCampo = Tecla
If Len(Campo) = Longitud And Tecla <> 8 Then TrataCampo = 0
If Len(Campo) > 8 And (Mid$(Campo, 3, 1) <> "-" Or Mid$(Campo, 6, 1) <> "-") And Tecla <> 8 Then
EstaMal = "S"
If Tecla = 13 Then
MsgBox ("La fecha es incorrecta. Formato:dd-mm-aaaa")
EstaMal1 = "S"
End If
Else
Dim estamal2
EstaMal = "N"
End If
If Len(Campo) > 0 And Len(Campo) < 10 And Tecla = 13 Then
EstaMal = "S"
If EstaMal1 <> "S" Then
MsgBox ("La fecha es incorrecta. Formato:dd-mm-aaaa")
EstaMal1 = ""
End If
End If
End Select
If Tecla = 13 Then
If EstaMal = "S" Then
Posiciona (Indice)
Else
If Comprobacion(FormaMe, Indice, Campo, tipo) = "OK" Then
Call MoverCampo(FormaMe, "AD")
Else
Posiciona (Indice)
End If
End If
End If
If Tecla = 9 Then 'hacia atras
If Atras = 1 Then
Call MoverCampo(FormaMe, "AT")
Else
Call MoverCampo(FormaMe, "AD")
End If
End If
End Function
Private Sub MoverCampo(FormaMe, Como)
If Como = "AD" Then ' adelante
If Indice + 1 > 15 Then
Indice = 0
End If
207
7. Anejo 5
Indice = Indice + 1
Do While Entrada(Indice).Enabled = False Or Entrada(Indice).Visible = False
Indice = Indice + 1
Loop
End If
If Como = "AT" Then 'atras
If Indice - 1 < 1 Then
Indice = 16
End If
Indice = Indice - 1
Do While Entrada(Indice).Enabled = False Or Entrada(Indice).Visible = False
Indice = Indice - 1
Loop
End If
Posiciona (Indice)
Me.Mensaje.Caption = Mensajes(Indice)
DoEvents
End Sub
Function Comprobacion(FormaMe, Indice, Campo, tipo)
Dim ValorN
Comprobacion = "OK"
If tipo = "N" Then
ValorN = Val(Campo)
End If
Select Case Indice
Case 1 '
If Campo = "" Then
MsgBox ("Entra algn porcentaje")
Comprobacion = ""
End If
If ValorN > 100 Then
MsgBox ("La cifra no puede exceder de 100")
Comprobacion = ""
End If
Case 2 '
If Campo = "" Then
MsgBox ("Entra algn porcentaje")
Comprobacion = ""
End If
If ValorN > 100 Then
MsgBox ("La cifra no puede exceder de 100")
Comprobacion = ""
End If
Case 3 '
If Campo = "" Then
MsgBox ("Entra algn porcentaje")
Comprobacion = ""
End If
If ValorN > 100 Then
MsgBox ("La cifra no puede exceder de 100")
Comprobacion = ""
End If
If Val(Entrada(1)) + Val(Entrada(2)) + Val(Entrada(3)) = 100 Then
If Entrada(1) <> "" And Entrada(2) <> "" And Entrada(3) <> "" Then
'ReDim Tierra(7)
Tierra(1) = Entrada(1)
Tierra(2) = Entrada(2)
Tierra(3) = Entrada(3)
CalculaTextura
Entrada(4) = Tierra(4)
Entrada(5) = Tierra(5)
Entrada(6) = Tierra(6)
Entrada(7) = Tierra(7)
Entrada(14).Text = LeerFichero("Texturas", "ORDEN", Entrada(4), "Infiltracion")
End If
Else
MsgBox ("Los 3 porcentajes han de sumar 100")
Comprobacion = ""
End If
Case 5 '
If Campo = "" Then
MsgBox ("Has de entrar algn valor")
Comprobacion = ""
208
7. Anejo 5
End If
Case 6 '
If Campo = "" Then
MsgBox ("Has de entrar algn valor")
Comprobacion = ""
End If
Case 10 '
If Campo = "" Then
MsgBox ("Has de entrar algn valor")
Comprobacion = ""
End If
If ValorN > 0 Then
Tierra(8) = Entrada(8)
Tierra(9) = Entrada(9)
Tierra(10) = Entrada(10)
'CalculaDensidadPorosidad
Entrada(11) = Tierra(11)
Entrada(12) = Tierra(12)
End If
Case 11 '
If Campo = "" Then
MsgBox ("Has de entrar algn valor")
Comprobacion = ""
End If
Case 13 '
If Campo = "" Then
MsgBox ("Has de entrar algn valor")
Comprobacion = ""
Else
'Tierra(13) = Entrada(13)
'CalculaDisminucionInfiltracion
'Entrada(14) = Tierra(14)
End If
Case 14 '
If Campo = "" Then
MsgBox ("Has de entrar algn valor")
Comprobacion = ""
End If
Case 15 '
If Campo = "" Then
MsgBox ("Has de entrar algn valor")
Comprobacion = ""
End If
End Select
End Function
Private Sub CalculaTextura()
Dim Are: Are = Val(Tierra(1))
Dim Arc: Arc = Val(Tierra(2))
Dim Lim: Lim = Val(Tierra(3))
Dim Textura
If Lim >= 80 And Are <= 12 Then Textura = "LIMOSO"
If (Lim >= 50 And Lim <= 80 And Are <= 50 And Arc <= 28) Or (Lim >= 80 And Lim <= 92 And Are <= 8 And Arc <= 20 And
Arc >= 12) Then Textura = "FRANCO-LIMOSO"
If Are >= 22 And Are <= 52 And Arc >= 8 And Arc <= 28 And Lim >= 28 And Lim <= 50 Then Textura = "FRANCO"
If Are <= 20 And Arc >= 28 And Arc <= 40 Then Textura = "FRANCO-ARCILLOSO-LIMOSO"
If Are >= 20 And Are <= 45 And Arc <= 40 And Arc >= 28 Then Textura = "FRANCO-ARCILLOSO"
If Arc >= 40 And Are <= 45 And Lim <= 40 Then Textura = "ARCILLOSO"
If Arc >= 45 And Are >= 45 Then Textura = "ARCILLOSO-ARENOSO"
If Arc >= 40 And Lim >= 40 Then Textura = "ARCILLOSO-LIMOSO"
If Arc >= 20 And Arc <= 35 And Are >= 45 And Lim <= 28 Then Textura = "FRANCO-ARCILLOSO-ARENOSO"
If (Are >= 52 And Are <= 85 And Arc <= 20 And Lim >= (-2 * Arc + 30)) Or (Are >= 42 And Are < 52 And Arc <= 8 And Lim
<= 50) Then Textura = "FRANCO-ARENOSO"
If Are >= 70 And Are <= 90 And Arc <= 15 And Lim >= (-1.5 * Arc + 15) And Lim <= (-2 * Arc + 30) Then Textura =
"ARENOSO-FRANCO"
If Are >= 85 And Arc <= 10 And Lim <= (-1.5 * Arc + 15) Then Textura = "ARENOSO"
Tierra(4) = Textura
Tierra(5) = Int((0.48 * Arc) + (0.162 * Lim) + (0.023 * Are) + 2.62)
Tierra(6) = Int((0.302 * Arc) + (0.102 * Lim) + (0.0147 * Are))
Tierra(7) = Int(Tierra(5) - Tierra(6))
End Sub
Private Sub CalculaDensidadPorosidad()
Dim PSS: PSS = Tierra(8)
Dim VSS: VSS = Tierra(9)
209
7. Anejo 5
Dim dr As Double: dr = CDbl(Tierra(10))
Dim Da As Double
Tierra(11) = Format((CDbl(PSS) / CDbl(VSS)), "####0.00")
Da = CDbl(Tierra(11))
Tierra(12) = Format(((dr - Da) / dr) * 100, "##0")
End Sub
Private Sub CalculaDisminucionInfiltracion()
Dim Pendiente: Pendiente = Tierra(13)
Dim Disminucion
If Val(Pendiente) >= 0 And Val(Pendiente) <= 5 Then Disminucion = 0
If Val(Pendiente) > 5 And Val(Pendiente) <= 8 Then Disminucion = 20
If Val(Pendiente) > 8 And Val(Pendiente) <= 12 Then Disminucion = 40
If Val(Pendiente) > 12 And Val(Pendiente) <= 20 Then Disminucion = 60
If Val(Pendiente) > 20 And Val(Pendiente) <= 100 Then Disminucion = 75
'Tierra(14) = Tierra(1) - (Tierra(14) * (Format(Disminucion, "##0") / 100))
End Sub
Sub Posiciona(Lugar As Integer)
Me.Entrada(Lugar).SelStart = 0
Me.Entrada(Lugar).SelLength = Len(Entrada(Lugar))
Me.Entrada(Lugar).SetFocus
End Sub
210
7. Anejo 5
RIEGOS25.FRM
' Vctor Yusta. Dicembre-1998
Object ="THREED32.OCX"
Option Explicit
'Dim Atras
Dim Mensajes(41) As String
Dim Alertas(41) As String
Dim ValorControl As Control
Dim ValorTabla As String
Dim Indice As Integer
Dim Atras As Integer
Dim Campos(41) As String
Dim ExisteFichero As String
Dim QueMes
Dim vColor
Dim Matriz(20)
Private Sub Form_Load()
Indice = 1
Mensajes(0) = ""
Mensajes(1) = "Entra la conductividad del agua de riego"
Alertas(0) = ""
Alertas(1) = "Entra la descripcin"
Call CargaPantalla(Me)
BaseDatos
Me.Caption = LeerFichero("Menu", "Orden", 25, "Titulo") + " " + NombreProgramacion
Call DibujaMensaje(Me)
Call DibujaPanelComandos(Me)
Show
Entrada(0).Text = NombreProgramacion
Mensaje.Caption = Mensajes(1)
CargarDatos
Posiciona (1)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Salir
End Sub
Private Sub Salir()
Unload Me
Load Riegos
End Sub
Private Sub Comando_Click(Index As Integer)
Select Case Index
Case 0 ' Salida del formulario
Salir
Case 5 ' Salida del formulario
Call GrabarDatos
Unload Me
End Select
End Sub
Private Sub CargarDatos()
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Call MoverFP("NombreProgramacion", Entrada(0))
Call MoverFP("ConductividadElectrica", Entrada(1))
End If
End Sub
Private Sub GrabarDatos()
fProgramacion.Edit
fProgramacion("ConductividadElectrica") = Entrada(1).Text
fProgramacion("Pantalla25") = "T"
fProgramacion.Update
End Sub
Private Sub MoverFP(Campo As String, Pantalla)
Pantalla.Text = NoNulo(fProgramacion(Campo))
End Sub
Function BorraDatos()
'Dim num
'For num = 31 To 41
' Entrada(num) = ""
'Next num
End Function
211
7. Anejo 5
Private Sub Entrada_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 9 Then
Atras = 1
End If
End Sub
Private Sub Entrada_KeyPress(Index As Integer, KeyAscii As Integer)
Select Case Index
Case 1: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 5, 1, "S")
Comando(5).Visible = True
End Select
End Sub
Function TrataCampo(FormaMe, Index, Campo, Tecla, tipo, Signo, Longitud, Decimales, Cero) As Integer
Dim EstaMal
Dim EstaMal1
Select Case tipo
Case "N" 'Comprobacin de Campo Numerico
If (Tecla < 48 Or Tecla > 57) And Tecla <> 8 Then
TrataCampo = 0
Else
TrataCampo = Tecla
End If
If Tecla = 45 And Signo = "S" And Len(Campo) = 0 Then TrataCampo = 45
If Tecla = 8 Then TrataCampo = Tecla
If Tecla = 46 Then Tecla = 44
If Tecla = 44 Then TrataCampo = Tecla
Dim num
For num = 1 To Len(Campo)
If Mid(Campo, num, 1) = "," And Tecla = 44 Then
TrataCampo = 0
End If
Next num
If Len(Campo) = 0 And Tecla = 48 Then
TrataCampo = 0
End If
If Len(Campo) = 1 And Campo = "0" And Cero <> "S" And Tecla = 48 Then
TrataCampo = 0
End If
If Decimales = 0 And TrataCampo = 46 Then
TrataCampo = 0
End If
If Decimales > 0 Then
Dim Flag
Dim CuentaDecimales
CuentaDecimales = 0
Flag = False
For num = 1 To Len(Campo)
If Flag = True Then CuentaDecimales = CuentaDecimales + 1
If Mid(Campo, num, 1) = "." Then
Flag = True
End If
Next num
If CuentaDecimales = Decimales Then
TrataCampo = 0
End If
End If
If Len(Campo) = Longitud And TrataCampo <> 8 Then
TrataCampo = 0
End If
Case "A" 'Tipo Alfanumerico
TrataCampo = Tecla
If Len(Campo) = Longitud And Tecla <> 8 Then
TrataCampo = 0
End If
Case "F" 'Tipo Fecha
If Len(Campo) = 2 And Tecla <> 45 And Tecla <> 8 And Tecla <> 13 Then
Tecla = 0
End If
If Len(Campo) = 5 And Tecla <> 45 And Tecla <> 8 And Tecla <> 13 Then
Tecla = 0
End If
If (Tecla < 48 Or Tecla > 57) And Tecla <> 8 Then
TrataCampo = 0
Else
212
7. Anejo 5
TrataCampo = Tecla
End If
If Tecla = 8 Then TrataCampo = Tecla
If Tecla = 45 Then TrataCampo = Tecla
If Len(Campo) = Longitud And Tecla <> 8 Then TrataCampo = 0
If Len(Campo) > 8 And (Mid$(Campo, 3, 1) <> "-" Or Mid$(Campo, 6, 1) <> "-") And Tecla <> 8 Then
EstaMal = "S"
If Tecla = 13 Then
MsgBox ("La fecha es incorrecta. Formato:dd-mm-aaaa")
EstaMal1 = "S"
End If
Else
Dim estamal2
EstaMal = "N"
End If
If Len(Campo) > 0 And Len(Campo) < 10 And Tecla = 13 Then
EstaMal = "S"
If EstaMal1 <> "S" Then
MsgBox ("La fecha es incorrecta. Formato:dd-mm-aaaa")
EstaMal1 = ""
End If
End If
End Select
If Tecla = 13 Then
If EstaMal = "S" Then
Posiciona (Indice)
Else
If Comprobacion(FormaMe, Indice, Campo, tipo) = "OK" Then
Call MoverCampo(FormaMe, "AD")
Else
Posiciona (Indice)
End If
End If
End If
If Tecla = 9 Then 'hacia atras
If Atras = 1 Then
Call MoverCampo(FormaMe, "AT")
Else
Call MoverCampo(FormaMe, "AD")
End If
End If
End Function
Private Sub MoverCampo(FormaMe, Como)
If Como = "AD" Then ' adelante
If Indice + 1 > 1 Then
Indice = 0
End If
Indice = Indice + 1
Do While Entrada(Indice).Enabled = False Or Entrada(Indice).Visible = False
Indice = Indice + 1
Loop
End If
If Como = "AT" Then 'atras
If Indice - 1 < 1 Then
Indice = 1
End If
Indice = Indice - 1
Do While Entrada(Indice).Enabled = False Or Entrada(Indice).Visible = False
Indice = Indice - 1
Loop
End If
Posiciona (Indice)
Me.Mensaje.Caption = Mensajes(Indice)
DoEvents
End Sub
Function Comprobacion(FormaMe, Indice, Campo, tipo)
Dim ValorN
Comprobacion = "OK"
If tipo = "N" Then
ValorN = Val(Campo)
End If
Select Case Indice
Case 1 '
213
7. Anejo 5
If Campo = "" Then
MsgBox ("Entra alguna cifra")
Comprobacion = ""
End If
End Select
End Function
Sub Posiciona(Lugar As Integer)
Me.Entrada(Lugar).SelStart = 0
Me.Entrada(Lugar).SelLength = Len(Entrada(Lugar))
Me.Entrada(Lugar).SetFocus
End Sub
214
7. Anejo 5
RIEGOS26.FRM
' Vctor Yusta. Dicembre-1998
Object ="THREED32.OCX"
Object ="DBLIST32.OCX"
Option Explicit
Dim Mensajes(41) As String
Dim Alertas(41) As String
Dim ValorControl As Control
Dim ValorTabla As String
Dim Indice As Integer
Dim Atras As Integer
Dim Campos(41) As String
Dim ExisteFichero As String
Dim QueMes
Dim vColor
Dim Matriz(20)
Private Sub Form_Load()
Indice = 1
Mensajes(1) = "Entra el sistema de riego cliquea en opciones ..."
Mensajes(2) = "Entra el tipo de riego (L para localizadd S para supericie)"
Mensajes(3) = "Entra la eficiencia de la aplicacin (%)"
Mensajes(4) = "Entra el caudal de la instalacin"
Mensajes(5) = "Entra el porcentaje de rea sombreada por el cultivo"
Mensajes(6) = "Entra los minutos de latitud del lugar"
Mensajes(7) = "Entra los segundos de latitud del lugar"
Alertas(0) = ""
Alertas(1) = "Entra la descripcin"
Alertas(2) = "Entra el nombre"
Alertas(3) = "Entra la poblacin"
Alertas(4) = "Entra la provincia"
Alertas(5) = "El valor de los grados de latitud van de 0 a 180"
Alertas(6) = "El valor de los minutos de latitud van de 0 a 59"
Alertas(7) = "El valor de los segundos de latitud van de 0 a 59"
Call CargaPantalla(Me)
BaseDatos
Me.Caption = LeerFichero("Menu", "Orden", 26, "Titulo") + " " + NombreProgramacion
Call DibujaMensaje(Me)
Call DibujaPanelComandos(Me)
Show
Entrada(0).Text = NombreProgramacion
Mensaje.Caption = Mensajes(1)
CargarDatos
Posiciona (1)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Salir
End Sub
Private Sub Salir()
Unload Me
Load Riegos
End Sub
Private Sub Comando_Click(Index As Integer)
Select Case Index
Case 0 ' Salida del formulario
Salir
Case 5 ' Salida del formulario
Call GrabarDatos
Unload Me
End Select
End Sub
Private Sub CargarDatos()
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Call MoverFP("NombreProgramacion", Entrada(0))
Call MoverFP("SistemaRiego", Entrada(1))
Call MoverFP("TipoRiego", Entrada(2))
Call MoverFP("EficienciaAplicacion", Entrada(3))
Call MoverFP("CaudalInstalacion", Entrada(4))
Call MoverFP("FraccionAreaSombreada", Entrada(5))
Call MoverFP("NumeroEmisores", Entrada(6))
Call MoverFP("CaudalEmisor", Entrada(7))
215
7. Anejo 5
Call MoverFP("CoeficienteUniformidad", Entrada(8))
End If
If Entrada(2) = "S" Then Entrada(5).Visible = False
End Sub
Private Sub GrabarDatos()
fProgramacion.Edit
fProgramacion("SistemaRiego") = UCase(Entrada(1).Text)
fProgramacion("TipoRiego") = UCase(Entrada(2).Text)
fProgramacion("EficienciaAplicacion") = Entrada(3).Text
fProgramacion("CaudalInstalacion") = Entrada(4).Text
fProgramacion("FraccionAreaSombreada") = Entrada(5).Text
fProgramacion("NumeroEmisores") = Entrada(6).Text
fProgramacion("CaudalEmisor") = Entrada(7).Text
fProgramacion("CoeficienteUniformidad") = Entrada(8).Text
fProgramacion("Pantalla26") = "T"
fProgramacion.Update
End Sub
Private Sub MoverFP(Campo As String, Pantalla)
Pantalla.Text = NoNulo(fProgramacion(Campo))
End Sub
Private Sub ComandoLista_Click(Index As Integer)
Select Case Index
Case 1
ValorTabla = "SistemasRiego"
Call CargaDBLista ' (ValorTabla, "Cultivo")
End Select
Indice = 1
Posiciona (Indice)
End Sub
Private Sub CargaDBLista() '(Fichero, Campo)
Dim Consulta As Recordset
Set Consulta = BaseDeDatos.OpenRecordset("SELECT * FROM SistemasRiego ORDER BY SistemaRiego ;")
Set Datos.Recordset = Consulta
Datos.Refresh
DBLista.ZOrder 0
DBLista.Left = Entrada(1).Left 'Control.Left
DBLista.Top = Entrada(1).Top 'Control.Top
DBLista.Width = Entrada(1).Width 'Control.Width
DBLista.Height = 4000
DBLista.ListField = "SistemaRiego"
DBLista.Refresh
DBLista.Visible = True
End Sub
Private Sub DBLista_DblClick()
Entrada(1).Text = DBLista.Text
Entrada(1) = LeerFichero("SistemasRiego", "ORDEN", DBLista.Text, "SistemaRiego")
Entrada(2) = LeerFichero("SistemasRiego", "ORDEN", DBLista.Text, "TipoRiego")
Entrada(3) = LeerFichero("SistemasRiego", "ORDEN", DBLista.Text, "EficienciaAplicacion")
DBLista.Visible = False
Posiciona (1)
End Sub
Private Sub dblista_click()
Entrada(1).Text = DBLista.Text
Entrada(1) = LeerFichero("SistemasRiego", "ORDEN", DBLista.Text, "SistemaRiego")
Entrada(2) = LeerFichero("SistemasRiego", "ORDEN", DBLista.Text, "TipoRiego")
Entrada(3) = LeerFichero("SistemasRiego", "ORDEN", DBLista.Text, "EficienciaAplicacion")
DBLista.Visible = False
Posiciona (1)
End Sub
Private Sub Entrada_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 9 Then
Atras = 1
End If
End Sub
Private Sub Entrada_KeyPress(Index As Integer, KeyAscii As Integer)
Entrada(2) = UCase(Entrada(2))
If UCase(Entrada(2)) = "S" Then
Entrada(5).Visible = False
Else
Entrada(5).Visible = True
End If
If Index = 4 And Entrada(5).Visible = False Then
Comando(5).Visible = True
216
7. Anejo 5
End If
If Index = 5 And Entrada(5).Visible = True Then
Comando(5).Visible = True
End If
Select Case Index
Case 1: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "A", "N", 50, 0, "S")
Case 2: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "A", "N", 1, 0, "S")
Case 3: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 4: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 0, "S")
Case 5: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 6: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 5, 0, "S")
Case 7: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 7, 1, "S")
Case 8: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
End Select
End Sub
Function TrataCampo(FormaMe, Index, Campo, Tecla, tipo, Signo, Longitud, Decimales, Cero) As Integer
Dim EstaMal
Dim EstaMal1
Select Case tipo
Case "N" 'Comprobacin de Campo Numerico
If (Tecla < 48 Or Tecla > 57) And Tecla <> 8 Then
TrataCampo = 0
Else
TrataCampo = Tecla
End If
If Tecla = 45 And Signo = "S" And Len(Campo) = 0 Then TrataCampo = 45
If Tecla = 8 Then TrataCampo = Tecla
If Tecla = 46 Then Tecla = 44
If Tecla = 44 Then TrataCampo = Tecla
Dim num
For num = 1 To Len(Campo)
If Mid(Campo, num, 1) = "," And Tecla = 44 Then
TrataCampo = 0
End If
Next num
If Len(Campo) = 0 And Tecla = 48 Then
TrataCampo = 0
End If
If Len(Campo) = 1 And Campo = "0" And Cero <> "S" And Tecla = 48 Then
TrataCampo = 0
End If
If Decimales = 0 And TrataCampo = 46 Then
TrataCampo = 0
End If
If Decimales > 0 Then
Dim Flag
Dim CuentaDecimales
CuentaDecimales = 0
Flag = False
For num = 1 To Len(Campo)
If Flag = True Then CuentaDecimales = CuentaDecimales + 1
If Mid(Campo, num, 1) = "." Then
Flag = True
End If
Next num
If CuentaDecimales = Decimales Then
TrataCampo = 0
End If
End If
If Len(Campo) = Longitud And TrataCampo <> 8 Then
TrataCampo = 0
End If
Case "A" 'Tipo Alfanumerico
TrataCampo = Tecla
If Len(Campo) = Longitud And Tecla <> 8 Then
TrataCampo = 0
End If
Case "F" 'Tipo Fecha
If Len(Campo) = 2 And Tecla <> 45 And Tecla <> 8 And Tecla <> 13 Then
Tecla = 0
End If
If Len(Campo) = 5 And Tecla <> 45 And Tecla <> 8 And Tecla <> 13 Then
Tecla = 0
217
7. Anejo 5
End If
If (Tecla < 48 Or Tecla > 57) And Tecla <> 8 Then
TrataCampo = 0
Else
TrataCampo = Tecla
End If
If Tecla = 8 Then TrataCampo = Tecla
If Tecla = 45 Then TrataCampo = Tecla
If Len(Campo) = Longitud And Tecla <> 8 Then TrataCampo = 0
If Len(Campo) > 8 And (Mid$(Campo, 3, 1) <> "-" Or Mid$(Campo, 6, 1) <> "-") And Tecla <> 8 Then
EstaMal = "S"
If Tecla = 13 Then
MsgBox ("La fecha es incorrecta. Formato:dd-mm-aaaa")
EstaMal1 = "S"
End If
Else
Dim estamal2
EstaMal = "N"
End If
If Len(Campo) > 0 And Len(Campo) < 10 And Tecla = 13 Then
EstaMal = "S"
If EstaMal1 <> "S" Then
MsgBox ("La fecha es incorrecta. Formato:dd-mm-aaaa")
EstaMal1 = ""
End If
End If
End Select
If Tecla = 13 Then
If EstaMal = "S" Then
Posiciona (Indice)
Else
If Comprobacion(FormaMe, Indice, Campo, tipo) = "OK" Then
Call MoverCampo(FormaMe, "AD")
Else
Posiciona (Indice)
End If
End If
End If
If Tecla = 9 Then 'hacia atras
If Atras = 1 Then
Call MoverCampo(FormaMe, "AT")
Else
Call MoverCampo(FormaMe, "AD")
End If
End If
End Function
Private Sub MoverCampo(FormaMe, Como)
If Como = "AD" Then ' adelante
If Indice + 1 > 8 Then
Indice = 0
End If
Indice = Indice + 1
Do While Entrada(Indice).Enabled = False Or Entrada(Indice).Visible = False
Indice = Indice + 1
If Indice > 8 Then
Indice = 1
End If
Loop
End If
If Como = "AT" Then 'atras
If Indice - 1 < 1 Then
Indice = 9
End If
Indice = Indice - 1
Do While Entrada(Indice).Enabled = False Or Entrada(Indice).Visible = False
Indice = Indice - 1
Loop
End If
Posiciona (Indice)
Me.Mensaje.Caption = Mensajes(Indice)
DoEvents
End Sub
Function Comprobacion(FormaMe, Indice, Campo, tipo)
218
7. Anejo 5
Dim ValorN
Comprobacion = "OK"
If tipo = "N" Then
ValorN = Val(Campo)
End If
Select Case Indice
Case 1 '
If Campo = "" Then
MsgBox ("Entra algn el sistema de riego")
Comprobacion = ""
End If
Case 2 '
If Campo = "" Then
MsgBox ("Entra el tipo de riego (L=goteo,aspersion,infiltracin S=resto")
Comprobacion = ""
End If
If UCase(Campo) <> "L" And UCase(Campo) <> "S" Then
MsgBox ("Entra el tipo de riego (L=goteo,aspersion,infiltracin S=resto")
Comprobacion = ""
End If
Case 3 '
If Campo = "" Then
MsgBox ("Entra algn porcentaje")
Comprobacion = ""
End If
If ValorN < 0 Then
MsgBox ("Entra un valor superior a 0")
Comprobacion = ""
End If
If ValorN > 100 Then
MsgBox ("La cifra no puede exceder de 100")
Comprobacion = ""
End If
Case 4 '
If Campo = "" Then
MsgBox ("Entra algn porcentaje")
Comprobacion = ""
End If
If ValorN < 0 Then
MsgBox ("Entra un valor superior a 0")
Comprobacion = ""
End If
Case 5 '
If Campo = "" Then
MsgBox ("Entra algn porcentaje")
Comprobacion = ""
End If
If ValorN < 0 Then
MsgBox ("Entra un valor superior a 0")
Comprobacion = ""
End If
If ValorN > 100 Then
MsgBox ("La cifra no puede exceder de 100")
Comprobacion = ""
End If
End Select
End Function
Sub Posiciona(Lugar As Integer)
Me.Entrada(Lugar).SelStart = 0
Me.Entrada(Lugar).SelLength = Len(Entrada(Lugar))
Me.Entrada(Lugar).SetFocus
End Sub
219
7. Anejo 5
RIEGOS27.FRM
' Vctor Yusta. Dicembre-1998
Object ="THREED32.OCX"
Option Explicit
'Dim Atras
Dim Mensajes(41) As String
Dim Alertas(41) As String
Dim ValorControl As Control
Dim ValorTabla As String
Dim Indice As Integer
Dim Atras As Integer
Dim Campos(41) As String
Dim ExisteFichero As String
Dim QueMes
Dim vColor
Dim Matriz(20)
Private Sub Form_Load()
Indice = 1
Mensajes(0) = ""
Mensajes(1) = "Entra el porcentaje de RFU agotada para emepezar el riego"
Mensajes(2) = "Entra el intrvalo de riego Si quires fijarlo. En caso contrario, deja el campo en blanco"
Mensajes(3) = "Entra el porcentaje de recarga de la RFU en el riego"
Mensajes(5) = "Entra el porcentaje de RFU lleno de agua, al inicio de la programacin"
Mensajes(6) = "Entra el porcentaje de lluvia efectiva"
Mensajes(7) = "Entra la constante de la ecuacin"
Mensajes(8) = "Entra la constante de la ecuacin"
Mensajes(9) = "Entra el valor de corte de la lluvia"
Mensajes(10) = "Entra la constante de la ecuacin"
Mensajes(11) = "Entra la constante de la ecuacin"
Mensajes(12) = "Entra el porcentaje de disminucin deseado debido a la conductividad del agua"
Alertas(0) = ""
Alertas(1) = "Entra la descripcin"
Call CargaPantalla(Me)
BaseDatos
Me.Caption = LeerFichero("Menu", "Orden", 27, "Titulo") + " " + NombreProgramacion
Call DibujaMensaje(Me)
Call DibujaPanelComandos(Me)
Show
Entrada(0).Text = NombreProgramacion
Mensaje.Caption = Mensajes(1)
CargarDatos
Posiciona (1)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Salir
End Sub
Private Sub Salir()
Unload Me
Load Riegos
End Sub
Private Sub Comando_Click(Index As Integer)
Select Case Index
Case 0 ' Salida del formulario
Salir
Case 5 ' Salida del formulario
Call GrabarDatos
Unload Me
End Select
End Sub
Private Sub CargarDatos()
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Call MoverFP("NombreProgramacion", Entrada(0))
Call MoverFP("AgotamientoRFU", Entrada(1))
Call MoverFP("IntervaloRiego", Entrada(2))
Call MoverFP("RecargaRFU", Entrada(3))
Call MoverFP("DosisFija", Entrada(4))
Call MoverFP("ReservaInicial", Entrada(5))
Option1 = fProgramacion("Lluvia1")
Option2 = fProgramacion("Lluvia2")
Option3 = fProgramacion("Lluvia3")
220
7. Anejo 5
Option4 = fProgramacion("Lluvia4")
If Option1 = False And Option2 = False And Option3 = False And Option4 = False Then
Option1 = True
Option1_Click
End If
If Option1 = True Then
Option1 = True
Option1_Click
End If
Call MoverFP("LluviaP", Entrada(6))
Call MoverFP("LluviaA1", Entrada(7))
Call MoverFP("LluviaB1", Entrada(8))
Call MoverFP("LluviaC1", Entrada(9))
Call MoverFP("LluviaA2", Entrada(10))
Call MoverFP("LluviaB2", Entrada(11))
Call MoverFP("RendimientoSal", Entrada(12))
End If
End Sub
Private Sub GrabarDatos()
fProgramacion.Edit
fProgramacion("AgotamientoRFU") = Entrada(1).Text
fProgramacion("IntervaloRiego") = Entrada(2).Text
fProgramacion("RecargaRFU") = Entrada(3).Text
fProgramacion("DosisFija") = Entrada(4).Text
fProgramacion("ReservaInicial") = Entrada(5).Text
fProgramacion("Pantalla27") = "T"
fProgramacion("Lluvia1") = Option1.Value
fProgramacion("Lluvia2") = Option2.Value
fProgramacion("Lluvia3") = Option3.Value
fProgramacion("Lluvia4") = Option4.Value
fProgramacion("LluviaP") = Entrada(6).Text
fProgramacion("LluviaA1") = Entrada(7).Text
fProgramacion("LluviaB1") = Entrada(8).Text
fProgramacion("LluviaC1") = Entrada(9).Text
fProgramacion("LluviaA2") = Entrada(10).Text
fProgramacion("LluviaB2") = Entrada(11).Text
fProgramacion("RendimientoSal") = Entrada(12).Text
fProgramacion.Update
End Sub
Private Sub MoverFP(Campo As String, Pantalla)
Pantalla.Text = NoNulo(fProgramacion(Campo))
End Sub
Private Sub Entrada_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 9 Then
Atras = 1
End If
End Sub
Private Sub Entrada_KeyPress(Index As Integer, KeyAscii As Integer)
Select Case Index
Case 1: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 1, "N")
Case 2: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 1, "S")
Case 3: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 1, "S")
Case 4: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 1, "N")
Case 5: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 1, "S")
Case 6: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 7: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 2, "S")
Case 8: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 9: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 10: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 4, 2, "S")
Case 11: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Case 12: KeyAscii = TrataCampo(Me, Index, Entrada(Index).Text, KeyAscii, "N", "N", 3, 0, "S")
Comando(5).Visible = True
End Select
End Sub
Function TrataCampo(FormaMe, Index, Campo, Tecla, tipo, Signo, Longitud, Decimales, Cero) As Integer
Dim EstaMal
Dim EstaMal1
Select Case tipo
Case "N" 'Comprobacin de Campo Numerico
If (Tecla < 48 Or Tecla > 57) And Tecla <> 8 Then
TrataCampo = 0
Else
TrataCampo = Tecla
221
7. Anejo 5
End If
If Tecla = 45 And Signo = "S" And Len(Campo) = 0 Then TrataCampo = 45
If Tecla = 8 Then TrataCampo = Tecla
If Tecla = 46 Then Tecla = 44
If Tecla = 44 Then TrataCampo = Tecla
Dim num
For num = 1 To Len(Campo)
If Mid(Campo, num, 1) = "," And Tecla = 44 Then
TrataCampo = 0
End If
Next num
If Len(Campo) = 0 And Tecla = 48 And Cero <> "S" Then
TrataCampo = 0
End If
If Len(Campo) = 1 And Campo = "0" And Cero <> "S" And Tecla = 48 Then
TrataCampo = 0
End If
If Decimales = 0 And TrataCampo = 46 Then
TrataCampo = 0
End If
If Decimales > 0 Then
Dim Flag
Dim CuentaDecimales
CuentaDecimales = 0
Flag = False
For num = 1 To Len(Campo)
If Flag = True Then CuentaDecimales = CuentaDecimales + 1
If Mid(Campo, num, 1) = "." Then
Flag = True
End If
Next num
If CuentaDecimales = Decimales Then
TrataCampo = 0
End If
End If
If Len(Campo) = Longitud And TrataCampo <> 8 Then
TrataCampo = 0
End If
Case "A" 'Tipo Alfanumerico
TrataCampo = Tecla
If Len(Campo) = Longitud And Tecla <> 8 Then
TrataCampo = 0
End If
Case "F" 'Tipo Fecha
If Len(Campo) = 2 And Tecla <> 45 And Tecla <> 8 And Tecla <> 13 Then
Tecla = 0
End If
If Len(Campo) = 5 And Tecla <> 45 And Tecla <> 8 And Tecla <> 13 Then
Tecla = 0
End If
If (Tecla < 48 Or Tecla > 57) And Tecla <> 8 Then
TrataCampo = 0
Else
TrataCampo = Tecla
End If
If Tecla = 8 Then TrataCampo = Tecla
If Tecla = 45 Then TrataCampo = Tecla
If Len(Campo) = Longitud And Tecla <> 8 Then TrataCampo = 0
If Len(Campo) > 8 And (Mid$(Campo, 3, 1) <> "-" Or Mid$(Campo, 6, 1) <> "-") And Tecla <> 8 Then
EstaMal = "S"
If Tecla = 13 Then
MsgBox ("La fecha es incorrecta. Formato:dd-mm-aaaa")
EstaMal1 = "S"
End If
Else
Dim estamal2
EstaMal = "N"
End If
If Len(Campo) > 0 And Len(Campo) < 10 And Tecla = 13 Then
EstaMal = "S"
If EstaMal1 <> "S" Then
MsgBox ("La fecha es incorrecta. Formato:dd-mm-aaaa")
EstaMal1 = ""
222
7. Anejo 5
End If
End If
End Select
If Tecla = 13 Then
If EstaMal = "S" Then
Posiciona (Indice)
Else
If Comprobacion(FormaMe, Indice, Campo, tipo) = "OK" Then
Call MoverCampo(FormaMe, "AD")
Else
Posiciona (Indice)
End If
End If
End If
If Tecla = 9 Then 'hacia atras
If Atras = 1 Then
Call MoverCampo(FormaMe, "AT")
Else
Call MoverCampo(FormaMe, "AD")
End If
End If
End Function
Private Sub MoverCampo(FormaMe, Como)
If Como = "AD" Then ' adelante
If Indice + 1 > 12 Then
Indice = 0
End If
Indice = Indice + 1
Do While Entrada(Indice).Enabled = False Or Entrada(Indice).Visible = False
Indice = Indice + 1
If Indice > 12 Then
Indice = 0
End If
Loop
End If
If Como = "AT" Then 'atras
If Indice - 1 < 1 Then
Indice = 13
End If
Indice = Indice - 1
Do While Entrada(Indice).Enabled = False Or Entrada(Indice).Visible = False
Indice = Indice - 1
Loop
End If
Posiciona (Indice)
Me.Mensaje.Caption = Mensajes(Indice)
DoEvents
End Sub
Function Comprobacion(FormaMe, Indice, Campo, tipo)
Dim ValorN
Comprobacion = "OK"
If tipo = "N" Then
ValorN = Val(Campo)
End If
Select Case Indice
Case 1 '
If Campo = "" Then
MsgBox ("Entra alguna cifra")
Comprobacion = ""
End If
If ValorN > 200 Then
MsgBox ("La cifra no puede exceder de 200")
Comprobacion = ""
End If
Case 2 '
'If Campo = "" Then
' MsgBox ("Entra algn porcentaje")
' Comprobacion = ""
'End If
Case 3 '
If Campo = "" Then
MsgBox ("Entra algn porcentaje")
Comprobacion = ""
223
7. Anejo 5
End If
Case 5 '
If Campo = "" Then
MsgBox ("Entra algn porcentaje")
Comprobacion = ""
End If
Case 6 '
If Campo = "" Then
MsgBox ("Entra algn porcentaje")
Comprobacion = ""
End If
Case 7 '
If Campo = "" Then
MsgBox ("Entra algn valor")
Comprobacion = ""
End If
Case 8 '
If Campo = "" Then
MsgBox ("Entra algn valor")
Comprobacion = ""
End If
Case 9 '
If Campo = "" Then
MsgBox ("Entra algn valor")
Comprobacion = ""
End If
Case 10 '
If Campo = "" Then
MsgBox ("Entra algn valor")
Comprobacion = ""
End If
Case 11 '
If Campo = "" Then
MsgBox ("Entra algn valor")
Comprobacion = ""
End If
Case 12 '
If Campo = "" Then
MsgBox ("Entra algn porcentaje")
Comprobacion = ""
End If
End Select
End Function
Sub Posiciona(Lugar As Integer)
Me.Entrada(Lugar).SelStart = 0
Me.Entrada(Lugar).SelLength = Len(Entrada(Lugar))
Me.Entrada(Lugar).SetFocus
End Sub
Private Sub Option1_Click()
apagaP
Label(6).Visible = True
Entrada(6).Visible = True
Posiciona (1)
End Sub
Private Sub Option2_Click()
apagaP
Label(7).Visible = True
Label(8).Visible = True
Posiciona (1)
End Sub
Private Sub Option3_Click()
apagaP
Label(9).Visible = True
Label(10).Visible = True
Posiciona (1)
End Sub
Private Sub Option4_Click()
apagaP
Label(11).Visible = True
Label(12).Visible = True
Label(13).Visible = True
Label(15).Visible = True
Entrada(7).Visible = True
224
7. Anejo 5
Entrada(8).Visible = True
Entrada(9).Visible = True
Entrada(10).Visible = True
Entrada(11).Visible = True
Posiciona (1)
End Sub
Function apagaP()
Label(6).Visible = False
Entrada(6).Visible = False
Label(7).Visible = False
Label(8).Visible = False
Label(9).Visible = False
Label(10).Visible = False
Label(11).Visible = False
Label(12).Visible = False
Label(13).Visible = False
Label(15).Visible = False
Entrada(7).Visible = False
Entrada(8).Visible = False
Entrada(9).Visible = False
Entrada(10).Visible = False
Entrada(11).Visible = False
Posiciona (1)
End Function
225
7. Anejo 5
RIEGOS31.FRM
' Vctor Yusta. Dicembre-1998
Object ="THREED32.OCX"
'Option Explicit
Dim Mensajes(41) As String
Dim Alertas(41) As String
Dim ValorControl As Control
Dim ValorTabla As String
Dim DiasMes(12) As Integer
Dim DiaPeso(12) As Integer
Dim Datos(12) As Double
Dim Indice As Integer
Dim Atras As Integer
Dim Campos(41) As String
Dim ExisteFichero As String
Dim QueMes
Dim vColor
Dim FechaPlantacion As String * 8
Dim MatrizCalculo(40) As String ' del 1 al 20 datos, del 21 al 40 resultados
Dim ReservaInicial As Double
Dim InicioRiego As String
Dim Cuenta
Dim Primero As String
Dim Tabu
Private Sub Form_Load()
Tabu = vbTab
Cuenta = 0
ReservaInicial = 0
InicioRiego = "00" 'CC a capacidad de campo, 00 con las reservas a 0
Primero = "SI"
Call CargaDiasMes
Call CargaPantalla(Me)
BaseDatos
Me.Caption = LeerFichero("Menu", "Orden", 31, "Titulo") + " " + NombreProgramacion
Call DibujaMensaje(Me)
Call DibujaPanelComandos(Me)
Show
Entrada(0).Text = NombreProgramacion
Mensaje.Caption = "Escoge una opcin" 'Pulsa la tecla de Clculo"
Call AnalizaDatos
End Sub
Private Sub AnalizaDatos()
Dim Falta As String
Dim Sortir: Sortir = "NO"
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
If Trim(NoNulo(fProgramacion("Pantalla21"))) = "" And Sortir = "NO" Then
Falta = " Faltan datos de la finca "
GoSub SalidaFalta
End If
If Trim(NoNulo(fProgramacion("Pantalla22"))) = "" And Sortir = "NO" Then
Falta = " Faltan datos del cultivo "
GoSub SalidaFalta
End If
If Trim(NoNulo(fProgramacion("Pantalla23"))) = "" And Sortir = "NO" Then
Falta = " Faltan datos climticos "
GoSub SalidaFalta
End If
If Trim(NoNulo(fProgramacion("Pantalla24"))) = "" And Sortir = "NO" Then
Falta = " Faltan datos del suelo "
GoSub SalidaFalta
End If
If Trim(NoNulo(fProgramacion("Pantalla25"))) = "" And Sortir = "NO" Then
Falta = " Faltan datos del agua de riego "
GoSub SalidaFalta
End If
If Trim(NoNulo(fProgramacion("Pantalla26"))) = "" And Sortir = "NO" Then
Falta = " Faltan datos del tipo de riego "
GoSub SalidaFalta
End If
If Trim(NoNulo(fProgramacion("Pantalla27"))) = "" And Sortir = "NO" Then
226
7. Anejo 5
Falta = " Faltan datos de rpogramacin del riego"
GoSub SalidaFalta
End If
If Sortir = "NO" Then
If fProgramacion("Pantalla21") = "C" And _
fProgramacion("Pantalla22") = "C" And _
fProgramacion("Pantalla23") = "C" And _
fProgramacion("Pantalla24") = "C" And _
fProgramacion("Pantalla25") = "C" And _
fProgramacion("Pantalla26") = "C" And _
fProgramacion("Pantalla27") = "C" Then
Call MostrarInformacion1
Call MostrarInformacion2
Else
EmpiezaACalcular
Call CursorLibre(Me)
End If
Else
Salir
End If
End If
Exit Sub
SalidaFalta:
MsgBox (Falta)
Sortir = "SI"
Return
End Sub
Private Sub Comando_Click(Index As Integer)
Select Case Index
Case 0 ' Salida del formulario
Salir
End Select
End Sub
Function CargaDiasMes()
' Se ha puesto un ao no bisiesto
DiasMes(1) = 31
DiasMes(2) = 28
DiasMes(3) = 31
DiasMes(4) = 30
DiasMes(5) = 31
DiasMes(6) = 30
DiasMes(7) = 31
DiasMes(8) = 31
DiasMes(9) = 30
DiasMes(10) = 31
DiasMes(11) = 30
DiasMes(12) = 31
DiaPeso(1) = 15
DiaPeso(2) = 46
DiaPeso(3) = 74
DiaPeso(4) = 105
DiaPeso(5) = 135
DiaPeso(6) = 166
DiaPeso(7) = 196
DiaPeso(8) = 227
DiaPeso(9) = 258
DiaPeso(10) = 288
DiaPeso(11) = 319
DiaPeso(12) = 349
End Function
Private Sub Form_Unload(Cancel As Integer)
Salir
End Sub
Private Sub Salir()
Unload Me
Load Riegos
End Sub
Private Sub EmpiezaACalcular()
Call CursorOcupado(Me)
DoEvents
Mensaje.Caption = "ESPERA un momento"
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
227
7. Anejo 5
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Dim vTipo
Dim vClima
vTipo = fProgramacion("Tipo")
vClima = fProgramacion("Clima")
Dim nnn
nnn = fProgramacion("FechaPlantacion")
FechaPlantacion = Mid(nnn, 7, 4) + Mid(nnn, 4, 2) + Mid(nnn, 1, 2)
If vClima = "M" Then
CalculaMensual
End If
If vClima = "D" Then
CalculaDiario
End If
End If
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
fProgramacion.Edit
fProgramacion("Pantalla21") = "C"
fProgramacion("Pantalla22") = "C"
fProgramacion("Pantalla23") = "C"
fProgramacion("Pantalla24") = "C"
fProgramacion("Pantalla25") = "C"
fProgramacion("Pantalla26") = "C"
fProgramacion("Pantalla27") = "C"
fProgramacion.Update
End If
DoEvents
Call MostrarInformacion1
Call MostrarInformacion2
Mensaje.Caption = "YA EST"
'Parrilla.Visible = True
End Sub
Private Function CalculaDiario()
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Dim vTipo As String
Dim vClima As String
Dim vLatitud As Double
Dim vAltitud As Double
Dim cFechaPlantacion
Dim cFechaFinal
vTipo = fProgramacion("Tipo")
vClima = fProgramacion("Clima")
vLatitud = fProgramacion("LatitudGrados") + (fProgramacion("LatitudGrados") / 60) + (fProgramacion("LatitudGrados") /
3600)
vAltitud = fProgramacion("Altitud")
cFechaPlantacion = Mid(fProgramacion("FechaPlantacion"), 7, 4) + Mid(fProgramacion("FechaPlantacion"), 4, 2) +
Mid(fProgramacion("FechaPlantacion"), 1, 2)
'cFechaFinal = Consulta
Dim Consulta As Recordset
Set Consulta = BaseDeDatos.OpenRecordset("SELECT * FROM ProgramacionClima WHERE NombreProgramacion =
'" & NombreProgramacion & "' and Clima = '" & "D" & "' ORDER BY Fecha ;")
If Consulta.RecordCount <> 0 Then
Consulta.MoveFirst
While Not Consulta.EOF
Call GrabarDatosDiarios(Consulta("Fecha"), "TemperaturaMaxima", Consulta("TemperaturaMaxima"), 4)
Call GrabarDatosDiarios(Consulta("Fecha"), "TemperaturaMinima", Consulta("TemperaturaMinima"), 4)
Call GrabarDatosDiarios(Consulta("Fecha"), "HumedadMaxima", Consulta("HumedadMaxima"), 3)
Call GrabarDatosDiarios(Consulta("Fecha"), "HumedadMinima", Consulta("HumedadMinima"), 3)
Call GrabarDatosDiarios(Consulta("Fecha"), "HumedadMedia", Consulta("HumedadMedia"), 3)
Call GrabarDatosDiarios(Consulta("Fecha"), "Viento", Consulta("Viento"), 3)
Call GrabarDatosDiarios(Consulta("Fecha"), "RadiacionNeta", Consulta("RadiacionNeta"), 5)
Call GrabarDatosDiarios(Consulta("Fecha"), "HorasSol", Consulta("HorasSol"), 4)
Call GrabarDatosDiarios(Consulta("Fecha"), "Lluvia", Consulta("Lluvia"), 6)
Call GrabarDatosDiarios(Consulta("Fecha"), "Radiacion", Consulta("Radiacion"), 1)
Call GrabarDatosDiarios(Consulta("Fecha"), "Psicrometro", Consulta("Psicrometro"), 1)
Consulta.MoveNext
228
7. Anejo 5
Wend
End If
Call CalculoBalanceHidrico(vTipo, vClima, vLatitud, vAltitud)
End If
End Function
Function GrabarDatosDiarios(Fecha, Campo, Valor, Longitud)
fBalanceHidrico.Index = "PROGRAMACION"
fBalanceHidrico.MoveFirst
fBalanceHidrico.Seek "=", NombreProgramacion, Fecha, "D"
If fBalanceHidrico.NoMatch = False Then 'Registro encontrado
fBalanceHidrico.Edit
Else
fBalanceHidrico.AddNew
End If
fBalanceHidrico("NombreProgramacion") = NombreProgramacion
fBalanceHidrico("Fecha") = Fecha
fBalanceHidrico("Clima") = "D"
fBalanceHidrico(Campo) = Valor
fBalanceHidrico.Update
End Function
Private Function CalculaMensual()
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Dim vTipo As String
Dim vClima As String
Dim vLatitud As Double
Dim vAltitud As Double
vTipo = fProgramacion("Tipo")
vClima = fProgramacion("Clima")
vLatitud = fProgramacion("LatitudGrados") + (fProgramacion("LatitudGrados") / 60) + (fProgramacion("LatitudGrados") /
3600)
vAltitud = fProgramacion("Altitud")
Call CargaDatosEstimacion(NombreProgramacion, vClima, "TemperaturaMaxima", 4, "N", "D")
Call CargaDatosEstimacion(NombreProgramacion, vClima, "TemperaturaMinima", 4, "N", "D")
Call CargaDatosEstimacion(NombreProgramacion, vClima, "HumedadMedia", 3, "S", "D")
Call CargaDatosEstimacion(NombreProgramacion, vClima, "HumedadMaxima", 3, "S", "D")
Call CargaDatosEstimacion(NombreProgramacion, vClima, "HumedadMinima", 3, "S", "D")
Call CargaDatosEstimacion(NombreProgramacion, vClima, "Viento", 3, "S", "D")
Call CargaDatosEstimacion(NombreProgramacion, vClima, "RadiacionNeta", 5, "N", "M")
Call CargaDatosEstimacion(NombreProgramacion, vClima, "HorasSol", 4, "N", "D")
Call CargaDatosEstimacion(NombreProgramacion, vClima, "Lluvia", 6, "N", "M")
Call CalculoBalanceHidrico(vTipo, vClima, vLatitud, vAltitud)
End If
End Function
Function CargaDatosEstimacion(NombreProgramacion, vClima, Campo, Longitud, Entero, Mensual)
Dim num
Dim NumAlfa
For num = 1 To 12
NumAlfa = Right(Str(num + 100), 2)
fProgramacionClima.Index = "PROGRAMACION"
fProgramacionClima.MoveFirst
fProgramacionClima.Seek "=", NombreProgramacion, NumAlfa, "M"
If fProgramacionClima.NoMatch = False Then 'Registro encontrado
Dim vPsicrometro
Dim vRadiacion
vPsicrometro = fProgramacionClima("Psicrometro")
vRadiacion = fProgramacionClima("Radiacion")
If Mensual = "M" Then
Datos(num) = CarNum(Trim(fProgramacionClima(Campo))) / DiasMes(num)
Else
Datos(num) = (CarNum(NoNulo(Trim(fProgramacionClima(Campo)))))
End If
If Entero = "S" Then Datos(num) = Int(Datos(num))
End If
Next num
Call CalculaDatosEstimacion(NombreProgramacion, vClima, Campo, Longitud, vPsicrometro, vRadiacion)
End Function
Function CalculaDatosEstimacion(NombreProgramacion, vClima, Campo, Longitud, vPsicrometro, vRadiacion)
Dim DesdeDia
Dim HastaDia
Dim DesdeValor
229
7. Anejo 5
Dim HastaValor
Dim Valor As Double: Valor = 0
Dim num As Double
For num = 1 To 365
'ESTO SIRVE PARA EL CASO QUE SE QUIERA IGUALAR LOS DATOS DEL MES A LOS DIAS DEL MES
'Dim num1
'For num1 = 1 To 12
'If Val(Left(MesDia(num), 2)) = num1 Then
Valor = Datos(Val(Left(MesDia(num), 2)))
'End If
'Next num1
'ESTO SIRVE EN EL CASO QUE SE QUIERA BALANCEAR LOS DATOS
'If num >= 1 And num <= DiaPeso(1) Then
' DesdeDia = -16 ' DiaPeso(12)
' HastaDia = DiaPeso(1)
' DesdeValor = Datos(12)
' HastaValor = Datos(1)
' Valor = ((HastaValor - DesdeValor) / (HastaDia - DesdeDia)) * num + (DesdeValor - (((HastaValor - DesdeValor) /
(HastaDia - DesdeDia)) * DesdeDia))
'End If
'Dim Num1
'For Num1 = 1 To 11
' If num > DiaPeso(Num1) And num <= DiaPeso(Num1 + 1) Then
'
DesdeDia = DiaPeso(Num1)
'
HastaDia = DiaPeso(Num1 + 1)
'
DesdeValor = Datos(Num1)
'
HastaValor = Datos(Num1 + 1)
'
Valor = ((HastaValor - DesdeValor) / (HastaDia - DesdeDia)) * num + (DesdeValor - (((HastaValor - DesdeValor) /
(HastaDia - DesdeDia)) * DesdeDia))
' End If
'Next Num1
'If num > DiaPeso(12) And num <= 365 Then
' DesdeDia = DiaPeso(12)
' HastaDia = 380
' DesdeValor = Datos(1)
' HastaValor = Datos(12)
' Valor = ((HastaValor - DesdeValor) / (HastaDia - DesdeDia)) * num + (DesdeValor - (((HastaValor - DesdeValor) /
(HastaDia - DesdeDia)) * DesdeDia))
'End If
'GRABACION DE DATOS
fBalanceHidrico.Index = "PROGRAMACION"
fBalanceHidrico.MoveFirst
Dim NumAlfa As String
NumAlfa = NumCar(num)
fBalanceHidrico.Seek "=", NombreProgramacion, "1998" + MesDia(num), "M"
If fBalanceHidrico.NoMatch = False Then 'Registro encontrado
fBalanceHidrico.Edit
Else
fBalanceHidrico.AddNew
End If
fBalanceHidrico("NombreProgramacion") = NombreProgramacion
fBalanceHidrico("Fecha") = "1998" + MesDia(num)
fBalanceHidrico("Clima") = "M"
fBalanceHidrico("Psicrometro") = vPsicrometro
fBalanceHidrico("Radiacion") = vRadiacion
fBalanceHidrico(Campo) = Left(NumCar(Valor), Longitud)
fBalanceHidrico.Update
Next num
End Function
Private Sub CalculoBalanceHidrico(vTipo As String, vClima As String, vLatitud As Double, vAltitud As Double)
Dim Consulta As Recordset
Set Consulta = BaseDeDatos.OpenRecordset("SELECT * FROM BalanceHidrico WHERE NombreProgramacion= '" &
NombreProgramacion & "' and Clima= '" & vClima & "' ORDER BY Fecha ;")
Consulta.MoveFirst
If Consulta.RecordCount <> 0 Then
Consulta.MoveFirst
While Not Consulta.EOF
Dim vFecha As String
vFecha = Right(Trim(Consulta("Fecha")), 4)
Dim vNumDia As Integer
vNumDia = DiaDelAno(vFecha)
Dim vTMax As Double
vTMax = CarNum(Trim(Consulta("TemperaturaMaxima")))
230
7. Anejo 5
Dim vTmin As Double
vTmin = CarNum(Trim(Consulta("TemperaturaMinima")))
Dim vHRMaxima As Double
vHRMaxima = CarNum(Trim(NoNulo(Consulta("HumedadMaxima"))))
Dim vHRMinima As Double
vHRMinima = CarNum(Trim(NoNulo(Consulta("HumedadMinima"))))
Dim vHRMedia As Double
vHRMedia = CarNum(Trim(NoNulo(Consulta("HumedadMedia"))))
Dim vVientoDia As Double
vVientoDia = CarNum(Trim(Consulta("Viento")))
Dim vHorasSol As Double
vHorasSol = CarNum(Trim(NoNulo(Consulta("HorasSol"))))
Dim vPsicrometro As String
vPsicrometro = Consulta("Psicrometro")
Dim vRadiacion As String
vRadiacion = Consulta("Radiacion")
Dim vRadiacionNeta As Double
vRadiacionNeta = CarNum(Trim(NoNulo(Consulta("RadiacionNeta"))))
Consulta.Edit
Dim nETo As Double
nETo = NumCar(CalculavETo(vLatitud, vAltitud, vNumDia, vTMax, vTmin, vHRMaxima, vHRMinima, vHRMedia,
vVientoDia, vRadiacionNeta, vHorasSol, vRadiacion, vPsicrometro))
Consulta("ETo") = Left(nETo, 5)
' meter condicional de Kc4
If (vTipo = "A" Or vTipo = "B" Or vTipo = "D") Then
Consulta("DiasCultivo") = DiferenciaFechas(FechaPlantacion, Consulta("Fecha"))
Consulta("Kc") = Left(NumCar(CalculaKc4(nETo, Consulta("DiasCultivo"))), 4)
Consulta("Raices") = Left(NumCar(CalculaRaices4(Consulta("DiasCultivo"))), 3)
Else
Consulta("DiasCultivo") = DiferenciaFechas(FechaPlantacion, Consulta("Fecha"))
Consulta("Kc") = Left(NumCar(CalculaKc12(vFecha)), 4)
Consulta("Raices") = Left(NumCar(CalculaRaices12), 3)
End If
Dim nKl As Double
nKl = NumCar(CalculaKl())
Consulta("Kl") = Left(nKl, 4)
Consulta("ETc") = Left(NumCar(CarNum(Consulta("ETo")) * CarNum(Consulta("Kc")) * CarNum(Consulta("Kl"))), 5)
Consulta("Fraccion") = Left(NumCar(CalculaFraccion(Consulta("ETc"))), 4)
Consulta("LluviaEfectiva") = Left(NumCar(CalculaLluviaEfectiva(Consulta("Lluvia"))), 4)
MatrizCalculo(1) = Consulta("Etc")
MatrizCalculo(2) = NoNulo(Consulta("LluviaEfectiva"))
MatrizCalculo(3) = NoNulo(Consulta("AporteCapilar"))
MatrizCalculo(4) = NoNulo(Consulta("Escorrentia"))
MatrizCalculo(5) = NoNulo(Consulta("Raices"))
MatrizCalculo(6) = NoNulo(Consulta("Fraccion"))
MatrizCalculo(7) = NoNulo(Consulta("Reserva"))
MatrizCalculo(8) = Consulta("Fecha")
CalculaMatrizCalculo
Consulta("RfuMaxima") = MatrizCalculo(21)
Consulta("RfuMinima") = MatrizCalculo(22)
Consulta("Reserva") = MatrizCalculo(23)
Consulta("DosisNeta") = MatrizCalculo(24)
Consulta("TipoRiego") = MatrizCalculo(25)
Consulta("EficienciaAplicacion") = MatrizCalculo(26)
Consulta("Lavado") = MatrizCalculo(27)
Consulta("EficienciaLavado") = MatrizCalculo(28)
Consulta("DosisBruta") = MatrizCalculo(29)
Consulta("CC") = MatrizCalculo(31)
Consulta("PM") = MatrizCalculo(32)
Consulta("DensidadAparente") = MatrizCalculo(33)
Consulta("AguaUtil") = MatrizCalculo(34)
Consulta("DosisBrutaTotal") = MatrizCalculo(35)
Consulta("Tiempo1") = MatrizCalculo(36)
Consulta("Tiempo2") = MatrizCalculo(37)
Consulta("Notas") = MatrizCalculo(38)
Consulta.Update
Consulta.MoveNext
Wend
End If
End Sub
Private Function CalculaKl() As Double
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
231
7. Anejo 5
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Dim nArea As Double
If CarNum(fProgramacion("FraccionAreaSombreada")) <> 0 Then
nArea = CarNum(fProgramacion("FraccionAreaSombreada")) / 100
Else
nArea = 1
End If
If fProgramacion("TipoRiego") <> "L" Then
nArea = 1
End If
Dim Suma As Double: Suma = 0
Dim Mayor As Double: Mayor = 0
Dim Menor As Double: Menor = 9999
Dim Fml1 As Double: Fml1 = 1.34 * nArea
Dim Fml2 As Double: Fml2 = 0.1 * nArea
Dim Fml3 As Double: Fml3 = (0.5 * nArea) + 0.5
Dim Fml4 As Double: Fml4 = (0.85 * nArea) + 0.15
If Fml1 > Mayor Then Mayor = Fml1
If Fml2 > Mayor Then Mayor = Fml2
If Fml3 > Mayor Then Mayor = Fml3
If Fml4 > Mayor Then Mayor = Fml4
If Fml1 < Menor Then Menor = Fml1
If Fml2 < Menor Then Menor = Fml2
If Fml3 < Menor Then Menor = Fml3
If Fml4 < Menor Then Menor = Fml4
If Fml1 <> Mayor And Fml1 <> Menor Then
Suma = Suma + Fml1
End If
If Fml2 <> Mayor And Fml2 <> Menor Then
Suma = Suma + Fml2
End If
If Fml3 <> Mayor And Fml3 <> Menor Then
Suma = Suma + Fml3
End If
If Fml4 <> Mayor And Fml4 <> Menor Then
Suma = Suma + Fml4
End If
CalculaKl = Suma / 2
End If
End Function
Private Function CalculavETo(Latitud As Double, Altitud As Double, NumDia As Integer, TMax As Double, TMin As Double,
HRMax As Double, HRMin As Double, HRMedia As Double, VientoDia As Double, ERadN As Double, vHorasSol As
Double, vRadiacion As String, vPsicrometro As String) As Double
' definicion variables
Dim WST As Double
Dim Emisividad As Double
Dim G As Double
Dim sigma As Double
Dim Rads As Double
Dim fnN As Double
Dim nN As Double
Dim n As Double
Dim AngHor As Double
Dim YY As Double
Dim XX As Double
Dim LatRad As Double
Dim Decli As Double
Dim dr As Double
Dim Albedo
'Dim Altitud As Double
'Dim TMin As Double
'Dim TMax As Double
Dim ETaero As Double
Dim gamma As Double
Dim gammaast As Double
Dim delta As Double
Dim t As Double
Dim U2 As Double
Dim eaMin As Double
Dim eaMax As Double
Dim ea As Double
Dim edTmin As Double
232
7. Anejo 5
'
'
'
'
'
233
7. Anejo 5
Rada = 37.586 * dr * ((AngHor * XX) + (YY * Sin(AngHor)))
n = (24 * AngHor) / Pi
nN = HorasSol / n
Rads = Rada * (0.25 + 0.5 * nN)
Radns = (1 - Albedo) * Rads
fnN = 0.1 + (0.9 * nN)
sigma = 0.00000000245 * ((TMax + 273.16) ^ 4 + (TMin + 273.16) ^ 4)
Emisividad = 0.34 + (Sqr(ed) * -0.139)
Radnl = sigma * fnN * Emisividad
If vRadiacion = "N" Then
Radn = Radns - Radnl
Else
Radn = ERadN
End If
G=0
ETrad = (delta / (delta + gammaast)) * (Radn / landa)
vETo = ETaero + ETrad
CalculavETo = vETo
End Function
Private Function CalculaKc12(vFecha) As Double
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
CalculaKc12 = CarNum(NoNulo(fProgramacion("Kc" + (Left(vFecha, 2)))))
End If
End Function
Private Function CalculaRaices12() As Double
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
CalculaRaices12 = fProgramacion("Raices")
End If
End Function
Private Function CalculaKc4(nETo As Double, cDiaCultivo) As Double
Dim nDiaCultivo As Double: nDiaCultivo = Val(cDiaCultivo)
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Dim nIntervaloDeRiego As Double: nIntervaloRiego = 0
nIntervaloDeRiego = CarNum(fProgramacion("IntervaloRiego"))
Dim vKcI As String
Dim vKcM As String
Dim vKcF As String
Dim nKcI As Double
Dim nKcM As Double
Dim nKcF As Double
Dim vDiasI As String
Dim vDiasD As String
Dim vDiasM As String
Dim vDiasF As String
Dim nDiasI As Double
Dim nDiasD As Double
Dim nDiasM As Double
Dim nDiasF As Double
vKcI = fProgramacion("KcI")
vKcM = fProgramacion("KcM")
vKcF = fProgramacion("KcF")
vDiasI = fProgramacion("DiasI")
vDiasD = fProgramacion("DiasD")
vDiasM = fProgramacion("DiasM")
vDiasF = fProgramacion("DiasF")
If RTrim(vKcI) = "*" Or RTrim(vKcI) = "" Then
nKcI = KcInicial(nIntervaloDeRiego, nETo)
Else
nKcI = CarNum(vKcI)
End If
nKcM = CarNum(vKcM)
nKcF = CarNum(vKcF)
nDiasI = CarNum(vDiasI)
nDiasD = CarNum(vDiasD)
234
7. Anejo 5
nDiasM = CarNum(vDiasM)
nDiasF = CarNum(vDiasF)
CalculaKc4 = 0
Dim Valor As Double
If nDiaCultivo > 0 And nDiaCultivo <= nDiasI Then
Valor = nKcI
End If
If nDiaCultivo > nDiasI And nDiaCultivo <= nDiasI + nDiasD Then
Valor = EstimacionKc4(nKcI, nKcM, nDiasD, nDiaCultivo - nDiasI)
End If
If nDiaCultivo > nDiasI + nDiasD And nDiaCultivo <= nDiasI + nDiasD + nDiasM Then
Valor = nKcM
End If
If nDiaCultivo > nDiasI + nDiasD + nDiasM And nDiaCultivo <= nDiasI + nDiasD + nDiasM + nDiasF Then
Valor = EstimacionKc4(nKcM, nKcF, nDiasF, nDiaCultivo - (nDiasI + nDiasD + nDiasM))
End If
CalculaKc4 = Valor
End If
End Function
Function KcInicial(vFrecuenciaRiego As Double, nETo As Double) As Double
If vFrecuenciaRiego = 0 Then vFrecuenciaRiego = 7
If vFrecuenciaRiego = 1 Then vFrecuenciaRiego = 2
If vFrecuenciaRiego > 20 Then vFrecuenciaRiego = 20
Dim Kc(20)
Dim vMaxima
Dim vMinima
If vFrecuenciaRiego = 2 Then vMinima = 2: vMaxima = 2
If vFrecuenciaRiego = 3 Then vMinima = 2: vMaxima = 4
If vFrecuenciaRiego = 4 Then vMinima = 4: vMaxima = 4
If vFrecuenciaRiego = 5 Then vMinima = 4: vMaxima = 7
If vFrecuenciaRiego = 6 Then vMinima = 4: vMaxima = 7
If vFrecuenciaRiego = 7 Then vMinima = 7: vMaxima = 7
If vFrecuenciaRiego = 8 Then vMinima = 7: vMaxima = 10
If vFrecuenciaRiego = 9 Then vMinima = 7: vMaxima = 10
If vFrecuenciaRiego = 10 Then vMinima = 10: vMaxima = 10
If vFrecuenciaRiego = 11 Then vMinima = 10: vMaxima = 20
If vFrecuenciaRiego = 12 Then vMinima = 10: vMaxima = 20
If vFrecuenciaRiego = 13 Then vMinima = 10: vMaxima = 20
If vFrecuenciaRiego = 14 Then vMinima = 10: vMaxima = 20
If vFrecuenciaRiego = 15 Then vMinima = 10: vMaxima = 20
If vFrecuenciaRiego = 16 Then vMinima = 10: vMaxima = 20
If vFrecuenciaRiego = 17 Then vMinima = 10: vMaxima = 20
If vFrecuenciaRiego = 18 Then vMinima = 10: vMaxima = 20
If vFrecuenciaRiego = 19 Then vMinima = 10: vMaxima = 20
If vFrecuenciaRiego = 20 Then vMinima = 20: vMaxima = 20
Kc(2) = (0.0025 * nETo * nETo) - (0.0588 * nETo) + 1.1068
Kc(4) = (0.0043 * nETo * nETo) - (0.097 * nETo) + 1.0403
Kc(7) = (0.0053 * nETo * nETo) - (0.1049 * nETo) + 0.8502
Kc(10) = (0.0053 * nETo * nETo) - (0.1009 * nETo) + 0.6915
Kc(20) = (0.0046 * nETo * nETo) - (0.0824 * nETo) + 0.52
If vMaxima <> vMinima Then
KcInicial = Kc(vMaxima) + ((vFrecuenciaRiego - vMinima) * ((Kc(vMinima) - Kc(vMaxima)) / (vMaxima - vMinima)))
Else
KcInicial = Kc(vMaxima)
End If
End Function
Function EstimacionKc4(vKc1 As Double, vKc2 As Double, Vdias As Double, Vdia As Double) As Double
EstimacionKc4 = vKc1 + (((vKc2 - vKc1) / Vdias) * Vdia)
End Function
Private Function CalculaRaices4(cDiaCultivo) As Double
Dim nDiaCultivo As Double: nDiaCultivo = Val(cDiaCultivo)
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Dim vRaicesI As String
Dim vRaicesM As String
Dim vRaicesF As String
Dim nRaicesI As Double
Dim nRaicesM As Double
Dim nRaicesF As Double
Dim vDiasI As String
Dim vDiasD As String
235
7. Anejo 5
Dim vDiasM As String
Dim vDiasF As String
Dim nDiasI As Double
Dim nDiasD As Double
Dim nDiasM As Double
Dim nDiasF As Double
vRaicesI = fProgramacion("RaicesI")
vRaicesM = fProgramacion("RaicesM")
vRaicesF = fProgramacion("RaicesF")
vDiasI = fProgramacion("DiasI")
vDiasD = fProgramacion("DiasD")
vDiasM = fProgramacion("DiasM")
vDiasF = fProgramacion("DiasF")
nRaicesI = CarNum(vRaicesI)
nRaicesM = CarNum(vRaicesM)
nRaicesF = CarNum(vRaicesF)
nDiasI = CarNum(vDiasI)
nDiasD = CarNum(vDiasD)
nDiasM = CarNum(vDiasM)
nDiasF = CarNum(vDiasF)
CalculaRaices4 = 0
Dim Valor As Double
If nDiaCultivo > 0 And nDiaCultivo <= nDiasI Then
Valor = nRaicesI
End If
If nDiaCultivo > nDiasI And nDiaCultivo <= nDiasI + nDiasD Then
Valor = EstimacionRaices4(nRaicesI, nRaicesM, nDiasD, nDiaCultivo - nDiasI)
End If
If nDiaCultivo > nDiasI + nDiasD And nDiaCultivo <= nDiasI + nDiasD + nDiasM Then
Valor = nRaicesM
End If
If nDiaCultivo > nDiasI + nDiasD + nDiasM And nDiaCultivo <= nDiasI + nDiasD + nDiasM + nDiasF Then
Valor = EstimacionRaices4(nRaicesM, nRaicesF, nDiasF, nDiaCultivo - (nDiasI + nDiasD + nDiasM))
End If
CalculaRaices4 = Valor
End If
End Function
Function EstimacionRaices4(vRaices1 As Double, vRaices2 As Double, Vdias As Double, Vdia As Double) As Double
EstimacionRaices4 = vRaices1 + (((vRaices2 - vRaices1) / Vdias) * Vdia)
End Function
Private Function CalculaFraccion(cETc As String) As Double
Dim nETc As Double: nETc = CarNum(cETc)
Dim nFraccion As Double: nFraccion = 0
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
nFraccion = fProgramacion("Fraccion")
End If
CalculaFraccion = nFraccion
' Es una regla que pone FAO-46 pero no se aplica PARA AUMENTAR O DISMINIUIR LA FRACCION DE AGUA
DISPONIBLE EN FUNCION DE LA ETO
'If nETc < 3 Then CalculaFraccion = 1.3 * nFraccion
'If nETc > 8 Then CalculaFraccion = 0.7 * nFraccion
'If nETc = 0 Then CalculaFraccion = 0
End Function
Private Function CalculaLluviaEfectiva(cLluvia As String) As Double
Dim nTipoLluvia As Integer
Dim nLluviaP As Double
Dim nLluviaA1 As Double
Dim nLluviaB1 As Double
Dim nLluviaC1 As Double
Dim nLluviaA2 As Double
Dim nLluviaB2 As Double
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
If fProgramacion("Lluvia1") = True Then
nTipoLluvia = 1
nLluviaP = CarNum(fProgramacion("LluviaP"))
End If
If fProgramacion("Lluvia2") = True Then nTipoLluvia = 2
236
7. Anejo 5
If fProgramacion("Lluvia3") = True Then nTipoLluvia = 3
If fProgramacion("Lluvia4") = True Then
nTipoLluvia = 4
nLluviaA1 = CarNum(fProgramacion("LluviaA1"))
nLluviaB1 = CarNum(fProgramacion("LluviaB1"))
nLluviaC1 = CarNum(fProgramacion("LluviaC1"))
nLluviaA2 = CarNum(fProgramacion("LluviaA2"))
nLluviaB2 = CarNum(fProgramacion("LluviaB2"))
End If
End If
Dim nLluvia As Double: nLluvia = CarNum(cLluvia)
Dim nLluviaEfectiva As Double: nLluviaEfectiva = 0
If nTipoLluvia = 1 Then 'metodo del porcentaje
CalculaLluviaEfectiva = nLluvia * (nLluviaP / 100)
End If
If nTipoLluvia = 2 Then 'metodo FAO/AGWL
If nLluvia * 30 < 70 Then
CalculaLluviaEfectiva = ((nLluvia * 30 * 0.6) - 10) / 30
Else
CalculaLluviaEfectiva = ((nLluvia * 30 * 0.8) - 25) / 30
End If
End If
If nTipoLluvia = 3 Then 'metodo USDA
If nLluvia * 30 < 250 Then
CalculaLluviaEfectiva = ((nLluvia * 30 * (125 - (0.2 * nLluvia * 30))) / 125) / 30
Else
CalculaLluviaEfectiva = (125 + (nLluvia * 30 * 0.1)) / 30
End If
End If
If nTipoLluvia = 4 Then 'metodo emprico
If nLluvia * 30 < nLluviaC1 Then
CalculaLluviaEfectiva = (((nLluvia * 30 * nLluviaA1) - (nLluviaB1))) / 30
Else
CalculaLluviaEfectiva = (((nLluvia * 30 * nLluviaA2) - (nLluviaB2))) / 30
End If
End If
' If Metodo = "A" Then 'metodo de Martin de Santa Olalla DE LLUVIA EFECTIVA
' If nLluvia > 7 Then CalculaLluviaEfectiva = 0.98 * nLluvia
' If nLluvia <= 7 Then CalculaLluviaEfectiva = 0.9 * nLluvia
' If nLluvia <= 5 Then CalculaLluviaEfectiva = 0.76 * nLluvia
' If nLluvia <= 3 Then CalculaLluviaEfectiva = 0.65 * nLluvia
' If nLluvia <= 0 Then CalculaLluviaEfectiva = 0 * nLluvia
' End If
End Function
Function DiferenciaFechas(cFechaInicial As String, cFechaFinal As String) As Double
Dim AnoI As Integer: AnoI = Val(Mid(cFechaInicial, 1, 4))
Dim MesI As Integer: MesI = Val(Mid(cFechaInicial, 5, 2))
Dim DiaI As Integer: DiaI = Val(Mid(cFechaInicial, 7, 2))
Dim AnoF As Integer: AnoF = Val(Mid(cFechaFinal, 1, 4))
Dim MesF As Integer: MesF = Val(Mid(cFechaFinal, 5, 2))
Dim DiaF As Integer: DiaF = Val(Mid(cFechaFinal, 7, 2))
Dim FechaInicial As Date: FechaInicial = DateSerial(AnoI, MesI, DiaI)
Dim FechaFinal As Date: FechaFinal = DateSerial(AnoF, MesF, DiaF)
Dim Numerodias As Double
DiferenciaFechas = FechaFinal - FechaInicial + 1
End Function
Function MesDia(NumeroDia as integer)
'Dar en string mesdia ("mmdd")
End Function
Function DiaDelAno(MesDia as string)
Dar en integer el nmero de da
End Function
Private Sub CalculaMatrizCalculo()
'''CalculaDosisNeta = AguaDisponible * (DensidadAparente / 10) * nFraccion * PorcentajeMojado * nRaices
'Datos entrada
Dim cNotas As String: cNotas = ""
Dim nETc As Double: nETc = CarNum(MatrizCalculo(1))
Dim nLluviaEfectiva As Double: nLluviaEfectiva = CarNum(MatrizCalculo(2))
Dim nRaices As Double: nRaices = CarNum(MatrizCalculo(5))
Dim nFraccion As Double: nFraccion = CarNum(MatrizCalculo(6))
Dim nReserva As Double: nReserva = CarNum(MatrizCalculo(1))
'Datos salida
Dim nCapacidadCampo As Double: nCapacidadCampo = 0
237
7. Anejo 5
Dim nPuntoMarchitez As Double: nPuntoMarchitez = 0
Dim nDensidadAparente As Double: nDensidadAparente = 0
Dim nRfuMaxima As Double: nRfuMaxima = 0
Dim nRFUMinima As Double: nRFUMinima = 0
Dim nDosisNeta As Double: nDosisNeta = 0
Dim vTipoRiego As String: vTipoRiego = ""
Dim nEficienciaAplicacion As Double: nEficienciaAplicacion = 0
Dim nEficienciaLavado As Double: nEficienciaLavado = 0
Dim nLavado As Double: nLavado = 0
Dim nDosisBruta As Double: nDosisBruta = 0
Dim nConductividadElectrica As Double
Dim nECe100 As Double
Dim nRenEsp As Double
Dim nMaxECe As Double
Dim nAguaUtil As Double
Dim nReservaInicial As Double
'Calculos
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
nCapacidadCampo = NumCar(fProgramacion("CapacidadCampo"))
nPuntoMarchitez = NumCar(fProgramacion("PuntoMarchitamiento"))
nDensidadAparente = NumCar(fProgramacion("DensidadAparente"))
vTipoRiego = fProgramacion("TipoRiego")
nEficienciaAplicacion = NumCar(fProgramacion("EficienciaAplicacion"))
nEficienciaLavado = CarNum(fProgramacion("EficienciaLavado"))
nConductividadElectrica = CarNum(fProgramacion("ConductividadElectrica"))
nECe100 = CarNum(fProgramacion("ECe100"))
nMaxECe = CarNum(fProgramacion("MaxECe"))
nRenEsp = CarNum(fProgramacion("RendimientoSal"))
nReservaInicial = CarNum(fProgramacion("ReservaInicial"))
'Dim nRFUMinima
nRFUMinima = CarNum(fProgramacion("AgotamientoRFU")) / 100
Dim nRecargaRFU
nRecargaRFU = CarNum(fProgramacion("RecargaRFU")) / 100
Dim nIntervaloRiego
nIntervaloRiego = CarNum(fProgramacion("IntervaloRiego"))
Dim nSuperficie
nSuperficie = CarNum(fProgramacion("SuperficieFinca"))
Dim nPendiente: nPendiente = 0
nPendiente = CarNum(fProgramacion("PendienteTerreno"))
Dim nInfiltracion
nInfiltracion = CarNum(fProgramacion("TasaInfiltracion"))
Dim nCaudal
nCaudal = CarNum(fProgramacion("CaudalInstalacion"))
End If
nAguaUtil = (nCapacidadCampo - nPuntoMarchitez) * (nDensidadAparente / 10) * nRaices
nRfuMaxima = (nCapacidadCampo - nPuntoMarchitez) * (nDensidadAparente / 10) * nRaices * nFraccion
nRFUMinima = nRfuMaxima * (1 - nRFUMinima)
If Primero = "SI" And nRaices > 0 Then
Primero = "NO"
ReservaInicial = nRfuMaxima * (nReservaInicial / 100)
End If
If ReservaInicial = 0 Then
nReserva = -nETc + nLluviaEfectiva
Else
nReserva = ReservaInicial - nETc + nLluviaEfectiva
End If
ReservaInicial = nReserva
If nReserva > nRfuMaxima Then
nReserva = nRfuMaxima
ReservaInicial = nRfuMaxima
End If
nDosisNeta = 0
If nReserva < nRFUMinima And nIntervaloRiego <> 0 Then
nDosisNeta = (nRfuMaxima * nRecargaRFU) - nReserva
nReserva = nReserva + nDosisNeta
ReservaInicial = nReserva
End If
If nReserva < nRFUMinima And nIntervaloRiego = 0 Then
nDosisNeta = (nRfuMaxima * nRecargaRFU) - nReserva
nReserva = nReserva + nDosisNeta
238
7. Anejo 5
ReservaInicial = nReserva
End If
If nIntervaloRiego > 0 And Cuenta = nIntervaloRiego Then
Cuenta = 0
nDosisNeta = (nRfuMaxima * nRecargaRFU) - nReserva
If nDosisNeta < 0 Then nDosisNeta = 0
nReserva = nReserva + nDosisNeta
ReservaInicial = nReserva
End If
If nDosisNeta > 0 Then
'Calculo de lavado al 100%
Dim FraccionLavado As Double
If vTipoRiego = "S" Then
Dim nECe As Double
nECe = ((nECe100 - nMaxECe) * nRenEsp / 100) + nMaxECe
nLavado = nConductividadElectrica / ((5 * nECe) - nConductividadElectrica)
FraccionLavado = 1 - nLavado
End If
If vTipoRiego = "L" Then
nLavado = nConductividadElectrica / (2 * nMaxECe)
FraccionLavado = 1 - nLavado
End If
If FraccionLavado < 0 Then
cNotas = "AGUA MUY SALINA."
Else
If FraccionLavado * (nEficienciaLavado / 100) < (nEficienciaAplicacion / 100) Then
'se aplica lavado de sales
nDosisBruta = nDosisNeta / (FraccionLavado * (nEficienciaLavado / 100))
cNotas = "Se aplica lavado de sales."
Else
nDosisBruta = nDosisNeta / (nEficienciaAplicacion / 100)
cNotas = "Se aplica eficiencia aplicacin."
End If
End If
Else
nEficienciaAplicacion = 0
nEficienciaLavado = 0
nDosisBruta = 0
End If
Dim nDosisBrutaTotal As Double: nDosisBrutaTotal = 0
nDosisBrutaTotal = (nDosisBruta * nSuperficie) / 1000
MatrizCalculo(21) = Left(NumCar(nRfuMaxima), 5)
MatrizCalculo(22) = Left(NumCar(nRFUMinima), 5)
MatrizCalculo(23) = Left(NumCar(nReserva), 5)
MatrizCalculo(24) = Left(NumCar(nDosisNeta), 5)
MatrizCalculo(25) = vTipoRiego
MatrizCalculo(26) = Left(NumCar(nEficienciaAplicacion), 3)
MatrizCalculo(27) = Left(NumCar(nLavado), 5)
MatrizCalculo(28) = Left(NumCar(nEficienciaLavado), 5)
MatrizCalculo(29) = Left(NumCar(nDosisBruta), 5)
MatrizCalculo(31) = Left(NumCar(nCapacidadCampo), 10)
MatrizCalculo(32) = Left(NumCar(nPuntoMarchitez), 10)
MatrizCalculo(33) = Left(NumCar(nDensidadAparente), 10)
MatrizCalculo(34) = Left(NumCar(nAguaUtil), 10)
MatrizCalculo(35) = Left(NumCar(nDosisBrutaTotal), 8)
Dim Disminucion: Disminucion = 0
' DISMINUCION EN FUNCION DE LA PENDIENTE (NO SE APLICA)
'If Val(nPendiente) >= 0 And Val(nPendiente) <= 5 Then Disminucion = 0
'If Val(nPendiente) > 5 And Val(nPendiente) <= 8 Then Disminucion = 20
'If Val(nPendiente) > 8 And Val(nPendiente) <= 12 Then Disminucion = 40
'If Val(nPendiente) > 12 And Val(nPendiente) <= 20 Then Disminucion = 60
'If Val(nPendiente) > 20 And Val(nPendiente) <= 100 Then Disminucion = 75
Dim nInfil As Double: nInfil = 0
Dim nTiempo1 As Double: nTiempo1 = 0
If nDosisBruta > 0 Then
nInfil = nInfiltracion - (nInfiltracion * (Disminucion / 100))
nTiempo1 = nDosisBruta / nInfil
End If
MatrizCalculo(36) = Left(NumCar(nTiempo1), 10)
Dim nTiempo2 As Double: nTiempo2 = 0
If nDosisBrutaTotal > 0 Then
nTiempo2 = nDosisBrutaTotal / nCaudal
End If
239
7. Anejo 5
MatrizCalculo(37) = Left(NumCar(nTiempo2), 10)
If nTiempo1 > nTiempo2 Then
cNotas = cNotas
End If
If nTiempo1 < nTiempo2 Then
cNotas = cNotas
End If
MatrizCalculo(38) = Left(cNotas, 100)
Cuenta = Cuenta + 1
End Sub
Sub Posiciona(Lugar As Integer)
Me.Entrada(Lugar).SelStart = 0
Me.Entrada(Lugar).SelLength = Len(Entrada(Lugar))
Me.Entrada(Lugar).SetFocus
End Sub
Private Sub MostrarInformacion1()
'Detalle
Dim tETc As Double: tETc = 0
Dim tPE As Double: tPE = 0
Dim tRiegos As Double: tRiegos = 0
Dim tDN As Double: tDN = 0
Dim tDB As Double: tDB = 0
Dim tDBT As Double: tDBT = 0
Dim Numero: Numero = 0
Dim Informacion
Open "C:\Riegos\RiegosDetalle.txt" For Output As #1
Dim Busca: Busca = ""
Busca = Busca + "SELECT * "
Busca = Busca + "FROM BalanceHidrico "
Busca = Busca + "WHERE "
Busca = Busca + "NombreProgramacion = '" & NombreProgramacion & "' and Raices <> '0' "
Busca = Busca + "ORDER BY "
Busca = Busca + "Fecha ;"
Dim Consulta As Recordset
Set Consulta = BaseDeDatos.OpenRecordset(Busca)
If Consulta.RecordCount <> 0 Then
Consulta.MoveFirst
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Print #1, "
BALANCE HDRICO
", Date, Time
Print #1, " "
Print #1, "Programacin........................................: " + Consulta("NombreProgramacion")
Print #1, "Finca...............................................: " + fProgramacion("NombreFinca")
Print #1, "Poblacin...........................................: " + fProgramacion("Poblacion")
Print #1, "Provincia...........................................: " + fProgramacion("Provincia")
Print #1, "Latitud [g,m,s].....................................: " + Str(fProgramacion("LatitudGrados")) + " " +
Str(fProgramacion("LatitudMinutos")) + "' " + Str(fProgramacion("LatitudSegundos")) + "'' " + fProgramacion("Latitud") + " "
Print #1, "Longitud [g,m,s]....................................: " + Str(fProgramacion("LongitudGrados")) + " " +
Str(fProgramacion("LongitudMinutos")) + "' " + Str(fProgramacion("LongitudSegundos")) + "'' " + fProgramacion("Longitud")
+ " "
Print #1, "Altitud [m].........................................: " + Str(fProgramacion("Altitud"))
Print #1, "Superficie [m2].....................................: " + fProgramacion("SuperficieFinca")
Print #1, "Cultivo.............................................: " + fProgramacion("Cultivo")
Print #1, "Fraccin agua disponible en el suelo................: " + fProgramacion("Fraccion")
Print #1, "Clase textural......................................: " + fProgramacion("TipoSuelo")
Print #1, "Densidad aparente [g/cm3]...........................: " + fProgramacion("DensidadAparente")
Print #1, "Capacidad de Campo [% peso].........................: " + fProgramacion("CapacidadCampo")
Print #1, "Punto de Marchitamiento [%peso].....................: " + fProgramacion("PuntoMarchitamiento")
Print #1, "Sistema Riego.......................................: " + fProgramacion("SistemaRiego")
Print #1, "Eficiencia en la aplicacin [%].....................: " + fProgramacion("EficienciaAplicacion")
Print #1, "Caudal instalacin riego [m3/parcela]...............: " + fProgramacion("CaudalInstalacion")
Print #1, "Conductividad agua de riego [dS/m)..................: " + fProgramacion("ConductividadElectrica")
Print #1, "Eficiencia en el lavado de sales [%]................: " + fProgramacion("EficienciaLavado")
Print #1, "Rendimiento mnimo deseado debido a salinidad [%]...: " + fProgramacion("RendimientoSal")
Print #1, "Fecha Plantacin/Inicio.............................: " + fProgramacion("FechaPlantacion")
Print #1, "Momento de Riego. Agotamiento de la RFU [%].........: " + fProgramacion("AgotamientoRFU")
Print #1, "Intervalo de riego [das]...........................: " + fProgramacion("IntervaloRiego")
Print #1, "Dosis de riego. Recarga de la RFU [%]...............: " + fProgramacion("RecargaRFU")
Print #1, "Nivel de agua de la RFU al inicio [%]...............: " + fProgramacion("ReservaInicial")
Print #1, " "
Print #1, " "
240
7. Anejo 5
Print #1, "Fecha " + " " + "ETo " + " " + "Kc " + " " + "Kl " + " " + "ETcKl" + " " + "P.E. " + " " + "Raices" + " " + "F.A."
+ " " + "R.F.U." + " " + "Reserva" + " " + "d.n. " + " " + "d.b. " + " " + "D.B. " + " " + "tiempoI" + " " + "tiempoC"
Print #1, "
" + " " + "[mm] " + " " + "[] " + " " + "[] " + " " + "[mm] " + " " + "[mm] " + " " + "[cm] " + " " + "[] " + " " +
"[mm] " + " " + "[mm] " + " " + "[mm] " + " " + "[mm] " + " " + "[m3/par]" + " " + "[horas]" + " " + "[hora] "
Print #1, "----------" + " " + "-----" + " " + "----" + " " + "----" + " " + "-----" + " " + "------" + " " + "------" + " " + "----" + " " + "-----" + " " + "-------" + " " + "-----" + " " + "-----" + " " + "--------" + " " + "-------" + " " + "-------"
Primero = "NO"
End If
Dim cFecha As String
Dim cETo As String * 5
Dim cKc As String * 4
Dim cKl As String * 4
Dim cETc As String * 5
Dim cPE As String * 6
Dim cRaices As String * 6
Dim cFA As String * 4
Dim cRFU As String * 6
Dim cReserva As String * 7
Dim cDN As String * 5
Dim cDB As String * 5
Dim cDBT As String * 8
Dim cTiempo1 As String * 6
Dim cTiempo2 As String * 6
While Not Consulta.EOF
Numero = Numero + 1
cFecha = Mid(Consulta("Fecha"), 7, 2) + "-" + Mid(Consulta("Fecha"), 5, 2) + "-" + Mid(Consulta("Fecha"), 1, 4)
Dim nETo: nETo = CarNum(Consulta("ETo")): RSet cETo = Format(nETo, "#0.00")
Dim nKc: nKc = CarNum(Consulta("Kc")): RSet cKc = Format(nKc, "0.00")
Dim nKl: nKl = CarNum(Consulta("Kl")): RSet cKl = Format(nKl, "0.00")
Dim nETc: nETc = CarNum(Consulta("ETc")): RSet cETc = Format(nETc, "#0.00")
Dim nPE: nPE = CarNum(Consulta("LluviaEfectiva")): RSet cPE = Format(nPE, "##0.00")
Dim nRaices: nRaices = CarNum(Consulta("Raices")): RSet cRaices = Format(nRaices, "##0")
Dim nFA: nFA = CarNum(Consulta("Fraccion")): RSet cFA = Format(nFA, "0.00")
Dim nRFU: nRFU = CarNum(Consulta("RFUMaxima")): RSet cRFU = Format(nRFU, "##0.0")
Dim nReserva: nReserva = CarNum(Consulta("Reserva")): RSet cReserva = Format(nReserva, "##0.00")
Dim nDN: nDN = CarNum(Consulta("DosisNeta")): RSet cDN = Format(nDN, "##0.00")
Dim nDB: nDB = CarNum(Consulta("DosisBruta")): RSet cDB = Format(nDB, "##0.00")
Dim nDBT: nDBT = CarNum(Consulta("DosisBrutaTotal")): RSet cDBT = Format(nDBT, "#####0.0")
Dim nTiempo1: nTiempo1 = CarNum(Consulta("Tiempo1")): RSet cTiempo1 = Format(nTiempo1, "###0.0")
Dim nTiempo2: nTiempo2 = CarNum(Consulta("Tiempo2")): RSet cTiempo2 = Format(nTiempo2, "###0.0")
tETc = tETc + nETc
tPE = tPE + nPE
If nDN > 0 Then
tRiegos = tRiegos + 1
tDN = tDN + nDN
tDB = tDB + nDB
tDBT = tDBT + nDBT
End If
Informacion = ""
Informacion = Informacion + cFecha + " "
Informacion = Informacion + cETo + " "
Informacion = Informacion + cKc + " "
Informacion = Informacion + cKl + " "
Informacion = Informacion + cETc + " "
Informacion = Informacion + cPE + " "
Informacion = Informacion + cRaices + " "
Informacion = Informacion + cFA + " "
Informacion = Informacion + cRFU + " "
Informacion = Informacion + cReserva + " "
Informacion = Informacion + cDN + " "
Informacion = Informacion + cDB + " "
Informacion = Informacion + cDBT + " "
Informacion = Informacion + cTiempo1 + " "
Informacion = Informacion + cTiempo2 + " "
Print #1, Informacion
DoEvents
Consulta.MoveNext
Wend
Print #1, " "
Print #1, "Total ETcKl [mm]..................: " + Str(Int(tETc))
Print #1, "Total P.E. [mm]....................: " + Str(Int(tPE))
Print #1, "Nmero de Riegos...................: " + Str(Int(tRiegos))
Print #1, "Total dosis neta [mm]..............: " + Str(Int(tDN))
241
7. Anejo 5
Print #1, "Total dosis bruta [mm].............: " + Str(Int(tDB))
Print #1, "Total dosis bruta [m3/parcela].....: " + Str(Int(tDBT))
Print #1, " "
Print #1, "----------------------------------------------------------------------------------"
Print #1, "NOTAS:"
Print #1, " - Cuando el intervalo de riego est en blanco, no se tiene en cuenta. "
Print #1, " - ETo [mm] = Evapotranspiracin de referencia."
Print #1, " - Kc [] = Constante de cultivo."
Print #1, " - Kl [] = Coeficiente de localizacin. Slo en riego localizado."
Print #1, " - ETcKl [mm]= Evapotranspiracin de cultivo por coeficiente de localizacin"
Print #1, " - P.E. [cm]= Lluvia efectiva (vase mtodo aplicado)"
Print #1, " - Races [cm] = Profundidad efectiva de las races "
Print #1, " - R.F.U. [mm] = Volumen de agua mximo de la Reserva Fcilmente Utilizable (RFU)"
Print #1, " - Reserva [mm] = Volumen de agua existente en la RFU al final del da"
Print #1, " - d.n. [mm] = Dosis neta de riego"
Print #1, " - d.b. [mm] = Dosis bruta de riego"
Print #1, " - D.B. [m3/parcela] = Dosis bruta de riego a aplicar en la parcela"
Print #1, " - tiempoI [horas] = Tiempo mnimo previsto de riego debido a la infiltracin"
Print #1, " - tiempoC [horas] = Tiempo mnimo previsto de riego debido al Caudal"
Print #1, " - De las dos cifras anteriores, la mayor de ellas ser el tiempo mnimo de riego"
Print #1, "----------------------------------------------------------------------------------"
End If
Close #1
Command3.Visible = True
End Sub
'***********************************************************************************
Private Sub MostrarInformacion2()
' riegos
Dim tRiegos As Double: tRiegos = 0
Dim tDN As Double: tDN = 0
Dim tDB As Double: tDB = 0
Dim tDBT As Double: tDBT = 0
Dim Numero: Numero = 0
Dim Informacion
Open "C:\Riegos\RiegosResumen.txt" For Output As #1
Dim Busca: Busca = ""
Busca = Busca + "SELECT * "
Busca = Busca + "FROM BalanceHidrico "
Busca = Busca + "WHERE "
Busca = Busca + "NombreProgramacion = '" & NombreProgramacion & "' and Raices <> '0' and DosisBruta <> '0' "
Busca = Busca + "ORDER BY "
Busca = Busca + "Fecha ;"
Dim Consulta As Recordset
Set Consulta = BaseDeDatos.OpenRecordset(Busca)
If Consulta.RecordCount <> 0 Then
Consulta.MoveFirst
fProgramacion.Index = "Programacion"
fProgramacion.MoveFirst
fProgramacion.Seek "=", NombreProgramacion
If fProgramacion.NoMatch = False Then 'Registro encontrado
Print #1, "
RIEGOS A EFECTUAR
", Date, Time
Print #1, " "
Print #1, "Programacin........................................: " + Consulta("NombreProgramacion")
Print #1, "Finca...............................................: " + fProgramacion("NombreFinca")
Print #1, "Poblacin...........................................: " + fProgramacion("Poblacion")
Print #1, "Provincia...........................................: " + fProgramacion("Provincia")
Print #1, "Latitud [g,m,s].....................................: " + Str(fProgramacion("LatitudGrados")) + " " +
Str(fProgramacion("LatitudMinutos")) + "' " + Str(fProgramacion("LatitudSegundos")) + "'' " + fProgramacion("Latitud") + " "
Print #1, "Longitud [g,m,s]....................................: " + Str(fProgramacion("LongitudGrados")) + " " +
Str(fProgramacion("LongitudMinutos")) + "' " + Str(fProgramacion("LongitudSegundos")) + "'' " + fProgramacion("Longitud")
+ " "
Print #1, "Altitud [m].........................................: " + Str(fProgramacion("Altitud"))
Print #1, "Superficie [m2].....................................: " + fProgramacion("SuperficieFinca")
Print #1, "Cultivo.............................................: " + fProgramacion("Cultivo")
Print #1, "Fraccin agua disponible en el suelo................: " + fProgramacion("Fraccion")
Print #1, "Clase textural......................................: " + fProgramacion("TipoSuelo")
Print #1, "Densidad aparente [g/cm3]...........................: " + fProgramacion("DensidadAparente")
Print #1, "Capacidad de Campo [% peso].........................: " + fProgramacion("CapacidadCampo")
Print #1, "Punto de Marchitamiento [%peso].....................: " + fProgramacion("PuntoMarchitamiento")
Print #1, "Sistema Riego.......................................: " + fProgramacion("SistemaRiego")
Print #1, "Eficiencia en la aplicacin [%].....................: " + fProgramacion("EficienciaAplicacion")
Print #1, "Caudal instalacin riego [m3/parcela]...............: " + fProgramacion("CaudalInstalacion")
Print #1, "Conductividad agua de riego [dS/m]..................: " + fProgramacion("ConductividadElectrica")
242
7. Anejo 5
Print #1, "Eficiencia en el lavado de sales [%]................: " + fProgramacion("EficienciaLavado")
Print #1, "Rendimiento mnimo deseado debido a salinidad [%]...: " + fProgramacion("RendimientoSal")
Print #1, "Fecha Plantacin/Inicio.............................: " + fProgramacion("FechaPlantacion")
Print #1, "Momento de Riego. Agotamiento de la RFU [%].........: " + fProgramacion("AgotamientoRFU")
Print #1, "Intervalo de riego [das]...........................: " + fProgramacion("IntervaloRiego")
Print #1, "Dosis de riego. Recarga de la RFU [%]...............: " + fProgramacion("RecargaRFU")
Print #1, "Nivel de agua de la RFU al inicio [%]...............: " + fProgramacion("ReservaInicial")
Print #1, " "
Print #1, " "
Print #1, "Fecha " + " " + "d.n. " + " " + "d.b. " + " " + "D.B. " + " " + "tiempoI" + " " + "tiempoF" + " " + " Notas
"
Print #1, "
" + " " + "[mm] " + " " + "[mm] " + " " + "[m3/par]" + " " + "[horas]" + " " + "[hora] " + " " + "
"
Print #1, "----------" + " " + "-----" + " " + "-----" + " " + "--------" + " " + "-------" + " " + "-------" + " " + "------------------------------------------"
Primero = "NO"
End If
Dim cFecha As String
Dim cETo As String * 5
Dim cKc As String * 4
Dim cKl As String * 4
Dim cETc As String * 5
Dim cPE As String * 6
Dim cRaices As String * 6
Dim cFA As String * 4
Dim cRFU As String * 6
Dim cReserva As String * 7
Dim cDN As String * 5
Dim cDB As String * 5
Dim cDBT As String * 8
Dim cTiempo1 As String * 6
Dim cTiempo2 As String * 6
While Not Consulta.EOF
Numero = Numero + 1
cFecha = Mid(Consulta("Fecha"), 7, 2) + "-" + Mid(Consulta("Fecha"), 5, 2) + "-" + Mid(Consulta("Fecha"), 1, 4)
Dim nETo: nETo = CarNum(Consulta("ETo")): RSet cETo = Format(nETo, "#0.00")
Dim nKc: nKc = CarNum(Consulta("Kc")): RSet cKc = Format(nKc, "0.00")
Dim nKl: nKl = CarNum(Consulta("Kl")): RSet cKl = Format(nKl, "0.00")
Dim nETc: nETc = CarNum(Consulta("ETc")): RSet cETc = Format(nETc, "#0.00")
Dim nPE: nPE = CarNum(Consulta("LluviaEfectiva")): RSet cPE = Format(nPE, "##0.00")
Dim nRaices: nRaices = CarNum(Consulta("Raices")): RSet cRaices = Format(nRaices, "##0")
Dim nFA: nFA = CarNum(Consulta("Fraccion")): RSet cFA = Format(nFA, "0.00")
Dim nRFU: nRFU = CarNum(Consulta("RFUMaxima")): RSet cRFU = Format(nRFU, "##0.0")
Dim nReserva: nReserva = CarNum(Consulta("Reserva")): RSet cReserva = Format(nReserva, "##0.00")
Dim nDN: nDN = CarNum(Consulta("DosisNeta")): RSet cDN = Format(nDN, "##0.00")
Dim nDB: nDB = CarNum(Consulta("DosisBruta")): RSet cDB = Format(nDB, "##0.00")
Dim nDBT: nDBT = CarNum(Consulta("DosisBrutaTotal")): RSet cDBT = Format(nDBT, "#####0.0")
Dim nTiempo1: nTiempo1 = CarNum(Consulta("Tiempo1")): RSet cTiempo1 = Format(nTiempo1, "###0.0")
Dim nTiempo2: nTiempo2 = CarNum(Consulta("Tiempo2")): RSet cTiempo2 = Format(nTiempo2, "###0.0")
Dim cNotas: cNotas = Consulta("Notas")
If nDN > 0 Then
tRiegos = tRiegos + 1
tDN = tDN + nDN
tDB = tDB + nDB
tDBT = tDBT + nDBT
End If
Informacion = ""
Informacion = Informacion + cFecha + " "
Informacion = Informacion + cDN + " "
Informacion = Informacion + cDB + " "
Informacion = Informacion + cDBT + " "
Informacion = Informacion + cTiempo1 + " "
Informacion = Informacion + cTiempo2 + " "
Informacion = Informacion + cNotas + " "
Print #1, Informacion
DoEvents
Consulta.MoveNext
Wend
Print #1, " "
Print #1, "Nmero de Riegos...................: " + Str(Int(tRiegos))
Print #1, "Total dosis neta [mm]..............: " + Str(Int(tDN))
Print #1, "Total dosis bruta [mm].............: " + Str(Int(tDB))
Print #1, "Total dosis bruta [m3/parcela].....: " + Str(Int(tDBT))
243
7. Anejo 5
Print #1, " "
Print #1, "----------------------------------------------------------------------------------"
Print #1, "NOTAS:"
Print #1, " - Cuando el intervalo de riego est en blanco, no se tiene en cuenta. "
Print #1, " - d.n. [mm] = Dosis neta de riego"
Print #1, " - d.b. [mm] = Dosis bruta de riego"
Print #1, " - D.B. [m3/parcela] = Dosis bruta de riego a aplicar en la parcela"
Print #1, " - tiempoI [horas] = Tiempo mnimo previsto de riego debido a la infiltracin"
Print #1, " - tiempoC [horas] = Tiempo mnimo previsto de riego debido al Caudal"
Print #1, " - De las dos cifras anteriores, la mayor de ellas ser el tiempo mnimo de riego"
Print #1, "----------------------------------------------------------------------------------"
Else
Print #1, " NO HAY RIEGOS"
End If
Close #1
Command4.Visible = True
Comando(0).Visible = True
Label1.Visible = False
End Sub
Private Sub Command3_Click()
Dim ReturnValue
ReturnValue = Shell("c:\Archivos de Programa\Accesorios\Wordpad.exe c:\Riegos\RiegosDetalle.txt", 1)
AppActivate ReturnValue
End Sub
Private Sub Command4_Click()
Dim ReturnValue
ReturnValue = Shell("c:\Archivos de Programa\Accesorios\Wordpad.exe c:\Riegos\RiegosResumen.txt", 1)
AppActivate ReturnValue
End Sub
244