Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions gyy/.classpath

This file was deleted.

17 changes: 0 additions & 17 deletions gyy/.project

This file was deleted.

2 changes: 0 additions & 2 deletions gyy/.settings/org.eclipse.core.resources.prefs

This file was deleted.

14 changes: 0 additions & 14 deletions gyy/.settings/org.eclipse.jdt.core.prefs

This file was deleted.

Binary file removed gyy/bin/gyy/ttt.class
Binary file not shown.
Binary file removed gyy/bin/module-info.class
Binary file not shown.
42 changes: 0 additions & 42 deletions gyy/src/gyy/ttt.java

This file was deleted.

9 changes: 0 additions & 9 deletions gyy/src/module-info.java

This file was deleted.

18 changes: 12 additions & 6 deletions test_maven12/src/main/java/centuri/test_maven/Camera.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,23 @@ public void takeStill() {

// changement de type de méthode boolean au lieu de void
public boolean takeStill(PicConfig config) {

boolean picture = false;
//logDebug("Taking Picture");
System.out.println("Taking Picture");

ProcessBuilder processBuilder = new ProcessBuilder();
processBuilder.command("bash", "-c", config.asCommand());

try {
callBash(processBuilder);
if (callBash(processBuilder) == true){
picture = true;
}
} catch (Exception e) {
System.out.println("Camera: Error while taking picture: " + e.getMessage());
//logError("Camera: Error while taking picture: " + e.getMessage());
}
return true;

return picture;
}

/**
Expand All @@ -80,7 +83,7 @@ public void takeVid(VidConfig config) {
processBuilder.command("bash", "-c", config.asCommand());

try {
callBash(processBuilder);
callBash(processBuilder);
} catch (Exception e) {
System.out.println("Camera_video: Error while taking video: " + e.getMessage());
//logError("Camera: Error while taking video: " + e.getMessage());
Expand All @@ -96,6 +99,8 @@ public void takeVid(VidConfig config) {

// changement de type de méthode boolean au lieu de void
public boolean callBash(ProcessBuilder processBuilder) throws IOException, InterruptedException {
boolean callbash = false;

Process process = processBuilder.start();

BufferedReader reader =
Expand All @@ -110,11 +115,12 @@ public boolean callBash(ProcessBuilder processBuilder) throws IOException, Inter
int exitCode = process.waitFor();
if(exitCode != 0){
System.out.println("\nCamera exited with error code : " + exitCode);
return true;
}else{
System.out.println("\nCamera finished successfully");
return false;
callbash = true;
}

return callbash;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion test_maven12/src/main/java/centuri/test_maven/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ public static void main(String[] args) {
//data.add(new Mouvement(150.0, 100.0, arduino));
data.add(new Pause(10000));
data.add(new Mouvement(90.0, 40.0, arduino));
data.add(new Picture(1000,1240,800));
//data.add(new Picture(1000,505852,656131154));

arduino.Start();

for (Event event : data) {
boolean ok = event.Do();
if (!ok){
System.out.println("WARNING : ERROR !");
break;
}
event.Info(ok);
Expand Down
14 changes: 11 additions & 3 deletions test_maven12/src/main/java/centuri/test_maven/Pause.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@ public Pause (int pause) {

@Override
public boolean Do() {

boolean pause_boolean = false;

System.out.println((pause/1000) + " secondes break... \r\n");

try {
Thread.sleep(pause);
Thread.sleep(pause)
pause_boolean = true;
}
} catch (InterruptedException e) {
e.printStackTrace();
e.printStackTrace(pause_boolean = false);

}
return true;

return pause_boolean;
}


Expand Down
7 changes: 5 additions & 2 deletions test_maven12/src/main/java/centuri/test_maven/Picture.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public Picture (int delay, int width, int heigth){
@Override
public boolean Do() {

boolean ok = false;

Camera camera = new Camera();

var config = new Camera.PicConfig.Builder().outputPath(path)
Expand All @@ -37,9 +39,10 @@ public boolean Do() {
.width(width)
.height(heigth)
.build();

ok = camera.takeStill(config);


return camera.takeStill(config);
return ok ;
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/home/audrey/Desktop/test_maven12/src/main/java/centuri/test_maven/Pause.java
/home/audrey/Desktop/test_maven12/src/main/java/centuri/test_maven/Event.java
/home/audrey/Desktop/test_maven12/src/main/java/centuri/test_maven/Picture.java
/home/audrey/Desktop/test_maven12/src/main/java/com/hopding/jrpicam/examples/ShootBufferedStill.java
/home/audrey/Desktop/test_maven12/src/main/java/com/hopding/jrpicam/enums/MeteringMode.java
/home/audrey/Desktop/test_maven12/src/main/java/com/hopding/jrpicam/examples/ShootStill.java
/home/audrey/Desktop/test_maven12/src/main/java/centuri/test_maven/Arduino.java
/home/audrey/Desktop/test_maven12/src/main/java/com/hopding/jrpicam/examples/ShootTimelapse.java
/home/audrey/Desktop/test_maven12/src/main/java/com/hopding/jrpicam/enums/Encoding.java
/home/audrey/Desktop/test_maven12/src/main/java/com/hopding/jrpicam/enums/Exposure.java
/home/audrey/Desktop/test_maven12/src/main/java/centuri/test_maven/Mouvement.java
/home/audrey/Desktop/test_maven12/src/main/java/centuri/test_maven/Initialisation.java
/home/audrey/Desktop/test_maven12/src/main/java/com/hopding/jrpicam/enums/AWB.java
/home/audrey/Desktop/test_maven12/src/main/java/com/hopding/jrpicam/examples/DemoView.java
/home/audrey/Desktop/test_maven12/src/main/java/com/hopding/jrpicam/exceptions/FailedToRunRaspistillException.java
/home/audrey/Desktop/test_maven12/src/main/java/centuri/test_maven/Main.java
/home/audrey/Desktop/test_maven12/src/main/java/com/hopding/jrpicam/RPiCamera.java
/home/audrey/Desktop/test_maven12/src/main/java/com/hopding/jrpicam/enums/ImageEffect.java
/home/audrey/Desktop/test_maven12/src/main/java/centuri/test_maven/Camera.java
/home/audrey/Desktop/test_maven12/src/main/java/com/hopding/jrpicam/enums/DRC.java