Commit 067efdff authored by P.Y.D Jayasinghe's avatar P.Y.D Jayasinghe

Update WeedMain.java

parent c0fd025e
......@@ -38,7 +38,7 @@ public class WeedMain extends AppCompatActivity {
Button camera, gallery;
ImageView imageView;
TextView result;
TextView result,solution;
int imageSize = 224;
@Override
......@@ -49,7 +49,8 @@ public class WeedMain extends AppCompatActivity {
camera = findViewById(R.id.btnTakePictureWeed);
gallery = findViewById(R.id.btnLaunchGalleryweed);
result = findViewById(R.id.classifiedWeed);
solution = findViewById(R.id.solutionWeed);
result = findViewById(R.id.resultWeed);
imageView = findViewById(R.id.imageViewWeed);
camera.setOnClickListener(new View.OnClickListener() {
......@@ -147,8 +148,60 @@ public class WeedMain extends AppCompatActivity {
// result.setText(classes[maxPos]);
probability.sort(Comparator.comparing(Category::getScore, Comparator.reverseOrder()));
for (int i=0; i<3; i++)
result.setText( probability.get(i).getLabel() +" : " + probability.get(i).getScore());
for (int i=0; i<3; i++) {
result.setText(probability.get(i).getLabel());// +" : " + probability.get(i).getScore());
if (probability.get(i).getLabel().equalsIgnoreCase("Snake Weed")) {
solution.setText("destock paddocks where snakeweed is a problem promote pasture growth; native pasture is usually not\n" +
"competitive enough once snakeweed has established" +
"itself; improved pasture grasses may have to be sown");
} else if (probability.get(i).getLabel().equalsIgnoreCase("Siam Weed")) {
solution.setText("Applying herbicide at the correct rates, and before flowering, " +
"will provide effective control if carried out regularly. " +
"Incorrect application can lead to chemical pruning, which will allow plant to re-shoot." +
" Always read label before using any herbicide.");
} else if (probability.get(i).getLabel().equalsIgnoreCase("Rubber Vine")) {
solution.setText("Infestations can be controlled by burning. For best results," +
" fuel loads must be prepared and managed before burning," +
" and sites must receive follow-up treatment after burning.\n");
} else if (probability.get(i).getLabel().equalsIgnoreCase("Prickly acacia")) {
solution.setText("Ideal for large areas of scattered to medium-density infestations. " +
"Wheeled tractors are usually used with a scoop or grubbing attachment. " +
"This method requires a tractor of around 80hp. " +
"Trees greater than 15cm in diameter can be difficult to grub out. " +
"Grubbing is best undertaken May–September or before pod drop.\n");
} else if (probability.get(i).getLabel().equalsIgnoreCase("Parthenium")) {
solution.setText("Treat small and/or isolated infestations immediately. " +
"Herbicide control will involve a knockdown herbicide to kill plants that are present" +
" and a residual herbicide to control future germinations." +
" Repeated spraying may be required even within a single growing season to prevent" +
" further seed production");
} else if (probability.get(i).getLabel().equalsIgnoreCase("Parkinsonia")) {
solution.setText("Aerial application is undertaken by purpose-built\n" +
"applicators by helicopter. This is useful for dense, strategic\n" +
"infestations although it may be expensive on a broad scale");
} else if (probability.get(i).getLabel().equalsIgnoreCase("Negative")) {
solution.setText("Not Recognized");
} else if (probability.get(i).getLabel().equalsIgnoreCase("Lantana")) {
solution.setText("basal bark spraying and cut-stump methods also give good results at any time of " +
"year (but best when the plant is actively growing). " +
"On multi-stemmed varieties, obtain best results by " +
"carefully applying herbicide to each stem");
} else {
solution.setText("Foliar spraying of seedlings and young plants to 2m may be undertaken using " +
"registered herbicides mixed with water and a wetting agent. " +
"Thoroughly spray plants to point of run-off when they are actively growing.\n");
}
}
// Releases model resources if no longer used.
model.close();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment