From ce5e3f58176eb936e628922bb5fa921336928387 Mon Sep 17 00:00:00 2001 From: AudreyComte <122619377+AudreyComte@users.noreply.github.com> Date: Fri, 31 Mar 2023 16:43:19 +0200 Subject: [PATCH 1/2] Add files via upload --- .../main/java/centuri/test_maven/Camera.java | 18 +++++++++++------ .../main/java/centuri/test_maven/Main.java | 3 ++- .../main/java/centuri/test_maven/Pause.java | 14 ++++++++++--- .../main/java/centuri/test_maven/Picture.java | 7 +++++-- .../compile/default-compile/createdFiles.lst | 0 .../compile/default-compile/inputFiles.lst | 20 +++++++++++++++++++ 6 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 test_maven12/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 test_maven12/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst diff --git a/test_maven12/src/main/java/centuri/test_maven/Camera.java b/test_maven12/src/main/java/centuri/test_maven/Camera.java index 4bfc7bc..18929f9 100644 --- a/test_maven12/src/main/java/centuri/test_maven/Camera.java +++ b/test_maven12/src/main/java/centuri/test_maven/Camera.java @@ -42,7 +42,7 @@ 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"); @@ -50,12 +50,15 @@ public boolean takeStill(PicConfig config) { 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; } /** @@ -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()); @@ -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 = @@ -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; } /** diff --git a/test_maven12/src/main/java/centuri/test_maven/Main.java b/test_maven12/src/main/java/centuri/test_maven/Main.java index 054fdd4..143863d 100644 --- a/test_maven12/src/main/java/centuri/test_maven/Main.java +++ b/test_maven12/src/main/java/centuri/test_maven/Main.java @@ -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); diff --git a/test_maven12/src/main/java/centuri/test_maven/Pause.java b/test_maven12/src/main/java/centuri/test_maven/Pause.java index 2cc0858..a4d0540 100644 --- a/test_maven12/src/main/java/centuri/test_maven/Pause.java +++ b/test_maven12/src/main/java/centuri/test_maven/Pause.java @@ -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; } diff --git a/test_maven12/src/main/java/centuri/test_maven/Picture.java b/test_maven12/src/main/java/centuri/test_maven/Picture.java index 620c5a2..f0bc4b7 100644 --- a/test_maven12/src/main/java/centuri/test_maven/Picture.java +++ b/test_maven12/src/main/java/centuri/test_maven/Picture.java @@ -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) @@ -37,9 +39,10 @@ public boolean Do() { .width(width) .height(heigth) .build(); + + ok = camera.takeStill(config); - - return camera.takeStill(config); + return ok ; } diff --git a/test_maven12/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/test_maven12/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/test_maven12/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/test_maven12/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..5621649 --- /dev/null +++ b/test_maven12/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -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 From 217ce637f99914edbe3ee36417a17c1acdd8ec1d Mon Sep 17 00:00:00 2001 From: AudreyComte <122619377+AudreyComte@users.noreply.github.com> Date: Tue, 18 Apr 2023 15:23:42 +0200 Subject: [PATCH 2/2] Delete gyy directory --- gyy/.classpath | 15 ------- gyy/.project | 17 ------- .../org.eclipse.core.resources.prefs | 2 - gyy/.settings/org.eclipse.jdt.core.prefs | 14 ------ gyy/bin/gyy/ttt.class | Bin 1277 -> 0 bytes gyy/bin/module-info.class | Bin 142 -> 0 bytes gyy/src/gyy/ttt.java | 42 ------------------ gyy/src/module-info.java | 9 ---- 8 files changed, 99 deletions(-) delete mode 100644 gyy/.classpath delete mode 100644 gyy/.project delete mode 100644 gyy/.settings/org.eclipse.core.resources.prefs delete mode 100644 gyy/.settings/org.eclipse.jdt.core.prefs delete mode 100644 gyy/bin/gyy/ttt.class delete mode 100644 gyy/bin/module-info.class delete mode 100644 gyy/src/gyy/ttt.java delete mode 100644 gyy/src/module-info.java diff --git a/gyy/.classpath b/gyy/.classpath deleted file mode 100644 index 1dec7be..0000000 --- a/gyy/.classpath +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/gyy/.project b/gyy/.project deleted file mode 100644 index 233ec7c..0000000 --- a/gyy/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - gyy - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/gyy/.settings/org.eclipse.core.resources.prefs b/gyy/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 4824b80..0000000 --- a/gyy/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/gyy/.settings/org.eclipse.jdt.core.prefs b/gyy/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index dbc27c5..0000000 --- a/gyy/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,14 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=17 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=17 diff --git a/gyy/bin/gyy/ttt.class b/gyy/bin/gyy/ttt.class deleted file mode 100644 index 5f14a8c05fb8882391e3c2289e5c13e179283e77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1277 zcmbtUOK%e~5dNH$Y_bis1X|wU-cp3p3nvO3ic&!pUTTPhIC(d2;<9T;UMD3dF8n7X zkl@abLX0;-B{UI{IIKPP%zU129{c0xmu~5lKi(+f*Rt) z`ItRT5yvvi=}cHIYnQY0U>_RU2^FGoux~{w7r~x2&x^aXd1P!?+D0=Sxba>t&vTu| zaJGWn87}gQgq2BK%_;MY(S*$+q|vk*e|N^7p+3m!O1pb}X8Bi-EE&}#X^W!rNnVoQ zpNaf`I2u9MR~bX4HJx#q+VIc}Z7lbdZ{jiyLc_NUb^bF=gPy6(&-zm(t*~)_9N-pB z$E1J(?sz#T%TRr;s6lnFP3$skfuTr06@~)Np+r&v6$B{LO@&T(Ny}&tzao5FtA56X z@3~El)>5vi;ZlC%G1hT;>UV#}Z)1*MG54!Z&~XJ<38jc@Io5UDpdH}!l_;W{xcv)e C>~y{W diff --git a/gyy/bin/module-info.class b/gyy/bin/module-info.class deleted file mode 100644 index b8bdb084353598cc592146210e3401bc94073287..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 142 zcmX^0Z`VEs1_oOOE_MbcMh5QO{FKt1RNc(Hw0uSeuHgLAqU2P!%$!t41_2}~y{yEt zL`DWSU$AOn26jdU=Jd)+VFpe{22PNiUQ%LlY6AlUBhYLJU}9hfGME@x7+8U{7y}zv Mn2~{_0nC690R0&n;{X5v diff --git a/gyy/src/gyy/ttt.java b/gyy/src/gyy/ttt.java deleted file mode 100644 index ac8aec4..0000000 --- a/gyy/src/gyy/ttt.java +++ /dev/null @@ -1,42 +0,0 @@ -package gyy; - -import java.awt.BorderLayout; -import java.awt.EventQueue; - -import javax.swing.JFrame; -import javax.swing.JPanel; -import javax.swing.border.EmptyBorder; - -public class ttt extends JFrame { - - private JPanel contentPane; - - /** - * Launch the application. - */ - public static void main(String[] args) { - EventQueue.invokeLater(new Runnable() { - public void run() { - try { - ttt frame = new ttt(); - frame.setVisible(true); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } - - /** - * Create the frame. - */ - public ttt() { - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - setBounds(100, 100, 450, 300); - contentPane = new JPanel(); - contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); - - setContentPane(contentPane); - } - -} diff --git a/gyy/src/module-info.java b/gyy/src/module-info.java deleted file mode 100644 index abc711a..0000000 --- a/gyy/src/module-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * - */ -/** - * @author Audrey - * - */ -module gyy { -} \ No newline at end of file