Skip to content

jorgepedret/Land-Plan

Repository files navigation

Land Plan

LANdpLAN is a computer program that puts the ability of planning a successful food producing landscape in the hands of anyone who has some basic computing skills.

So far it is an idea and a program is in the making.

Your help is wanted, I (Jonathan) am not a programmer... yet...

Requirements:

Using on Mac

Using on Linux

  • LibreOffice version 7.3.5.2 and 7.2.7.2 work on linux. other versions may give the error: The connection to the data source “LANdpLAN.odb” could not be established. error in script file line 1 Unexpected token UNIQUE, requires COLLATION in statement [SET DATABASE UNIQUE] ./connectivity/source/drivers/jdbc/Object.cxx:175

  • 32bit linux computers will crash unless you add a boot parameter to the kernel by: From a terminal (or after pressing Alt + F2) run: gksudo gedit /etc/default/grub (or use sudo nano if gksudo or gedit are not available) and enter your password. Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and append stack_guard_gap=1 to its end. For example: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash stack_guard_gap=1" Save the file and close the editor. Finally, start a terminal and run: sudo update-grub to update GRUB's configuration file (you probably need to enter your password). On the next reboot, the kernel should be started with the boot parameter. To permanently remove it, simply remove the parameter from GRUB_CMDLINE_LINUX_DEFAULT and run sudo update-grub again. To verify your changes, you can see exactly what parameters your kernel booted with by executing cat /proc/cmdline.

Setup

  • You must change the macro security settings in Libreoffice: Open LibreOffice and got to:

    Tools>Options>LibreOffice>Security>Macro Security...>Medium

  • Open up the LANdpLAN.odb file.

  • you need to tell the databse where the files are: Go to Edit>Database>Properties: and change the file address to reflect your setup for example: hsqldb:file:////home/jonathan/Dropbox/LANdpLAN/LANdpLAN/mydb;default_schema=true;shutdown=true;hsqldb.default_table_type=c becomes hsqldb:file:////home/workaway/Dropbox/LANdpLAN/LANdpLAN/mydb;default_schema=true;shutdown=true;hsqldb.default_table_type=c

  • to add images: to the Drawing>Plant_images>images folder. Name them using caps for the first letter of each Genus, species with no spaces, ".jpg" at the end and ascending numbers if there are mor than one like GenusSpecies.jpg, GenusSpecies.jpg2, GenusSpecies.jpg3 next use the file browser and opne the folder Drawing>Plant_images>images select all and copy. (this copies all of the file paths in the folder) open aaaimages.ods select column A on Sheet1 and paste. on Sheet2 select all go to Tables inthe LANdpLAN databse and delete "images" click and drag the selcetion on sheet two to the Table window in the LANdpLAN database. Givethe name "images", select definition and data, next> move all, next> right click ID select "Primary Key", change Field Type to "Integer", Create


  • If you create a new Table you will need to:

use Tools > SQL... to add the AutoValue function to your Primary Key column as shown below... replacing the TableName and ColumnName with your own:

ALTER TABLE "TableName" ALTER COLUMN "ColumnName" INTEGER IDENTITY;

for example: ALTER TABLE "species" ALTER COLUMN "id" INTEGER IDENTITY; or ALTER TABLE "Availability" ALTER COLUMN "ID" INTEGER IDENTITY; or ALTER TABLE "plot_plants" ALTER COLUMN "id" INTEGER IDENTITY; or ALTER TABLE "images" ALTER COLUMN "ID" INTEGER IDENTITY;

This will update the table but you'll need to click: View > Refresh Tables to see the change in the Base GUI.

If the id or ID field is not auto incrementing the way it should, then you can fix this by:

A)ALTER TABLE 'YOURTABLENAME' ALTER COLUMN 'YOURCOLUMNNAME' SET GENERATED BY DEFAULT AS IDENTITY

ex: ALTER TABLE 'Availability' ALTER COLUMN 'ID' SET GENERATED BY DEFAULT AS IDENTITY or ALTER TABLE 'plot_plants' ALTER COLUMN 'id' SET GENERATED BY DEFAULT AS IDENTITY or ALTER TABLE 'images' ALTER COLUMN 'ID' SET GENERATED BY DEFAULT AS IDENTITY

B)Next get the highest value already in use in the table and add 1 to that for use in the next statement:

ALTER TABLE 'YOURTABLENAME' ALTER COLUMN 'YOURCOLUMNNAME' RESTART WITH XXX

ex: ALTER TABLE 'Availability' ALTER COLUMN 'ID' RESTART WITH 11216 or ALTER TABLE 'plot_plants' ALTER COLUMN 'id' RESTART WITH 3017 or ALTER TABLE 'images' ALTER COLUMN 'ID' RESTART WITH 440

where XXX = that highest value + 1.


here is a list of the table views in case you need to replace a table that depends on them: 6 annual_cultivation_dates_view 1 annual_cultivation_practices_calculated_view 3 plot_annual_cultivation_dates_view 2 plot_annual_cultivation_practices_calculated_view 4 view_growers_annaul_cultivation_practices 5 view_p_a_c_p_ plot_annual_cultivation_practices

🌱 License Note

This project is copyleft and open source.

You are free to use, modify, and redistribute it under the terms of the GNU General Public License v3, as long as you attribute the original source and keep it open for others.

See the full LICENSE file for details.

About

Grow Food Assistant

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published