Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2023-113
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2023-113
2023-113
Commits
7e830b00
Commit
7e830b00
authored
Sep 02, 2023
by
di-nethra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvements added
parent
c8cc3752
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
190 additions
and
27 deletions
+190
-27
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/assets/coconut.jpeg
...p Finder - IT20233808/RP-MobileAPP-FE/assets/coconut.jpeg
+0
-0
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/assets/mango.jpeg
...rop Finder - IT20233808/RP-MobileAPP-FE/assets/mango.jpeg
+0
-0
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/assets/pomagranate.jpeg
...nder - IT20233808/RP-MobileAPP-FE/assets/pomagranate.jpeg
+0
-0
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/components/common/Images.js
... - IT20233808/RP-MobileAPP-FE/components/common/Images.js
+29
-0
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/components/recomendationComponentsBySoil/MostSutaibleCrops.js
...onents/recomendationComponentsBySoil/MostSutaibleCrops.js
+7
-24
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/package.json
...zed Crop Finder - IT20233808/RP-MobileAPP-FE/package.json
+2
-1
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/yarn.lock
...imized Crop Finder - IT20233808/RP-MobileAPP-FE/yarn.lock
+152
-2
No files found.
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/assets/coconut.jpeg
0 → 100644
View file @
7e830b00
244 KB
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/assets/mango.jpeg
0 → 100644
View file @
7e830b00
192 KB
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/assets/pomagranate.jpeg
0 → 100644
View file @
7e830b00
149 KB
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/components/common/Images.js
0 → 100644
View file @
7e830b00
import
BarleyImage
from
'
../../assets/barley.png
'
;
import
WheatImage
from
'
../../assets/wheat.png
'
;
import
RiceImage
from
'
../../assets/rice.png
'
;
import
MaizeImage
from
'
../../assets/maize.png
'
;
import
PotatoImage
from
'
../../assets/potato.png
'
;
import
TomatoImage
from
'
../../assets/tomato.png
'
;
import
CottonImage
from
'
../../assets/cotton.png
'
;
import
SoybeanImage
from
'
../../assets/soybean.jpg
'
;
import
CoconutImage
from
'
../../assets/coconut.jpeg
'
;
import
PomagranateImage
from
'
../../assets/pomagranate.jpeg
'
;
import
MangoImage
from
'
../../assets/mango.jpeg
'
;
const
cropImages
=
{
Soybean
:
SoybeanImage
,
Barley
:
BarleyImage
,
Wheat
:
WheatImage
,
Rice
:
RiceImage
,
Maize
:
MaizeImage
,
Potato
:
PotatoImage
,
Tomato
:
TomatoImage
,
Cotton
:
CottonImage
,
coconut
:
CoconutImage
,
pomegranate
:
PomagranateImage
,
mango
:
MangoImage
};
export
default
cropImages
;
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/components/recomendationComponentsBySoil/MostSutaibleCrops.js
View file @
7e830b00
...
...
@@ -2,27 +2,9 @@ import React, { useState, useEffect } from 'react';
import
{
View
,
Text
,
TouchableOpacity
,
ActivityIndicator
,
StyleSheet
,
ImageBackground
,
Image
}
from
'
react-native
'
;
import
axios
from
'
axios
'
;
import
{
useRoute
}
from
'
@react-navigation/native
'
;
import
BarleyImage
from
'
../../assets/barley.png
'
;
import
WheatImage
from
'
../../assets/wheat.png
'
;
import
RiceImage
from
'
../../assets/rice.png
'
;
import
MaizeImage
from
'
../../assets/maize.png
'
;
import
PotatoImage
from
'
../../assets/potato.png
'
;
import
TomatoImage
from
'
../../assets/tomato.png
'
;
import
CottonImage
from
'
../../assets/cotton.png
'
;
import
SoybeanImage
from
'
../../assets/soybean.jpg
'
;
import
BackgroundImage
from
'
../../assets/backgroudManualData.jpg
'
;
import
cropImages
from
'
../common/Images
'
;
const
cropImages
=
{
Soybean
:
SoybeanImage
,
Barley
:
BarleyImage
,
Wheat
:
WheatImage
,
Rice
:
RiceImage
,
Maize
:
MaizeImage
,
Potato
:
PotatoImage
,
Tomato
:
TomatoImage
,
Cotton
:
CottonImage
,
};
const
MostSuitableCrops
=
()
=>
{
const
[
cropData
,
setCropData
]
=
useState
(
null
);
...
...
@@ -52,12 +34,13 @@ const MostSuitableCrops = () => {
useEffect
(()
=>
{
const
fetchCropData
=
async
()
=>
{
try
{
const
response
=
await
axios
.
post
(
'
http://127.0.0.1:5000/
npk-data
'
,
{
const
response
=
await
axios
.
post
(
'
http://127.0.0.1:5000/
predict
'
,
{
N
:
userNpkData
[
'
Nitrogen
'
],
P
:
userNpkData
[
'
Phosphorus
'
],
K
:
userNpkData
[
'
Potassium
'
]
});
const
responseData
=
response
.
data
;
console
.
log
(
"
res data
"
,
responseData
);
setCropData
(
responseData
);
}
catch
(
error
)
{
console
.
error
(
'
Error fetching crop data:
'
,
error
);
...
...
@@ -83,10 +66,10 @@ const MostSuitableCrops = () => {
<
View
style
=
{
styles
.
card
}
>
<
Text
style
=
{
styles
.
title
}
>
Most
Suitable
Crops
:
<
/Text
>
<
View
style
=
{
styles
.
cropContainer
}
>
{
cropData
.
top_
crops
.
map
((
cropName
)
=>
(
<
View
key
=
{
crop
Name
}
style
=
{
styles
.
cropItem
}
>
<
Image
source
=
{
cropImages
[
crop
Name
]}
style
=
{
styles
.
cropImage
}
/
>
<
Text
style
=
{
styles
.
cropText
}
>
{
crop
Name
}
<
/Text
>
{
cropData
.
top_
three_crops
.
map
((
cropInfo
)
=>
(
<
View
key
=
{
crop
Info
.
crop
}
style
=
{
styles
.
cropItem
}
>
<
Image
source
=
{
cropImages
[
crop
Info
.
crop
]}
style
=
{
styles
.
cropImage
}
/
>
<
Text
style
=
{
styles
.
cropText
}
>
{
crop
Info
.
crop
}
<
/Text
>
<
/View
>
))}
<
/View
>
...
...
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/package.json
View file @
7e830b00
...
...
@@ -21,7 +21,8 @@
"react-native"
:
"0.71.8"
,
"react-native-safe-area-context"
:
"4.5.0"
,
"react-native-screens"
:
"~3.20.0"
,
"react-native-svg"
:
"^13.9.0"
"react-native-svg"
:
"^13.9.0"
,
"react-native-web"
:
"~0.18.11"
},
"devDependencies"
:
{
"@babel/core"
:
"^7.20.0"
...
...
Soil Analyzer and Optimized Crop Finder - IT20233808/RP-MobileAPP-FE/yarn.lock
View file @
7e830b00
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment