Wlo-commits
Threads by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
February 2014
- 3 participants
- 19 discussions
01 Mar '14
See <http://ci.codelutin.com/jenkins/job/wlo-nightly/1/>
------------------------------------------
[...truncated 65 lines...]
A src/fr/ifremer/wlo/models/MetierModel.java
A src/fr/ifremer/wlo/models/CommercialSpeciesModel.java
A src/fr/ifremer/wlo/models/LocationModel.java
AU src/fr/ifremer/wlo/models/MeasurementsModel.java
A src/fr/ifremer/wlo/models/BaseModel.java
A src/fr/ifremer/wlo/models/ScientificSpeciesModel.java
A src/fr/ifremer/wlo/CommercialSpeciesActivity.java
A src/fr/ifremer/wlo/measurement
AU src/fr/ifremer/wlo/measurement/MeasurementActivity.java
AU src/fr/ifremer/wlo/measurement/GraphFragment.java
AU src/fr/ifremer/wlo/measurement/LogsFragment.java
AU src/fr/ifremer/wlo/measurement/TableAdapter.java
AU src/fr/ifremer/wlo/measurement/MeasurementsDisplayerFragment.java
AU src/fr/ifremer/wlo/measurement/TableFragment.java
AU src/fr/ifremer/wlo/measurement/GraphActivity.java
A src/fr/ifremer/wlo/WloBaseListActivity.java
AU src/fr/ifremer/wlo/BigFinCommunicationService.java
AU src/fr/ifremer/wlo/DeviceListActivity.java
A src/fr/ifremer/wlo/LocationsActivity.java
A src/fr/ifremer/wlo/WloBaseActivity.java
A src/fr/ifremer/wlo/LocationFormActivity.java
A src/fr/ifremer/wlo/ScientificSpeciesActivity.java
A src/fr/ifremer/wlo/WloModelEditionActivity.java
A src/fr/ifremer/wlo/utils
A src/fr/ifremer/wlo/utils/DatePickerFragment.java
A src/fr/ifremer/wlo/utils/TimePickerFragment.java
A src/fr/ifremer/wlo/utils/AbstractDateTimePickerFragment.java
A src/fr/ifremer/wlo/utils/WloAutoCompleteTextViewWithFavorites.java
A src/fr/ifremer/wlo/utils/filechooser
A src/fr/ifremer/wlo/utils/filechooser/FileDialog.java
A src/fr/ifremer/wlo/utils/filechooser/SelectionMode.java
A src/fr/ifremer/wlo/utils/WloAutoCompleteTextView.java
A src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java
A src/fr/ifremer/wlo/utils/BaseModelArrayAdapter.java
A src/fr/ifremer/wlo/utils/WloItemListViewBinder.java
A src/fr/ifremer/wlo/utils/BaseTextWatcher.java
AU src/fr/ifremer/wlo/utils/UIUtils.java
A src/fr/ifremer/wlo/preferences
A src/fr/ifremer/wlo/preferences/StringPreference.java
A src/fr/ifremer/wlo/preferences/WloMultiSelectListPreference.java
A src/fr/ifremer/wlo/preferences/MultiSelectItemPreference.java
A src/fr/ifremer/wlo/preferences/ListItemPreference.java
A src/fr/ifremer/wlo/preferences/SettingsActivity.java
AU src/fr/ifremer/wlo/ContextsActivity.java
A src/fr/ifremer/wlo/storage
AU src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
A src/fr/ifremer/wlo/storage/StorageUtils.java
A src/fr/ifremer/wlo/storage/DataCache.java
A src/fr/ifremer/wlo/MetiersActivity.java
A src/fr/ifremer/wlo/ContextFormActivity.java
A src/fr/ifremer/wlo/MetierFormActivity.java
A src/fr/ifremer/wlo/WeightsActivity.java
A src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java
A src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java
A res
A res/values
AU res/values/style.xml
A res/values/arrays.xml
A res/values/colors.xml
AU res/values/strings.xml
A res/xml
A res/xml/preferences.xml
A res/drawable
A res/drawable/favorite_toggle.xml
AU res/drawable/file.png
AU res/drawable/weight.png
AU res/drawable/app_icon.png
AU res/drawable/border_bottom.9.png
AU res/drawable/icon.png
AU res/drawable/tab_bg_selector.xml
AU res/drawable/folder.png
AU res/drawable/wlo_ico.png
A res/drawable-hdpi
AU res/drawable-hdpi/ic_drawer.png
AU res/drawable-hdpi/drawer_shadow.9.png
A res/drawable-xxhdpi
AU res/drawable-xxhdpi/ic_drawer.png
AU res/drawable-xxhdpi/drawer_shadow.9.png
A res/menu
A res/menu/form_menu.xml
A res/menu/weight_menu.xml
AU res/menu/model_list_menu.xml
A res/values-fr
A res/values-fr/arrays.xml
A res/values-fr/strings.xml
A res/drawable-mdpi
AU res/drawable-mdpi/ic_drawer.png
AU res/drawable-mdpi/drawer_shadow.9.png
A res/drawable-xhdpi
AU res/drawable-xhdpi/ic_drawer.png
AU res/drawable-xhdpi/drawer_shadow.9.png
A res/layout
A res/layout/location_list_item.xml
AU res/layout/measurement_table_row.xml
A res/layout/vessel_form.xml
AU res/layout/message.xml
AU res/layout/main.xml
A res/layout/file_dialog_row.xml
AU res/layout/measurement.xml
AU res/layout/measurement_graph_fragment.xml
A res/layout/location_form.xml
AU res/layout/measurement_logs_fragment.xml
AU res/layout/device_name.xml
AU res/layout/measurement_logs_row.xml
AU res/layout/tabs_bg.xml
A res/layout/file_dialog_main.xml
AU res/layout/measurement_graph.xml
A res/layout/context_form.xml
A res/layout/metier_form.xml
A res/layout/commercial_species_form.xml
A res/layout/vessel_list_item.xml
A res/layout/weights.xml
AU res/layout/custom_title.xml
A res/layout/autocomplete_text_view_with_favorites.xml
A res/layout/scientific_species_form.xml
AU res/layout/measurement_table_fragment.xml
AU pom.xml
AU README.txt
U .
At revision 48
Parsing POMs
Discovered a new module fr.ifremer:wlo WLO
Modules changed, recalculating dependency graph
[trunk] $ /opt/jdk7/bin/java -Dsettings.security=/var/local/forge/data/codelutin.com/maven/settings-security.xml -Djava.awt.headless=true -cp /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.4.jar:/opt/maven3/boot/plexus-classworlds-2.5.1.jar:/opt/maven3/conf/logging jenkins.maven3.agent.Maven31Main /opt/maven3 /var/local/forge/exec/tomcat-codelutin.com/webapps/jenkins/WEB-INF/lib/remoting-2.33.jar /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.4.jar /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.4.jar 34922
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.codelutin.com/jenkins/job/wlo-nightly/ws/trunk/pom.xml> -s /var/local/forge/data/codelutin.com/maven/settings.xml -e -U clean verify -DperformRelease
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WLO 0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wlo ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ wlo ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ wlo ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ wlo ---
[INFO] Exporting server [redmine-forge.codelutin.com] username in ${redmine.username}
[INFO] Exporting server [redmine-forge.codelutin.com] privateKey in ${redmine.apiKey}
[INFO]
[INFO] --- android-maven-plugin:3.8.2:generate-sources (default-generate-sources) @ wlo ---
[DEBUG] Expanding: /var/local/forge/data/codelutin.com/maven/repository/android/support/compatibility-v7-appcompat/19.0.1/compatibility-v7-appcompat-19.0.1.apklib into <http://ci.codelutin.com/jenkins/job/wlo-nightly/ws/trunk/target/unpacked-li…>
[DEBUG] expand complete
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] Manifest merging disabled. Using project manifest only
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidHomeOrThrow(AbstractAndroidMojo.java:1176)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidSdk(AbstractAndroidMojo.java:1129)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:481)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.306s
[INFO] Finished at: Sat Feb 15 02:01:36 CET 2014
[INFO] Final Memory: 20M/246M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project wlo: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project wlo: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.MojoExecutionException: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidHomeOrThrow(AbstractAndroidMojo.java:1176)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidSdk(AbstractAndroidMojo.java:1129)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:481)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Sending e-mails to: wlo-commits(a)list.forge.codelutin.com
channel stopped
Skipping sonar analysis due to bad build status FAILURE
1
6
01 Mar '14
See <http://ci.codelutin.com/jenkins/job/wlo-nightly/fr.ifremer$wlo/1/>
------------------------------------------
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.codelutin.com/jenkins/job/wlo-nightly/fr.ifremer$wlo/ws/pom.xml> -s /var/local/forge/data/codelutin.com/maven/settings.xml -e -U clean verify -DperformRelease
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WLO 0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wlo ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ wlo ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ wlo ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ wlo ---
[INFO] Exporting server [redmine-forge.codelutin.com] username in ${redmine.username}
[INFO] Exporting server [redmine-forge.codelutin.com] privateKey in ${redmine.apiKey}
[INFO]
[INFO] --- android-maven-plugin:3.8.2:generate-sources (default-generate-sources) @ wlo ---
[DEBUG] Expanding: /var/local/forge/data/codelutin.com/maven/repository/android/support/compatibility-v7-appcompat/19.0.1/compatibility-v7-appcompat-19.0.1.apklib into <http://ci.codelutin.com/jenkins/job/wlo-nightly/fr.ifremer$wlo/ws/target/un…>
[DEBUG] expand complete
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] Manifest merging disabled. Using project manifest only
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidHomeOrThrow(AbstractAndroidMojo.java:1176)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidSdk(AbstractAndroidMojo.java:1129)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:481)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
[JENKINS] Archiving disabled
1
6
Author: tchemit
Date: 2014-02-28 14:25:58 +0100 (Fri, 28 Feb 2014)
New Revision: 56
Url: http://codelutin.com/projects/wlo/repository/revisions/56
Log:
updates mavenpom to 5.0
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-28 13:13:35 UTC (rev 55)
+++ trunk/pom.xml 2014-02-28 13:25:58 UTC (rev 56)
@@ -29,7 +29,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>4.5</version>
+ <version>5.0</version>
</parent>
<groupId>fr.ifremer</groupId>
@@ -41,7 +41,7 @@
Application pour les missions de recueil d'information sur les stockes pour l'observation en criée et en mer.
</description>
<inceptionYear>2013</inceptionYear>
- <url>http://forge.codelutin.com/projects/wlo</url>
+ <url>https://forge.codelutin.com/projects/wlo</url>
<licenses>
<license>
@@ -53,7 +53,7 @@
<developers>
<developer>
- <id>chemit</id>
+ <id>tchemit</id>
<name>Tony Chemit</name>
<email>chemit at codelutin dot com</email>
<organization>CodeLutin</organization>
@@ -77,17 +77,17 @@
</developers>
<scm>
- <url>https://forge.codelutin.com/svn/wlo/trunk</url>
+ <url>https://svn.codelutin.com/wlo/trunk</url>
<connection>
- scm:svn:https://svn.forge.codelutin.com/svn/wlo/trunk
+ scm:svn:https://svn.codelutin.com/wlo/trunk
</connection>
<developerConnection>
- scm:svn:https://svn.forge.codelutin.com/svn/wlo/trunk
+ scm:svn:https://svn.codelutin.com/wlo/trunk
</developerConnection>
</scm>
<distributionManagement>
<site>
- <id>${platform}</id>
+ <id>doc.${platform}</id>
<url>${our.site.repository}/${projectId}</url>
</site>
</distributionManagement>
@@ -102,7 +102,7 @@
<signatureArtifactId>java17</signatureArtifactId>
<signatureVersion>1.0</signatureVersion>
- <platform>forge.codelutin.com</platform>
+ <platform>codelutin.com</platform>
<projectId>wlo</projectId>
<maven.test.skip>true</maven.test.skip>
<!-- locales for the site generation, by default only french -->
@@ -180,7 +180,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.1</version>
</dependency>
<dependency>
@@ -193,13 +192,11 @@
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
- <version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>2.4</version>
</dependency>
</dependencies>
@@ -207,7 +204,7 @@
<repositories>
<repository>
<id>wlo-group</id>
- <url>http://nexus.nuiton.org/nexus/content/groups/wlo-group/</url>
+ <url>https://nexus.nuiton.org/nexus/content/groups/wlo-group/</url>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
@@ -217,21 +214,12 @@
<checksumPolicy>fail</checksumPolicy>
</releases>
</repository>
-
- <!--<repository>-->
- <!--<id>android.support-mvn-repo</id>-->
- <!--<url>https://raw.github.com/kmchugh/android.support/mvn-repo</url>-->
- <!--<snapshots>-->
- <!--<enabled>true</enabled>-->
- <!--<updatePolicy>daily</updatePolicy>-->
- <!--</snapshots>-->
- <!--</repository>-->
</repositories>
<pluginRepositories>
<pluginRepository>
<id>wlo-group</id>
- <url>http://nexus.nuiton.org/nexus/content/groups/wlo-group/</url>
+ <url>https://nexus.nuiton.org/nexus/content/groups/wlo-group/</url>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
@@ -328,19 +316,6 @@
<!--</dependencies>-->
<!--</plugin>-->
- <!--<plugin>-->
- <!--<groupId>org.codehaus.mojo</groupId>-->
- <!--<artifactId>animal-sniffer-maven-plugin</artifactId>-->
- <!--<version>${animalSnifferPluginVersion}</version>-->
- <!--<configuration>-->
- <!--<signature>-->
- <!--<groupId>org.codehaus.mojo.signature</groupId>-->
- <!--<artifactId>java16-sun</artifactId>-->
- <!--<version>1.10</version>-->
- <!--</signature>-->
- <!--</configuration>-->
- <!--</plugin>-->
-
</plugins>
</build>
@@ -400,75 +375,6 @@
</profile>
<profile>
- <id>deploy-update</id>
- <activation>
- <property>
- <name>performRelease</name>
- <value>true</value>
- </property>
- </activation>
-
- <build>
- <plugins>
- <!--<plugin>-->
- <!--<artifactId>maven-antrun-plugin</artifactId>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<id>copy update-properties to site</id>-->
- <!--<phase>package</phase>-->
- <!--<inherited>false</inherited>-->
- <!--<configuration>-->
- <!--<tasks>-->
- <!--<echo message="Copy model to site" />-->
- <!--<copy verbose="true" failonerror="false" overwrite="true" filtering="true" todir="${project.build.directory}/update">-->
- <!--<filterset>-->
- <!--<filter value="${project.version}" token="projectVersion" />-->
- <!--<filter value="${jreVersion}" token="jreVersion" />-->
- <!--<filter value="${dbVersion}" token="dbVersion" />-->
- <!--</filterset>-->
- <!--<fileset dir="${basedir}/src/update/">-->
- <!--<include name="update-tutti.properties" />-->
- <!--</fileset>-->
- <!--</copy>-->
- <!--</tasks>-->
- <!--</configuration>-->
- <!--<goals>-->
- <!--<goal>run</goal>-->
- <!--</goals>-->
- <!--</execution>-->
- <!--</executions>-->
- <!--</plugin>-->
-
- <!--<plugin>-->
- <!--<groupId>org.codehaus.mojo</groupId>-->
- <!--<artifactId>wagon-maven-plugin</artifactId>-->
- <!--<version>1.0-beta-4</version>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<phase>deploy</phase>-->
- <!--<inherited>false</inherited>-->
- <!--<goals>-->
- <!--<goal>upload-single</goal>-->
- <!--</goals>-->
- <!--<configuration>-->
- <!--<serverId>forge.codelutin.com</serverId>-->
- <!--<fromFile>-->
- <!--${project.build.directory}/update/update-tutti.properties-->
- <!--</fromFile>-->
- <!--<url>-->
- <!--scpexe://forge.codelutin.com/var/www/ApplicationUpdate/http/tutti-->
- <!--</url>-->
- <!--</configuration>-->
- <!--</execution>-->
- <!--</executions>-->
-
- <!--</plugin>-->
- </plugins>
- </build>
-
- </profile>
-
- <profile>
<id>reporting</id>
<activation>
<property>
1
0
r55 - in trunk: . assets res/values res/values-fr res/xml src/fr/ifremer/wlo src/fr/ifremer/wlo/measurement src/fr/ifremer/wlo/models src/fr/ifremer/wlo/models/calcifiedPartTaking src/fr/ifremer/wlo/models/referentials/imports src/fr/ifremer/wlo/preferences src/fr/ifremer/wlo/storage src/fr/ifremer/wlo/utils/filechooser
by kmorin@users.forge.codelutin.com 28 Feb '14
by kmorin@users.forge.codelutin.com 28 Feb '14
28 Feb '14
Author: kmorin
Date: 2014-02-28 14:13:35 +0100 (Fri, 28 Feb 2014)
New Revision: 55
Url: http://codelutin.com/projects/wlo/repository/revisions/55
Log:
refs #4122 Gestion des pr?\195?\169l?\195?\168vements de pi?\195?\168ces calcifi?\195?\169es
refs #4176 Import du param?\195?\169trage de l'algorithme de pr?\195?\169l?\195?\168vement des pi?\195?\168ces calcifi?\195?\169es
fix pom to make the release
Added:
trunk/assets/ref_import_calcified_part_takings.csv
trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/
trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTaking.java
trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTakingRowModel.java
Modified:
trunk/pom.xml
trunk/res/values-fr/strings.xml
trunk/res/values/strings.xml
trunk/res/xml/preferences.xml
trunk/src/fr/ifremer/wlo/MainActivity.java
trunk/src/fr/ifremer/wlo/WeightsActivity.java
trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
trunk/src/fr/ifremer/wlo/models/BaseModel.java
trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java
trunk/src/fr/ifremer/wlo/models/MeasurementsModel.java
trunk/src/fr/ifremer/wlo/models/referentials/imports/ImportUtil.java
trunk/src/fr/ifremer/wlo/preferences/SettingsActivity.java
trunk/src/fr/ifremer/wlo/storage/Exporter.java
trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
trunk/src/fr/ifremer/wlo/utils/filechooser/FileDialog.java
Copied: trunk/assets/ref_import_calcified_part_takings.csv (from rev 29, trunk/assets/ref_import_scientific_species.csv)
===================================================================
--- trunk/assets/ref_import_calcified_part_takings.csv (rev 0)
+++ trunk/assets/ref_import_calcified_part_takings.csv 2014-02-28 13:13:35 UTC (rev 55)
@@ -0,0 +1,6 @@
+Espece_scientifique;Classe_debut;Classe_fin;Pas_de_classe;Pas;Arret
+AAPT;10;200;1;5;Inf
+AAPT;201;400;1;2;Inf
+AAPT;401;Inf;1;1;Inf
+AAPTAAP;5;Inf;5;2;5
+ABAL;10;Inf;10;5;2
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/pom.xml 2014-02-28 13:13:35 UTC (rev 55)
@@ -177,6 +177,31 @@
<version>3.0-alpha-1</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ <version>20090211</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+
</dependencies>
<repositories>
@@ -216,6 +241,14 @@
<checksumPolicy>fail</checksumPolicy>
</releases>
</pluginRepository>
+ <pluginRepository>
+ <id>oss.sonatype.org-jayway-snapshots</id>
+ <name>Jayway OpenSource SNAPSHOTs on Sonatype.org</name>
+ <url>http://oss.sonatype.org/content/repositories/jayway-snapshots/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
</pluginRepositories>
<build>
@@ -232,7 +265,7 @@
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
- <version>3.8.2</version>
+ <version>3.8.3-SNAPSHOT</version>
<executions>
<execution>
<id>alignApk</id>
@@ -248,6 +281,9 @@
<platform>15</platform>
</sdk>
<extractDuplicates>true</extractDuplicates>
+ <excludeJarResources>
+ <excludeJarResource>.*nuiton.*</excludeJarResource>
+ </excludeJarResources>
<!--<sign>-->
<!--<debug>false</debug>-->
<!--</sign>-->
@@ -533,6 +569,37 @@
</build>
</profile>
+ <profile>
+ <id>analyze-dependencies</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <defaultGoal>verify</defaultGoal>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>analyze</id>
+ <goals>
+ <goal>analyze-only</goal>
+ </goals>
+ <configuration>
+ <usedDependencies>
+ <usedDependency>android.support:compatibility-v7-appcompat</usedDependency>
+ </usedDependencies>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
Modified: trunk/res/values/strings.xml
===================================================================
--- trunk/res/values/strings.xml 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/res/values/strings.xml 2014-02-28 13:13:35 UTC (rev 55)
@@ -68,6 +68,9 @@
<string name="observed_number">Number of individuals observed:</string>
+ <string name="measurement_taking_message">STOP, please take calcified parts on this individual</string>
+ <string name="measurement_taking_audio_message">STOP, taking</string>
+
<!-- Home screen -->
<string name="main_open_contexts">Watch/Input data</string>
<string name="main_export_data">Export data</string>
@@ -100,6 +103,7 @@
<string name="preferences_import_scientific_species">Import scientific species</string>
<string name="preferences_import_states">Import states</string>
<string name="preferences_import_vessels">Import vessels</string>
+ <string name="preferences_import_calcified_parts_takings">Import calcified parts taking algorithm settings</string>
<string name="preferences_import_no_external_storage_title">External storage unavailable</string>
<string name="preferences_import_no_external_storage_message">No externat storage is available.\nWould you like to import the data without saving the source file?</string>
<string name="preferences_importing_referential">Importing referential data</string>
Modified: trunk/res/values-fr/strings.xml
===================================================================
--- trunk/res/values-fr/strings.xml 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/res/values-fr/strings.xml 2014-02-28 13:13:35 UTC (rev 55)
@@ -54,14 +54,17 @@
<string name="measurement_graph_title">Observations</string>
<string name="deletion">Suppression</string>
- <string name="input_deletion_confirmation_title">Supprimer une mesure</string>
- <string name="input_deletion_confirmation_message">Êtes vous sûr de vouloir\nsupprimer la saisie\n%s ?</string>
+ <string name="input_deletion_confirmation_title">Supprimer une observation</string>
+ <string name="input_deletion_confirmation_message">Êtes vous sûr de vouloir\nsupprimer l\'observation\n%s ?</string>
<string name="item_deletion_confirmation_message">Êtes vous sûr de vouloir\nsupprimer l\'élément\n%s ?</string>
<string name="undefined">Non défini</string>
<string name="observed_number">Nombre d\'individus observés :</string>
+ <string name="measurement_taking_message">STOP, merci de réaliser le prélèvement des pièces calcifiées de cet individu</string>
+ <string name="measurement_taking_audio_message">STOP, prélèvement</string>
+
<!-- Home screen -->
<string name="main_open_contexts">Voir / saisir des données</string>
<string name="main_export_data">Export des données</string>
@@ -93,6 +96,8 @@
<string name="preferences_import_scientific_species">Importer des espèces scientifiques</string>
<string name="preferences_import_states">Importer des états</string>
<string name="preferences_import_vessels">Importer des navires</string>
+ <string name="preferences_import_calcified_parts_takings">Import des paramètres des prélèvements</string>
+ <string name="preferences_import_calcified_parts_takings_summary">des pièces calcifiées</string>
<string name="preferences_import_no_external_storage_title">Stockage externe non trouvé</string>
<string name="preferences_import_no_external_storage_message">Aucun stockage externe n\'est disponible.\nVoulez vous continuer sans sauvegarder le fichier d\'origine ?</string>
<string name="preferences_importing_referential">Import des données du référentiel en cours</string>
Modified: trunk/res/xml/preferences.xml
===================================================================
--- trunk/res/xml/preferences.xml 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/res/xml/preferences.xml 2014-02-28 13:13:35 UTC (rev 55)
@@ -63,6 +63,9 @@
android:key="import_maturities"/>
<Preference android:title="@string/preferences_import_genders"
android:key="import_genders"/>
+ <Preference android:title="@string/preferences_import_calcified_parts_takings"
+ android:summary="@string/preferences_import_calcified_parts_takings_summary"
+ android:key="import_calcified_parts_takings"/>
</PreferenceScreen>
Modified: trunk/src/fr/ifremer/wlo/MainActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -29,31 +29,24 @@
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.content.res.Configuration;
-import android.database.Cursor;
import android.os.Bundle;
-import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import android.util.Log;
import android.view.View;
-import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;
-import fr.ifremer.wlo.models.ContextModel;
import fr.ifremer.wlo.models.referentials.imports.ImportUtil;
import fr.ifremer.wlo.preferences.SettingsActivity;
import fr.ifremer.wlo.storage.DataCache;
import fr.ifremer.wlo.storage.Exporter;
-import fr.ifremer.wlo.storage.WloSqlOpenHelper;
-import fr.ifremer.wlo.utils.BigFinFeedReaderRecord;
import fr.ifremer.wlo.utils.filechooser.FileDialog;
import fr.ifremer.wlo.utils.filechooser.SelectionMode;
import org.apache.commons.io.FileUtils;
import org.json.JSONException;
-import org.json.JSONObject;
import java.io.File;
import java.io.IOException;
@@ -305,8 +298,11 @@
File file = new File(selectedFile, "export" + date + ".json");
FileUtils.write(file, jsonData);
+ Toast.makeText(this, "Export effectué dans le fichier " + file.getAbsolutePath(), Toast.LENGTH_LONG).show();
+
} catch (JSONException | IOException e) {
Log.e(TAG, "error while exporting to JSON", e);
+ Toast.makeText(this, "Erreur lors de l'export", Toast.LENGTH_SHORT).show();
}
}
break;
Modified: trunk/src/fr/ifremer/wlo/WeightsActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -1,5 +1,29 @@
package fr.ifremer.wlo;
+/*
+ * #%L
+ * WLO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
Modified: trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -25,6 +25,8 @@
*/
import android.app.ActionBar;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.database.Cursor;
@@ -63,10 +65,9 @@
import fr.ifremer.wlo.ScientificSpeciesFormActivity;
import fr.ifremer.wlo.VesselFormActivity;
import fr.ifremer.wlo.WloBaseActivity;
-import fr.ifremer.wlo.WloBaseListActivity;
import fr.ifremer.wlo.WloModelEditionActivity;
import fr.ifremer.wlo.models.CategoryWeightModel;
-import fr.ifremer.wlo.models.HierarchicalModel;
+import fr.ifremer.wlo.models.calcifiedPartTaking.CalcifiedPartTaking;
import fr.ifremer.wlo.models.referentials.Mensuration;
import fr.ifremer.wlo.storage.DataCache;
import fr.ifremer.wlo.models.BaseModel;
@@ -164,6 +165,8 @@
measurements.addMeasurement(measurement);
}
}
+ fetchCalcifiedPartTakings();
+
measurements.addMeasurementsListener(new MeasurementsModel.MeasurementsListener() {
@Override
public void onMeasurementAdded(MeasurementsModel source, MeasurementModel measurement) {
@@ -353,6 +356,7 @@
break;
case 4:
scientificSpecies = (ScientificSpeciesModel) data.getSerializableExtra(WloModelEditionActivity.INTENT_EXTRA_MODEL);
+ fetchCalcifiedPartTakings();
break;
}
setDrawerListAdapter();
@@ -462,8 +466,28 @@
}
soh.saveData(measurement);
- measurements.addMeasurement(measurement);
+ boolean take = measurements.addMeasurement(measurement);
+ if (take) {
+ if (useTextToSpeech) {
+ textToSpeech.speak(getString(R.string.measurement_taking_audio_message), TextToSpeech.QUEUE_FLUSH, null);
+ } else {
+ ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, ToneGenerator.MAX_VOLUME);
+ tg.startTone(ToneGenerator.TONE_PROP_PROMPT);
+ }
+
+ // Get instance of Vibrator from current Context
+ Vibrator v = (Vibrator) getSystemService(VIBRATOR_SERVICE);
+ // Vibrate for 300 milliseconds
+ v.vibrate(300);
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setMessage(R.string.measurement_taking_message)
+ .setPositiveButton(android.R.string.ok, UIUtils.getCancelClickListener())
+ .create()
+ .show();
+ }
+
MeasurementModel result = measurement;
initFishMeasurement(size, cat1, cat2, cat3);
@@ -552,6 +576,21 @@
}));
}
+ protected void fetchCalcifiedPartTakings() {
+ if (scientificSpecies.isTakingActivation()) {
+ WloSqlOpenHelper soh = new WloSqlOpenHelper(this);
+ Cursor cursor = soh.getAllCalcifiedPartTakings(scientificSpecies.getName().getId());
+ List<CalcifiedPartTaking> calcifiedPartTakings = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, CalcifiedPartTaking>() {
+ @Override
+ public CalcifiedPartTaking apply(Cursor input) {
+ return new CalcifiedPartTaking(input);
+ }
+ });
+ soh.close();
+ measurements.setCalcifiedPartTakings(calcifiedPartTakings);
+ }
+ }
+
private class DrawerItemClickListener implements ListView.OnItemClickListener {
@Override
public void onItemClick(AdapterView parent, View view, int position, long id) {
Modified: trunk/src/fr/ifremer/wlo/models/BaseModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/BaseModel.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/models/BaseModel.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -199,4 +199,13 @@
}
}
+ protected void putValue(ContentValues values, String column, Float value) {
+ if (value == null) {
+ values.putNull(column);
+ Log.d(TAG, "put value null for column " + column);
+ } else {
+ values.put(column, value);
+ }
+ }
+
}
Modified: trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -1,5 +1,29 @@
package fr.ifremer.wlo.models;
+/*
+ * #%L
+ * WLO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
Modified: trunk/src/fr/ifremer/wlo/models/MeasurementsModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/MeasurementsModel.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/models/MeasurementsModel.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -3,8 +3,8 @@
/*
* #%L
* WLO
- * $Id:$
- * $HeadURL:$
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2013 - 2014 Ifremer
* %%
@@ -24,9 +24,11 @@
* #L%
*/
+import android.util.Log;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
+import fr.ifremer.wlo.models.calcifiedPartTaking.CalcifiedPartTaking;
import fr.ifremer.wlo.models.referentials.Mensuration;
import java.io.Serializable;
@@ -47,6 +49,8 @@
protected Multimap<Integer, MeasurementModel> measurements = HashMultimap.create();
+ protected List<CalcifiedPartTaking> calcifiedPartTakings;
+
transient protected List<MeasurementsListener> listeners = new ArrayList<MeasurementsListener>();
public ScientificSpeciesModel getScientificSpecies() {
@@ -77,10 +81,41 @@
return measurements.get(size).size();
}
- public void addMeasurement(MeasurementModel fishMeasurement) {
+ public boolean addMeasurement(MeasurementModel fishMeasurement) {
int size = fishMeasurement.getSize();
measurements.put(size, fishMeasurement);
fireMeasurementAdded(fishMeasurement);
+
+ boolean result = false;
+ Log.d(TAG, "calcifiedPartTakings : " + calcifiedPartTakings);
+ if (calcifiedPartTakings != null) {
+ CalcifiedPartTaking calcifiedPartTaking = null;
+ for (CalcifiedPartTaking cpt : calcifiedPartTakings) {
+ Log.d(TAG, "size : " + size);
+ Integer startSize = cpt.getStartSize();
+ Log.d(TAG, "startSize : " + startSize);
+ Integer endSize = cpt.getEndSize();
+ Log.d(TAG, "endSize : " + endSize);
+ if ((startSize == null || startSize <= size)
+ && (endSize == null || endSize >= size)) {
+ calcifiedPartTaking = cpt;
+ break;
+ }
+ }
+ Log.d(TAG, "calcifiedPartTaking : " + calcifiedPartTaking);
+ if (calcifiedPartTaking != null) {
+ int nb = measurements.get(size).size();
+ Log.d(TAG, "nb : " + nb);
+ int step = calcifiedPartTaking.getStep();
+ Log.d(TAG, "step : " + step);
+ Integer stop = calcifiedPartTaking.getStop();
+ Log.d(TAG, "stop : " + stop);
+ Log.d(TAG, "nb % step : " + (nb % step));
+ result = nb == 1 || (nb % step == 0 && (stop == null || nb <= stop));
+ }
+
+ }
+ return result;
}
public void removeMeasurement(MeasurementModel fishMeasurement) {
@@ -89,6 +124,14 @@
fireMeasurementRemoved(fishMeasurement);
}
+ public List<CalcifiedPartTaking> getCalcifiedPartTakings() {
+ return calcifiedPartTakings;
+ }
+
+ public void setCalcifiedPartTakings(List<CalcifiedPartTaking> calcifiedPartTakings) {
+ this.calcifiedPartTakings = calcifiedPartTakings;
+ }
+
public void addMeasurementsListener(MeasurementsListener listener) {
ensureListeners();
listeners.add(listener);
Added: trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTaking.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTaking.java (rev 0)
+++ trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTaking.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -0,0 +1,142 @@
+package fr.ifremer.wlo.models.calcifiedPartTaking;
+
+/*
+ * #%L
+ * WLO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.util.Log;
+import fr.ifremer.wlo.models.BaseModel;
+import fr.ifremer.wlo.models.HierarchicalModel;
+import fr.ifremer.wlo.models.referentials.ScientificSpecies;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public class CalcifiedPartTaking extends HierarchicalModel<ScientificSpecies> {
+
+ private static final String TAG = "CalcifiedPartTaking";
+
+ public static final String TABLE_NAME = "calcifiedPartTaking";
+ public static final String COLUMN_START_SIZE = "startSize";
+ public static final String COLUMN_END_SIZE = "endSize";
+ public static final String COLUMN_SIZE_STEP = "sizeStep";
+ public static final String COLUMN_STEP = "step";
+ public static final String COLUMN_STOP = "stop";
+ public static final String COLUMN_SCIENTIFIC_SPECIES_ID = "scientificSpeciesId";
+ public static final String[] ALL_COLUMNS = new String[] {
+ _ID,
+ COLUMN_START_SIZE,
+ COLUMN_END_SIZE,
+ COLUMN_SIZE_STEP,
+ COLUMN_STEP,
+ COLUMN_STOP,
+ COLUMN_SCIENTIFIC_SPECIES_ID
+ };
+
+ @Override
+ public String getTableName() {
+ return TABLE_NAME;
+ }
+
+ protected Integer startSize;
+ protected Integer endSize;
+ protected int sizeStep;
+ protected int step;
+ protected Integer stop;
+
+ public CalcifiedPartTaking() {
+ }
+
+ public CalcifiedPartTaking(Cursor cursor) {
+ super(cursor);
+ if (!cursor.isNull(1)) {
+ startSize = cursor.getInt(1);
+ }
+ if (!cursor.isNull(2)) {
+ endSize = cursor.getInt(2);
+ }
+ if (!cursor.isNull(3)) {
+ sizeStep = cursor.getInt(3);
+ }
+ step = cursor.getInt(4);
+ if (!cursor.isNull(5)) {
+ stop = cursor.getInt(5);
+ }
+ Log.d(TAG, startSize + " " + endSize + " " + sizeStep + " " + step + " " + stop);
+ }
+
+ public Integer getStartSize() {
+ return startSize;
+ }
+
+ public void setStartSize(Integer startSize) {
+ this.startSize = startSize;
+ }
+
+ public Integer getEndSize() {
+ return endSize;
+ }
+
+ public void setEndSize(Integer endSize) {
+ this.endSize = endSize;
+ }
+
+ public int getSizeStep() {
+ return sizeStep;
+ }
+
+ public void setSizeStep(int sizeStep) {
+ this.sizeStep = sizeStep;
+ }
+
+ public int getStep() {
+ return step;
+ }
+
+ public void setStep(int step) {
+ this.step = step;
+ }
+
+ public Integer getStop() {
+ return stop;
+ }
+
+ public void setStop(Integer stop) {
+ this.stop = stop;
+ }
+
+ @Override
+ public ContentValues convertIntoContentValues() {
+ ContentValues value = super.convertIntoContentValues();
+ putValue(value, COLUMN_START_SIZE, startSize);
+ putValue(value, COLUMN_END_SIZE, endSize);
+ putValue(value, COLUMN_SIZE_STEP, sizeStep);
+ putValue(value, COLUMN_STEP, step);
+ putValue(value, COLUMN_STOP, stop);
+ putValue(value, COLUMN_SCIENTIFIC_SPECIES_ID, getParentId());
+ return value;
+ }
+}
\ No newline at end of file
Copied: trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTakingRowModel.java (from rev 29, trunk/src/fr/ifremer/wlo/models/referentials/imports/AgeRowModel.java)
===================================================================
--- trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTakingRowModel.java (rev 0)
+++ trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTakingRowModel.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -0,0 +1,132 @@
+package fr.ifremer.wlo.models.calcifiedPartTaking;
+
+/*
+ * #%L
+ * WLO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import android.util.Log;
+import com.google.common.base.Function;
+import com.google.common.collect.Maps;
+import fr.ifremer.wlo.models.referentials.ScientificSpecies;
+import org.nuiton.csv.ValueSetter;
+import org.nuiton.csv.ext.AbstractImportExportModel;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 0.1
+ */
+public class CalcifiedPartTakingRowModel extends AbstractImportExportModel<CalcifiedPartTaking> {
+
+ private static final String TAG = "CalcifiedPartTakingRowModel";
+
+ public CalcifiedPartTakingRowModel(char separator, Collection<ScientificSpecies> scientificSpecies) {
+
+ super(separator);
+
+ final Map<String, ScientificSpecies> scientificSpeciesByCode = Maps.uniqueIndex(scientificSpecies, new Function<ScientificSpecies, String>() {
+ @Override
+ public String apply(ScientificSpecies input) {
+ return input.getCode();
+ }
+ });
+
+ newMandatoryColumn("Espece_scientifique", new ValueSetter<CalcifiedPartTaking, String>() {
+ @Override
+ public void set(CalcifiedPartTaking object, String value) throws Exception {
+ if (value == null) {
+ throw new NullPointerException("L'espece scientifique ne peut etre nulle");
+ }
+ ScientificSpecies species = scientificSpeciesByCode.get(value);
+ object.setParent(species);
+ }
+ });
+
+ newMandatoryColumn("Classe_debut", new ValueSetter<CalcifiedPartTaking, String>() {
+ @Override
+ public void set(CalcifiedPartTaking object, String value) throws Exception {
+ Integer size;
+ try {
+ size = Integer.parseInt(value);
+ } catch (NumberFormatException e) {
+ size = null;
+ }
+ Log.d(TAG, object + "setStartSize " + size);
+ object.setStartSize(size);
+ }
+ });
+
+ newMandatoryColumn("Classe_fin", new ValueSetter<CalcifiedPartTaking, String>() {
+ @Override
+ public void set(CalcifiedPartTaking object, String value) throws Exception {
+ Integer size;
+ try {
+ size = Integer.parseInt(value);
+ } catch (NumberFormatException e) {
+ size = null;
+ }
+ Log.d(TAG, object + "setEndSize " + size);
+ object.setEndSize(size);
+ }
+ });
+
+ newMandatoryColumn("Pas_de_classe", new ValueSetter<CalcifiedPartTaking, String>() {
+ @Override
+ public void set(CalcifiedPartTaking object, String value) throws Exception {
+ Integer size = Integer.parseInt(value);
+ Log.d(TAG, object + "setSizeStep " + size);
+ object.setSizeStep(size);
+ }
+ });
+
+ newMandatoryColumn("Pas", new ValueSetter<CalcifiedPartTaking, String>() {
+ @Override
+ public void set(CalcifiedPartTaking object, String value) throws Exception {
+ Integer size = Integer.parseInt(value);
+ Log.d(TAG, object + "setStep " + size);
+ object.setStep(size);
+ }
+ });
+
+ newMandatoryColumn("Arret", new ValueSetter<CalcifiedPartTaking, String>() {
+ @Override
+ public void set(CalcifiedPartTaking object, String value) throws Exception {
+ Integer size;
+ try {
+ size = Integer.parseInt(value);
+ } catch (NumberFormatException e) {
+ size = null;
+ }
+ Log.d(TAG, object + "setStop " + size);
+ object.setStop(size);
+ }
+ });
+ }
+
+ @Override
+ public CalcifiedPartTaking newEmptyInstance() {
+ return new CalcifiedPartTaking();
+ }
+}
Modified: trunk/src/fr/ifremer/wlo/models/referentials/imports/ImportUtil.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/referentials/imports/ImportUtil.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/models/referentials/imports/ImportUtil.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -35,6 +35,8 @@
import com.google.common.collect.Lists;
import fr.ifremer.wlo.R;
import fr.ifremer.wlo.models.BaseModel;
+import fr.ifremer.wlo.models.calcifiedPartTaking.CalcifiedPartTaking;
+import fr.ifremer.wlo.models.calcifiedPartTaking.CalcifiedPartTakingRowModel;
import fr.ifremer.wlo.models.referentials.HasCode;
import fr.ifremer.wlo.storage.DataCache;
import fr.ifremer.wlo.storage.WloSqlOpenHelper;
@@ -49,6 +51,7 @@
import java.io.InputStream;
import java.io.StringWriter;
import java.nio.charset.Charset;
+import java.util.ArrayList;
import java.util.Collection;
/**
@@ -237,8 +240,23 @@
return result;
}
+ public static int importCalcifiedPartTakings(Context context, String path) {
+ try {
+ return importCalcifiedPartTakings(context, new FileInputStream(path));
+ } catch (FileNotFoundException e) {
+ Log.e(TAG, "File " + path + " not found", e);
+ }
+ return 0;
+ }
+
+ public static int importCalcifiedPartTakings(Context context, InputStream inputStream) {
+ CalcifiedPartTakingRowModel calcifiedPartTakingRowModel = new CalcifiedPartTakingRowModel(CSV_SEPARATOR, DataCache.getAllScientificSpecies(context));
+ int result = importData(context, calcifiedPartTakingRowModel, inputStream, new ArrayList<CalcifiedPartTaking>());
+ return result;
+ }
+
protected static <M extends BaseModel> int importData(Context context, ImportModel<M> importModel,
- InputStream inputStream, final Collection<M> actualReferential) {
+ InputStream inputStream, final Collection<M> actualReferential) {
Preconditions.checkNotNull(actualReferential);
Import<M> importer = null;
Collection<M> models = null;
Modified: trunk/src/fr/ifremer/wlo/preferences/SettingsActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/preferences/SettingsActivity.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/preferences/SettingsActivity.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -88,6 +88,8 @@
protected static final int REQUEST_IMPORT_SCIENTIFIC_SPECIES = 8;
protected static final int REQUEST_IMPORT_STATES = 9;
protected static final int REQUEST_IMPORT_VESSELS = 10;
+ protected static final int REQUEST_IMPORT_CALCIFIED_PARTS_TAKINGS = 11;
+
@Override
protected Integer getContentView() {
return null;
@@ -133,6 +135,7 @@
requestCodeByPrefKey.put("import_scientific_species", REQUEST_IMPORT_SCIENTIFIC_SPECIES);
requestCodeByPrefKey.put("import_states", REQUEST_IMPORT_STATES);
requestCodeByPrefKey.put("import_vessels", REQUEST_IMPORT_VESSELS);
+ requestCodeByPrefKey.put("import_calcified_parts_takings", REQUEST_IMPORT_CALCIFIED_PARTS_TAKINGS);
Map<String, Integer> nbElementsByPrefKey = Maps.newHashMap();
Context context = getActivity();
@@ -151,7 +154,10 @@
for (String key : requestCodeByPrefKey.keySet()) {
final Integer requestCode = requestCodeByPrefKey.get(key);
Preference filePicker = findPreference(key);
- filePicker.setSummary(getString(R.string.preferences_import_summary, nbElementsByPrefKey.get(key)));
+ Integer nb = nbElementsByPrefKey.get(key);
+ if (nb != null) {
+ filePicker.setSummary(getString(R.string.preferences_import_summary, nb));
+ }
filePicker.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
@@ -234,7 +240,7 @@
@Override
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
if (resultCode == RESULT_OK
- && requestCode >= REQUEST_IMPORT_AGES && requestCode <= REQUEST_IMPORT_VESSELS) {
+ && requestCode >= REQUEST_IMPORT_AGES && requestCode <= REQUEST_IMPORT_CALCIFIED_PARTS_TAKINGS) {
Context context = getActivity();
if (!StorageUtils.isExternalStorageWritable()) {
@@ -273,8 +279,8 @@
public void run() {
String path = data.getStringExtra(FileDialog.RESULT_PATH);
Log.d(TAG, path);
- final int updatedNb;
- final int newNb;
+ final Integer updatedNb;
+ final Integer newNb;
try {
switch (requestCode) {
@@ -322,9 +328,16 @@
newNb = ImportUtil.importVessels(context, path);
updatedNb = DataCache.getAllVessels(context).size();
break;
+ case REQUEST_IMPORT_CALCIFIED_PARTS_TAKINGS:
+ WloSqlOpenHelper soh = new WloSqlOpenHelper(context);
+ soh.clearCalcifiedPartTakings();
+ soh.close();
+ newNb = ImportUtil.importCalcifiedPartTakings(context, path);
+ updatedNb = null;
+ break;
default:
- newNb = 0;
- updatedNb = 0;
+ newNb = null;
+ updatedNb = null;
}
if (backupFile) {
@@ -343,10 +356,13 @@
@Override
public void run() {
dialog.dismiss();
- String key = requestCodeByPrefKey.inverse().get(requestCode);
- Preference filePicker = findPreference(key);
- filePicker.setSummary(getString(R.string.preferences_import_summary, updatedNb));
+ if (updatedNb != null) {
+ String key = requestCodeByPrefKey.inverse().get(requestCode);
+ Preference filePicker = findPreference(key);
+ filePicker.setSummary(getString(R.string.preferences_import_summary, updatedNb));
+ }
+
Toast.makeText(context, context.getString(R.string.import_new_element_number, newNb), Toast.LENGTH_SHORT).show();
}
});
Modified: trunk/src/fr/ifremer/wlo/storage/Exporter.java
===================================================================
--- trunk/src/fr/ifremer/wlo/storage/Exporter.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/storage/Exporter.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -1,5 +1,29 @@
package fr.ifremer.wlo.storage;
+/*
+ * #%L
+ * WLO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import android.content.Context;
import android.database.Cursor;
import com.google.common.base.Function;
Modified: trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
===================================================================
--- trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -28,10 +28,10 @@
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
+import android.util.Log;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
import fr.ifremer.wlo.models.BaseModel;
import fr.ifremer.wlo.models.CategoryWeightModel;
import fr.ifremer.wlo.models.CommercialSpeciesModel;
@@ -41,6 +41,7 @@
import fr.ifremer.wlo.models.MetierModel;
import fr.ifremer.wlo.models.ScientificSpeciesModel;
import fr.ifremer.wlo.models.VesselModel;
+import fr.ifremer.wlo.models.calcifiedPartTaking.CalcifiedPartTaking;
import fr.ifremer.wlo.models.referentials.Age;
import fr.ifremer.wlo.models.referentials.CommercialSpecies;
import fr.ifremer.wlo.models.referentials.Gender;
@@ -55,7 +56,6 @@
import java.util.Collection;
import java.util.List;
-import java.util.Set;
import java.util.UUID;
/**
@@ -67,11 +67,12 @@
private static final String TAG = "WloOpenHelper";
public static final String DATABASE_NAME = "wlo.db";
- public static final int DATABASE_VERSION = 17;
+ public static final int DATABASE_VERSION = 18;
public static final String TEXT_TYPE = " TEXT";
- public static final String BIGINT_TYPE = " BIGINT";
- public static final String BYTE_TYPE = " BYTE";
+ public static final String INTEGER_TYPE = " INTEGER";
+ public static final String NUMERIC_TYPE = " NUMERIC";
+ public static final String REAL_TYPE = " REAL";
public static final String COMMA_SEP = ",";
public static final String NOT_NULL = " NOT NULL";
@@ -92,8 +93,8 @@
"CREATE TABLE " + LocationModel.TABLE_NAME + " (" +
LocationModel._ID + TEXT_TYPE + " PRIMARY KEY" + COMMA_SEP +
LocationModel.COLUMN_OPERATOR + TEXT_TYPE + COMMA_SEP +
- LocationModel.COLUMN_START_DATE + BIGINT_TYPE + COMMA_SEP +
- LocationModel.COLUMN_END_DATE + BIGINT_TYPE + COMMA_SEP +
+ LocationModel.COLUMN_START_DATE + INTEGER_TYPE + COMMA_SEP +
+ LocationModel.COLUMN_END_DATE + INTEGER_TYPE + COMMA_SEP +
LocationModel.COLUMN_LOCATION + TEXT_TYPE + NOT_NULL + COMMA_SEP +
LocationModel.COLUMN_COMMENT + TEXT_TYPE + COMMA_SEP +
LocationModel.COLUMN_CONTEXT_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
@@ -112,7 +113,7 @@
VesselModel._ID + TEXT_TYPE + " PRIMARY KEY" + COMMA_SEP +
VesselModel.COLUMN_REGISTRATION_NUMBER + TEXT_TYPE + COMMA_SEP +
VesselModel.COLUMN_NAME + TEXT_TYPE + COMMA_SEP +
- VesselModel.COLUMN_LANDING_DATE + BIGINT_TYPE + COMMA_SEP +
+ VesselModel.COLUMN_LANDING_DATE + INTEGER_TYPE + COMMA_SEP +
VesselModel.COLUMN_LANDING_LOCATION + TEXT_TYPE + COMMA_SEP +
VesselModel.COLUMN_COMMENT + TEXT_TYPE + COMMA_SEP +
VesselModel.COLUMN_LOCATION_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
@@ -150,12 +151,12 @@
CommercialSpeciesModel.COLUMN_FAO_CODE + TEXT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_MEASUREMENT_METHOD + TEXT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_PRECISION + TEXT_TYPE + COMMA_SEP +
- CommercialSpeciesModel.COLUMN_SPECIES_MIX + BYTE_TYPE + COMMA_SEP +
+ CommercialSpeciesModel.COLUMN_SPECIES_MIX + NUMERIC_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_SORT_CATEGORY + TEXT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_STATE + TEXT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_PRESENTATION + TEXT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_COMMENT + TEXT_TYPE + COMMA_SEP +
- CommercialSpeciesModel.COLUMN_TOTAL_UNLOADED_WEIGHT + BIGINT_TYPE + COMMA_SEP +
+ CommercialSpeciesModel.COLUMN_TOTAL_UNLOADED_WEIGHT + INTEGER_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_METIER_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
"FOREIGN KEY(" + CommercialSpeciesModel.COLUMN_METIER_ID + ") REFERENCES " +
MetierModel.TABLE_NAME + "(" + MetierModel._ID + ") ON DELETE CASCADE" + COMMA_SEP +
@@ -177,10 +178,10 @@
"CREATE TABLE " + ScientificSpeciesModel.TABLE_NAME + " (" +
ScientificSpeciesModel._ID + TEXT_TYPE + " PRIMARY KEY" + COMMA_SEP +
ScientificSpeciesModel.COLUMN_NAME + TEXT_TYPE + COMMA_SEP +
- ScientificSpeciesModel.COLUMN_TAKING_ACTIVATION + BYTE_TYPE + COMMA_SEP +
+ ScientificSpeciesModel.COLUMN_TAKING_ACTIVATION + NUMERIC_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_COMMENT + TEXT_TYPE + COMMA_SEP +
- ScientificSpeciesModel.COLUMN_SORTED_WEIGHT + BIGINT_TYPE + COMMA_SEP +
- ScientificSpeciesModel.COLUMN_SAMPLE_WEIGHT + BIGINT_TYPE + COMMA_SEP +
+ ScientificSpeciesModel.COLUMN_SORTED_WEIGHT + INTEGER_TYPE + COMMA_SEP +
+ ScientificSpeciesModel.COLUMN_SAMPLE_WEIGHT + INTEGER_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_COMMERCIAL_SPECIES_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
"FOREIGN KEY(" + ScientificSpeciesModel.COLUMN_COMMERCIAL_SPECIES_ID + ") REFERENCES " +
CommercialSpeciesModel.TABLE_NAME + "(" + CommercialSpeciesModel._ID + ") ON DELETE CASCADE" + COMMA_SEP +
@@ -195,8 +196,8 @@
protected static final String SQL_CREATE_MEASUREMENTS =
"CREATE TABLE " + MeasurementModel.TABLE_NAME + " (" +
MeasurementModel._ID + TEXT_TYPE + " PRIMARY KEY" + COMMA_SEP +
- MeasurementModel.COLUMN_SIZE + BIGINT_TYPE + COMMA_SEP +
- MeasurementModel.COLUMN_DATE + BIGINT_TYPE + COMMA_SEP +
+ MeasurementModel.COLUMN_SIZE + INTEGER_TYPE + COMMA_SEP +
+ MeasurementModel.COLUMN_DATE + INTEGER_TYPE + COMMA_SEP +
MeasurementModel.COLUMN_CATEGORY_1 + TEXT_TYPE + COMMA_SEP +
MeasurementModel.COLUMN_CATEGORY_2 + TEXT_TYPE + COMMA_SEP +
MeasurementModel.COLUMN_CATEGORY_3 + TEXT_TYPE + COMMA_SEP +
@@ -215,7 +216,7 @@
CategoryWeightModel.COLUMN_CATEGORY_1 + TEXT_TYPE + COMMA_SEP +
CategoryWeightModel.COLUMN_CATEGORY_2 + TEXT_TYPE + COMMA_SEP +
CategoryWeightModel.COLUMN_CATEGORY_3 + TEXT_TYPE + COMMA_SEP +
- CategoryWeightModel.COLUMN_WEIGHT + BIGINT_TYPE + COMMA_SEP +
+ CategoryWeightModel.COLUMN_WEIGHT + INTEGER_TYPE + COMMA_SEP +
CategoryWeightModel.COLUMN_SCIENTIFIC_SPECIES_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
"FOREIGN KEY(" + CategoryWeightModel.COLUMN_SCIENTIFIC_SPECIES_ID + ") REFERENCES " +
ScientificSpeciesModel.TABLE_NAME + "(" + ScientificSpeciesModel._ID + ") ON DELETE CASCADE" +
@@ -224,6 +225,23 @@
protected static final String SQL_DELETE_CATEGORY_WEIGHTS =
"DROP TABLE IF EXISTS " + CategoryWeightModel.TABLE_NAME;
+ // CALCIFIED PART TAKING
+ protected static final String SQL_CREATE_CALCIFIED_PART_TAKINGS =
+ "CREATE TABLE " + CalcifiedPartTaking.TABLE_NAME + " (" +
+ CalcifiedPartTaking._ID + TEXT_TYPE + " PRIMARY KEY" + COMMA_SEP +
+ CalcifiedPartTaking.COLUMN_START_SIZE + INTEGER_TYPE + COMMA_SEP +
+ CalcifiedPartTaking.COLUMN_END_SIZE + INTEGER_TYPE + COMMA_SEP +
+ CalcifiedPartTaking.COLUMN_SIZE_STEP + INTEGER_TYPE + COMMA_SEP +
+ CalcifiedPartTaking.COLUMN_STEP + INTEGER_TYPE + COMMA_SEP +
+ CalcifiedPartTaking.COLUMN_STOP + INTEGER_TYPE + COMMA_SEP +
+ CalcifiedPartTaking.COLUMN_SCIENTIFIC_SPECIES_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
+ "FOREIGN KEY(" + CalcifiedPartTaking.COLUMN_SCIENTIFIC_SPECIES_ID + ") REFERENCES " +
+ ScientificSpecies.TABLE_NAME + "(" + ScientificSpecies._ID + ") ON DELETE CASCADE" +
+ " )";
+
+ protected static final String SQL_DELETE_CALCIFIED_PART_TAKINGS =
+ "DROP TABLE IF EXISTS " + CalcifiedPartTaking.TABLE_NAME;
+
// Referentials
// Ages
@@ -247,7 +265,7 @@
CommercialSpecies.COLUMN_FRENCH_LABEL + TEXT_TYPE + COMMA_SEP +
CommercialSpecies.COLUMN_FAMILY + TEXT_TYPE + COMMA_SEP +
CommercialSpecies.COLUMN_SPECIES_ORDER + TEXT_TYPE + COMMA_SEP +
- CommercialSpecies.COLUMN_ACTIVE + BYTE_TYPE +
+ CommercialSpecies.COLUMN_ACTIVE + NUMERIC_TYPE +
" )";
protected static final String SQL_DELETE_REF_COMMERCIAL_SPECIES =
@@ -308,8 +326,8 @@
Metier.COLUMN_GEAR_LABEL + TEXT_TYPE + COMMA_SEP +
Metier.COLUMN_SPECIES_CODE + TEXT_TYPE + COMMA_SEP +
Metier.COLUMN_SPECIES_LABEL + TEXT_TYPE + COMMA_SEP +
- Metier.COLUMN_FISHING + BYTE_TYPE + COMMA_SEP +
- Metier.COLUMN_ACTIVE + BYTE_TYPE +
+ Metier.COLUMN_FISHING + NUMERIC_TYPE + COMMA_SEP +
+ Metier.COLUMN_ACTIVE + NUMERIC_TYPE +
" )";
protected static final String SQL_DELETE_REF_METIERS =
@@ -390,12 +408,14 @@
db.execSQL(SQL_CREATE_SCIENTIFIC_SPECIES);
db.execSQL(SQL_CREATE_MEASUREMENTS);
db.execSQL(SQL_CREATE_CATEGORY_WEIGHTS);
+ db.execSQL(SQL_CREATE_CALCIFIED_PART_TAKINGS);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
//TODO kmorin 20131129 migrate data before droping the table
// models
+ db.execSQL(SQL_DELETE_CALCIFIED_PART_TAKINGS);
db.execSQL(SQL_DELETE_CATEGORY_WEIGHTS);
db.execSQL(SQL_DELETE_MEASUREMENTS);
db.execSQL(SQL_DELETE_SCIENTIFIC_SPECIES);
@@ -549,6 +569,21 @@
return cursor;
}
+ // CALCIFIED PART TAKING
+
+ public Cursor getAllCalcifiedPartTakings(String scientificSpeciesId) {
+ SQLiteDatabase db = getReadableDatabase();
+ Cursor cursor = db.query(CalcifiedPartTaking.TABLE_NAME, CalcifiedPartTaking.ALL_COLUMNS,
+ CalcifiedPartTaking.COLUMN_SCIENTIFIC_SPECIES_ID + " = ?", new String[]{ scientificSpeciesId },
+ null, null, CalcifiedPartTaking.COLUMN_START_SIZE + " ASC");
+ return cursor;
+ }
+
+ public void clearCalcifiedPartTakings() {
+ SQLiteDatabase db = getWritableDatabase();
+ db.delete(CalcifiedPartTaking.TABLE_NAME, null, null);
+ }
+
// Referentials
public Cursor getAllRefAges() {
Modified: trunk/src/fr/ifremer/wlo/utils/filechooser/FileDialog.java
===================================================================
--- trunk/src/fr/ifremer/wlo/utils/filechooser/FileDialog.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/utils/filechooser/FileDialog.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -88,7 +88,7 @@
/**
* Parametro de entrada da Activity: tipo de selecao: pode criar novos paths
* ou nao. Padrao: nao permite.
- *
+ *
* @see {@link SelectionMode}
*/
public static final String SELECTION_MODE = "SELECTION_MODE";
@@ -224,7 +224,7 @@
/**
* Monta a estrutura de arquivos e diretorios filhos do diretorio fornecido.
- *
+ *
* @param dirPath
* Diretorio pai.
*/
@@ -385,7 +385,7 @@
/**
* Define se o botao de CREATE e visivel.
- *
+ *
* @param v
*/
private void setCreateVisible(View v) {
@@ -398,7 +398,7 @@
/**
* Define se o botao de SELECT e visivel.
- *
+ *
* @param v
*/
private void setSelectVisible(View v) {
1
0
See <http://ci.codelutin.com/jenkins/job/wlo-ci/7/changes>
Changes:
[kmorin] fixes #4207 Retour sur le mauvais écran après un "back" depuis les observations
------------------------------------------
Started by an SCM change
Building in workspace <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/>
Updating https://forge.codelutin.com/svn/wlo/trunk at revision '2014-02-19T15:20:40.114 +0100'
U AndroidManifest.xml
U src/fr/ifremer/wlo/MainActivity.java
U src/fr/ifremer/wlo/VesselFormActivity.java
U src/fr/ifremer/wlo/measurement/MeasurementActivity.java
U src/fr/ifremer/wlo/BigFinCommunicationService.java
U src/fr/ifremer/wlo/WloBaseActivity.java
U src/fr/ifremer/wlo/LocationFormActivity.java
U src/fr/ifremer/wlo/ScientificSpeciesActivity.java
U src/fr/ifremer/wlo/WloModelEditionActivity.java
U src/fr/ifremer/wlo/ContextFormActivity.java
U src/fr/ifremer/wlo/MetierFormActivity.java
U src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java
U src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java
U res/drawable/weight.png
D res/layout/main.xml
A res/layout/main.xml
At revision 52
Parsing POMs
[trunk] $ /opt/jdk7/bin/java -Dsettings.security=/var/local/forge/data/codelutin.com/maven/settings-security.xml -Djava.awt.headless=true -cp /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.4.jar:/opt/maven3/boot/plexus-classworlds-2.5.1.jar:/opt/maven3/conf/logging jenkins.maven3.agent.Maven31Main /opt/maven3 /var/local/forge/exec/tomcat-codelutin.com/webapps/jenkins/WEB-INF/lib/remoting-2.33.jar /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.4.jar /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.4.jar 53438
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/pom.xml> -s /var/local/forge/data/codelutin.com/maven/settings.xml -e -U clean verify
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WLO 0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wlo ---
[INFO] Deleting <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ wlo ---
[INFO]
[INFO] --- android-maven-plugin:3.8.2:generate-sources (default-generate-sources) @ wlo ---
[DEBUG] Expanding: /var/local/forge/data/codelutin.com/maven/repository/android/support/compatibility-v7-appcompat/19.0.1/compatibility-v7-appcompat-19.0.1.apklib into <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/unpacked-libs/an…>
[DEBUG] expand complete
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] Manifest merging disabled. Using project manifest only
[INFO] /opt/android/build-tools/android-4.4/aapt [package, -f, --no-crunch, -I, /opt/android/platforms/android-15/android.jar, -M, <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/AndroidManifest.xml,> -S, <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/res,> -S, <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/unpacked-libs/an…,> -A, <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…,> -m, -J, <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…,> --output-text-symbols, <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target,> --auto-add-overlay]
[INFO] <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/res/layout/main.xml>:13: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/wlo_ico_transparent').
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException:
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:593)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk> && /opt/android/build-tools/android-4.4/aapt package -f --no-crunch -I /opt/android/platforms/android-15/android.jar -M <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/AndroidManifest.xml> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/res> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/unpacked-libs/an…> -A <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…> -m -J <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…> --output-text-symbols <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target> --auto-add-overlay, Result = 1
at com.jayway.maven.plugins.android.CommandExecutor$Factory$DefaultCommandExecutor.executeCommand(CommandExecutor.java:246)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:589)
... 33 more
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.713s
[INFO] Finished at: Wed Feb 19 15:20:47 CET 2014
[INFO] Final Memory: 20M/437M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project wlo: MojoExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk> && /opt/android/build-tools/android-4.4/aapt package -f --no-crunch -I /opt/android/platforms/android-15/android.jar -M <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/AndroidManifest.xml> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/res> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/unpacked-libs/an…> -A <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…> -m -J <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…> --output-text-symbols <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target> --auto-add-overlay, Result = 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project wlo:
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.MojoExecutionException:
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:593)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk> && /opt/android/build-tools/android-4.4/aapt package -f --no-crunch -I /opt/android/platforms/android-15/android.jar -M <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/AndroidManifest.xml> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/res> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/unpacked-libs/an…> -A <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…> -m -J <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…> --output-text-symbols <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target> --auto-add-overlay, Result = 1
at com.jayway.maven.plugins.android.CommandExecutor$Factory$DefaultCommandExecutor.executeCommand(CommandExecutor.java:246)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:589)
... 33 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Sending e-mails to: wlo-commits(a)list.forge.codelutin.com morin(a)codelutin.com
channel stopped
1
2
23 Feb '14
See <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/7/changes>
Changes:
[kmorin] fixes #4207 Retour sur le mauvais écran après un "back" depuis les observations
------------------------------------------
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/pom.xml> -s /var/local/forge/data/codelutin.com/maven/settings.xml -e -U clean verify
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WLO 0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wlo ---
[INFO] Deleting <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ wlo ---
[INFO]
[INFO] --- android-maven-plugin:3.8.2:generate-sources (default-generate-sources) @ wlo ---
[DEBUG] Expanding: /var/local/forge/data/codelutin.com/maven/repository/android/support/compatibility-v7-appcompat/19.0.1/compatibility-v7-appcompat-19.0.1.apklib into <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/unpacke…>
[DEBUG] expand complete
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] Manifest merging disabled. Using project manifest only
[INFO] /opt/android/build-tools/android-4.4/aapt [package, -f, --no-crunch, -I, /opt/android/platforms/android-15/android.jar, -M, <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/AndroidManifes…,> -S, <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/res,> -S, <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/unpacke…,> -A, <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/generat…,> -m, -J, <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/generat…,> --output-text-symbols, <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target,> --auto-add-overlay]
[INFO] <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/res/layout/mai…>:13: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/wlo_ico_transparent').
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException:
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:593)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/> && /opt/android/build-tools/android-4.4/aapt package -f --no-crunch -I /opt/android/platforms/android-15/android.jar -M <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/AndroidManifes…> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/res> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/unpacke…> -A <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/generat…> -m -J <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/generat…> --output-text-symbols <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target> --auto-add-overlay, Result = 1
at com.jayway.maven.plugins.android.CommandExecutor$Factory$DefaultCommandExecutor.executeCommand(CommandExecutor.java:246)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:589)
... 33 more
[JENKINS] Archiving disabled
1
2
Author: kmorin
Date: 2014-02-23 18:32:50 +0100 (Sun, 23 Feb 2014)
New Revision: 54
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/54
Log:
refs #4193 [EXPORT] ?\195?\137cran Export des donn?\195?\169es
Added:
trunk/res/drawable/wlo_ico_small.png
trunk/res/drawable/wlo_ico_transparent.png
Added: trunk/res/drawable/wlo_ico_small.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable/wlo_ico_small.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable/wlo_ico_transparent.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable/wlo_ico_transparent.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
r53 - in trunk: . res/layout src/fr/ifremer/wlo src/fr/ifremer/wlo/storage
by kmorin@users.forge.codelutin.com 23 Feb '14
by kmorin@users.forge.codelutin.com 23 Feb '14
23 Feb '14
Author: kmorin
Date: 2014-02-23 18:05:13 +0100 (Sun, 23 Feb 2014)
New Revision: 53
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/53
Log:
refs #4193 [EXPORT] ?\195?\137cran Export des donn?\195?\169es
Added:
trunk/src/fr/ifremer/wlo/storage/Exporter.java
Modified:
trunk/pom.xml
trunk/res/layout/main.xml
trunk/src/fr/ifremer/wlo/MainActivity.java
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-19 14:00:00 UTC (rev 52)
+++ trunk/pom.xml 2014-02-23 17:05:13 UTC (rev 53)
@@ -166,13 +166,6 @@
</dependency>
<dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gsonVersion}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
<groupId>org.achartengine</groupId>
<artifactId>achartengine</artifactId>
<version>1.1.0</version>
Modified: trunk/res/layout/main.xml
===================================================================
--- trunk/res/layout/main.xml 2014-02-19 14:00:00 UTC (rev 52)
+++ trunk/res/layout/main.xml 2014-02-23 17:05:13 UTC (rev 53)
@@ -30,7 +30,8 @@
android:onClick="openContexts"/>
<Button style="@style/MainButton"
- android:text="@string/main_export_data"/>
+ android:text="@string/main_export_data"
+ android:onClick="export"/>
<Button style="@style/MainButton"
android:id="@+id/main_connect_ichtyometer_button"
Modified: trunk/src/fr/ifremer/wlo/MainActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-19 14:00:00 UTC (rev 52)
+++ trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-23 17:05:13 UTC (rev 53)
@@ -29,7 +29,9 @@
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.content.res.Configuration;
+import android.database.Cursor;
import android.os.Bundle;
+import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
@@ -40,13 +42,22 @@
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;
+import fr.ifremer.wlo.models.ContextModel;
import fr.ifremer.wlo.models.referentials.imports.ImportUtil;
import fr.ifremer.wlo.preferences.SettingsActivity;
import fr.ifremer.wlo.storage.DataCache;
+import fr.ifremer.wlo.storage.Exporter;
import fr.ifremer.wlo.storage.WloSqlOpenHelper;
import fr.ifremer.wlo.utils.BigFinFeedReaderRecord;
+import fr.ifremer.wlo.utils.filechooser.FileDialog;
+import fr.ifremer.wlo.utils.filechooser.SelectionMode;
+import org.apache.commons.io.FileUtils;
+import org.json.JSONException;
+import org.json.JSONObject;
+import java.io.File;
import java.io.IOException;
+import java.util.Date;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -58,6 +69,7 @@
protected static final int REQUEST_ENABLE_BT = 1;
protected static final int REQUEST_CONNECT_ICHTYOMETER = 2;
+ protected static final int REQUEST_SELECT_EXPORT_FOLDER = 3;
// Local Bluetooth adapter
protected BluetoothAdapter mBluetoothAdapter = null;
@@ -215,6 +227,47 @@
setOrientation(newConfig.orientation);
}
+ public void openContexts(View source) {
+ startActivity(new Intent(this, ContextsActivity.class));
+ }
+
+ public void connectIchtyometer(View source) {
+ // If BT is not on, request that it be enabled.
+ if (!mBluetoothAdapter.isEnabled()) {
+ Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
+ startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
+
+ } else {
+ selectDevice();
+ }
+ }
+
+ public void disconnectIchtyometer(View source) {
+ Message message = Message.obtain(null, BigFinCommunicationService.MESSAGE_DISCONNECT_DEVICE);
+ try {
+ mServiceMessenger.send(message);
+
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error while sending data to the service");
+ }
+ }
+
+ public void openSettings(View source) {
+ startActivity(new Intent(this, SettingsActivity.class));
+ }
+
+ public void export(View source) {
+ Intent intent = new Intent(this, FileDialog.class); //Intent to start openIntents File Manager
+ intent.putExtra(FileDialog.START_PATH, "/sdcard");
+ intent.putExtra(FileDialog.CAN_SELECT_DIR, true);
+ intent.putExtra(FileDialog.SELECTION_MODE, SelectionMode.MODE_OPEN);
+
+ //alternatively you can set file filter
+ intent.putExtra(FileDialog.FORMAT_FILTER, new String[] { "json" });
+
+ startActivityForResult(intent, REQUEST_SELECT_EXPORT_FOLDER);
+ }
+
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
@@ -239,6 +292,24 @@
}
break;
+ case REQUEST_SELECT_EXPORT_FOLDER:
+ if (resultCode == Activity.RESULT_OK) {
+ try {
+ String jsonData = Exporter.exportData(this);
+
+ File selectedFile = new File(data.getStringExtra(FileDialog.RESULT_PATH));
+ if (selectedFile.isFile()) {
+ selectedFile = selectedFile.getParentFile();
+ }
+ String date = String.format("-%1$tY%1$tm%1$td-%1$tH%1$tM%1$tS", new Date());
+ File file = new File(selectedFile, "export" + date + ".json");
+ FileUtils.write(file, jsonData);
+
+ } catch (JSONException | IOException e) {
+ Log.e(TAG, "error while exporting to JSON", e);
+ }
+ }
+ break;
}
}
@@ -248,20 +319,20 @@
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
logoParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
- LinearLayout.LayoutParams.MATCH_PARENT);
+ LinearLayout.LayoutParams.MATCH_PARENT);
logoParams.weight = 1.0f;
buttonParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
- LinearLayout.LayoutParams.MATCH_PARENT);
+ LinearLayout.LayoutParams.MATCH_PARENT);
buttonParams.weight = 1.0f;
} else {
logoParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
- LinearLayout.LayoutParams.WRAP_CONTENT);
+ LinearLayout.LayoutParams.WRAP_CONTENT);
logoParams.weight = 1.0f;
buttonParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
- LinearLayout.LayoutParams.WRAP_CONTENT);
+ LinearLayout.LayoutParams.WRAP_CONTENT);
buttonParams.weight = 0.0f;
}
logoPanel.setLayoutParams(logoParams);
@@ -269,35 +340,6 @@
mainPanel.setOrientation(orientation);
}
- public void openContexts(View source) {
- startActivity(new Intent(this, ContextsActivity.class));
- }
-
- public void connectIchtyometer(View source) {
- // If BT is not on, request that it be enabled.
- if (!mBluetoothAdapter.isEnabled()) {
- Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
- startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
-
- } else {
- selectDevice();
- }
- }
-
- public void disconnectIchtyometer(View source) {
- Message message = Message.obtain(null, BigFinCommunicationService.MESSAGE_DISCONNECT_DEVICE);
- try {
- mServiceMessenger.send(message);
-
- } catch (RemoteException e) {
- Log.e(TAG, "Error while sending data to the service");
- }
- }
-
- public void openSettings(View source) {
- startActivity(new Intent(this, SettingsActivity.class));
- }
-
protected void selectDevice() {
// Launch the DeviceListActivity to see devices and do scan
Intent serverIntent = new Intent(this, DeviceListActivity.class);
Added: trunk/src/fr/ifremer/wlo/storage/Exporter.java
===================================================================
--- trunk/src/fr/ifremer/wlo/storage/Exporter.java (rev 0)
+++ trunk/src/fr/ifremer/wlo/storage/Exporter.java 2014-02-23 17:05:13 UTC (rev 53)
@@ -0,0 +1,392 @@
+package fr.ifremer.wlo.storage;
+
+import android.content.Context;
+import android.database.Cursor;
+import com.google.common.base.Function;
+import com.google.common.base.Preconditions;
+import fr.ifremer.wlo.models.*;
+import fr.ifremer.wlo.models.referentials.*;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public class Exporter {
+
+ public static final SimpleDateFormat UTC_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSZ");
+
+ public static String exportData(Context context) throws JSONException {
+ WloSqlOpenHelper soh = new WloSqlOpenHelper(context);
+ JSONArray root = new JSONArray();
+ try {
+
+ Cursor cursor = soh.getAllContexts();
+ List<ContextModel> contexts = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, ContextModel>() {
+ @Override
+ public ContextModel apply(Cursor input) {
+ return new ContextModel(input);
+ }
+ });
+ for (ContextModel contextModel : contexts) {
+ JSONObject jsonContext = createJSONContextModel(contextModel, context, soh);
+ root.put(jsonContext);
+ }
+
+ } finally {
+ soh.close();
+ }
+ return root.toString(2);
+ }
+
+ public static JSONObject createJSONContextModel(ContextModel model,
+ final Context context,
+ WloSqlOpenHelper soh) throws JSONException {
+ Preconditions.checkNotNull(model);
+ Preconditions.checkNotNull(soh);
+
+ JSONObject jsonContext = new JSONObject();
+ jsonContext.put("contexte", model.getName());
+ jsonContext.put("commentaire", model.getComment());
+
+ Cursor cursor = soh.getAllLocations(model.getId());
+ List<LocationModel> locations = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, LocationModel>() {
+ @Override
+ public LocationModel apply(Cursor input) {
+ return new LocationModel(context, input);
+ }
+ });
+ JSONArray jsonLocations = new JSONArray();
+ for (LocationModel location : locations) {
+ JSONObject jsonLocation = createJSONLocationModel(location, context, soh);
+ jsonLocations.put(jsonLocation);
+ }
+ jsonContext.put("lieux", jsonLocations);
+ cursor.close();
+
+ return jsonContext;
+ }
+
+ public static JSONObject createJSONLocationModel(LocationModel model,
+ final Context context,
+ WloSqlOpenHelper soh) throws JSONException {
+ Preconditions.checkNotNull(model);
+ Preconditions.checkNotNull(soh);
+
+ JSONObject jsonLocation = new JSONObject();
+
+ jsonLocation.put("lieu", createJSONLocation(model.getLocation()));
+ if (model.getStartDate() != null) {
+ jsonLocation.put("date-début", UTC_DATE_FORMAT.format(model.getStartDate().getTime()));
+ }
+ if (model.getEndDate() != null) {
+ jsonLocation.put("date-fin", UTC_DATE_FORMAT.format(model.getEndDate().getTime()));
+ }
+ jsonLocation.put("observateur", model.getOperator());
+ jsonLocation.put("commentaire", model.getComment());
+
+ Cursor cursor = soh.getAllVessels(model.getId());
+ List<VesselModel> vessels = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, VesselModel>() {
+ @Override
+ public VesselModel apply(Cursor input) {
+ return new VesselModel(context, input);
+ }
+ });
+ JSONArray jsonVessels = new JSONArray();
+ for (VesselModel vessel : vessels) {
+ JSONObject jsonVessel = createJSONVesselModel(vessel, context, soh);
+ jsonVessels.put(jsonVessel);
+ }
+ jsonLocation.put("navires", jsonVessels);
+ cursor.close();
+
+ return jsonLocation;
+ }
+
+ public static JSONObject createJSONVesselModel(VesselModel model,
+ final Context context,
+ WloSqlOpenHelper soh) throws JSONException {
+ Preconditions.checkNotNull(model);
+ Preconditions.checkNotNull(soh);
+
+ JSONObject jsonVessel = new JSONObject();
+
+ jsonVessel.put("immatriculation", model.getRegistrationNumber());
+ jsonVessel.put("nom", model.getRegistrationNumber());
+ if (model.getLandingDate() != null) {
+ jsonVessel.put("date-débarquement", UTC_DATE_FORMAT.format(model.getLandingDate().getTime()));
+ }
+ jsonVessel.put("lieu-débarquement", createJSONLocation(model.getLandingLocation()));
+ jsonVessel.put("commentaire", model.getComment());
+
+ Cursor cursor = soh.getAllMetiers(model.getId());
+ List<MetierModel> metiers = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, MetierModel>() {
+ @Override
+ public MetierModel apply(Cursor input) {
+ return new MetierModel(context, input);
+ }
+ });
+ JSONArray jsonMetiers = new JSONArray();
+ for (MetierModel metier : metiers) {
+ JSONObject jsonMetier = createJSONMetierModel(metier, context, soh);
+ jsonMetiers.put(jsonMetier);
+ }
+ jsonVessel.put("métiers", jsonMetiers);
+ cursor.close();
+
+ return jsonVessel;
+ }
+
+ public static JSONObject createJSONMetierModel(MetierModel model,
+ final Context context,
+ WloSqlOpenHelper soh) throws JSONException {
+ Preconditions.checkNotNull(model);
+ Preconditions.checkNotNull(soh);
+
+ JSONObject jsonMetier = new JSONObject();
+
+ jsonMetier.put("engin-espèce", createJSONMetier(model.getGearSpecies()));
+ jsonMetier.put("secteur", model.getZone());
+ jsonMetier.put("référence-plan", model.getSampleRowCode());
+ jsonMetier.put("commentaire", model.getComment());
+
+ Cursor cursor = soh.getAllCommercialSpecies(model.getId());
+ List<CommercialSpeciesModel> commercialSpecies = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, CommercialSpeciesModel>() {
+ @Override
+ public CommercialSpeciesModel apply(Cursor input) {
+ return new CommercialSpeciesModel(context, input);
+ }
+ });
+ JSONArray jsonCommercialSpeciesArray = new JSONArray();
+ for (CommercialSpeciesModel commercialSpeciesModel : commercialSpecies) {
+ JSONObject jsonCommercialSpecies = createJSONComercialSpeciesModel(commercialSpeciesModel, context, soh);
+ jsonCommercialSpeciesArray.put(jsonCommercialSpecies);
+ }
+ jsonMetier.put("espèces-fao", jsonCommercialSpeciesArray);
+ cursor.close();
+
+ return jsonMetier;
+ }
+
+ public static JSONObject createJSONComercialSpeciesModel(CommercialSpeciesModel model,
+ final Context context,
+ WloSqlOpenHelper soh) throws JSONException {
+ Preconditions.checkNotNull(model);
+ Preconditions.checkNotNull(soh);
+
+ JSONObject jsonCommercialSpecies = new JSONObject();
+
+ jsonCommercialSpecies.put("espèce-fao", createJSONCommercialSpecies(model.getFaoCode()));
+ jsonCommercialSpecies.put("méthode-mensuration", createJSONMensuration(model.getMeasurementMethod()));
+ jsonCommercialSpecies.put("état", createJSONState(model.getState()));
+ jsonCommercialSpecies.put("présentation", createJSONPresentation(model.getPresentation()));
+ jsonCommercialSpecies.put("précision", model.getPrecision().getValue());
+ jsonCommercialSpecies.put("mélange-espèces", model.isSpeciesMix());
+ jsonCommercialSpecies.put("catégorie-tri", model.getSortCategory());
+ jsonCommercialSpecies.put("poids-total-déchargé", model.getTotalUnloadedWeight());
+ jsonCommercialSpecies.put("commentaire", model.getComment());
+
+ Cursor cursor = soh.getAllScientificSpecies(model.getId());
+ List<ScientificSpeciesModel> scientificSpecies = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, ScientificSpeciesModel>() {
+ @Override
+ public ScientificSpeciesModel apply(Cursor input) {
+ return new ScientificSpeciesModel(context, input);
+ }
+ });
+ JSONArray jsonScientificSpeciesArray = new JSONArray();
+ for (ScientificSpeciesModel scientificSpeciesModel : scientificSpecies) {
+ JSONObject jsonScientificSpecies = createJSONScientificSpeciesModel(scientificSpeciesModel, context, soh);
+ jsonScientificSpeciesArray.put(jsonScientificSpecies);
+ }
+ jsonCommercialSpecies.put("espèces-scientifiques", jsonScientificSpeciesArray);
+ cursor.close();
+
+ return jsonCommercialSpecies;
+ }
+
+ public static JSONObject createJSONScientificSpeciesModel(ScientificSpeciesModel model,
+ final Context context,
+ WloSqlOpenHelper soh) throws JSONException {
+ Preconditions.checkNotNull(model);
+ Preconditions.checkNotNull(soh);
+
+ JSONObject jsonScientificSpeciesModel = new JSONObject();
+ jsonScientificSpeciesModel.put("espèce-scientifique", createJSONScientificSpecies(model.getName()));
+ jsonScientificSpeciesModel.put("prélèvement-pièces-calcifiées", model.isTakingActivation());
+ jsonScientificSpeciesModel.put("commentaire", model.getComment());
+ jsonScientificSpeciesModel.put("poids-trié", model.getSortedWeight());
+ jsonScientificSpeciesModel.put("poids-échantillon", model.getSampleWeight());
+
+ Cursor cursor = soh.getAllMeasurements(model.getId());
+ List<MeasurementModel> measurements = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, MeasurementModel>() {
+ @Override
+ public MeasurementModel apply(Cursor input) {
+ return new MeasurementModel(input);
+ }
+ });
+ JSONArray jsonMeasurements = new JSONArray();
+ for (MeasurementModel measurement : measurements) {
+ JSONObject jsonMeasurement = createJSONMeasurementModel(measurement, context);
+ jsonMeasurements.put(jsonMeasurement);
+ }
+ jsonScientificSpeciesModel.put("observations", jsonMeasurements);
+ cursor.close();
+
+ cursor = soh.getAllCategoryWeigths(model.getId());
+ List<CategoryWeightModel> categoryWeights = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, CategoryWeightModel>() {
+ @Override
+ public CategoryWeightModel apply(Cursor input) {
+ return new CategoryWeightModel(input);
+ }
+ });
+ JSONArray jsonCategoryWeightModels = new JSONArray();
+ for (CategoryWeightModel categoryWeight : categoryWeights) {
+ JSONObject jsonCategoryWeightModel = createJSONCategoryWeightModel(categoryWeight, context);
+ jsonCategoryWeightModels.put(jsonCategoryWeightModel);
+ }
+ jsonScientificSpeciesModel.put("poids-par-categorie", jsonCategoryWeightModels);
+ cursor.close();
+
+ return jsonScientificSpeciesModel;
+ }
+
+ public static JSONObject createJSONMeasurementModel(MeasurementModel model,
+ final Context context) throws JSONException {
+ Preconditions.checkNotNull(model);
+
+ JSONObject jsonMeasurementModel = new JSONObject();
+ jsonMeasurementModel.put("sexe", createJSONGender(DataCache.getGenderById(context, model.getCategory1())));
+ Maturity maturity = DataCache.getMaturityById(context, model.getCategory2());
+ if (maturity != null) {
+ jsonMeasurementModel.put("maturité", maturity.getLabel());
+ }
+ Age age = DataCache.getAgeById(context, model.getCategory3());
+ if (age != null) {
+ jsonMeasurementModel.put("âge", age.getLabel());
+ }
+ jsonMeasurementModel.put("taille", model.getSize());
+ jsonMeasurementModel.put("date", UTC_DATE_FORMAT.format(model.getDate().getTime()));
+
+ return jsonMeasurementModel;
+ }
+
+ public static JSONObject createJSONCategoryWeightModel(CategoryWeightModel model,
+ final Context context) throws JSONException {
+ Preconditions.checkNotNull(model);
+
+ JSONObject jsonCategoryWeightModel = new JSONObject();
+ jsonCategoryWeightModel.put("sexe", createJSONGender(DataCache.getGenderById(context, model.getCategory1())));
+ Maturity maturity = DataCache.getMaturityById(context, model.getCategory2());
+ if (maturity != null) {
+ jsonCategoryWeightModel.put("maturité", maturity.getLabel());
+ }
+ Age age = DataCache.getAgeById(context, model.getCategory3());
+ if (age != null) {
+ jsonCategoryWeightModel.put("âge", age.getLabel());
+ }
+ jsonCategoryWeightModel.put("poids", model.getWeight());
+
+ return jsonCategoryWeightModel;
+ }
+
+ public static JSONObject createJSONLocation(Location location) throws JSONException {
+ if (location == null) {
+ return null;
+ }
+ JSONObject jsonLocation = new JSONObject();
+ jsonLocation.put("type", location.getTypeLabel());
+ jsonLocation.put("code", location.getCode());
+ jsonLocation.put("libellé", location.getLabel());
+ return jsonLocation;
+ }
+
+ public static JSONObject createJSONMetier(Metier metier) throws JSONException {
+ if (metier == null) {
+ return null;
+ }
+ JSONObject jsonMetier = new JSONObject();
+ jsonMetier.put("id", metier.getId());
+ jsonMetier.put("code", metier.getCode());
+ jsonMetier.put("libellé", metier.getLabel());
+ jsonMetier.put("engin-code", metier.getGearCode());
+ jsonMetier.put("engin-libellé", metier.getGearLabel());
+ jsonMetier.put("espece-code", metier.getSpeciesCode());
+ jsonMetier.put("espece-libellé", metier.getSpeciesLabel());
+ jsonMetier.put("pêche", metier.getFishing());
+ jsonMetier.put("actif", metier.getActive());
+ return jsonMetier;
+ }
+
+ public static JSONObject createJSONCommercialSpecies(CommercialSpecies commercialSpecies) throws JSONException {
+ if (commercialSpecies == null) {
+ return null;
+ }
+ JSONObject jsonCommercialSpecies = new JSONObject();
+ jsonCommercialSpecies.put("code", commercialSpecies.getCode());
+ jsonCommercialSpecies.put("isscap", commercialSpecies.getIsscap());
+ jsonCommercialSpecies.put("code-taxon", commercialSpecies.getTaxonCode());
+ jsonCommercialSpecies.put("libellé-scientifique", commercialSpecies.getScientificLabel());
+ jsonCommercialSpecies.put("libellé-français", commercialSpecies.getFrenchLabel());
+ jsonCommercialSpecies.put("famille", commercialSpecies.getFamily());
+ jsonCommercialSpecies.put("ordre", commercialSpecies.getSpeciesOrder());
+ jsonCommercialSpecies.put("actif", commercialSpecies.getActive());
+ return jsonCommercialSpecies;
+ }
+
+ public static JSONObject createJSONMensuration(Mensuration mensuration) throws JSONException {
+ if (mensuration == null) {
+ return null;
+ }
+ JSONObject jsonMensuration = new JSONObject();
+ jsonMensuration.put("code", mensuration.getCode());
+ jsonMensuration.put("libellé", mensuration.getLabel());
+ return jsonMensuration;
+ }
+
+ public static JSONObject createJSONState(State state) throws JSONException {
+ if (state == null) {
+ return null;
+ }
+ JSONObject jsonState = new JSONObject();
+ jsonState.put("code", state.getCode());
+ jsonState.put("libellé", state.getLabel());
+ return jsonState;
+ }
+
+ public static JSONObject createJSONPresentation(Presentation presentation) throws JSONException {
+ if (presentation == null) {
+ return null;
+ }
+ JSONObject jsonPresentation = new JSONObject();
+ jsonPresentation.put("code", presentation.getCode());
+ jsonPresentation.put("libellé", presentation.getLabel());
+ return jsonPresentation;
+ }
+
+ public static JSONObject createJSONScientificSpecies(ScientificSpecies scientificSpecies) throws JSONException {
+ if (scientificSpecies == null) {
+ return null;
+ }
+ JSONObject jsonScientificSpecies = new JSONObject();
+ jsonScientificSpecies.put("code", scientificSpecies.getCode());
+ jsonScientificSpecies.put("libellé", scientificSpecies.getLabel());
+ jsonScientificSpecies.put("perm-code", scientificSpecies.getPermCode());
+ return jsonScientificSpecies;
+ }
+
+ public static JSONObject createJSONGender(Gender gender) throws JSONException {
+ if (gender == null) {
+ return null;
+ }
+ JSONObject jsonGender = new JSONObject();
+ jsonGender.put("code", gender.getCode());
+ jsonGender.put("libellé", gender.getLabel());
+ return jsonGender;
+ }
+
+}
\ No newline at end of file
1
0
r52 - in trunk: . res/drawable res/layout src/fr/ifremer/wlo src/fr/ifremer/wlo/measurement
by kmorin@users.forge.codelutin.com 19 Feb '14
by kmorin@users.forge.codelutin.com 19 Feb '14
19 Feb '14
Author: kmorin
Date: 2014-02-19 15:00:00 +0100 (Wed, 19 Feb 2014)
New Revision: 52
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/52
Log:
fixes #4207 Retour sur le mauvais ?\195?\169cran apr?\195?\168s un "back" depuis les observations
Added:
trunk/res/layout/main.xml
Removed:
trunk/res/layout/main.xml
Modified:
trunk/AndroidManifest.xml
trunk/res/drawable/weight.png
trunk/src/fr/ifremer/wlo/BigFinCommunicationService.java
trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java
trunk/src/fr/ifremer/wlo/ContextFormActivity.java
trunk/src/fr/ifremer/wlo/LocationFormActivity.java
trunk/src/fr/ifremer/wlo/MainActivity.java
trunk/src/fr/ifremer/wlo/MetierFormActivity.java
trunk/src/fr/ifremer/wlo/ScientificSpeciesActivity.java
trunk/src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java
trunk/src/fr/ifremer/wlo/VesselFormActivity.java
trunk/src/fr/ifremer/wlo/WloBaseActivity.java
trunk/src/fr/ifremer/wlo/WloModelEditionActivity.java
trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
Modified: trunk/AndroidManifest.xml
===================================================================
--- trunk/AndroidManifest.xml 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/AndroidManifest.xml 2014-02-19 14:00:00 UTC (rev 52)
@@ -26,7 +26,7 @@
<uses-permission android:name="android.permission.VIBRATE"/>
<application android:label="@string/app_name"
- android:icon="@drawable/wlo_ico"
+ android:icon="@drawable/wlo_ico_small"
android:theme="@style/Theme.AppCompat">
<service android:name=".BigFinCommunicationService" />
Modified: trunk/res/drawable/weight.png
===================================================================
(Binary files differ)
Deleted: trunk/res/layout/main.xml
===================================================================
--- trunk/res/layout/main.xml 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/res/layout/main.xml 2014-02-19 14:00:00 UTC (rev 52)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <ImageView android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:src="@drawable/wlo_ico"
- android:layout_weight="1"/>
-
- <TextView style="@style/MainTitle"
- android:text="@string/app_name"
- android:layout_weight="1"/>
-
- <Button style="@style/MainButton"
- android:text="@string/main_open_contexts"
- android:onClick="openContexts"/>
-
- <Button style="@style/MainButton"
- android:text="@string/main_export_data"/>
-
- <Button style="@style/MainButton"
- android:id="@+id/main_connect_ichtyometer_button"
- android:text="@string/main_connect_ichtyometer"
- android:onClick="connectIchtyometer"/>
-
- <Button style="@style/MainButton"
- android:id="@+id/main_disconnect_ichtyometer_button"
- android:text="@string/main_disconnect_ichtyometer"
- android:onClick="disconnectIchtyometer"/>
-
- <Button style="@style/MainButton"
- android:text="@string/main_settings"
- android:onClick="openSettings"/>
-
-</LinearLayout>
\ No newline at end of file
Added: trunk/res/layout/main.xml
===================================================================
--- trunk/res/layout/main.xml (rev 0)
+++ trunk/res/layout/main.xml 2014-02-19 14:00:00 UTC (rev 52)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/main_panel"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout android:id="@+id/logo_panel"
+ android:orientation="vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <ImageView android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:src="@drawable/wlo_ico_transparent"/>
+
+ <TextView style="@style/MainTitle"
+ android:text="@string/app_name"/>
+
+ </LinearLayout>
+
+ <LinearLayout android:id="@+id/button_panel"
+ android:orientation="vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center">
+
+ <Button style="@style/MainButton"
+ android:text="@string/main_open_contexts"
+ android:onClick="openContexts"/>
+
+ <Button style="@style/MainButton"
+ android:text="@string/main_export_data"/>
+
+ <Button style="@style/MainButton"
+ android:id="@+id/main_connect_ichtyometer_button"
+ android:text="@string/main_connect_ichtyometer"
+ android:onClick="connectIchtyometer"/>
+
+ <Button style="@style/MainButton"
+ android:id="@+id/main_disconnect_ichtyometer_button"
+ android:text="@string/main_disconnect_ichtyometer"
+ android:onClick="disconnectIchtyometer"/>
+
+ <Button style="@style/MainButton"
+ android:text="@string/main_settings"
+ android:onClick="openSettings"/>
+
+ </LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
Modified: trunk/src/fr/ifremer/wlo/BigFinCommunicationService.java
===================================================================
--- trunk/src/fr/ifremer/wlo/BigFinCommunicationService.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/BigFinCommunicationService.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -130,7 +130,8 @@
setState(STATE_NONE);
notificationBuilder = new NotificationCompat.Builder(this)
- .setSmallIcon(R.drawable.wlo_ico);
+ .setSmallIcon(R.drawable.wlo_ico_small)
+ .setContentIntent(PendingIntent.getActivity(this, -1, new Intent(this, MainActivity.class), PendingIntent.FLAG_CANCEL_CURRENT));
updateNotification(false);
Modified: trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -78,6 +78,11 @@
}
@Override
+ protected Class<? extends WloBaseListActivity> getNextListActivity() {
+ return ScientificSpeciesActivity.class;
+ }
+
+ @Override
protected CommercialSpeciesModel createNewModel() {
return new CommercialSpeciesModel();
}
Modified: trunk/src/fr/ifremer/wlo/ContextFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/ContextFormActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/ContextFormActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -52,6 +52,11 @@
}
@Override
+ protected Class<? extends WloBaseListActivity> getNextListActivity() {
+ return LocationsActivity.class;
+ }
+
+ @Override
protected ContextModel createNewModel() {
return new ContextModel();
}
Modified: trunk/src/fr/ifremer/wlo/LocationFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/LocationFormActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/LocationFormActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -67,6 +67,11 @@
}
@Override
+ protected Class<? extends WloBaseListActivity> getNextListActivity() {
+ return VesselsActivity.class;
+ }
+
+ @Override
protected LocationModel createNewModel() {
return new LocationModel();
}
Modified: trunk/src/fr/ifremer/wlo/MainActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -28,6 +28,7 @@
import android.app.ProgressDialog;
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
+import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@@ -35,7 +36,9 @@
import android.os.RemoteException;
import android.util.Log;
import android.view.View;
+import android.view.ViewGroup;
import android.widget.Button;
+import android.widget.LinearLayout;
import android.widget.Toast;
import fr.ifremer.wlo.models.referentials.imports.ImportUtil;
import fr.ifremer.wlo.preferences.SettingsActivity;
@@ -59,6 +62,10 @@
// Local Bluetooth adapter
protected BluetoothAdapter mBluetoothAdapter = null;
+ protected LinearLayout mainPanel;
+ protected LinearLayout logoPanel;
+ protected LinearLayout buttonPanel;
+
protected Button connectButton;
protected Button disconnectButton;
protected ProgressDialog dialog;
@@ -94,6 +101,10 @@
super.onCreate(savedInstanceState);
+ mainPanel = (LinearLayout) findViewById(R.id.main_panel);
+ logoPanel = (LinearLayout) findViewById(R.id.logo_panel);
+ buttonPanel = (LinearLayout) findViewById(R.id.button_panel);
+
// Get local Bluetooth adapter
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
@@ -106,6 +117,9 @@
disconnectButton = (Button) findViewById(R.id.main_disconnect_ichtyometer_button);
bigfinDisconnected();
+ Configuration config = getResources().getConfiguration();
+ setOrientation(config.orientation);
+
dialog = new ProgressDialog(this);
dialog.setIndeterminate(false);
dialog.setCancelable(false);
@@ -196,6 +210,12 @@
}
@Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ setOrientation(newConfig.orientation);
+ }
+
+ @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
@@ -223,6 +243,32 @@
}
+ protected void setOrientation(int orientation) {
+ LinearLayout.LayoutParams logoParams, buttonParams;
+
+ if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ logoParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
+ LinearLayout.LayoutParams.MATCH_PARENT);
+ logoParams.weight = 1.0f;
+
+ buttonParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
+ LinearLayout.LayoutParams.MATCH_PARENT);
+ buttonParams.weight = 1.0f;
+
+ } else {
+ logoParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
+ LinearLayout.LayoutParams.WRAP_CONTENT);
+ logoParams.weight = 1.0f;
+
+ buttonParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
+ LinearLayout.LayoutParams.WRAP_CONTENT);
+ buttonParams.weight = 0.0f;
+ }
+ logoPanel.setLayoutParams(logoParams);
+ buttonPanel.setLayoutParams(buttonParams);
+ mainPanel.setOrientation(orientation);
+ }
+
public void openContexts(View source) {
startActivity(new Intent(this, ContextsActivity.class));
}
Modified: trunk/src/fr/ifremer/wlo/MetierFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/MetierFormActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/MetierFormActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -59,6 +59,11 @@
}
@Override
+ protected Class<? extends WloBaseListActivity> getNextListActivity() {
+ return CommercialSpeciesActivity.class;
+ }
+
+ @Override
protected MetierModel createNewModel() {
return new MetierModel();
}
Modified: trunk/src/fr/ifremer/wlo/ScientificSpeciesActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/ScientificSpeciesActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/ScientificSpeciesActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -60,7 +60,7 @@
public boolean onCreateOptionsMenu(Menu menu) {
CommercialSpeciesModel parent = (CommercialSpeciesModel) parentModel;
MenuInflater inflater = getMenuInflater();
- if (parent.isSpeciesMix() || adapter.getCount() == 0) {
+ if (parent != null && parent.isSpeciesMix() || adapter.getCount() == 0) {
inflater.inflate(R.menu.model_list_menu, menu);
}
inflater.inflate(R.menu.weight_menu, menu);
Modified: trunk/src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -72,6 +72,11 @@
}
@Override
+ protected Class<? extends WloBaseListActivity> getNextListActivity() {
+ return null;
+ }
+
+ @Override
protected ScientificSpeciesModel createNewModel() {
return new ScientificSpeciesModel();
}
Modified: trunk/src/fr/ifremer/wlo/VesselFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/VesselFormActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/VesselFormActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -74,6 +74,11 @@
}
@Override
+ protected Class<? extends WloBaseListActivity> getNextListActivity() {
+ return MetiersActivity.class;
+ }
+
+ @Override
protected VesselModel createNewModel() {
return new VesselModel();
}
Modified: trunk/src/fr/ifremer/wlo/WloBaseActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/WloBaseActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/WloBaseActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -59,7 +59,7 @@
}
ActionBar actionBar = getSupportActionBar();
- actionBar.setDisplayHomeAsUpEnabled(true);
+ actionBar.setDisplayHomeAsUpEnabled(getUpActivity() != null);
bindService(new Intent(this, BigFinCommunicationService.class), this, Context.BIND_AUTO_CREATE);
}
@@ -123,7 +123,7 @@
public Intent getSupportParentActivityIntent() {
Class upClass = getUpActivity();
if (upClass == null) {
- return null;
+ return super.getSupportParentActivityIntent();
}
Intent intent = new Intent(this, upClass);
return intent;
Modified: trunk/src/fr/ifremer/wlo/WloModelEditionActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/WloModelEditionActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/WloModelEditionActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -71,6 +71,8 @@
protected abstract Class<? extends WloModelEditionActivity> getNextEditionActivity();
+ protected abstract Class<? extends WloBaseListActivity> getNextListActivity();
+
protected abstract M createNewModel();
@Override
@@ -98,8 +100,7 @@
model.setModified(true);
}
});
- getWindow().setSoftInputMode(
- WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
+ getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
}
@Override
@@ -161,8 +162,8 @@
saveModel();
if (newModel) {
-
- Intent intent = new Intent(this, getNextEditionActivity());
+// Intent intent = new Intent(this, getNextEditionActivity());
+ Intent intent = new Intent(this, getNextListActivity());
intent.putExtra(WloModelEditionActivity.INTENT_EXTRA_PARENT_MODEL, model);
startActivity(intent);
Modified: trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -63,8 +63,10 @@
import fr.ifremer.wlo.ScientificSpeciesFormActivity;
import fr.ifremer.wlo.VesselFormActivity;
import fr.ifremer.wlo.WloBaseActivity;
+import fr.ifremer.wlo.WloBaseListActivity;
import fr.ifremer.wlo.WloModelEditionActivity;
import fr.ifremer.wlo.models.CategoryWeightModel;
+import fr.ifremer.wlo.models.HierarchicalModel;
import fr.ifremer.wlo.models.referentials.Mensuration;
import fr.ifremer.wlo.storage.DataCache;
import fr.ifremer.wlo.models.BaseModel;
1
0
Author: kmorin
Date: 2014-02-19 11:19:58 +0100 (Wed, 19 Feb 2014)
New Revision: 51
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/51
Log:
fixes #4192 [SAISIE] ?\195?\137cran des poids [niveau 5 ?\195?\160 7]
Modified:
trunk/src/fr/ifremer/wlo/WeightsActivity.java
Modified: trunk/src/fr/ifremer/wlo/WeightsActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-19 10:17:11 UTC (rev 50)
+++ trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-19 10:19:58 UTC (rev 51)
@@ -233,11 +233,10 @@
int inputType = InputType.TYPE_CLASS_NUMBER;
String textValue = null;
+ if (weightUnit > 1) {
+ inputType |= InputType.TYPE_NUMBER_FLAG_DECIMAL;
+ }
if (value != null) {
- if (weightUnit > 1) {
- inputType |= InputType.TYPE_NUMBER_FLAG_DECIMAL;
- }
-
if (weightUnit > 1 && value != null) {
float floatValue = (float) value / weightUnit;
textValue = String.format(Locale.US, "%.3f", floatValue);
1
0
r50 - in trunk: res/values res/values-fr src/fr/ifremer/wlo src/fr/ifremer/wlo/models src/fr/ifremer/wlo/storage src/fr/ifremer/wlo/utils
by kmorin@users.forge.codelutin.com 19 Feb '14
by kmorin@users.forge.codelutin.com 19 Feb '14
19 Feb '14
Author: kmorin
Date: 2014-02-19 11:17:11 +0100 (Wed, 19 Feb 2014)
New Revision: 50
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/50
Log:
fixes #4192 [SAISIE] ?\195?\137cran des poids [niveau 5 ?\195?\160 7]
Modified:
trunk/res/values-fr/strings.xml
trunk/res/values/strings.xml
trunk/src/fr/ifremer/wlo/WeightsActivity.java
trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java
trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java
trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java
trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
trunk/src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java
Modified: trunk/res/values/strings.xml
===================================================================
--- trunk/res/values/strings.xml 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/res/values/strings.xml 2014-02-19 10:17:11 UTC (rev 50)
@@ -171,8 +171,9 @@
<!-- Weights -->
<string name="weights_title">Weights</string>
<string name="commercial_species_total_unloaded_weight">Total unloaded weight</string>
+ <string name="scientific_species_sorted_weight">Sorted weight</string>
<string name="scientific_species_sample_weight">Sample weight</string>
- <string name="scientific_species_categories">Weights per category</string>
+ <string name="scientific_species_categories">Weights per category (gender / maturity / age)</string>
<!--File chooser-->
<string name="file_chooser_location">Location</string>
Modified: trunk/res/values-fr/strings.xml
===================================================================
--- trunk/res/values-fr/strings.xml 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/res/values-fr/strings.xml 2014-02-19 10:17:11 UTC (rev 50)
@@ -164,8 +164,9 @@
<!-- Weights -->
<string name="weights_title">Poids</string>
<string name="commercial_species_total_unloaded_weight">Poids total débarqué</string>
+ <string name="scientific_species_sample_weight">Poids trié</string>
<string name="scientific_species_sample_weight">Poids d\'échantillon</string>
- <string name="scientific_species_categories">Poids par catégorie</string>
+ <string name="scientific_species_categories">Poids par catégorie (Sexe / maturité / age)</string>
<!--File chooser-->
<string name="file_chooser_location">Emplacement</string>
Modified: trunk/src/fr/ifremer/wlo/WeightsActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-19 10:17:11 UTC (rev 50)
@@ -26,6 +26,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
/**
* @author Kevin Morin (Code Lutin)
@@ -109,6 +110,18 @@
container.addView(labelView);
// add label
+ createWeightLabel(getString(R.string.scientific_species_sorted_weight));
+
+ // create the sorted weight field
+ createEditText(scientificSpecies.getSortedWeight(), new Function<Integer, Void>() {
+ @Override
+ public Void apply(Integer input) {
+ scientificSpecies.setSortedWeight(input);
+ return null;
+ }
+ });
+
+ // add label
createWeightLabel(getString(R.string.scientific_species_sample_weight));
// create the sample weight field
@@ -201,7 +214,12 @@
public void onTextChanged(CharSequence s, int start, int before, int count) {
Integer newValue = null;
if (StringUtils.isNotEmpty(s)) {
- newValue = Integer.parseInt(s.toString());
+ if (weightUnit > 1) {
+ newValue = (int) (Float.parseFloat(s.toString()) * weightUnit);
+
+ } else {
+ newValue = Integer.parseInt(s.toString());
+ }
}
setWeightFunction.apply(newValue);
editText.setSelection(start + count);
@@ -213,18 +231,20 @@
final EditText editText = new EditText(this);
int inputType = InputType.TYPE_CLASS_NUMBER;
- String textValue;
+ String textValue = null;
- if (weightUnit > 1) {
- inputType |= InputType.TYPE_NUMBER_FLAG_DECIMAL;
- }
+ if (value != null) {
+ if (weightUnit > 1) {
+ inputType |= InputType.TYPE_NUMBER_FLAG_DECIMAL;
+ }
- if (weightUnit > 1 && value != null) {
- float floatValue = (float) value / weightUnit;
- textValue = String.format("%.3f", floatValue);
+ if (weightUnit > 1 && value != null) {
+ float floatValue = (float) value / weightUnit;
+ textValue = String.format(Locale.US, "%.3f", floatValue);
- } else {
- textValue = String.valueOf(value);
+ } else {
+ textValue = String.valueOf(value);
+ }
}
editText.setInputType(inputType);
editText.setText(textValue);
Modified: trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java 2014-02-19 10:17:11 UTC (rev 50)
@@ -46,7 +46,9 @@
category1 = cursor.getString(1);
category2 = cursor.getString(2);
category3 = cursor.getString(3);
- weight = cursor.getInt(4);
+ if (!cursor.isNull(4)) {
+ weight = cursor.getInt(4);
+ }
}
public String getCategory1() {
return category1;
Modified: trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java 2014-02-19 10:17:11 UTC (rev 50)
@@ -99,7 +99,9 @@
String presentationId = cursor.getString(7);
presentation = DataCache.getPresentationById(context, presentationId);
comment = cursor.getString(8);
- totalUnloadedWeight = cursor.getInt(9);
+ if (!cursor.isNull(9)) {
+ totalUnloadedWeight = cursor.getInt(9);
+ }
}
public CommercialSpecies getFaoCode() {
Modified: trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java 2014-02-19 10:17:11 UTC (rev 50)
@@ -44,6 +44,7 @@
public static final String COLUMN_NAME = "name";
public static final String COLUMN_TAKING_ACTIVATION = "takingActivation";
public static final String COLUMN_COMMENT = "comment";
+ public static final String COLUMN_SORTED_WEIGHT = "sortedWeight";
public static final String COLUMN_SAMPLE_WEIGHT = "sampleWeight";
public static final String COLUMN_COMMERCIAL_SPECIES_ID = "commercialSpeciesId";
public static final String[] ALL_COLUMNS = new String[] {
@@ -51,6 +52,7 @@
COLUMN_NAME,
COLUMN_TAKING_ACTIVATION,
COLUMN_COMMENT,
+ COLUMN_SORTED_WEIGHT,
COLUMN_SAMPLE_WEIGHT,
COLUMN_COMMERCIAL_SPECIES_ID
};
@@ -58,6 +60,7 @@
protected ScientificSpecies name;
protected boolean takingActivation;
protected String comment;
+ protected Integer sortedWeight;
protected Integer sampleWeight;
public ScientificSpeciesModel() {
@@ -69,7 +72,12 @@
name = DataCache.getScientificSpeciesById(context, nameId);
takingActivation = cursor.getShort(2) > 0;
comment = cursor.getString(3);
- sampleWeight = cursor.getInt(4);
+ if (!cursor.isNull(4)) {
+ sortedWeight = cursor.getInt(4);
+ }
+ if (!cursor.isNull(5)) {
+ sampleWeight = cursor.getInt(5);
+ }
}
public ScientificSpecies getName() {
@@ -102,6 +110,16 @@
firePropertyChange(COLUMN_COMMENT, oldValue, comment);
}
+ public Integer getSortedWeight() {
+ return sortedWeight;
+ }
+
+ public void setSortedWeight(Integer sortedWeight) {
+ Object oldValue = this.sortedWeight;
+ this.sortedWeight = sortedWeight;
+ firePropertyChange(COLUMN_SORTED_WEIGHT, oldValue, sortedWeight);
+ }
+
public Integer getSampleWeight() {
return sampleWeight;
}
@@ -128,6 +146,7 @@
putValue(value, COLUMN_NAME, name != null ? name.getId() : null);
putValue(value, COLUMN_TAKING_ACTIVATION, takingActivation ? 1 : 0);
putValue(value, COLUMN_COMMENT, comment);
+ putValue(value, COLUMN_SORTED_WEIGHT, sortedWeight);
putValue(value, COLUMN_SAMPLE_WEIGHT, sampleWeight);
putValue(value, COLUMN_COMMERCIAL_SPECIES_ID, getParentId());
return value;
Modified: trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
===================================================================
--- trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java 2014-02-19 10:17:11 UTC (rev 50)
@@ -67,7 +67,7 @@
private static final String TAG = "WloOpenHelper";
public static final String DATABASE_NAME = "wlo.db";
- public static final int DATABASE_VERSION = 16;
+ public static final int DATABASE_VERSION = 17;
public static final String TEXT_TYPE = " TEXT";
public static final String BIGINT_TYPE = " BIGINT";
@@ -179,6 +179,7 @@
ScientificSpeciesModel.COLUMN_NAME + TEXT_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_TAKING_ACTIVATION + BYTE_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_COMMENT + TEXT_TYPE + COMMA_SEP +
+ ScientificSpeciesModel.COLUMN_SORTED_WEIGHT + BIGINT_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_SAMPLE_WEIGHT + BIGINT_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_COMMERCIAL_SPECIES_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
"FOREIGN KEY(" + ScientificSpeciesModel.COLUMN_COMMERCIAL_SPECIES_ID + ") REFERENCES " +
Modified: trunk/src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java
===================================================================
--- trunk/src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java 2014-02-19 10:17:11 UTC (rev 50)
@@ -155,7 +155,7 @@
// remove any starting 0
lengthCell = lengthCell.replaceAll("^0*", "");
- length = Float.valueOf(lengthCell) * 10;
+ length = Float.valueOf(lengthCell);
} catch (Exception e) {
Log.e(TAG, "Could not get length from " + record, e);
1
0
See <http://ci.codelutin.com/jenkins/job/wlo-ci/1/>
------------------------------------------
[...truncated 57 lines...]
A src/fr/ifremer/wlo/models/referentials/imports/VesselRowModel.java
A src/fr/ifremer/wlo/models/referentials/imports/GenderRowModel.java
A src/fr/ifremer/wlo/models/referentials/imports/MensurationRowModel.java
A src/fr/ifremer/wlo/models/referentials/imports/MetierRowModel.java
A src/fr/ifremer/wlo/models/referentials/Maturity.java
AU src/fr/ifremer/wlo/models/ContextModel.java
A src/fr/ifremer/wlo/models/CategoryWeightModel.java
AU src/fr/ifremer/wlo/models/MeasurementModel.java
A src/fr/ifremer/wlo/models/MetierModel.java
A src/fr/ifremer/wlo/models/CommercialSpeciesModel.java
A src/fr/ifremer/wlo/models/LocationModel.java
AU src/fr/ifremer/wlo/models/MeasurementsModel.java
A src/fr/ifremer/wlo/models/BaseModel.java
A src/fr/ifremer/wlo/models/ScientificSpeciesModel.java
A src/fr/ifremer/wlo/CommercialSpeciesActivity.java
A src/fr/ifremer/wlo/measurement
AU src/fr/ifremer/wlo/measurement/MeasurementActivity.java
AU src/fr/ifremer/wlo/measurement/GraphFragment.java
AU src/fr/ifremer/wlo/measurement/LogsFragment.java
AU src/fr/ifremer/wlo/measurement/TableAdapter.java
AU src/fr/ifremer/wlo/measurement/MeasurementsDisplayerFragment.java
AU src/fr/ifremer/wlo/measurement/TableFragment.java
AU src/fr/ifremer/wlo/measurement/GraphActivity.java
A src/fr/ifremer/wlo/WloBaseListActivity.java
AU src/fr/ifremer/wlo/BigFinCommunicationService.java
AU src/fr/ifremer/wlo/DeviceListActivity.java
A src/fr/ifremer/wlo/LocationsActivity.java
A src/fr/ifremer/wlo/WloBaseActivity.java
A src/fr/ifremer/wlo/LocationFormActivity.java
A src/fr/ifremer/wlo/ScientificSpeciesActivity.java
A src/fr/ifremer/wlo/WloModelEditionActivity.java
A src/fr/ifremer/wlo/utils
A src/fr/ifremer/wlo/utils/DatePickerFragment.java
A src/fr/ifremer/wlo/utils/TimePickerFragment.java
A src/fr/ifremer/wlo/utils/AbstractDateTimePickerFragment.java
A src/fr/ifremer/wlo/utils/WloAutoCompleteTextViewWithFavorites.java
A src/fr/ifremer/wlo/utils/filechooser
A src/fr/ifremer/wlo/utils/filechooser/FileDialog.java
A src/fr/ifremer/wlo/utils/filechooser/SelectionMode.java
A src/fr/ifremer/wlo/utils/WloAutoCompleteTextView.java
A src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java
A src/fr/ifremer/wlo/utils/BaseModelArrayAdapter.java
A src/fr/ifremer/wlo/utils/WloItemListViewBinder.java
A src/fr/ifremer/wlo/utils/BaseTextWatcher.java
AU src/fr/ifremer/wlo/utils/UIUtils.java
A src/fr/ifremer/wlo/preferences
A src/fr/ifremer/wlo/preferences/StringPreference.java
A src/fr/ifremer/wlo/preferences/WloMultiSelectListPreference.java
A src/fr/ifremer/wlo/preferences/MultiSelectItemPreference.java
A src/fr/ifremer/wlo/preferences/ListItemPreference.java
A src/fr/ifremer/wlo/preferences/SettingsActivity.java
AU src/fr/ifremer/wlo/ContextsActivity.java
A src/fr/ifremer/wlo/storage
AU src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
A src/fr/ifremer/wlo/storage/StorageUtils.java
A src/fr/ifremer/wlo/storage/DataCache.java
A src/fr/ifremer/wlo/MetiersActivity.java
A src/fr/ifremer/wlo/ContextFormActivity.java
A src/fr/ifremer/wlo/MetierFormActivity.java
A src/fr/ifremer/wlo/WeightsActivity.java
A src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java
A src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java
A res
A res/values
AU res/values/style.xml
A res/values/arrays.xml
A res/values/colors.xml
AU res/values/strings.xml
A res/xml
A res/xml/preferences.xml
A res/drawable
A res/drawable/favorite_toggle.xml
AU res/drawable/file.png
AU res/drawable/weight.png
AU res/drawable/app_icon.png
AU res/drawable/border_bottom.9.png
AU res/drawable/icon.png
AU res/drawable/tab_bg_selector.xml
AU res/drawable/folder.png
AU res/drawable/wlo_ico.png
A res/drawable-hdpi
AU res/drawable-hdpi/ic_drawer.png
AU res/drawable-hdpi/drawer_shadow.9.png
A res/drawable-xxhdpi
AU res/drawable-xxhdpi/ic_drawer.png
AU res/drawable-xxhdpi/drawer_shadow.9.png
A res/menu
A res/menu/form_menu.xml
A res/menu/weight_menu.xml
AU res/menu/model_list_menu.xml
A res/values-fr
A res/values-fr/arrays.xml
A res/values-fr/strings.xml
A res/drawable-mdpi
AU res/drawable-mdpi/ic_drawer.png
AU res/drawable-mdpi/drawer_shadow.9.png
A res/drawable-xhdpi
AU res/drawable-xhdpi/ic_drawer.png
AU res/drawable-xhdpi/drawer_shadow.9.png
A res/layout
A res/layout/location_list_item.xml
AU res/layout/measurement_table_row.xml
A res/layout/vessel_form.xml
AU res/layout/message.xml
AU res/layout/main.xml
A res/layout/file_dialog_row.xml
AU res/layout/measurement.xml
AU res/layout/measurement_graph_fragment.xml
A res/layout/location_form.xml
AU res/layout/measurement_logs_fragment.xml
AU res/layout/device_name.xml
AU res/layout/measurement_logs_row.xml
AU res/layout/tabs_bg.xml
A res/layout/file_dialog_main.xml
AU res/layout/measurement_graph.xml
A res/layout/context_form.xml
A res/layout/metier_form.xml
A res/layout/commercial_species_form.xml
A res/layout/vessel_list_item.xml
A res/layout/weights.xml
AU res/layout/custom_title.xml
A res/layout/autocomplete_text_view_with_favorites.xml
A res/layout/scientific_species_form.xml
AU res/layout/measurement_table_fragment.xml
AU pom.xml
AU README.txt
U .
At revision 48
Parsing POMs
Discovered a new module fr.ifremer:wlo WLO
Modules changed, recalculating dependency graph
[trunk] $ /opt/jdk7/bin/java -Dsettings.security=/var/local/forge/data/codelutin.com/maven/settings-security.xml -Djava.awt.headless=true -cp /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.4.jar:/opt/maven3/boot/plexus-classworlds-2.5.1.jar:/opt/maven3/conf/logging jenkins.maven3.agent.Maven31Main /opt/maven3 /var/local/forge/exec/tomcat-codelutin.com/webapps/jenkins/WEB-INF/lib/remoting-2.33.jar /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.4.jar /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.4.jar 39476
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/pom.xml> -s /var/local/forge/data/codelutin.com/maven/settings.xml -e -U clean verify
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WLO 0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wlo ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ wlo ---
[INFO]
[INFO] --- android-maven-plugin:3.8.2:generate-sources (default-generate-sources) @ wlo ---
[DEBUG] Expanding: /var/local/forge/data/codelutin.com/maven/repository/android/support/compatibility-v7-appcompat/19.0.1/compatibility-v7-appcompat-19.0.1.apklib into <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/unpacked-libs/an…>
[DEBUG] expand complete
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] Manifest merging disabled. Using project manifest only
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidHomeOrThrow(AbstractAndroidMojo.java:1176)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidSdk(AbstractAndroidMojo.java:1129)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:481)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.735s
[INFO] Finished at: Fri Feb 14 19:20:28 CET 2014
[INFO] Final Memory: 18M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project wlo: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project wlo: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.MojoExecutionException: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidHomeOrThrow(AbstractAndroidMojo.java:1176)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidSdk(AbstractAndroidMojo.java:1129)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:481)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Sending e-mails to: wlo-commits(a)list.forge.codelutin.com
channel stopped
1
4
18 Feb '14
See <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/1/>
------------------------------------------
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/pom.xml> -s /var/local/forge/data/codelutin.com/maven/settings.xml -e -U clean verify
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WLO 0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wlo ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ wlo ---
[INFO]
[INFO] --- android-maven-plugin:3.8.2:generate-sources (default-generate-sources) @ wlo ---
[DEBUG] Expanding: /var/local/forge/data/codelutin.com/maven/repository/android/support/compatibility-v7-appcompat/19.0.1/compatibility-v7-appcompat-19.0.1.apklib into <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/unpacke…>
[DEBUG] expand complete
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] Manifest merging disabled. Using project manifest only
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidHomeOrThrow(AbstractAndroidMojo.java:1176)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidSdk(AbstractAndroidMojo.java:1129)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:481)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
[JENKINS] Archiving disabled
1
4
r49 - in trunk: res/layout res/values res/values-fr res/xml src/fr/ifremer/wlo src/fr/ifremer/wlo/measurement src/fr/ifremer/wlo/models src/fr/ifremer/wlo/storage src/fr/ifremer/wlo/utils
by kmorin@users.forge.codelutin.com 17 Feb '14
by kmorin@users.forge.codelutin.com 17 Feb '14
17 Feb '14
Author: kmorin
Date: 2014-02-17 14:32:31 +0100 (Mon, 17 Feb 2014)
New Revision: 49
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/49
Log:
refs #4264 Recevoir les mesures de l'ichtyom?\195?\168tre
fixes #4192 [SAISIE] ?\195?\137cran des poids [niveau 5 ?\195?\160 7]
Added:
trunk/res/layout/vertical_separator.xml
Modified:
trunk/res/layout/weights.xml
trunk/res/values-fr/strings.xml
trunk/res/values/strings.xml
trunk/res/xml/preferences.xml
trunk/src/fr/ifremer/wlo/WeightsActivity.java
trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java
trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java
trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
trunk/src/fr/ifremer/wlo/utils/WloAutoCompleteTextView.java
Added: trunk/res/layout/vertical_separator.xml
===================================================================
--- trunk/res/layout/vertical_separator.xml (rev 0)
+++ trunk/res/layout/vertical_separator.xml 2014-02-17 13:32:31 UTC (rev 49)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<View xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="2dip"
+ android:layout_marginTop="5dip"
+ android:layout_marginBottom="5dip"
+ android:background="@android:color/darker_gray"/>
\ No newline at end of file
Modified: trunk/res/layout/weights.xml
===================================================================
--- trunk/res/layout/weights.xml 2014-02-14 14:49:07 UTC (rev 48)
+++ trunk/res/layout/weights.xml 2014-02-17 13:32:31 UTC (rev 49)
@@ -10,19 +10,11 @@
android:layout_weight="1"
android:fillViewport="true">
- <LinearLayout android:orientation="vertical"
+ <LinearLayout android:id="@+id/container"
+ android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
- <TextView android:text="@string/commercial_species_total_unloaded_weight"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
-
- <EditText android:id="@+id/total_unloaded_weight"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:inputType="numberDecimal"/>
-
</LinearLayout>
</ScrollView>
Modified: trunk/res/values/strings.xml
===================================================================
--- trunk/res/values/strings.xml 2014-02-14 14:49:07 UTC (rev 48)
+++ trunk/res/values/strings.xml 2014-02-17 13:32:31 UTC (rev 49)
@@ -171,6 +171,8 @@
<!-- Weights -->
<string name="weights_title">Weights</string>
<string name="commercial_species_total_unloaded_weight">Total unloaded weight</string>
+ <string name="scientific_species_sample_weight">Sample weight</string>
+ <string name="scientific_species_categories">Weights per category</string>
<!--File chooser-->
<string name="file_chooser_location">Location</string>
Modified: trunk/res/values-fr/strings.xml
===================================================================
--- trunk/res/values-fr/strings.xml 2014-02-14 14:49:07 UTC (rev 48)
+++ trunk/res/values-fr/strings.xml 2014-02-17 13:32:31 UTC (rev 49)
@@ -164,6 +164,8 @@
<!-- Weights -->
<string name="weights_title">Poids</string>
<string name="commercial_species_total_unloaded_weight">Poids total débarqué</string>
+ <string name="scientific_species_sample_weight">Poids d\'échantillon</string>
+ <string name="scientific_species_categories">Poids par catégorie</string>
<!--File chooser-->
<string name="file_chooser_location">Emplacement</string>
Modified: trunk/res/xml/preferences.xml
===================================================================
--- trunk/res/xml/preferences.xml 2014-02-14 14:49:07 UTC (rev 48)
+++ trunk/res/xml/preferences.xml 2014-02-17 13:32:31 UTC (rev 49)
@@ -16,7 +16,7 @@
android:title="@string/preferences_weight_unit"
android:entries="@array/preferences_weight_unit_entries"
android:entryValues="@array/preferences_weight_unit_values"
- android:defaultValue="0"/>
+ android:defaultValue="1"/>
<ListPreference android:key="preferences_date_format"
android:title="@string/preferences_date_format"
Modified: trunk/src/fr/ifremer/wlo/WeightsActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-14 14:49:07 UTC (rev 48)
+++ trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-17 13:32:31 UTC (rev 49)
@@ -1,19 +1,31 @@
package fr.ifremer.wlo;
import android.content.Intent;
+import android.content.SharedPreferences;
+import android.database.Cursor;
+import android.graphics.Typeface;
import android.os.Bundle;
+import android.preference.PreferenceManager;
+import android.text.InputType;
+import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
-import com.google.common.collect.Multimap;
-import fr.ifremer.wlo.models.BaseModel;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import com.google.common.base.Function;
+import fr.ifremer.wlo.models.CategoryWeightModel;
import fr.ifremer.wlo.models.CommercialSpeciesModel;
+import fr.ifremer.wlo.models.ScientificSpeciesModel;
+import fr.ifremer.wlo.preferences.ListItemPreference;
+import fr.ifremer.wlo.preferences.StringPreference;
+import fr.ifremer.wlo.storage.DataCache;
import fr.ifremer.wlo.storage.WloSqlOpenHelper;
import fr.ifremer.wlo.utils.BaseTextWatcher;
import org.apache.commons.lang3.StringUtils;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Collection;
+import java.util.ArrayList;
+import java.util.List;
/**
* @author Kevin Morin (Code Lutin)
@@ -25,32 +37,131 @@
public static final String INTENT_COMMERCIAL_SPECIES = "commercialSpecies";
+ protected LinearLayout container;
+
protected CommercialSpeciesModel commercialSpeciesModel;
+ protected List<ScientificSpeciesModel> scientficSpeciesModels;
+
+ protected List<CategoryWeightModel> categoryWeightModels = new ArrayList<>();
+
+ protected int weightUnit;
+
+ protected String weightUnitLabel;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ container = (LinearLayout) findViewById(R.id.container);
+
+ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
+ String weightUnitString = sharedPref.getString(ListItemPreference.WEIGHT_UNIT.getKey(), "1");
+ weightUnit = Integer.parseInt(weightUnitString);
+ switch (weightUnit) {
+ case 1000:
+ weightUnitLabel = "kg";
+ break;
+ default:
+ weightUnitLabel = "g";
+ break;
+ }
+
commercialSpeciesModel = (CommercialSpeciesModel) getIntent().getSerializableExtra(INTENT_COMMERCIAL_SPECIES);
getSupportActionBar().setSubtitle(commercialSpeciesModel.toString(this));
- final EditText totalUnloadedWeightText = (EditText) findViewById(R.id.total_unloaded_weight);
- Log.d(TAG, "TotalUnloadedWeight " + commercialSpeciesModel.getTotalUnloadedWeight());
- totalUnloadedWeightText.setText(String.valueOf(commercialSpeciesModel.getTotalUnloadedWeight()));
- totalUnloadedWeightText.addTextChangedListener(new BaseTextWatcher() {
+ // create total unloaded weight label
+ createWeightLabel(getString(R.string.commercial_species_total_unloaded_weight));
+
+ // create total unloaded weight field
+ createEditText(commercialSpeciesModel.getTotalUnloadedWeight(), new Function<Integer, Void>() {
@Override
- public void onTextChanged(CharSequence s, int start, int before, int count) {
- Integer newValue = null;
- Log.d(TAG, "onTextChanged " + s);
- if (StringUtils.isNotEmpty(s)) {
- newValue = Integer.parseInt(s.toString());
- }
- Log.d(TAG, "TotalUnloadedWeight " + newValue);
- commercialSpeciesModel.setTotalUnloadedWeight(newValue);
- totalUnloadedWeightText.setSelection(start + count);
+ public Void apply(Integer input) {
+ commercialSpeciesModel.setTotalUnloadedWeight(input);
+ return null;
}
+ });
+ // get all scientific species
+ WloSqlOpenHelper woh = new WloSqlOpenHelper(this);
+ Cursor allScientificSpeciesCursor = woh.getAllScientificSpecies(commercialSpeciesModel.getId());
+ scientficSpeciesModels = WloSqlOpenHelper.transformCursorIntoCollection(allScientificSpeciesCursor,
+ new Function<Cursor, ScientificSpeciesModel>() {
+ @Override
+ public ScientificSpeciesModel apply(Cursor input) {
+ ScientificSpeciesModel scientificSpeciesModel =
+ new ScientificSpeciesModel(WeightsActivity.this, input);
+ scientificSpeciesModel.setParent(commercialSpeciesModel);
+ return scientificSpeciesModel;
+ }
});
+
+ for (final ScientificSpeciesModel scientificSpecies : scientficSpeciesModels) {
+
+ // add separator
+ getLayoutInflater().inflate(R.layout.vertical_separator, container);
+
+ // add label
+ TextView labelView = new TextView(this);
+ labelView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
+ labelView.setTextAppearance(this, android.R.style.TextAppearance_Large);
+ labelView.setText(scientificSpecies.toString(this));
+ container.addView(labelView);
+
+ // add label
+ createWeightLabel(getString(R.string.scientific_species_sample_weight));
+
+ // create the sample weight field
+ createEditText(scientificSpecies.getSampleWeight(), new Function<Integer, Void>() {
+ @Override
+ public Void apply(Integer input) {
+ scientificSpecies.setSampleWeight(input);
+ return null;
+ }
+ });
+
+ // weight per category
+ TextView weightByCategoryView = new TextView(this);
+ weightByCategoryView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
+ weightByCategoryView.setTextAppearance(this, android.R.style.TextAppearance_Medium);
+ weightByCategoryView.setText(R.string.scientific_species_categories);
+ container.addView(weightByCategoryView);
+
+ // get all the category weights
+ Cursor categoryWeighs = woh.getAllCategoryWeigths(scientificSpecies.getId());
+ categoryWeightModels = WloSqlOpenHelper.transformCursorIntoCollection(categoryWeighs,
+ new Function<Cursor, CategoryWeightModel>() {
+ @Override
+ public CategoryWeightModel apply(Cursor input) {
+ CategoryWeightModel result = new CategoryWeightModel(input);
+ result.setParent(scientificSpecies);
+ return result;
+ }
+ });
+
+ for (final CategoryWeightModel categoryWeightModel : categoryWeightModels) {
+
+ // create the weight field
+ String category1Id = categoryWeightModel.getCategory1();
+ String category2Id = categoryWeightModel.getCategory2();
+ String category3Id = categoryWeightModel.getCategory3();
+ String label = (category1Id != null ? DataCache.getGenderById(this, category1Id).getLabel() : "NA") + ", " +
+ (category2Id != null ? DataCache.getMaturityById(this, category2Id).getLabel() : "NA") + ", " +
+ (category3Id != null ? DataCache.getAgeById(this, category3Id).getLabel() : "NA");
+
+ // add label
+ createWeightLabel(label);
+
+ createEditText(categoryWeightModel.getWeight(), new Function<Integer, Void>() {
+ @Override
+ public Void apply(Integer input) {
+ categoryWeightModel.setWeight(input);
+ return null;
+ }
+ });
+ }
+ }
+ woh.close();
}
@Override
@@ -63,6 +174,13 @@
return ScientificSpeciesActivity.class;
}
+ @Override
+ public Intent getSupportParentActivityIntent() {
+ Intent intent = super.getSupportParentActivityIntent();
+ intent.putExtra(ScientificSpeciesActivity.INTENT_EXTRA_PARENT_MODEL, commercialSpeciesModel);
+ return intent;
+ }
+
public void validate(View view) {
saveModel();
finish();
@@ -70,9 +188,56 @@
/* Protected methods */
+ protected TextView createWeightLabel(String label) {
+ TextView textView = new TextView(this);
+ textView.setText(label + " (" + weightUnitLabel + ")");
+ container.addView(textView);
+ return textView;
+ }
+
+ protected TextWatcher getTextWatcher(final EditText editText, final Function<Integer, Void> setWeightFunction) {
+ return new BaseTextWatcher() {
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ Integer newValue = null;
+ if (StringUtils.isNotEmpty(s)) {
+ newValue = Integer.parseInt(s.toString());
+ }
+ setWeightFunction.apply(newValue);
+ editText.setSelection(start + count);
+ }
+ };
+ }
+
+ protected EditText createEditText(Integer value, Function<Integer, Void> setWeightFunction) {
+ final EditText editText = new EditText(this);
+
+ int inputType = InputType.TYPE_CLASS_NUMBER;
+ String textValue;
+
+ if (weightUnit > 1) {
+ inputType |= InputType.TYPE_NUMBER_FLAG_DECIMAL;
+ }
+
+ if (weightUnit > 1 && value != null) {
+ float floatValue = (float) value / weightUnit;
+ textValue = String.format("%.3f", floatValue);
+
+ } else {
+ textValue = String.valueOf(value);
+ }
+ editText.setInputType(inputType);
+ editText.setText(textValue);
+ editText.addTextChangedListener(getTextWatcher(editText, setWeightFunction));
+ container.addView(editText);
+
+ return editText;
+ }
+
protected void saveModel() {
WloSqlOpenHelper woh = new WloSqlOpenHelper(this);
- Log.d(TAG, "TotalUnloadedWeight " + commercialSpeciesModel.getTotalUnloadedWeight());
+ woh.saveData(categoryWeightModels);
+ woh.saveData(scientficSpeciesModels);
woh.saveData(commercialSpeciesModel);
woh.close();
}
Modified: trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-14 14:49:07 UTC (rev 48)
+++ trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-17 13:32:31 UTC (rev 49)
@@ -35,6 +35,7 @@
import android.os.Message;
import android.os.Messenger;
import android.os.Vibrator;
+import android.speech.tts.TextToSpeech;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.widget.DrawerLayout;
import android.text.Editable;
@@ -63,25 +64,20 @@
import fr.ifremer.wlo.VesselFormActivity;
import fr.ifremer.wlo.WloBaseActivity;
import fr.ifremer.wlo.WloModelEditionActivity;
-import fr.ifremer.wlo.models.referentials.Age;
-import fr.ifremer.wlo.models.referentials.Maturity;
+import fr.ifremer.wlo.models.CategoryWeightModel;
import fr.ifremer.wlo.models.referentials.Mensuration;
import fr.ifremer.wlo.storage.DataCache;
import fr.ifremer.wlo.models.BaseModel;
import fr.ifremer.wlo.models.CommercialSpeciesModel;
-import fr.ifremer.wlo.models.LocationModel;
import fr.ifremer.wlo.models.MeasurementModel;
import fr.ifremer.wlo.models.MeasurementsModel;
import fr.ifremer.wlo.models.MetierModel;
import fr.ifremer.wlo.models.ScientificSpeciesModel;
import fr.ifremer.wlo.models.VesselModel;
-import fr.ifremer.wlo.models.referentials.Gender;
import fr.ifremer.wlo.storage.WloSqlOpenHelper;
-import fr.ifremer.wlo.utils.BaseModelArrayAdapter;
import fr.ifremer.wlo.utils.BaseTextWatcher;
import fr.ifremer.wlo.utils.BigFinFeedReaderRecord;
import fr.ifremer.wlo.utils.UIUtils;
-import org.apache.commons.lang3.ObjectUtils;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -95,7 +91,7 @@
* @author kmorin <kmorin(a)codelutin.com>
* @since 0.1
*/
-public class MeasurementActivity extends WloBaseActivity implements AdapterView.OnItemSelectedListener {
+public class MeasurementActivity extends WloBaseActivity implements AdapterView.OnItemSelectedListener, TextToSpeech.OnInitListener {
private static final String TAG = "MeasurementActivity";
@@ -106,6 +102,8 @@
protected static final String TABLE_TAB = "table";
protected static final String LOGS_TAB = "logs";
+ protected static final int CHECK_TTS_REQUEST_CODE = 42;
+
protected WloSqlOpenHelper soh = new WloSqlOpenHelper(this);
protected TabHost tabs;
@@ -124,6 +122,9 @@
protected ListView mDrawerList;
+ protected TextToSpeech textToSpeech;
+ protected boolean useTextToSpeech = false;
+
@Override
protected Integer getContentView() {
return R.layout.measurement;
@@ -289,22 +290,33 @@
BigFinFeedReaderRecord record = (BigFinFeedReaderRecord) msg.obj;
if (record != null && record.getLength() != null) {
- final ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, ToneGenerator.MAX_VOLUME);
- tg.startTone(ToneGenerator.TONE_PROP_BEEP);
+ int size = Math.round(record.getLength());
+ measurement.setSize(size);
+ MeasurementModel savedMeasurement = addMeasurement();
+
+ if (useTextToSpeech) {
+ String formattedSize = UIUtils.getFormattedSize(savedMeasurement.getSize(), measurements.getPrecision());
+ textToSpeech.speak(formattedSize, TextToSpeech.QUEUE_ADD, null);
+
+ } else {
+ ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, ToneGenerator.MAX_VOLUME);
+ tg.startTone(ToneGenerator.TONE_PROP_BEEP);
+ }
+
// Get instance of Vibrator from current Context
Vibrator v = (Vibrator) getSystemService(VIBRATOR_SERVICE);
// Vibrate for 300 milliseconds
v.vibrate(300);
-
- int size = Math.round(record.getLength());
- measurement.setSize(size);
- addMeasurement(null);
}
break;
}
}
});
+
+ Intent checkIntent = new Intent();
+ checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
+ startActivityForResult(checkIntent, CHECK_TTS_REQUEST_CODE);
}
@Override
@@ -317,7 +329,15 @@
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
- if (resultCode == RESULT_OK) {
+
+ if (requestCode == CHECK_TTS_REQUEST_CODE && resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
+ // Succès, au moins un moteur de TTS à été trouvé, on l'instancie
+ textToSpeech = new TextToSpeech(this, this);
+ if (textToSpeech.isLanguageAvailable(Locale.FRANCE) == TextToSpeech.LANG_COUNTRY_AVAILABLE) {
+ textToSpeech.setLanguage(Locale.FRANCE);
+ }
+
+ } else if (resultCode == RESULT_OK) {
switch (requestCode) {
case 1:
vessel = (VesselModel) data.getSerializableExtra(WloModelEditionActivity.INTENT_EXTRA_MODEL);
@@ -359,6 +379,7 @@
protected void onDestroy() {
super.onDestroy();
soh.close();
+ textToSpeech.shutdown();
}
@Override
@@ -398,6 +419,11 @@
}
}
+ @Override
+ public void onInit(int status) {
+ useTextToSpeech = status == TextToSpeech.SUCCESS;
+ }
+
/* Public methods */
public void incSize(View source) {
@@ -409,20 +435,40 @@
}
public void addMeasurement(View source) {
+ addMeasurement();
+ }
+
+ /* Protected methods */
+
+ protected MeasurementModel addMeasurement() {
measurement.setDate(Calendar.getInstance());
measurement.roundSize(measurements.getPrecision());
- soh.saveData(measurement);
- measurements.addMeasurement(measurement);
Integer size = measurement.getSize();
String cat1 = measurement.getCategory1();
String cat2 = measurement.getCategory2();
String cat3 = measurement.getCategory3();
+
+ Cursor categoryWeightModelCursor = soh.getCategoryWeight(scientificSpecies.getId(), cat1, cat2, cat3);
+ if (categoryWeightModelCursor.getCount() == 0) {
+ CategoryWeightModel categoryWeightModel = new CategoryWeightModel();
+ categoryWeightModel.setCategory1(cat1);
+ categoryWeightModel.setCategory2(cat2);
+ categoryWeightModel.setCategory3(cat3);
+ categoryWeightModel.setParent(scientificSpecies);
+ soh.saveData(categoryWeightModel);
+ }
+
+ soh.saveData(measurement);
+ measurements.addMeasurement(measurement);
+
+ MeasurementModel result = measurement;
+
initFishMeasurement(size, cat1, cat2, cat3);
+
+ return result;
}
- /* Protected methods */
-
protected void initFishMeasurement(Integer size, String cat1, String cat2, String cat3) {
measurement = new MeasurementModel();
measurement.addPropertyChangeListener(new PropertyChangeListener() {
Modified: trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java 2014-02-14 14:49:07 UTC (rev 48)
+++ trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java 2014-02-17 13:32:31 UTC (rev 49)
@@ -36,7 +36,7 @@
protected String category1;
protected String category2;
protected String category3;
- protected int weight;
+ protected Integer weight;
public CategoryWeightModel() {
}
@@ -78,11 +78,11 @@
firePropertyChange(COLUMN_CATEGORY_3, oldValue, category3);
}
- public int getWeight() {
+ public Integer getWeight() {
return weight;
}
- public void setWeight(int weight) {
+ public void setWeight(Integer weight) {
Object oldValue = this.weight;
this.weight = weight;
firePropertyChange(COLUMN_WEIGHT, oldValue, weight);
Modified: trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java 2014-02-14 14:49:07 UTC (rev 48)
+++ trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java 2014-02-17 13:32:31 UTC (rev 49)
@@ -58,7 +58,7 @@
protected ScientificSpecies name;
protected boolean takingActivation;
protected String comment;
- protected int sampleWeight;
+ protected Integer sampleWeight;
public ScientificSpeciesModel() {
}
@@ -102,11 +102,11 @@
firePropertyChange(COLUMN_COMMENT, oldValue, comment);
}
- public int getSampleWeight() {
+ public Integer getSampleWeight() {
return sampleWeight;
}
- public void setSampleWeight(int sampleWeight) {
+ public void setSampleWeight(Integer sampleWeight) {
Object oldValue = this.sampleWeight;
this.sampleWeight = sampleWeight;
firePropertyChange(COLUMN_SAMPLE_WEIGHT, oldValue, sampleWeight);
Modified: trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
===================================================================
--- trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java 2014-02-14 14:49:07 UTC (rev 48)
+++ trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java 2014-02-17 13:32:31 UTC (rev 49)
@@ -67,7 +67,7 @@
private static final String TAG = "WloOpenHelper";
public static final String DATABASE_NAME = "wlo.db";
- public static final int DATABASE_VERSION = 15;
+ public static final int DATABASE_VERSION = 16;
public static final String TEXT_TYPE = " TEXT";
public static final String BIGINT_TYPE = " BIGINT";
@@ -532,6 +532,22 @@
return cursor;
}
+ public Cursor getCategoryWeight(String scientificSpeciesId, String category1Id,
+ String category2Id, String category3Id) {
+ SQLiteDatabase db = getReadableDatabase();
+ String cat1Condition = category1Id == null ? " IS NULL" : " = '" + category1Id + "'";
+ String cat2Condition = category2Id == null ? " IS NULL" : " = '" + category2Id + "'";
+ String cat3Condition = category3Id == null ? " IS NULL" : " = '" + category3Id + "'";
+ Cursor cursor = db.query(CategoryWeightModel.TABLE_NAME, CategoryWeightModel.ALL_COLUMNS,
+ CategoryWeightModel.COLUMN_SCIENTIFIC_SPECIES_ID + " = ? AND " +
+ CategoryWeightModel.COLUMN_CATEGORY_1 + cat1Condition + " AND " +
+ CategoryWeightModel.COLUMN_CATEGORY_2 + cat2Condition + " AND " +
+ CategoryWeightModel.COLUMN_CATEGORY_3 + cat3Condition,
+ new String[]{ scientificSpeciesId },
+ null, null, null);
+ return cursor;
+ }
+
// Referentials
public Cursor getAllRefAges() {
Modified: trunk/src/fr/ifremer/wlo/utils/WloAutoCompleteTextView.java
===================================================================
--- trunk/src/fr/ifremer/wlo/utils/WloAutoCompleteTextView.java 2014-02-14 14:49:07 UTC (rev 48)
+++ trunk/src/fr/ifremer/wlo/utils/WloAutoCompleteTextView.java 2014-02-17 13:32:31 UTC (rev 49)
@@ -28,6 +28,7 @@
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
+import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.AutoCompleteTextView;
@@ -80,6 +81,7 @@
}
}
});
+ setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
}
@Override
1
0
r48 - in trunk: . res/layout src/fr/ifremer/wlo src/fr/ifremer/wlo/measurement src/fr/ifremer/wlo/utils
by kmorin@users.forge.codelutin.com 14 Feb '14
by kmorin@users.forge.codelutin.com 14 Feb '14
14 Feb '14
Author: kmorin
Date: 2014-02-14 15:49:07 +0100 (Fri, 14 Feb 2014)
New Revision: 48
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/48
Log:
fixes #4264 Recevoir les mesures de l'ichtyom?\195?\168tre
Added:
trunk/src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java
Modified:
trunk/AndroidManifest.xml
trunk/res/layout/measurement.xml
trunk/src/fr/ifremer/wlo/BigFinCommunicationService.java
trunk/src/fr/ifremer/wlo/DeviceListActivity.java
trunk/src/fr/ifremer/wlo/MainActivity.java
trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
Modified: trunk/AndroidManifest.xml
===================================================================
--- trunk/AndroidManifest.xml 2014-02-13 21:28:40 UTC (rev 47)
+++ trunk/AndroidManifest.xml 2014-02-14 14:49:07 UTC (rev 48)
@@ -23,6 +23,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH" />
+ <uses-permission android:name="android.permission.VIBRATE"/>
<application android:label="@string/app_name"
android:icon="@drawable/wlo_ico"
Modified: trunk/res/layout/measurement.xml
===================================================================
--- trunk/res/layout/measurement.xml 2014-02-13 21:28:40 UTC (rev 47)
+++ trunk/res/layout/measurement.xml 2014-02-14 14:49:07 UTC (rev 48)
@@ -4,7 +4,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:keepScreenOn="true">
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
Modified: trunk/src/fr/ifremer/wlo/BigFinCommunicationService.java
===================================================================
--- trunk/src/fr/ifremer/wlo/BigFinCommunicationService.java 2014-02-13 21:28:40 UTC (rev 47)
+++ trunk/src/fr/ifremer/wlo/BigFinCommunicationService.java 2014-02-14 14:49:07 UTC (rev 48)
@@ -58,6 +58,7 @@
import android.support.v4.app.TaskStackBuilder;
import android.util.Log;
import com.google.common.collect.Lists;
+import fr.ifremer.wlo.utils.BigFinFeedReaderRecord;
import java.io.IOException;
import java.io.InputStream;
@@ -552,17 +553,48 @@
while (true) {
try {
// Read from the InputStream
- bytes = mmInStream.read(buffer);
+// bytes = mmInStream.read(buffer);
- Log.d(TAG, "received " + new String(buffer, 0, bytes));
+// Log.d(TAG, "received " + new String(buffer, 0, bytes));
+ String result = "";
+
+ // wait until got a @
+
+ boolean complete = false;
+ while (!complete) {
+ while (mmInStream.available() > 0) {
+// if (stop) {
+// break;
+// }
+ int c = mmInStream.read();
+ if (c == '@') {
+ complete = true;
+ } else {
+ result += (char) c;
+ }
+ }
+ }
+
+// int atSignIndex = result.indexOf('@');
+// result = result.substring(0, atSignIndex);
+
+ int lastComma = result.lastIndexOf(',');
+ result = result.substring(0, lastComma);
+
+ lastComma = result.lastIndexOf(',') + 1;
+ String record = result.substring(0, lastComma);
+
+ String crc = result.substring(lastComma);
+
+ Log.d(TAG, String.format("Record: %s / %s", record, crc));
+ BigFinFeedReaderRecord readerRecord = new BigFinFeedReaderRecord(record, crc);
+
// Send the obtained bytes to the UI Activity
+ sendMessage(MESSAGE_READ, -1, -1, readerRecord);
- sendMessage(MESSAGE_READ, bytes, -1, buffer);
-
} catch (IOException e) {
Log.e(TAG, "disconnected", e);
connectionLost();
- break;
}
}
}
Modified: trunk/src/fr/ifremer/wlo/DeviceListActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/DeviceListActivity.java 2014-02-13 21:28:40 UTC (rev 47)
+++ trunk/src/fr/ifremer/wlo/DeviceListActivity.java 2014-02-14 14:49:07 UTC (rev 48)
@@ -19,8 +19,8 @@
/*
* #%L
* WLO
- * $Id:$
- * $HeadURL:$
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2013 - 2014 Ifremer
* %%
@@ -62,6 +62,7 @@
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
+import fr.ifremer.wlo.utils.BigFinFeedReaderRecord;
import java.util.Set;
@@ -323,10 +324,9 @@
break;
case BigFinCommunicationService.MESSAGE_READ:
- byte[] readBuf = (byte[]) msg.obj;
+ BigFinFeedReaderRecord record = (BigFinFeedReaderRecord) msg.obj;
// construct a string from the valid bytes in the buffer
- String readMessage = new String(readBuf, 0, msg.arg1);
- Log.d(TAG, "read " + readMessage);
+ Log.d(TAG, "read " + record.getLength());
break;
case BigFinCommunicationService.MESSAGE_DEVICE_NAME:
Modified: trunk/src/fr/ifremer/wlo/MainActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-13 21:28:40 UTC (rev 47)
+++ trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-14 14:49:07 UTC (rev 48)
@@ -41,6 +41,7 @@
import fr.ifremer.wlo.preferences.SettingsActivity;
import fr.ifremer.wlo.storage.DataCache;
import fr.ifremer.wlo.storage.WloSqlOpenHelper;
+import fr.ifremer.wlo.utils.BigFinFeedReaderRecord;
import java.io.IOException;
Modified: trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-13 21:28:40 UTC (rev 47)
+++ trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-14 14:49:07 UTC (rev 48)
@@ -28,7 +28,13 @@
import android.content.Intent;
import android.content.res.Configuration;
import android.database.Cursor;
+import android.media.AudioManager;
+import android.media.ToneGenerator;
import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.Vibrator;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.widget.DrawerLayout;
import android.text.Editable;
@@ -47,6 +53,7 @@
import android.widget.TextView;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
+import fr.ifremer.wlo.BigFinCommunicationService;
import fr.ifremer.wlo.CommercialSpeciesFormActivity;
import fr.ifremer.wlo.MainActivity;
import fr.ifremer.wlo.MetierFormActivity;
@@ -72,6 +79,7 @@
import fr.ifremer.wlo.storage.WloSqlOpenHelper;
import fr.ifremer.wlo.utils.BaseModelArrayAdapter;
import fr.ifremer.wlo.utils.BaseTextWatcher;
+import fr.ifremer.wlo.utils.BigFinFeedReaderRecord;
import fr.ifremer.wlo.utils.UIUtils;
import org.apache.commons.lang3.ObjectUtils;
@@ -272,6 +280,31 @@
commercialSpecies.getPrecision());
actionBar.setSubtitle(vessel.toString(this) + " / " +
metier.toString(this));
+
+ mMessenger = new Messenger(new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case BigFinCommunicationService.MESSAGE_READ:
+ BigFinFeedReaderRecord record = (BigFinFeedReaderRecord) msg.obj;
+
+ if (record != null && record.getLength() != null) {
+ final ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, ToneGenerator.MAX_VOLUME);
+ tg.startTone(ToneGenerator.TONE_PROP_BEEP);
+
+ // Get instance of Vibrator from current Context
+ Vibrator v = (Vibrator) getSystemService(VIBRATOR_SERVICE);
+ // Vibrate for 300 milliseconds
+ v.vibrate(300);
+
+ int size = Math.round(record.getLength());
+ measurement.setSize(size);
+ addMeasurement(null);
+ }
+ break;
+ }
+ }
+ });
}
@Override
Added: trunk/src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java
===================================================================
--- trunk/src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java (rev 0)
+++ trunk/src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java 2014-02-14 14:49:07 UTC (rev 48)
@@ -0,0 +1,166 @@
+package fr.ifremer.wlo.utils;
+
+/*
+ * #%L
+ * Tutti :: Ichtyometer API
+ * $Id: FeedReaderRecord.java 1574 2014-02-06 17:34:03Z tchemit $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ichtyometer/src/main/j… $
+ * %%
+ * Copyright (C) 2012 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import android.util.Log;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * Record_id,length(mm),weight(g),species,cruise,station,pan,Dt,sz class,gender,text,
+ * <p/>
+ * Created on 1/24/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.1
+ */
+public class BigFinFeedReaderRecord {
+
+ /** Logger. */
+ private static final String TAG = "BigFinFeedReaderRecord";
+
+ /**
+ * Incoming raw record.
+ */
+ protected final String record;
+
+ /**
+ * Incoming crc.
+ */
+ protected final String crc;
+
+ /**
+ * Our computed crc.
+ */
+ protected final String computedCrc;
+
+ /**
+ * Extracted length (the first data of the record).
+ */
+ protected final Float length;
+
+ /**
+ * Computed valid flag (if crc == computedCrc and length != null).
+ */
+ protected final boolean valid;
+
+ public BigFinFeedReaderRecord(String record, String crc) {
+ this.record = record;
+ this.crc = crc;
+ this.computedCrc = computeCRC(record);
+ this.length = computeLength(record);
+
+ //FIXME Uncomment when computedCrc will be ok
+ this.valid = length != null; /*&& crc.equals(computedCrc);*/
+ }
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ public String getRecord() {
+ return record;
+ }
+
+ public String getCrc() {
+ return crc;
+ }
+
+ public String getComputedCrc() {
+ return computedCrc;
+ }
+
+ public Float getLength() {
+ return length;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("record", record)
+ .append("crc", crc)
+ .append("computedCrc", computedCrc)
+ .append("valid", valid)
+ .append("length", length)
+ .toString();
+ }
+
+ public static String computeCRC(String record) {
+
+ // use long because int are signed and add doesn't work correctly
+ long checksum = 0;
+
+ // to keep using 4 octets (32bites)
+ long mask = 0b0000000000000000000000000000000011111111111111111111111111111111L;
+
+ for (int i = 0, recordLength = record.length(); i < recordLength; i++) {
+
+ // keep only the first 32 bites
+ checksum = checksum & mask;
+
+ // get msb bite value
+ long msb = checksum >> 31;
+
+ Log.d(TAG, String.format("i=%4d char=%s(int:%3d) incoming checksum=%10d msb=%d bits=%33s", i, record.charAt(i), (int) record.charAt(i), checksum, msb, Long.toBinaryString(checksum)));
+
+ // logical shift left
+ checksum <<= 1;
+ Log.d(TAG, String.format("After lef shift : %33s", Long.toBinaryString(checksum)));
+
+ // rotates msb to lsb
+ checksum += msb;
+ Log.d(TAG, String.format("After add smb : %33s", Long.toBinaryString(checksum)));
+
+ // add new caracter
+ checksum += record.charAt(i);
+ Log.d(TAG, String.format("After add car : %33s", Long.toBinaryString(checksum)));
+ }
+
+ // get a hexadecimal on 32bites -> 8 hexadecimal caracters
+ String hex = Long.toHexString(checksum).toUpperCase();
+ Log.d(TAG, "checksum= " + checksum);
+ return hex;
+ }
+
+ protected Float computeLength(String record) {
+ Float length;
+ try {
+ String[] cells = record.split("\\s*,\\s*");
+ // first cell is the record number, second one is the length
+ String lengthCell = cells[1];
+ // remove any spaces
+ lengthCell = lengthCell.replaceAll("\\s*", "");
+
+ // remove any starting 0
+ lengthCell = lengthCell.replaceAll("^0*", "");
+
+ length = Float.valueOf(lengthCell) * 10;
+
+ } catch (Exception e) {
+ Log.e(TAG, "Could not get length from " + record, e);
+ length = null;
+ }
+ return length;
+ }
+}
1
0
r47 - in trunk: . res/drawable res/layout res/menu res/values res/values-fr src/fr/ifremer/wlo src/fr/ifremer/wlo/models src/fr/ifremer/wlo/preferences src/fr/ifremer/wlo/storage src/fr/ifremer/wlo/utils
by kmorin@users.forge.codelutin.com 13 Feb '14
by kmorin@users.forge.codelutin.com 13 Feb '14
13 Feb '14
Author: kmorin
Date: 2014-02-13 22:28:40 +0100 (Thu, 13 Feb 2014)
New Revision: 47
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/47
Log:
refs #4192 [SAISIE] ?\195?\137cran des poids [niveau 5 ?\195?\160 7]
Added:
trunk/proguard.cfg
trunk/res/drawable/weight.png
trunk/res/layout/weights.xml
trunk/res/menu/weight_menu.xml
trunk/src/fr/ifremer/wlo/WeightsActivity.java
trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java
Modified:
trunk/AndroidManifest.xml
trunk/pom.xml
trunk/res/values-fr/strings.xml
trunk/res/values/strings.xml
trunk/src/fr/ifremer/wlo/ScientificSpeciesActivity.java
trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java
trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java
trunk/src/fr/ifremer/wlo/preferences/WloMultiSelectListPreference.java
trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
trunk/src/fr/ifremer/wlo/utils/WloAutoCompleteTextViewWithFavorites.java
Modified: trunk/AndroidManifest.xml
===================================================================
--- trunk/AndroidManifest.xml 2014-02-04 18:31:27 UTC (rev 46)
+++ trunk/AndroidManifest.xml 2014-02-13 21:28:40 UTC (rev 47)
@@ -108,6 +108,10 @@
android:noHistory="true"
android:configChanges="orientation|screenSize|keyboardHidden"/>
+ <activity android:name=".WeightsActivity"
+ android:label="@string/weights_title"
+ android:configChanges="orientation|screenSize|keyboardHidden"/>
+
<activity android:name=".preferences.SettingsActivity"
android:label="@string/main_settings"
android:configChanges="orientation|screenSize|keyboardHidden"/>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-04 18:31:27 UTC (rev 46)
+++ trunk/pom.xml 2014-02-13 21:28:40 UTC (rev 47)
@@ -254,6 +254,10 @@
<!--<path>${env.ANDROID_HOME}</path>-->
<platform>15</platform>
</sdk>
+ <extractDuplicates>true</extractDuplicates>
+ <!--<sign>-->
+ <!--<debug>false</debug>-->
+ <!--</sign>-->
<!--<device>emulator</device>-->
<device>usb</device>
<zipalign>
@@ -266,7 +270,9 @@
${project.build.directory}/${project.artifactId}-${project.version}-aligned.apk
</outputApk>
</zipalign>
- <extractDuplicates>true</extractDuplicates>
+ <proguard>
+ <skip>true</skip> <!-- android.proguard.skip -->
+ </proguard>
</configuration>
<extensions>true</extensions>
</plugin>
Added: trunk/proguard.cfg
===================================================================
--- trunk/proguard.cfg (rev 0)
+++ trunk/proguard.cfg 2014-02-13 21:28:40 UTC (rev 47)
@@ -0,0 +1,10 @@
+-dontoptimize
+-dontobfuscate
+-dontwarn javax.annotation.**
+-dontwarn javax.inject.**
+-dontwarn sun.misc.Unsafe
+-dontwarn com.google.common.collect.MinMaxPriorityQueue
+
+-keepclasseswithmembers public class * {
+ public static void main(java.lang.String[]);
+}
\ No newline at end of file
Added: trunk/res/drawable/weight.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable/weight.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/layout/weights.xml
===================================================================
--- trunk/res/layout/weights.xml (rev 0)
+++ trunk/res/layout/weights.xml 2014-02-13 21:28:40 UTC (rev 47)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ScrollView android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:fillViewport="true">
+
+ <LinearLayout android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView android:text="@string/commercial_species_total_unloaded_weight"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+
+ <EditText android:id="@+id/total_unloaded_weight"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inputType="numberDecimal"/>
+
+ </LinearLayout>
+
+ </ScrollView>
+
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="bottom">
+
+ <Button android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@android:string/cancel"
+ android:onClick="cancel" />
+
+ <Button android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@android:string/ok"
+ android:onClick="validate" />
+
+ </LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
Added: trunk/res/menu/weight_menu.xml
===================================================================
--- trunk/res/menu/weight_menu.xml (rev 0)
+++ trunk/res/menu/weight_menu.xml 2014-02-13 21:28:40 UTC (rev 47)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:wlo="http://schemas.android.com/apk/res-auto">
+
+ <item android:id="@+id/weights"
+ android:icon="@drawable/weight"
+ wlo:showAsAction="always" />
+
+</menu>
\ No newline at end of file
Modified: trunk/res/values/strings.xml
===================================================================
--- trunk/res/values/strings.xml 2014-02-04 18:31:27 UTC (rev 46)
+++ trunk/res/values/strings.xml 2014-02-13 21:28:40 UTC (rev 47)
@@ -168,6 +168,10 @@
<string name="exit_form_confirmation">Do you want to save the form before leaving?</string>
+ <!-- Weights -->
+ <string name="weights_title">Weights</string>
+ <string name="commercial_species_total_unloaded_weight">Total unloaded weight</string>
+
<!--File chooser-->
<string name="file_chooser_location">Location</string>
<string name="file_chooser_cant_read_folder">folder can\'t be read!</string>
Modified: trunk/res/values-fr/strings.xml
===================================================================
--- trunk/res/values-fr/strings.xml 2014-02-04 18:31:27 UTC (rev 46)
+++ trunk/res/values-fr/strings.xml 2014-02-13 21:28:40 UTC (rev 47)
@@ -161,6 +161,10 @@
<string name="exit_form_confirmation">Voulez-vous sauvegarder les données avant de quitter le formulaire ?</string>
+ <!-- Weights -->
+ <string name="weights_title">Poids</string>
+ <string name="commercial_species_total_unloaded_weight">Poids total débarqué</string>
+
<!--File chooser-->
<string name="file_chooser_location">Emplacement</string>
<string name="file_chooser_cant_read_folder">Le dossier est illisible !</string>
Modified: trunk/src/fr/ifremer/wlo/ScientificSpeciesActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/ScientificSpeciesActivity.java 2014-02-04 18:31:27 UTC (rev 46)
+++ trunk/src/fr/ifremer/wlo/ScientificSpeciesActivity.java 2014-02-13 21:28:40 UTC (rev 47)
@@ -30,6 +30,7 @@
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
+import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
import com.google.common.collect.Maps;
@@ -58,10 +59,11 @@
@Override
public boolean onCreateOptionsMenu(Menu menu) {
CommercialSpeciesModel parent = (CommercialSpeciesModel) parentModel;
+ MenuInflater inflater = getMenuInflater();
if (parent.isSpeciesMix() || adapter.getCount() == 0) {
- MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.model_list_menu, menu);
}
+ inflater.inflate(R.menu.weight_menu, menu);
return true;
}
@@ -77,6 +79,18 @@
}
@Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.weights:
+ Intent intent = new Intent(this, WeightsActivity.class);
+ intent.putExtra(WeightsActivity.INTENT_COMMERCIAL_SPECIES, parentModel);
+ startActivity(intent);
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
protected Class<? extends WloModelEditionActivity> getEditionActivity() {
return ScientificSpeciesFormActivity.class;
}
Added: trunk/src/fr/ifremer/wlo/WeightsActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/WeightsActivity.java (rev 0)
+++ trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-13 21:28:40 UTC (rev 47)
@@ -0,0 +1,80 @@
+package fr.ifremer.wlo;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.EditText;
+import com.google.common.collect.Multimap;
+import fr.ifremer.wlo.models.BaseModel;
+import fr.ifremer.wlo.models.CommercialSpeciesModel;
+import fr.ifremer.wlo.storage.WloSqlOpenHelper;
+import fr.ifremer.wlo.utils.BaseTextWatcher;
+import org.apache.commons.lang3.StringUtils;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public class WeightsActivity extends WloBaseActivity {
+
+ private static final String TAG = "WeightsActivity";
+
+ public static final String INTENT_COMMERCIAL_SPECIES = "commercialSpecies";
+
+ protected CommercialSpeciesModel commercialSpeciesModel;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ commercialSpeciesModel = (CommercialSpeciesModel) getIntent().getSerializableExtra(INTENT_COMMERCIAL_SPECIES);
+ getSupportActionBar().setSubtitle(commercialSpeciesModel.toString(this));
+
+ final EditText totalUnloadedWeightText = (EditText) findViewById(R.id.total_unloaded_weight);
+ Log.d(TAG, "TotalUnloadedWeight " + commercialSpeciesModel.getTotalUnloadedWeight());
+ totalUnloadedWeightText.setText(String.valueOf(commercialSpeciesModel.getTotalUnloadedWeight()));
+ totalUnloadedWeightText.addTextChangedListener(new BaseTextWatcher() {
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ Integer newValue = null;
+ Log.d(TAG, "onTextChanged " + s);
+ if (StringUtils.isNotEmpty(s)) {
+ newValue = Integer.parseInt(s.toString());
+ }
+ Log.d(TAG, "TotalUnloadedWeight " + newValue);
+ commercialSpeciesModel.setTotalUnloadedWeight(newValue);
+ totalUnloadedWeightText.setSelection(start + count);
+ }
+
+ });
+ }
+
+ @Override
+ protected Integer getContentView() {
+ return R.layout.weights;
+ }
+
+ @Override
+ protected Class<? extends WloBaseActivity> getUpActivity() {
+ return ScientificSpeciesActivity.class;
+ }
+
+ public void validate(View view) {
+ saveModel();
+ finish();
+ }
+
+ /* Protected methods */
+
+ protected void saveModel() {
+ WloSqlOpenHelper woh = new WloSqlOpenHelper(this);
+ Log.d(TAG, "TotalUnloadedWeight " + commercialSpeciesModel.getTotalUnloadedWeight());
+ woh.saveData(commercialSpeciesModel);
+ woh.close();
+ }
+
+}
Added: trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java (rev 0)
+++ trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java 2014-02-13 21:28:40 UTC (rev 47)
@@ -0,0 +1,102 @@
+package fr.ifremer.wlo.models;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import fr.ifremer.wlo.utils.UIUtils;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since 0.2
+ */
+public class CategoryWeightModel extends HierarchicalModel<ScientificSpeciesModel> {
+
+ private static final String TAG = "CategoryWeightModel";
+
+ public static final String TABLE_NAME = "category_weights";
+ public static final String COLUMN_CATEGORY_1 = "category1";
+ public static final String COLUMN_CATEGORY_2 = "category2";
+ public static final String COLUMN_CATEGORY_3 = "category3";
+ public static final String COLUMN_WEIGHT = "weight";
+ public static final String COLUMN_SCIENTIFIC_SPECIES_ID = "scientificSpeciesId";
+ public static final String[] ALL_COLUMNS = new String[] {
+ _ID,
+ COLUMN_CATEGORY_1,
+ COLUMN_CATEGORY_2,
+ COLUMN_CATEGORY_3,
+ COLUMN_WEIGHT,
+ COLUMN_SCIENTIFIC_SPECIES_ID
+ };
+
+ @Override
+ public String getTableName() {
+ return TABLE_NAME;
+ }
+
+ protected String category1;
+ protected String category2;
+ protected String category3;
+ protected int weight;
+
+ public CategoryWeightModel() {
+ }
+
+ public CategoryWeightModel(Cursor cursor) {
+ super(cursor);
+ category1 = cursor.getString(1);
+ category2 = cursor.getString(2);
+ category3 = cursor.getString(3);
+ weight = cursor.getInt(4);
+ }
+ public String getCategory1() {
+ return category1;
+ }
+
+ public void setCategory1(String category1) {
+ Object oldValue = this.category1;
+ this.category1 = category1;
+ firePropertyChange(COLUMN_CATEGORY_1, oldValue, category1);
+ }
+
+ public String getCategory2() {
+ return category2;
+ }
+
+ public void setCategory2(String category2) {
+ Object oldValue = this.category2;
+ this.category2 = category2;
+ firePropertyChange(COLUMN_CATEGORY_2, oldValue, category2);
+ }
+
+ public String getCategory3() {
+ return category3;
+ }
+
+ public void setCategory3(String category3) {
+ Object oldValue = this.category3;
+ this.category3 = category3;
+ firePropertyChange(COLUMN_CATEGORY_3, oldValue, category3);
+ }
+
+ public int getWeight() {
+ return weight;
+ }
+
+ public void setWeight(int weight) {
+ Object oldValue = this.weight;
+ this.weight = weight;
+ firePropertyChange(COLUMN_WEIGHT, oldValue, weight);
+ }
+
+ @Override
+ public ContentValues convertIntoContentValues() {
+ ContentValues value = super.convertIntoContentValues();
+ putValue(value, COLUMN_CATEGORY_1, category1);
+ putValue(value, COLUMN_CATEGORY_2, category2);
+ putValue(value, COLUMN_CATEGORY_3, category3);
+ putValue(value, COLUMN_WEIGHT, weight);
+ putValue(value, COLUMN_SCIENTIFIC_SPECIES_ID, getParentId());
+ return value;
+ }
+
+}
Modified: trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java 2014-02-04 18:31:27 UTC (rev 46)
+++ trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java 2014-02-13 21:28:40 UTC (rev 47)
@@ -54,6 +54,7 @@
public static final String COLUMN_STATE = "state";
public static final String COLUMN_PRESENTATION = "presentation";
public static final String COLUMN_COMMENT = "comment";
+ public static final String COLUMN_TOTAL_UNLOADED_WEIGHT = "totalUnloadedWeight";
public static final String COLUMN_METIER_ID = "metierId";
public static final String[] ALL_COLUMNS = new String[] {
_ID,
@@ -65,6 +66,7 @@
COLUMN_STATE,
COLUMN_PRESENTATION,
COLUMN_COMMENT,
+ COLUMN_TOTAL_UNLOADED_WEIGHT,
COLUMN_METIER_ID
};
@@ -76,6 +78,7 @@
protected State state;
protected Presentation presentation;
protected String comment;
+ protected Integer totalUnloadedWeight;
public CommercialSpeciesModel() {
}
@@ -96,6 +99,7 @@
String presentationId = cursor.getString(7);
presentation = DataCache.getPresentationById(context, presentationId);
comment = cursor.getString(8);
+ totalUnloadedWeight = cursor.getInt(9);
}
public CommercialSpecies getFaoCode() {
@@ -179,6 +183,16 @@
firePropertyChange(COLUMN_COMMENT, oldValue, comment);
}
+ public Integer getTotalUnloadedWeight() {
+ return totalUnloadedWeight;
+ }
+
+ public void setTotalUnloadedWeight(Integer totalUnloadedWeight) {
+ Object oldValue = this.totalUnloadedWeight;
+ this.totalUnloadedWeight = totalUnloadedWeight;
+ firePropertyChange(COLUMN_TOTAL_UNLOADED_WEIGHT, oldValue, totalUnloadedWeight);
+ }
+
@Override
public String getTableName() {
return TABLE_NAME;
@@ -200,6 +214,7 @@
putValue(value, COLUMN_STATE, state != null ? state.getId() : null);
putValue(value, COLUMN_PRESENTATION, presentation != null ? presentation.getId() : null);
putValue(value, COLUMN_COMMENT, comment);
+ putValue(value, COLUMN_TOTAL_UNLOADED_WEIGHT, totalUnloadedWeight);
putValue(value, COLUMN_METIER_ID, getParentId());
return value;
}
Modified: trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java 2014-02-04 18:31:27 UTC (rev 46)
+++ trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java 2014-02-13 21:28:40 UTC (rev 47)
@@ -44,18 +44,21 @@
public static final String COLUMN_NAME = "name";
public static final String COLUMN_TAKING_ACTIVATION = "takingActivation";
public static final String COLUMN_COMMENT = "comment";
+ public static final String COLUMN_SAMPLE_WEIGHT = "sampleWeight";
public static final String COLUMN_COMMERCIAL_SPECIES_ID = "commercialSpeciesId";
public static final String[] ALL_COLUMNS = new String[] {
_ID,
COLUMN_NAME,
COLUMN_TAKING_ACTIVATION,
COLUMN_COMMENT,
+ COLUMN_SAMPLE_WEIGHT,
COLUMN_COMMERCIAL_SPECIES_ID
};
protected ScientificSpecies name;
protected boolean takingActivation;
protected String comment;
+ protected int sampleWeight;
public ScientificSpeciesModel() {
}
@@ -66,6 +69,7 @@
name = DataCache.getScientificSpeciesById(context, nameId);
takingActivation = cursor.getShort(2) > 0;
comment = cursor.getString(3);
+ sampleWeight = cursor.getInt(4);
}
public ScientificSpecies getName() {
@@ -98,6 +102,16 @@
firePropertyChange(COLUMN_COMMENT, oldValue, comment);
}
+ public int getSampleWeight() {
+ return sampleWeight;
+ }
+
+ public void setSampleWeight(int sampleWeight) {
+ Object oldValue = this.sampleWeight;
+ this.sampleWeight = sampleWeight;
+ firePropertyChange(COLUMN_SAMPLE_WEIGHT, oldValue, sampleWeight);
+ }
+
@Override
public String getTableName() {
return TABLE_NAME;
@@ -114,6 +128,7 @@
putValue(value, COLUMN_NAME, name != null ? name.getId() : null);
putValue(value, COLUMN_TAKING_ACTIVATION, takingActivation ? 1 : 0);
putValue(value, COLUMN_COMMENT, comment);
+ putValue(value, COLUMN_SAMPLE_WEIGHT, sampleWeight);
putValue(value, COLUMN_COMMERCIAL_SPECIES_ID, getParentId());
return value;
}
Modified: trunk/src/fr/ifremer/wlo/preferences/WloMultiSelectListPreference.java
===================================================================
--- trunk/src/fr/ifremer/wlo/preferences/WloMultiSelectListPreference.java 2014-02-04 18:31:27 UTC (rev 46)
+++ trunk/src/fr/ifremer/wlo/preferences/WloMultiSelectListPreference.java 2014-02-13 21:28:40 UTC (rev 47)
@@ -1,5 +1,29 @@
package fr.ifremer.wlo.preferences;
+/*
+ * #%L
+ * WLO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.MultiSelectListPreference;
Modified: trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
===================================================================
--- trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java 2014-02-04 18:31:27 UTC (rev 46)
+++ trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java 2014-02-13 21:28:40 UTC (rev 47)
@@ -33,6 +33,7 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import fr.ifremer.wlo.models.BaseModel;
+import fr.ifremer.wlo.models.CategoryWeightModel;
import fr.ifremer.wlo.models.CommercialSpeciesModel;
import fr.ifremer.wlo.models.ContextModel;
import fr.ifremer.wlo.models.LocationModel;
@@ -66,7 +67,7 @@
private static final String TAG = "WloOpenHelper";
public static final String DATABASE_NAME = "wlo.db";
- public static final int DATABASE_VERSION = 14;
+ public static final int DATABASE_VERSION = 15;
public static final String TEXT_TYPE = " TEXT";
public static final String BIGINT_TYPE = " BIGINT";
@@ -154,6 +155,7 @@
CommercialSpeciesModel.COLUMN_STATE + TEXT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_PRESENTATION + TEXT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_COMMENT + TEXT_TYPE + COMMA_SEP +
+ CommercialSpeciesModel.COLUMN_TOTAL_UNLOADED_WEIGHT + BIGINT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_METIER_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
"FOREIGN KEY(" + CommercialSpeciesModel.COLUMN_METIER_ID + ") REFERENCES " +
MetierModel.TABLE_NAME + "(" + MetierModel._ID + ") ON DELETE CASCADE" + COMMA_SEP +
@@ -177,6 +179,7 @@
ScientificSpeciesModel.COLUMN_NAME + TEXT_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_TAKING_ACTIVATION + BYTE_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_COMMENT + TEXT_TYPE + COMMA_SEP +
+ ScientificSpeciesModel.COLUMN_SAMPLE_WEIGHT + BIGINT_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_COMMERCIAL_SPECIES_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
"FOREIGN KEY(" + ScientificSpeciesModel.COLUMN_COMMERCIAL_SPECIES_ID + ") REFERENCES " +
CommercialSpeciesModel.TABLE_NAME + "(" + CommercialSpeciesModel._ID + ") ON DELETE CASCADE" + COMMA_SEP +
@@ -204,7 +207,22 @@
protected static final String SQL_DELETE_MEASUREMENTS =
"DROP TABLE IF EXISTS " + MeasurementModel.TABLE_NAME;
+ // CATEGORY WEIGHTS
+ protected static final String SQL_CREATE_CATEGORY_WEIGHTS =
+ "CREATE TABLE " + CategoryWeightModel.TABLE_NAME + " (" +
+ CategoryWeightModel._ID + TEXT_TYPE + " PRIMARY KEY" + COMMA_SEP +
+ CategoryWeightModel.COLUMN_CATEGORY_1 + TEXT_TYPE + COMMA_SEP +
+ CategoryWeightModel.COLUMN_CATEGORY_2 + TEXT_TYPE + COMMA_SEP +
+ CategoryWeightModel.COLUMN_CATEGORY_3 + TEXT_TYPE + COMMA_SEP +
+ CategoryWeightModel.COLUMN_WEIGHT + BIGINT_TYPE + COMMA_SEP +
+ CategoryWeightModel.COLUMN_SCIENTIFIC_SPECIES_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
+ "FOREIGN KEY(" + CategoryWeightModel.COLUMN_SCIENTIFIC_SPECIES_ID + ") REFERENCES " +
+ ScientificSpeciesModel.TABLE_NAME + "(" + ScientificSpeciesModel._ID + ") ON DELETE CASCADE" +
+ " )";
+ protected static final String SQL_DELETE_CATEGORY_WEIGHTS =
+ "DROP TABLE IF EXISTS " + CategoryWeightModel.TABLE_NAME;
+
// Referentials
// Ages
@@ -370,12 +388,14 @@
db.execSQL(SQL_CREATE_COMMERCIAL_SPECIES);
db.execSQL(SQL_CREATE_SCIENTIFIC_SPECIES);
db.execSQL(SQL_CREATE_MEASUREMENTS);
+ db.execSQL(SQL_CREATE_CATEGORY_WEIGHTS);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
//TODO kmorin 20131129 migrate data before droping the table
// models
+ db.execSQL(SQL_DELETE_CATEGORY_WEIGHTS);
db.execSQL(SQL_DELETE_MEASUREMENTS);
db.execSQL(SQL_DELETE_SCIENTIFIC_SPECIES);
db.execSQL(SQL_DELETE_COMMERCIAL_SPECIES);
@@ -502,6 +522,16 @@
}
}
+ // CATEGORY WEIGHTS
+
+ public Cursor getAllCategoryWeigths(String scientificSpeciesId) {
+ SQLiteDatabase db = getReadableDatabase();
+ Cursor cursor = db.query(CategoryWeightModel.TABLE_NAME, CategoryWeightModel.ALL_COLUMNS,
+ CategoryWeightModel.COLUMN_SCIENTIFIC_SPECIES_ID + " = ?", new String[]{ scientificSpeciesId },
+ null, null, null);
+ return cursor;
+ }
+
// Referentials
public Cursor getAllRefAges() {
@@ -581,25 +611,6 @@
return cursor;
}
- //TODO remove when tests are over
- public void clearReferentials() {
- SQLiteDatabase db = getWritableDatabase();
- db.beginTransaction();
- db.delete(Age.TABLE_NAME, null, null);
- db.delete(CommercialSpecies.TABLE_NAME, null, null);
- db.delete(Gender.TABLE_NAME, null, null);
- db.delete(Location.TABLE_NAME, null, null);
- db.delete(Maturity.TABLE_NAME, null, null);
- db.delete(Mensuration.TABLE_NAME, null, null);
- db.delete(Metier.TABLE_NAME, null, null);
- db.delete(Presentation.TABLE_NAME, null, null);
- db.delete(ScientificSpecies.TABLE_NAME, null, null);
- db.delete(State.TABLE_NAME, null, null);
- db.delete(Vessel.TABLE_NAME, null, null);
- db.setTransactionSuccessful();
- db.endTransaction();
- }
-
public <M extends BaseModel> void saveData(M model) {
saveData(Lists.newArrayList(model));
}
Modified: trunk/src/fr/ifremer/wlo/utils/WloAutoCompleteTextViewWithFavorites.java
===================================================================
--- trunk/src/fr/ifremer/wlo/utils/WloAutoCompleteTextViewWithFavorites.java 2014-02-04 18:31:27 UTC (rev 46)
+++ trunk/src/fr/ifremer/wlo/utils/WloAutoCompleteTextViewWithFavorites.java 2014-02-13 21:28:40 UTC (rev 47)
@@ -1,5 +1,29 @@
package fr.ifremer.wlo.utils;
+/*
+ * #%L
+ * WLO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
1
0
r46 - in trunk: res/layout res/values res/values-fr src/fr/ifremer/wlo/measurement src/fr/ifremer/wlo/utils
by kmorin@users.forge.codelutin.com 04 Feb '14
by kmorin@users.forge.codelutin.com 04 Feb '14
04 Feb '14
Author: kmorin
Date: 2014-02-04 19:31:27 +0100 (Tue, 04 Feb 2014)
New Revision: 46
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/46
Log:
fixes #4186 Les lignes du tableau des nombres par taille ne prennent pas tout la largeur
Added:
trunk/res/values/colors.xml
Modified:
trunk/res/layout/main.xml
trunk/res/layout/measurement.xml
trunk/res/layout/measurement_table_fragment.xml
trunk/res/layout/measurement_table_row.xml
trunk/res/values-fr/strings.xml
trunk/res/values/strings.xml
trunk/src/fr/ifremer/wlo/measurement/LogsFragment.java
trunk/src/fr/ifremer/wlo/measurement/TableAdapter.java
trunk/src/fr/ifremer/wlo/utils/BaseModelArrayAdapter.java
Modified: trunk/res/layout/main.xml
===================================================================
--- trunk/res/layout/main.xml 2014-02-04 14:27:37 UTC (rev 45)
+++ trunk/res/layout/main.xml 2014-02-04 18:31:27 UTC (rev 46)
@@ -5,6 +5,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
+ <ImageView android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:src="@drawable/wlo_ico"
+ android:layout_weight="1"/>
+
<TextView style="@style/MainTitle"
android:text="@string/app_name"
android:layout_weight="1"/>
Modified: trunk/res/layout/measurement.xml
===================================================================
--- trunk/res/layout/measurement.xml 2014-02-04 14:27:37 UTC (rev 45)
+++ trunk/res/layout/measurement.xml 2014-02-04 18:31:27 UTC (rev 46)
@@ -163,6 +163,6 @@
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
- android:background="@android:color/holo_blue_dark"/>
+ android:background="@color/dark_gray"/>
</android.support.v4.widget.DrawerLayout>
\ No newline at end of file
Modified: trunk/res/layout/measurement_table_fragment.xml
===================================================================
--- trunk/res/layout/measurement_table_fragment.xml 2014-02-04 14:27:37 UTC (rev 45)
+++ trunk/res/layout/measurement_table_fragment.xml 2014-02-04 18:31:27 UTC (rev 46)
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<ListView android:id="@+id/table_content"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="match_parent"/>
-</LinearLayout>
\ No newline at end of file
+</FrameLayout>
\ No newline at end of file
Modified: trunk/res/layout/measurement_table_row.xml
===================================================================
--- trunk/res/layout/measurement_table_row.xml 2014-02-04 14:27:37 UTC (rev 45)
+++ trunk/res/layout/measurement_table_row.xml 2014-02-04 18:31:27 UTC (rev 46)
@@ -10,19 +10,23 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
- android:gravity="center_vertical"
- android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
- android:paddingRight="?android:attr/listPreferredItemPaddingRight"
+ android:gravity="center_vertical|right"
+ android:paddingLeft="20dp"
+ android:paddingRight="20dp"
android:minHeight="?android:attr/listPreferredItemHeightSmall"/>
+ <View android:layout_height="match_parent"
+ android:layout_width="2px"
+ android:background="@color/dark_gray"/>
+
<TextView android:id="@+id/table_nb"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
- android:gravity="center_vertical"
- android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
- android:paddingRight="?android:attr/listPreferredItemPaddingRight"
+ android:gravity="center_vertical|right"
+ android:paddingLeft="20dp"
+ android:paddingRight="20dp"
android:minHeight="?android:attr/listPreferredItemHeightSmall"/>
</LinearLayout>
\ No newline at end of file
Added: trunk/res/values/colors.xml
===================================================================
--- trunk/res/values/colors.xml (rev 0)
+++ trunk/res/values/colors.xml 2014-02-04 18:31:27 UTC (rev 46)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <color name="gray">#404040</color>
+ <color name="dark_gray">#202020</color>
+</resources>
\ No newline at end of file
Modified: trunk/res/values/strings.xml
===================================================================
--- trunk/res/values/strings.xml 2014-02-04 14:27:37 UTC (rev 45)
+++ trunk/res/values/strings.xml 2014-02-04 18:31:27 UTC (rev 46)
@@ -15,8 +15,9 @@
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_name">WLO</string>
+ <string name="app_name">Wild Life Observations</string>
+
<!-- Common -->
<string name="yes">Yes</string>
<string name="no">No</string>
Modified: trunk/res/values-fr/strings.xml
===================================================================
--- trunk/res/values-fr/strings.xml 2014-02-04 14:27:37 UTC (rev 45)
+++ trunk/res/values-fr/strings.xml 2014-02-04 18:31:27 UTC (rev 46)
@@ -15,7 +15,6 @@
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_name">WLO</string>
<!-- Common -->
<string name="yes">Oui</string>
Modified: trunk/src/fr/ifremer/wlo/measurement/LogsFragment.java
===================================================================
--- trunk/src/fr/ifremer/wlo/measurement/LogsFragment.java 2014-02-04 14:27:37 UTC (rev 45)
+++ trunk/src/fr/ifremer/wlo/measurement/LogsFragment.java 2014-02-04 18:31:27 UTC (rev 46)
@@ -97,7 +97,20 @@
result += StringUtils.join(cats, " - ");
return result;
}
- });
+ }) {
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View result = super.getView(position, convertView, parent);
+ int color;
+ if (position % 2 == 0) {
+ color = R.color.dark_gray;
+ } else {
+ color = android.R.color.black;
+ }
+ result.setBackgroundResource(color);
+ return result;
+ }
+ };
dialogBuilder = new AlertDialog.Builder(activity)
.setTitle(R.string.input_deletion_confirmation_title)
Modified: trunk/src/fr/ifremer/wlo/measurement/TableAdapter.java
===================================================================
--- trunk/src/fr/ifremer/wlo/measurement/TableAdapter.java 2014-02-04 14:27:37 UTC (rev 45)
+++ trunk/src/fr/ifremer/wlo/measurement/TableAdapter.java 2014-02-04 18:31:27 UTC (rev 46)
@@ -3,8 +3,8 @@
/*
* #%L
* WLO
- * $Id:$
- * $HeadURL:$
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2013 - 2014 Ifremer
* %%
@@ -28,6 +28,8 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.ViewParent;
+import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.TextView;
import fr.ifremer.wlo.R;
@@ -79,8 +81,7 @@
if (convertView == null) {
convertView = LayoutInflater.from(context)
- .inflate(R.layout.measurement_table_row, parent, false);
-// convertView.setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, AbsListView.LayoutParams.WRAP_CONTENT));
+ .inflate(R.layout.measurement_table_row, null);
viewHolder = new ViewHolder();
viewHolder.sizeText = (TextView) convertView.findViewById(R.id.table_size);
@@ -97,7 +98,7 @@
int color;
if (position % 2 == 0) {
- color = android.R.color.holo_blue_dark;
+ color = R.color.gray;
} else {
color = android.R.color.black;
}
Modified: trunk/src/fr/ifremer/wlo/utils/BaseModelArrayAdapter.java
===================================================================
--- trunk/src/fr/ifremer/wlo/utils/BaseModelArrayAdapter.java 2014-02-04 14:27:37 UTC (rev 45)
+++ trunk/src/fr/ifremer/wlo/utils/BaseModelArrayAdapter.java 2014-02-04 18:31:27 UTC (rev 46)
@@ -155,7 +155,7 @@
TextView text;
if (convertView == null) {
- view = mInflater.inflate(resource, parent, false);
+ view = mInflater.inflate(resource, null);
} else {
view = convertView;
}
1
0
Author: kmorin
Date: 2014-02-04 15:27:37 +0100 (Tue, 04 Feb 2014)
New Revision: 45
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/45
Log:
fixes #4307 esp?\195?\169ce fao : arret application quand saisie d'une cat?\195?\169gorie terrain au clavier num?\195?\169rique
Modified:
trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java
Modified: trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java 2014-02-04 13:59:04 UTC (rev 44)
+++ trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java 2014-02-04 14:27:37 UTC (rev 45)
@@ -130,6 +130,8 @@
precisionSpinner.setSelection(model.getPrecision().ordinal());
Set<String> sortCategories = DataCache.getAllSortCategories(this);
+ sortCategories.remove("");
+ initEditText(R.id.commercial_species_form_sortCategory, CommercialSpeciesModel.COLUMN_SORT_CATEGORY);
initAutoCompleteTextView(R.id.commercial_species_form_sortCategory, CommercialSpeciesModel.COLUMN_SORT_CATEGORY, sortCategories);
List<State> states = Lists.newArrayList(DataCache.getAllStates(this));
1
0
04 Feb '14
Author: kmorin
Date: 2014-02-04 14:59:04 +0100 (Tue, 04 Feb 2014)
New Revision: 44
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/44
Log:
fixes #4315 Les dates dans les formulaires ne sont plus affich?\195?\169es tant qu'on ne d?\195?\169finit pas de format dans la configuration
fixes #4308 L'?\195?\169cran des mensuration ne s'affiche pas apr?\195?\168s saisie de l'esp?\195?\168ce scientifique
Modified:
trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
trunk/src/fr/ifremer/wlo/utils/BaseModelArrayAdapter.java
trunk/src/fr/ifremer/wlo/utils/UIUtils.java
Modified: trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-01-30 17:54:19 UTC (rev 43)
+++ trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-04 13:59:04 UTC (rev 44)
@@ -70,6 +70,7 @@
import fr.ifremer.wlo.models.VesselModel;
import fr.ifremer.wlo.models.referentials.Gender;
import fr.ifremer.wlo.storage.WloSqlOpenHelper;
+import fr.ifremer.wlo.utils.BaseModelArrayAdapter;
import fr.ifremer.wlo.utils.BaseTextWatcher;
import fr.ifremer.wlo.utils.UIUtils;
import org.apache.commons.lang3.ObjectUtils;
@@ -222,23 +223,23 @@
Spinner genderSpinner = (Spinner) findViewById(R.id.gender_spinner);
genderSpinner.setOnItemSelectedListener(this);
- List<Gender> genders = Lists.newArrayList(DataCache.getAllGenders(this));
- genders.add(0, null);
- ArrayAdapter<Gender> gendersAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, genders);
+ List genders = Lists.newArrayList(DataCache.getAllGenders(this));
+ genders.add(0, "");
+ ArrayAdapter gendersAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, genders);
genderSpinner.setAdapter(gendersAdapter);
Spinner maturitySpinner = (Spinner) findViewById(R.id.maturity_spinner);
maturitySpinner.setOnItemSelectedListener(this);
- List<Maturity> maturities = Lists.newArrayList(DataCache.getAllMaturities(this));
- maturities.add(0, null);
- ArrayAdapter<Maturity> maturitiesAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, maturities);
+ List maturities = Lists.newArrayList(DataCache.getAllMaturities(this));
+ maturities.add(0, "");
+ ArrayAdapter maturitiesAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, maturities);
maturitySpinner.setAdapter(maturitiesAdapter);
Spinner ageSpinner = (Spinner) findViewById(R.id.age_spinner);
ageSpinner.setOnItemSelectedListener(this);
- List<Age> ages = Lists.newArrayList(DataCache.getAllAges(this));
- ages.add(0, null);
- ArrayAdapter<Age> agesAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, ages);
+ List ages = Lists.newArrayList(DataCache.getAllAges(this));
+ ages.add(0, "");
+ ArrayAdapter agesAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, ages);
ageSpinner.setAdapter(agesAdapter);
initFishMeasurement(10 * measurements.getPrecision().getUnitDivider(), null, null, null);
@@ -329,8 +330,13 @@
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
- BaseModel selected = (BaseModel) adapterView.getItemAtPosition(i);
- String id = selected != null ? selected.getId() : null;
+ String id;
+ if (i == 0) {
+ id = null;
+ } else {
+ BaseModel selected = (BaseModel) adapterView.getItemAtPosition(i);
+ id = selected != null ? selected.getId() : null;
+ }
switch(adapterView.getId()) {
case R.id.gender_spinner:
measurement.setCategory1(id);
@@ -346,6 +352,17 @@
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
+ switch(adapterView.getId()) {
+ case R.id.gender_spinner:
+ measurement.setCategory1(null);
+ break;
+ case R.id.maturity_spinner:
+ measurement.setCategory2(null);
+ break;
+ case R.id.age_spinner:
+ measurement.setCategory3(null);
+ break;
+ }
}
/* Public methods */
Modified: trunk/src/fr/ifremer/wlo/utils/BaseModelArrayAdapter.java
===================================================================
--- trunk/src/fr/ifremer/wlo/utils/BaseModelArrayAdapter.java 2014-01-30 17:54:19 UTC (rev 43)
+++ trunk/src/fr/ifremer/wlo/utils/BaseModelArrayAdapter.java 2014-02-04 13:59:04 UTC (rev 44)
@@ -176,7 +176,9 @@
M item = getItem(position);
String s;
- if (toStringFunction != null) {
+ if (item == null) {
+ s = "";
+ } else if (toStringFunction != null) {
s = toStringFunction.apply(item);
} else {
s = item.toString(getContext());
Modified: trunk/src/fr/ifremer/wlo/utils/UIUtils.java
===================================================================
--- trunk/src/fr/ifremer/wlo/utils/UIUtils.java 2014-01-30 17:54:19 UTC (rev 43)
+++ trunk/src/fr/ifremer/wlo/utils/UIUtils.java 2014-02-04 13:59:04 UTC (rev 44)
@@ -3,8 +3,8 @@
/*
* #%L
* WLO
- * $Id:$
- * $HeadURL:$
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2013 - 2014 Ifremer
* %%
@@ -108,7 +108,8 @@
public static String getDateFormat(Context context) {
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
- String dateFormat = sharedPref.getString(ListItemPreference.DATE_FORMAT.getKey(), "");
+ String defaultFormat = context.getResources().getStringArray(ListItemPreference.DATE_FORMAT.getValuesArrayId())[0];
+ String dateFormat = sharedPref.getString(ListItemPreference.DATE_FORMAT.getKey(), defaultFormat);
return dateFormat;
}
1
0