diff --git a/.gitignore b/.gitignore index db26ae491d365f3623e1d2d05c51acc02b9ee9fe..09f675ff3777a09796bca0bf30305485d5e8b638 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.jl.cov *.jl.*.cov *.jl.mem -*.sh~ \ No newline at end of file +*.sh~ +*.jl~ diff --git a/.travis.yml b/.travis.yml index efdd0c8e683a6a6a5c39ea1c449a7c67a546c82e..8dbaadbfbbdfae1b45a9052b5a98e28d6079de14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,9 +27,9 @@ git: ## uncomment the following lines to override the default test script #script: -# - julia -e 'Pkg.clone(pwd()); Pkg.build("LabConnection"); Pkg.test("LabConnection"; coverage=true)' +# - julia -e 'Pkg.clone(pwd()); Pkg.build("LabConnections"); Pkg.test("LabConnections"; coverage=true)' after_success: # push coverage results to Coveralls - - julia -e 'cd(Pkg.dir("LabConnection")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())' + - julia -e 'cd(Pkg.dir("LabConnections")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())' # push coverage results to Codecov - - julia -e 'cd(Pkg.dir("LabConnection")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' + - julia -e 'cd(Pkg.dir("LabConnections")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' diff --git a/Examples/testLED.jl b/Examples/testLED.jl index 6a9740acffa0a3bb7b6a10f9528ee8a90adb2cbc..a1ca59942854ca6c4542387967468c72f4478ef0 100644 --- a/Examples/testLED.jl +++ b/Examples/testLED.jl @@ -1,9 +1,9 @@ #On beaglebone, run: -# include("LabConnection/src/LabConnection.jl") -# using LabConnection.BeagleBone +# include("LabConnections/src/LabConnections.jl") +# using LabConnections.BeagleBone # run_server() -using LabConnection.Computer +using LabConnections.Computer stream = BeagleBoneStream(ip"192.168.7.2") led1 = SysLED(1) diff --git a/LICENSE.md b/LICENSE.md index b363325eca82b5f6d9f19dd04e0ec99c4df24fc3..c92dfc9e8f8ac6f76aca35d26e13ac3dbddb5e5e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -The LabConnection.jl package is licensed under the MIT "Expat" License: +The LabConnections.jl package is licensed under the MIT "Expat" License: > Copyright (c) 2017: Mattias Fält. > diff --git a/README.md b/README.md index 13b83086f6bee30fd176a0269884427b7bb90ef0..97e7287eba800b3629d8d2c0810efbd5d8f0b9cb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# LabConnection +# LabConnections -[](https://travis-ci.org/mfalt/LabConnection.jl) +[](https://travis-ci.org/mfalt/LabConnections.jl) -[](https://coveralls.io/github/mfalt/LabConnection.jl?branch=master) +[](https://coveralls.io/github/mfalt/LabConnections.jl?branch=master) -[](http://codecov.io/github/mfalt/LabConnection.jl?branch=master) +[](http://codecov.io/github/mfalt/LabConnections.jl?branch=master) diff --git a/appveyor.yml b/appveyor.yml index 5c62a1fff3c52fe86bc19d0133242d1231794b4b..c22350dad0f2875ad325383276856cff5079ba49 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -41,7 +41,7 @@ build_script: # Need to convert from shallow to complete for Pkg.clone to work - IF EXIST .git\shallow (git fetch --unshallow) - C:\projects\julia\bin\julia -e "versioninfo(); - Pkg.clone(pwd(), \"LabConnection\"); Pkg.build(\"LabConnection\")" + Pkg.clone(pwd(), \"LabConnections\"); Pkg.build(\"LabConnections\")" test_script: - - C:\projects\julia\bin\julia -e "Pkg.test(\"LabConnection\")" + - C:\projects\julia\bin\julia -e "Pkg.test(\"LabConnections\")" diff --git a/src/LabConnection.jl b/src/LabConnection.jl index 18cd8788391aff96d762163ad04e4ebbc2e317d0..c564687919f676a8a6a64950235bb674f3973680 100644 --- a/src/LabConnection.jl +++ b/src/LabConnection.jl @@ -1,5 +1,5 @@ __precompile__() -module LabConnection +module LabConnections module BeagleBone export run_server diff --git a/test/BeagleBone/GPIO_test.jl b/test/BeagleBone/GPIO_test.jl index fff3f10cd311848ac98e394bf1c6ff448a7d2594..90afe80d2711c605e05ca8db430eb0ea5ed6a44e 100644 --- a/test/BeagleBone/GPIO_test.jl +++ b/test/BeagleBone/GPIO_test.jl @@ -1,6 +1,6 @@ -include("../../src/LabConnection.jl") -using LabConnection.BeagleBone -import LabConnection.BeagleBone: getdev, write!, channels +include("../../src/LabConnections.jl") +using LabConnections.BeagleBone +import LabConnections.BeagleBone: getdev, write!, channels using Base.Test diff --git a/test/BeagleBone/PWM_test.jl b/test/BeagleBone/PWM_test.jl index 2f9a2b165b0d2aefa923c7c0d0c780767818d109..41a630a72eb0acd20ffe8ae0e4d1d175eb09e010 100644 --- a/test/BeagleBone/PWM_test.jl +++ b/test/BeagleBone/PWM_test.jl @@ -1,6 +1,6 @@ -include("../../src/LabConnection.jl") -using LabConnection.BeagleBone -import LabConnection.BeagleBone: getdev, write!, setup, teardown +include("../../src/LabConnections.jl") +using LabConnections.BeagleBone +import LabConnections.BeagleBone: getdev, write!, setup, teardown pins = Dict( "P9.22" => ("PWM0A", "pwmchip0", "0"), diff --git a/test/BeagleBone/PWM_test.jl~ b/test/BeagleBone/PWM_test.jl~ deleted file mode 100644 index 2f9a2b165b0d2aefa923c7c0d0c780767818d109..0000000000000000000000000000000000000000 --- a/test/BeagleBone/PWM_test.jl~ +++ /dev/null @@ -1,40 +0,0 @@ -include("../../src/LabConnection.jl") -using LabConnection.BeagleBone -import LabConnection.BeagleBone: getdev, write!, setup, teardown - -pins = Dict( - "P9.22" => ("PWM0A", "pwmchip0", "0"), - "P9.21" => ("PWM0B", "pwmchip0", "1"), - "P9.14" => ("PWM1A", "pwmchip0", "0"), - "P9.16" => ("PWM1B", "pwmchip0", "1"), - "P8.19" => ("PWM2A", "pwmchip0", "0"), - "P8.13" => ("PWM2B", "pwmchip0", "1"), -) - -dev = getdev("pwm") - -println("Running first experiment on selected pins...") -for pin in keys(pins) - println("Testing pin $(pin)") - setup(dev, pin) - write!(dev, pin, 2, "100000000") - write!(dev, pin, 3, "50000000") - write!(dev, pin, 1, "1") - sleep(1) - write!(dev, pin, 1, "0") - teardown(dev, pin) -end - - -println("Running second experiment on pin $(pin)...") -pin = "P9.22" -setup(dev, pin) -write!(dev, pin, 2, "1000000000") -write!(dev, pin, 3, "250000000") -write!(dev, pin, 1, "1") -sleep(5.0) -write!(dev, pin, 3, "500000000") -sleep(5.0) -write!(dev, pin, 3, "750000000") -write!(dev, pin, 1, "0") -teardown(dev, pin) diff --git a/test/BeagleBone/Sys_LED_test.jl b/test/BeagleBone/Sys_LED_test.jl index 8c1e8265f5874f2f91b52c046b54679a14395b6b..b52ef567d07db2899f438893656f21638d6d95b5 100644 --- a/test/BeagleBone/Sys_LED_test.jl +++ b/test/BeagleBone/Sys_LED_test.jl @@ -1,6 +1,6 @@ -include("../../src/LabConnection.jl") -using LabConnection.BeagleBone -import LabConnection.BeagleBone: getdev, write! +include("../../src/LabConnections.jl") +using LabConnections.BeagleBone +import LabConnections.BeagleBone: getdev, write! using Base.Test diff --git a/test/runtests.jl b/test/runtests.jl index 0f194849e84610c91872523d7829686fa9b6b524..833ef7555fb22ab1285e70cce11631aafdb37510 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,4 @@ -using LabConnection +using LabConnections using Base.Test # write your own tests here diff --git a/util/connect_BBB.sh b/util/connect_BBB.sh index 3b412bba63923c38b7f13210cbfd078fd24e87cf..fa8a340f5f49e9239694ce4a381d66f897c5ca1d 100755 --- a/util/connect_BBB.sh +++ b/util/connect_BBB.sh @@ -5,4 +5,4 @@ # # The code may be executed from anywhere on the HOST computer. ############################################################################### -ssh -t debian@192.168.7.2 "./LabConnection.jl/util/startup.sh; bash -l" +ssh -t debian@192.168.7.2 "./LabConnections.jl/util/startup.sh; bash -l" diff --git a/util/connect_BBB.sh~ b/util/connect_BBB.sh~ deleted file mode 100755 index 3b412bba63923c38b7f13210cbfd078fd24e87cf..0000000000000000000000000000000000000000 --- a/util/connect_BBB.sh~ +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -############################################################################### -# This line of code connects to the BBB via ssh, runs the startup file and -# remains in the shell of the BBB after executing startup.sh on the BBB -# -# The code may be executed from anywhere on the HOST computer. -############################################################################### -ssh -t debian@192.168.7.2 "./LabConnection.jl/util/startup.sh; bash -l" diff --git a/util/copyfoldertobb.sh b/util/copyfoldertobb.sh index 1bf613891e797a71bc3fdd5b228fc9757b4dd2b9..a9c9d052e2c51ae0a9374063353baf822b871591 100755 --- a/util/copyfoldertobb.sh +++ b/util/copyfoldertobb.sh @@ -8,7 +8,7 @@ printf "${BLUE}Updating project${NC}\n..." codeHost=gitlab.control.lth.se codeUser=labdev -projects=LabConnection +projects=LabConnections flag=false printf "${BLUE}Initializing Transferring files to BBB${NC}\n" diff --git a/util/flash_BBB.sh b/util/flash_BBB.sh index f8102e1a7b9a285f4f490ffcac52db3df8ac799e..ef9bde0d901ba256d990a07621df1692879a62ce 100755 --- a/util/flash_BBB.sh +++ b/util/flash_BBB.sh @@ -15,7 +15,7 @@ printf "${BLUE}Updating project${NC}\n..." codeHost=gitlab.control.lth.se codeUser=labdev -projects=(LabConnection.jl) +projects=(LabConnections.jl) flag=false for project in "${projects[@]}"; do @@ -63,7 +63,7 @@ done printf "${BLUE}Connecting to the BBB...${NC}\n" { - ssh -t debian@192.168.7.2 "./LabConnection.jl/util/startup.sh; bash -l" + ssh -t debian@192.168.7.2 "./LabConnections.jl/util/startup.sh; bash -l" } || { printf "${RED}Could Connect to the BBB!${NC}\n" } diff --git a/util/flash_BBB.sh~ b/util/flash_BBB.sh~ deleted file mode 100755 index f8102e1a7b9a285f4f490ffcac52db3df8ac799e..0000000000000000000000000000000000000000 --- a/util/flash_BBB.sh~ +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -############################################################################### -# This code clones or upps the most recent code from github and transfers it to -# the BBB before connecting to it and running the startup file on the BBB. -# -# The code may be executed from anywhere on the HOST computer. -############################################################################### - -BLUE='\033[0;34m' -GREEN='\033[0;32m' -RED='\033[0;31m' -NC='\033[0m' - -printf "${BLUE}Updating project${NC}\n..." - -codeHost=gitlab.control.lth.se -codeUser=labdev -projects=(LabConnection.jl) -flag=false - -for project in "${projects[@]}"; do - { - if [ -d "${project}" ]; then - # Try to clone repository - printf "${GREEN}Pulling /${project}...${NC}\n" - cd "${project}" - echo $(ls) - git pull "https://${codeHost}/${codeUser}/${project}.git" - cd ".." - else - printf "${GREEN}Cloning /${project}...${NC}\n" - git clone "https://${codeHost}/${codeUser}/${project}.git" - fi - } || { # catch - # save log for exception - flag=false - printf "${RED}Could not udate repository /${project}${NC}, aborting.\n" - } -done - -printf "${BLUE}Initializing Transferring files to BBB${NC}\n" -if [ "{flag}"=true ]; then - for project in "${projects[@]}"; do - { - printf "${GREEN}Transferring /${project}...${NC}\n" - scp -r ${project} debian@192.168.7.2:/home/debian - } || { # catch - # save log for exception - flag=false - printf "${RED}Could not send project /${project} to the BBB, aborting!${NC}\n" - } - done -fi - -printf "${BLUE}Deleting temporary files...${NC}\n" -for project in "${projects[@]}"; do - { - rm -rf ${project} - } || { - printf "${RED}Could not delete project /${project}, aborting!${NC}\n" -} -done - -printf "${BLUE}Connecting to the BBB...${NC}\n" -{ - ssh -t debian@192.168.7.2 "./LabConnection.jl/util/startup.sh; bash -l" -} || { - printf "${RED}Could Connect to the BBB!${NC}\n" -} diff --git a/util/getfrom_BBB.sh~ b/util/getfrom_BBB.sh~ deleted file mode 100755 index 00246845492ec516ca249cf0cb3866c0a1da6b0e..0000000000000000000000000000000000000000 --- a/util/getfrom_BBB.sh~ +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -############################################################################### -# This pice of tries to scp files from the BBB to a directory $PWD/temp -# -# The code may be executed from anywhere on the HOST computer. -############################################################################### -{ - if [ ! -d "temp" ]; then - mkdir temp - fi - sudo scp -r debian@192.168.7.2:/home/debian/$1 $PWD/temp -} || { - echo "Could not find or transfer $1, check that the file exists on the BBB" -} diff --git a/util/startup.sh b/util/startup.sh index d556f1b05fa45910545a3d1f71545bd77b2d57d6..f7fd68da423aa464898d3fbaa8413d956cca8cea 100755 --- a/util/startup.sh +++ b/util/startup.sh @@ -1,4 +1,4 @@ #!/bin/sh ls -cd "LabConnection.jl/test/BeagleBone" +cd "LabConnections.jl/test/BeagleBone" sudo /home/debian/julia-903644385b/bin/julia diff --git a/util/startup.sh~ b/util/startup.sh~ deleted file mode 100755 index 78a8c75b74c62a7e02de9283fb4bd10d5ba94a0a..0000000000000000000000000000000000000000 --- a/util/startup.sh~ +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -ls -cd "LabConnection.jl/test/BeagleBone" -sudo /home/debian/julia-903644385b/bin/julia -