From ac98e61c32bc2ad1e2230312acad4adf419cd3c4 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Tue, 21 Jan 2020 16:31:54 +0000 Subject: [PATCH 01/46] Initial commit --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6fc2c54 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Dave Walker + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From e83b847c764207f861a35d87bbb41d1089828398 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Wed, 22 Jan 2020 05:52:22 +0000 Subject: [PATCH 02/46] Initial commit --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6fc2c54 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Dave Walker + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From e4fb7472c884e6631595dbf0ddd02d30e84073d1 Mon Sep 17 00:00:00 2001 From: David Walker Date: Wed, 22 Jan 2020 06:21:55 +0000 Subject: [PATCH 03/46] First version created --- .gitignore | 405 ++++++++++++++++++ README.md | 218 ++++++++++ src/TelloCommanderConsole.sln | 17 + src/TelloCommanderConsole/Program.cs | 13 + .../TelloCommanderConsole.csproj | 11 + 5 files changed, 664 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 src/TelloCommanderConsole.sln create mode 100644 src/TelloCommanderConsole/Program.cs create mode 100644 src/TelloCommanderConsole/TelloCommanderConsole.csproj diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed9dbcb --- /dev/null +++ b/.gitignore @@ -0,0 +1,405 @@ +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# content below from: https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..05dda9f --- /dev/null +++ b/README.md @@ -0,0 +1,218 @@ +# TelloCommander + +[![Build Status](https://github.com/davewalker5/TelloCommander/workflows/.NET%20Core%20CI%20Build/badge.svg)](https://github.com/davewalker5/TelloCommander/actions) +[![GitHub issues](https://img.shields.io/github/issues/davewalker5/TelloCommander)](https://github.com/davewalker5/TelloCommander/issues) +[![Coverage Status](https://coveralls.io/repos/github/davewalker5/TelloCommander/badge.svg?branch=master)](https://coveralls.io/github/davewalker5/TelloCommander?branch=master) +[![Releases](https://img.shields.io/github/v/release/davewalker5/TelloCommander.svg?include_prereleases)](https://github.com/davewalker5/TelloCommander/releases) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/davewalker5/TelloCommander/blob/master/LICENSE) +[![Language](https://img.shields.io/badge/language-c%23-blue.svg)](https://github.com/davewalker5/TelloCommander/) +[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/davewalker5/TelloCommander)](https://github.com/davewalker5/TelloCommander/) + +## About + +Tello Commander is a C# API for controlling a Tello drone, offering the following features: + +- A simple interface to connect to, control and disconnect from the drone +- Validation of all commands to ensure only valid commands are sent to the drone +- Command/response history +- Response parser for processing drone "read" command responses +- Execution of commands from pre-prepared scripts +- Background monitoring and reporting of drone status +- Capture of status information to CSV + +## Getting Started + +Once the API is referenced by a project, you should include the following "using" statements to import the necessary types: + +```csharp +using TelloCommander.CommandDictionaries; +using TelloCommander.Commander; +using TelloCommander.Connections; +using TelloCommander.Interfaces; +``` + +The following code snippet can be pasted into the Main() method of a C# console application to demonstrate connection to the drone, command processing and disconnection from the drone: + +```csharp +// Connect to the drone +var dictionary = CommandDictionary.ReadStandardDictionary("1.3.0.0"); +var commander = new DroneCommander(new TelloConnection(), dictionary); +commander.Connect(); + +// Ask for a command to process and process it. Repeat until the an empty +// command is entered +bool isEmpty; +do +{ + Console.Write("Please enter a command or press [ENTER] to quit : "); + string command = Console.ReadLine().Trim(); + isEmpty = string.IsNullOrEmpty(command); + if (!isEmpty) + { + try + { + // Process the command using the API + Console.WriteLine($"Command : {command}"); + commander.RunCommand(command); + Console.WriteLine($"Response : {commander.LastResponse}"); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + } +} +while (!isEmpty); + +// Disconnect from the drone +commander.Disconnect(); +``` + +The argument passed to the "ReadStandardDictionary" is the Tello API version number and defines the set of available commands (see the [wiki](https://github.com/davewalker5/TelloCommander/wiki/Home)) for more details. + +The following is example output for a simple takeoff, height query and landing: + +``` +Please enter a command or press [ENTER] to quit : takeoff +Command : takeoff +Response : ok +Please enter a command or press [ENTER] to quit : height? +Command : height? +Response : 6dm +Please enter a command or press [ENTER] to quit : land +Command : land +Response : ok +``` + +## Monitoring the Status of the Drone + +The DroneStatusMonitor class reads the status from the drone, parses the raw status and presents those values to the calling application. It also provides an event subscription model for receiving updates to the drone status. + +To use it, first reference the required namespaces: + +```csharp +using TelloCommander.Status; +``` + +The following code snippet can be cut and pasted into a console application's "Program" class to demonstrate the status monitor: + +```csharp +static void Main(string[] args) +{ + // Note that the drone must already be in API mode for the monitoring + // to work. Create an instance of the monitor and start listening in + // the background. Subscribe to status update events to report status + DroneStatusMonitor monitor = new DroneStatusMonitor(); + monitor.Listen(DroneStatusMonitor.DefaultTelloStatusPort); + monitor.DroneStatusUpdated += OnDroneStatusUpdated; + + // Optionally, capture the status to a CSV file + // monitor.StartCapture("path_to_csv", interval_in_milliseconds); + + while (true) + { + Thread.Sleep(1000); + } +} + +private static void OnDroneStatusUpdated(object sender, DroneStatusEventArgs e) +{ + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Status : {e.Status.Status}"); + if (!string.IsNullOrEmpty(e.Status.Error)) + { + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Error : {e.Status.Error}"); + } + else if (!string.IsNullOrEmpty(e.Status.Status)) + { + // If there's no error and the status has a value, it's been successfully read and + // the public properties on the monitor will be populated. The sequence number is + // incremented every time the status is read from the drone. If it stops increasing + // for any length of time, then either the monitor has stopped or the drone has + // stopped broadcasting its status + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Sequence : {e.Status.Sequence}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Attitude : {e.Status.Attitude.ToString()}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Speed : {e.Status.Speed.ToString()}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Temperature : {e.Status.Temperature.ToString()}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} TOF : {e.Status.TOF}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Height : {e.Status.Height}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Battery : {e.Status.Battery}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Barometer : {e.Status.Battery}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Time : {e.Status.Time}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Acceleration : {e.Status.Acceleration.ToString()}"); + } +} +``` + +The status is reported as follows: + +``` +09:54:23.639 Status : pitch:0;roll:0;yaw:0;vgx:0;vgy:0;vgz:0;templ:0;temph:0;tof:0;h:0;bat:0;baro:0.00;time:0;agx:0.00;agy:0.00;agz:0.00; +09:54:23.639 Sequence : 5 +09:54:23.639 Attitude : Pitch: 0 Roll: 0 Yaw: 0 +09:54:23.640 Speed : X: 0 Y: 0 Z: 0 +09:54:23.640 Temperature : Minimum: 0 Maximum: 0 +09:54:23.640 TOF : 0 +09:54:23.640 Height : 0 +09:54:23.640 Battery : 0 +09:54:23.640 Barometer : 0 +09:54:23.640 Time : 0 +09:54:23.640 Acceleration : X: 0.00 Y: 0.00 Z: 0.00 +``` + +Please note that the drone must be in API mode in order for drone status to be reported. This can be achieved by creating a DroneCommander and connecting to the drone (see above). + +## Putting it Together + +The ConsoleCommander class demonstrates background status monitoring with an interactive console-based drone commander. To use it, first reference the required namespaces: + +```csharp +using TelloCommander.CommandDictionaries; +using TelloCommander.Connections; +using TelloCommander.Interfaces; +``` + +The following snippet can then be pasted into the Main() method of a console application to run the application: + +```csharp +CommandDictionary dictionary = CommandDictionary.ReadStandardDictionary("1.3.0.0"); +new ConsoleCommander(new TelloConnection(), dictionary).Run(true); +``` + +The argument passed to the "ReadStandardDictionary" is the Tello API version number and defines the set of available commands (see the [wiki](https://github.com/davewalker5/TelloCommander/wiki/Home)) for more details. + +In addition to the commands supported by the drone and custom commands supported by the DroneCommander, the ConsoleCommander supports the following commands: + +| Command | Parameters | Purpose | +| --- | --- | --- | +| ? | None | Report the current status to the console | +| startcapture | file interval | Start writing status records to the specified file (in CSV format) at the specified interval (in milliseconds) | +| stopcapture | None | Stop file capture if it's in progress | + +## Wiki + +More complete information on the capabilities and use of the API are provided in the Wiki: + +* [About TelloCommander](https://github.com/davewalker5/TelloCommander/wiki/Home) +* [Building and testing the API](https://github.com/davewalker5/TelloCommander/wiki/Building-and-Testing-the-API) +* [The demonstration application](https://github.com/davewalker5/TelloCommander/wiki/Demonstration-Application) +* [The drone simulator](https://github.com/davewalker5/TelloCommander/wiki/Drone-Simulator) +* [Command dictionaries](https://github.com/davewalker5/TelloCommander/wiki/Command-Dictionaries) +* [Custom commands and scripting](https://github.com/davewalker5/TelloCommander/wiki/Custom-Commands-And-Scripting) +* [Creating applications using the API](https://github.com/davewalker5/TelloCommander/wiki/Creating-Applications-With-the-Api) +* [Streaming Video](https://github.com/davewalker5/TelloCommander/wiki/Streaming-Video) + +## Authors + +- **Dave Walker** - *Initial work* - [LinkedIn](https://www.linkedin.com/in/davewalker5/) + +## Feedback + +To file issues or suggestions, please use the [Issues](https://github.com/davewalker5/TelloCommander/issues) page for this project on GitHub. + +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details + +## Trello + +* [TelloCommander on Trello](https://trello.com/b/VCFq6tAk) diff --git a/src/TelloCommanderConsole.sln b/src/TelloCommanderConsole.sln new file mode 100644 index 0000000..a030258 --- /dev/null +++ b/src/TelloCommanderConsole.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommanderConsole", "TelloCommanderConsole\TelloCommanderConsole.csproj", "{292CB991-4AAD-4D7E-BB9D-8AFB1EA3693B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {292CB991-4AAD-4D7E-BB9D-8AFB1EA3693B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {292CB991-4AAD-4D7E-BB9D-8AFB1EA3693B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {292CB991-4AAD-4D7E-BB9D-8AFB1EA3693B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {292CB991-4AAD-4D7E-BB9D-8AFB1EA3693B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/src/TelloCommanderConsole/Program.cs b/src/TelloCommanderConsole/Program.cs new file mode 100644 index 0000000..5a8dc58 --- /dev/null +++ b/src/TelloCommanderConsole/Program.cs @@ -0,0 +1,13 @@ +using TelloCommander.Commander; + +namespace TelloCommander +{ + public class Program + { + + public static void Main(string[] args) + { + new ConsoleCommanderWrapper().Run(); + } + } +} diff --git a/src/TelloCommanderConsole/TelloCommanderConsole.csproj b/src/TelloCommanderConsole/TelloCommanderConsole.csproj new file mode 100644 index 0000000..ea24ff2 --- /dev/null +++ b/src/TelloCommanderConsole/TelloCommanderConsole.csproj @@ -0,0 +1,11 @@ + + + + Exe + netcoreapp3.1 + + + + + + From 8909c580cf3be5c9b8a27b64f833339794df5a0d Mon Sep 17 00:00:00 2001 From: David Walker Date: Wed, 22 Jan 2020 06:37:00 +0000 Subject: [PATCH 04/46] Created the README from the TelloCommander README --- README.md | 231 +++++++++++++++++------------------------------------- 1 file changed, 72 insertions(+), 159 deletions(-) diff --git a/README.md b/README.md index 05dda9f..f478801 100644 --- a/README.md +++ b/README.md @@ -1,186 +1,99 @@ -# TelloCommander +# TelloCommanderConsole -[![Build Status](https://github.com/davewalker5/TelloCommander/workflows/.NET%20Core%20CI%20Build/badge.svg)](https://github.com/davewalker5/TelloCommander/actions) -[![GitHub issues](https://img.shields.io/github/issues/davewalker5/TelloCommander)](https://github.com/davewalker5/TelloCommander/issues) -[![Coverage Status](https://coveralls.io/repos/github/davewalker5/TelloCommander/badge.svg?branch=master)](https://coveralls.io/github/davewalker5/TelloCommander?branch=master) -[![Releases](https://img.shields.io/github/v/release/davewalker5/TelloCommander.svg?include_prereleases)](https://github.com/davewalker5/TelloCommander/releases) -[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/davewalker5/TelloCommander/blob/master/LICENSE) -[![Language](https://img.shields.io/badge/language-c%23-blue.svg)](https://github.com/davewalker5/TelloCommander/) -[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/davewalker5/TelloCommander)](https://github.com/davewalker5/TelloCommander/) +[![Build Status](https://github.com/davewalker5/TelloCommanderConsole/workflows/.NET%20Core%20CI%20Build/badge.svg)](https://github.com/davewalker5/TelloCommanderConsole/actions) +[![GitHub issues](https://img.shields.io/github/issues/davewalker5/TelloCommanderConsole)](https://github.com/davewalker5/TelloCommander/issues) +[![Releases](https://img.shields.io/github/v/release/davewalker5/TelloCommanderConsole.svg?include_prereleases)](https://github.com/davewalker5/TelloCommanderConsole/releases) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/davewalker5/TelloCommanderConsole/blob/master/LICENSE) +[![Language](https://img.shields.io/badge/language-c%23-blue.svg)](https://github.com/davewalker5/TelloCommanderConsole/) +[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/davewalker5/TelloCommanderConsole)](https://github.com/davewalker5/TelloCommanderConsole/) ## About -Tello Commander is a C# API for controlling a Tello drone, offering the following features: +TelloCommanderConsole is a console application that demonstrates use of the [TelloCommander API](https://github.com/davewalker5/TelloCommander) to connect to and communicate with a drone. -- A simple interface to connect to, control and disconnect from the drone -- Validation of all commands to ensure only valid commands are sent to the drone -- Command/response history -- Response parser for processing drone "read" command responses -- Execution of commands from pre-prepared scripts -- Background monitoring and reporting of drone status -- Capture of status information to CSV +It provides the following connection types: -## Getting Started +| Type | Purpose | +| --- | --- | +| Mock | Uses a mock that simulates responses from the drone without establishing a connection | +| Simulator | The API is connected to the simulator, running on the same machine | +| Drone | The API is connected to a real drone | -Once the API is referenced by a project, you should include the following "using" statements to import the necessary types: +It is based on the ConsoleCommander class provided by the API. -```csharp -using TelloCommander.CommandDictionaries; -using TelloCommander.Commander; -using TelloCommander.Connections; -using TelloCommander.Interfaces; +## Running the Application + +To run the application, open a terminal window, change to the folder containing the compiled output for the TelloCommanderConsole project and run the following command: + +``` +TelloCommanderConsole ``` -The following code snippet can be pasted into the Main() method of a C# console application to demonstrate connection to the drone, command processing and disconnection from the drone: - -```csharp -// Connect to the drone -var dictionary = CommandDictionary.ReadStandardDictionary("1.3.0.0"); -var commander = new DroneCommander(new TelloConnection(), dictionary); -commander.Connect(); - -// Ask for a command to process and process it. Repeat until the an empty -// command is entered -bool isEmpty; -do -{ - Console.Write("Please enter a command or press [ENTER] to quit : "); - string command = Console.ReadLine().Trim(); - isEmpty = string.IsNullOrEmpty(command); - if (!isEmpty) - { - try - { - // Process the command using the API - Console.WriteLine($"Command : {command}"); - commander.RunCommand(command); - Console.WriteLine($"Response : {commander.LastResponse}"); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - } - } -} -while (!isEmpty); - -// Disconnect from the drone -commander.Disconnect(); +The following will be displayed: + ``` +Tello Commander 1.0.0.0 -The argument passed to the "ReadStandardDictionary" is the Tello API version number and defines the set of available commands (see the [wiki](https://github.com/davewalker5/TelloCommander/wiki/Home)) for more details. +Dictionary Version: -The following is example output for a simple takeoff, height query and landing: +[1] 1.3.0.0 +[2] 2.0.0.0 -``` -Please enter a command or press [ENTER] to quit : takeoff -Command : takeoff -Response : ok -Please enter a command or press [ENTER] to quit : height? -Command : height? -Response : 6dm -Please enter a command or press [ENTER] to quit : land -Command : land -Response : ok +Please enter your option between 1 and 2 or enter 0 to quit: ``` -## Monitoring the Status of the Drone +### Selecting an API Version -The DroneStatusMonitor class reads the status from the drone, parses the raw status and presents those values to the calling application. It also provides an event subscription model for receiving updates to the drone status. +The dictionary version determines the set of commands available to run. For mock or simulator connections, any version can be used but for connection to a real drone it's important to choose the correct version: -To use it, first reference the required namespaces: +| Drone | Version | +| --- | --- | +| Tello | 1.3.0.0 | +| Tello EDU | 2.0.0.0 | -```csharp -using TelloCommander.Status; -``` +### Selecting a Connection Type + +Once you have selected the version, you are prompted to enter the required connection type: -The following code snippet can be cut and pasted into a console application's "Program" class to demonstrate the status monitor: - -```csharp -static void Main(string[] args) -{ - // Note that the drone must already be in API mode for the monitoring - // to work. Create an instance of the monitor and start listening in - // the background. Subscribe to status update events to report status - DroneStatusMonitor monitor = new DroneStatusMonitor(); - monitor.Listen(DroneStatusMonitor.DefaultTelloStatusPort); - monitor.DroneStatusUpdated += OnDroneStatusUpdated; - - // Optionally, capture the status to a CSV file - // monitor.StartCapture("path_to_csv", interval_in_milliseconds); - - while (true) - { - Thread.Sleep(1000); - } -} - -private static void OnDroneStatusUpdated(object sender, DroneStatusEventArgs e) -{ - Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Status : {e.Status.Status}"); - if (!string.IsNullOrEmpty(e.Status.Error)) - { - Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Error : {e.Status.Error}"); - } - else if (!string.IsNullOrEmpty(e.Status.Status)) - { - // If there's no error and the status has a value, it's been successfully read and - // the public properties on the monitor will be populated. The sequence number is - // incremented every time the status is read from the drone. If it stops increasing - // for any length of time, then either the monitor has stopped or the drone has - // stopped broadcasting its status - Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Sequence : {e.Status.Sequence}"); - Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Attitude : {e.Status.Attitude.ToString()}"); - Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Speed : {e.Status.Speed.ToString()}"); - Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Temperature : {e.Status.Temperature.ToString()}"); - Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} TOF : {e.Status.TOF}"); - Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Height : {e.Status.Height}"); - Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Battery : {e.Status.Battery}"); - Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Barometer : {e.Status.Battery}"); - Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Time : {e.Status.Time}"); - Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Acceleration : {e.Status.Acceleration.ToString()}"); - } -} ``` +Connection: -The status is reported as follows: +[1] Mock connection +[2] Simulator connection +[3] Real connection +Please enter your option between 1 and 3 or enter 0 to quit: ``` -09:54:23.639 Status : pitch:0;roll:0;yaw:0;vgx:0;vgy:0;vgz:0;templ:0;temph:0;tof:0;h:0;bat:0;baro:0.00;time:0;agx:0.00;agy:0.00;agz:0.00; -09:54:23.639 Sequence : 5 -09:54:23.639 Attitude : Pitch: 0 Roll: 0 Yaw: 0 -09:54:23.640 Speed : X: 0 Y: 0 Z: 0 -09:54:23.640 Temperature : Minimum: 0 Maximum: 0 -09:54:23.640 TOF : 0 -09:54:23.640 Height : 0 -09:54:23.640 Battery : 0 -09:54:23.640 Barometer : 0 -09:54:23.640 Time : 0 -09:54:23.640 Acceleration : X: 0.00 Y: 0.00 Z: 0.00 -``` -Please note that the drone must be in API mode in order for drone status to be reported. This can be achieved by creating a DroneCommander and connecting to the drone (see above). +The simulator is part of the [TelloCommander project](https://github.com/davewalker5/TelloCommander) and instructions on how to start it are given in the [project wiki](https://github.com/davewalker5/TelloCommander/wiki/Home). If you're connecting to the simulator, start it before entering the connection type. + +If you're connecting to a drone, switch it on and connect to its WiFi before entering the connection type. -## Putting it Together +Once a connection type's been entered, the application will respond as follows, indicating it's connected and ready to receive and send commands: -The ConsoleCommander class demonstrates background status monitoring with an interactive console-based drone commander. To use it, first reference the required namespaces: +``` +You are connected to the Tello in API mode -```csharp -using TelloCommander.CommandDictionaries; -using TelloCommander.Connections; -using TelloCommander.Interfaces; +Enter command or hit ENTER to quit : ``` -The following snippet can then be pasted into the Main() method of a console application to run the application: +### Entering Commands + +The application repeatedly prompts for and sends commands, echoing the reponse from the connection, until instructed to stop. For example: -```csharp -CommandDictionary dictionary = CommandDictionary.ReadStandardDictionary("1.3.0.0"); -new ConsoleCommander(new TelloConnection(), dictionary).Run(true); ``` +Enter command or hit ENTER to quit : takeoff +Command : takeoff +Response: ok -The argument passed to the "ReadStandardDictionary" is the Tello API version number and defines the set of available commands (see the [wiki](https://github.com/davewalker5/TelloCommander/wiki/Home)) for more details. +Enter command or hit ENTER to quit : land +Command : land +Response: ok -In addition to the commands supported by the drone and custom commands supported by the DroneCommander, the ConsoleCommander supports the following commands: +Enter command or hit ENTER to quit : +``` + +In addition to the commands supported by the drone and the custom commands provided by the [TelloCommander API](https://github.com/davewalker5/TelloCommander), the console application also supports the following commands: | Command | Parameters | Purpose | | --- | --- | --- | @@ -188,18 +101,18 @@ In addition to the commands supported by the drone and custom commands supported | startcapture | file interval | Start writing status records to the specified file (in CSV format) at the specified interval (in milliseconds) | | stopcapture | None | Stop file capture if it's in progress | -## Wiki +### Closing the Connection -More complete information on the capabilities and use of the API are provided in the Wiki: +Before closing the application, please: + +- Land the drone, if you are connected to a real drone +- Stop the simulator, by issuing the "stopsimulator" command, if you are using a simulator connection + +To close the connection and stop the application, enter an empty command in response to the prompt. + +## Wiki -* [About TelloCommander](https://github.com/davewalker5/TelloCommander/wiki/Home) -* [Building and testing the API](https://github.com/davewalker5/TelloCommander/wiki/Building-and-Testing-the-API) -* [The demonstration application](https://github.com/davewalker5/TelloCommander/wiki/Demonstration-Application) -* [The drone simulator](https://github.com/davewalker5/TelloCommander/wiki/Drone-Simulator) -* [Command dictionaries](https://github.com/davewalker5/TelloCommander/wiki/Command-Dictionaries) -* [Custom commands and scripting](https://github.com/davewalker5/TelloCommander/wiki/Custom-Commands-And-Scripting) -* [Creating applications using the API](https://github.com/davewalker5/TelloCommander/wiki/Creating-Applications-With-the-Api) -* [Streaming Video](https://github.com/davewalker5/TelloCommander/wiki/Streaming-Video) +* [TelloCommander Wiki](https://github.com/davewalker5/TelloCommander/wiki/Home) ## Authors From 3edd98a516ac03b3c80b51d5c5b17d0c95d9a009 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Wed, 22 Jan 2020 06:38:24 +0000 Subject: [PATCH 05/46] Added CI build --- .github/workflows/dotnetcore.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/dotnetcore.yml diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml new file mode 100644 index 0000000..86f1cb3 --- /dev/null +++ b/.github/workflows/dotnetcore.yml @@ -0,0 +1,17 @@ +name: .NET Core CI Build + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.0.100 + - name: Build + run: dotnet build --configuration Release src/TelloCommander.sln From 54bd75260208b47f56b7a65b70d4e0b220179c54 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Wed, 22 Jan 2020 06:43:27 +0000 Subject: [PATCH 06/46] Fixup incorrect solution file name --- .github/workflows/dotnetcore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 86f1cb3..4003dfe 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -14,4 +14,4 @@ jobs: with: dotnet-version: 3.0.100 - name: Build - run: dotnet build --configuration Release src/TelloCommander.sln + run: dotnet build --configuration Release src/TelloCommanderConsole.sln From 2855e4daf26ea7e227c5c43fa1b9a94c7af0302b Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Wed, 22 Jan 2020 06:44:51 +0000 Subject: [PATCH 07/46] Fixup .NET code version --- .github/workflows/dotnetcore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 4003dfe..3500c8f 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,6 +12,6 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.0.100 + dotnet-version: 3.1.101 - name: Build run: dotnet build --configuration Release src/TelloCommanderConsole.sln From 0f09eff716329345cd0298ada669f34ec1f0ad31 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Wed, 22 Jan 2020 06:48:57 +0000 Subject: [PATCH 08/46] Added build instructions --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index f478801..7791f40 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,22 @@ It provides the following connection types: It is based on the ConsoleCommander class provided by the API. +## Pre-requisites + +You will need .NET Core 3.1.101 and the .NET CLI installed to build and run the application. Instructions for downloading and installing are on the .NET website: + +[https://dotnet.microsoft.com/download](https://dotnet.microsoft.com/download) + +## Building the Application + +* Clone or download the repository +* Open a terminal window and CD to the folder containing the TelloCommanderConsole.sln solution file +* Enter the following command to build the application: + +``` +dotnet build +``` + ## Running the Application To run the application, open a terminal window, change to the folder containing the compiled output for the TelloCommanderConsole project and run the following command: From 525c7bb4b626e0c779e1f935fdf37155b7ae46d1 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Wed, 22 Jan 2020 06:50:35 +0000 Subject: [PATCH 09/46] Replace API with "application" in the connection details --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7791f40..9c818dd 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ It provides the following connection types: | Type | Purpose | | --- | --- | | Mock | Uses a mock that simulates responses from the drone without establishing a connection | -| Simulator | The API is connected to the simulator, running on the same machine | -| Drone | The API is connected to a real drone | +| Simulator | The application is connected to the simulator, running on the same machine | +| Drone | The application is connected to a real drone | It is based on the ConsoleCommander class provided by the API. From 34ad9a624894a74ac0041239571e0a8986ed76e3 Mon Sep 17 00:00:00 2001 From: David Walker Date: Wed, 22 Jan 2020 18:35:52 +0000 Subject: [PATCH 10/46] First version --- src/.DS_Store | Bin 0 -> 8196 bytes src/TelloCommander.Data.InMemory/Class1.cs | 8 + .../Content/TelloCommanderDbLicense.txt | 21 +++ .../TelloCommander.Data.InMemory.csproj | 43 +++++ .../TelloCommanderDbContext.cs | 21 +++ .../TelloCommanderDbContextFactory.cs | 16 ++ src/TelloCommander.Data.Migrations/Program.cs | 14 ++ .../TelloCommander.Data.Migrations.csproj | 28 ++++ .../appsettings.json | 5 + .../Content/TelloCommanderDbLicense.txt | 21 +++ .../20200121152421_initial.Designer.cs | 156 ++++++++++++++++++ .../Migrations/20200121152421_initial.cs | 146 ++++++++++++++++ .../TelloCommanderDbContextModelSnapshot.cs | 154 +++++++++++++++++ .../TelloCommander.Data.Sqlite.csproj | 48 ++++++ .../TelloCommanderDbContext.cs | 21 +++ .../TelloCommanderDbContextFactory.cs | 27 +++ .../TelemetryCollectorTest.cs | 66 ++++++++ .../TelloCommander.Data.Tests.csproj | 29 ++++ .../Collector/TelemetryCollector.cs | 148 +++++++++++++++++ .../Content/TelloCommanderDbLicense.txt | 21 +++ src/TelloCommander.Data/Entities/Drone.cs | 16 ++ .../Entities/TelemetryDataPoint.cs | 20 +++ .../Entities/TelemetryError.cs | 14 ++ .../Entities/TelemetryProperty.cs | 13 ++ .../Entities/TelemetrySession.cs | 21 +++ .../Interfaces/ITelloCommanderDbContext.cs | 16 ++ .../TelloCommander.Data.csproj | 39 +++++ src/TelloCommanderDb.sln | 45 +++++ 28 files changed, 1177 insertions(+) create mode 100644 src/.DS_Store create mode 100644 src/TelloCommander.Data.InMemory/Class1.cs create mode 100644 src/TelloCommander.Data.InMemory/Content/TelloCommanderDbLicense.txt create mode 100644 src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj create mode 100644 src/TelloCommander.Data.InMemory/TelloCommanderDbContext.cs create mode 100644 src/TelloCommander.Data.InMemory/TelloCommanderDbContextFactory.cs create mode 100644 src/TelloCommander.Data.Migrations/Program.cs create mode 100644 src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj create mode 100644 src/TelloCommander.Data.Migrations/appsettings.json create mode 100644 src/TelloCommander.Data.Sqlite/Content/TelloCommanderDbLicense.txt create mode 100644 src/TelloCommander.Data.Sqlite/Migrations/20200121152421_initial.Designer.cs create mode 100644 src/TelloCommander.Data.Sqlite/Migrations/20200121152421_initial.cs create mode 100644 src/TelloCommander.Data.Sqlite/Migrations/TelloCommanderDbContextModelSnapshot.cs create mode 100644 src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj create mode 100644 src/TelloCommander.Data.Sqlite/TelloCommanderDbContext.cs create mode 100644 src/TelloCommander.Data.Sqlite/TelloCommanderDbContextFactory.cs create mode 100644 src/TelloCommander.Data.Tests/TelemetryCollectorTest.cs create mode 100644 src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj create mode 100644 src/TelloCommander.Data/Collector/TelemetryCollector.cs create mode 100644 src/TelloCommander.Data/Content/TelloCommanderDbLicense.txt create mode 100644 src/TelloCommander.Data/Entities/Drone.cs create mode 100644 src/TelloCommander.Data/Entities/TelemetryDataPoint.cs create mode 100644 src/TelloCommander.Data/Entities/TelemetryError.cs create mode 100644 src/TelloCommander.Data/Entities/TelemetryProperty.cs create mode 100644 src/TelloCommander.Data/Entities/TelemetrySession.cs create mode 100644 src/TelloCommander.Data/Interfaces/ITelloCommanderDbContext.cs create mode 100644 src/TelloCommander.Data/TelloCommander.Data.csproj create mode 100644 src/TelloCommanderDb.sln diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6e635a67eef17c157f6409ce7ae03686194e3063 GIT binary patch literal 8196 zcmeI1%}T>S5XWczfPx5u2r42udl0=VM2(0CL8uR)ZT%=Tjao@Th6d+w`v^58*z z4-X!E0ROYQjT@^F6A{swu=`&&JF}Y~$)=MMky<{j%@d6iQ3-{0WC+y<#^<^8SfA|~ zgDUtFMYMtv;@IgKEgeEY2nYcoAOwWKZyj|B?Xj4;~7uZ#6cm zw+>V~1%M8qTN~QQ1GJB4)wdcO)vkzXvIk{dl}#~}amRU&heLg?(Xn!rfANGzAh{l#sUN$$0U(Ho`jh?nNJ$=s$hbK9Ug?SmNKYIU${QY+1F@TF)x zm*4Z+U6)^>HM$JHD`uMG9CMt^%&|;Ic#!L$xSQrzzRnxR<+j*PxaC@t%d2RtG^Y-8 zn#jzFx4af8y}QeXAM-_V8I=~2{VK + + + netstandard2.1 + TelloCommander.Data.InMemory + 1.0.0.5 + 1.0.0.5 + true + Dave Walker + Copyright (c) 2020 Dave Walker + Dave Walker + First release + TelloCommander Tello Database Collector Memory + TelloCommander Drone Telemetry InMemory Database + TelloCommander Drone Telemetry InMemory Database + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + PreserveNewest + + + + + + diff --git a/src/TelloCommander.Data.InMemory/TelloCommanderDbContext.cs b/src/TelloCommander.Data.InMemory/TelloCommanderDbContext.cs new file mode 100644 index 0000000..27f2d14 --- /dev/null +++ b/src/TelloCommander.Data.InMemory/TelloCommanderDbContext.cs @@ -0,0 +1,21 @@ +using System.Diagnostics.CodeAnalysis; +using Microsoft.EntityFrameworkCore; +using TelloCommander.Data.Entities; +using TelloCommander.Data.Interfaces; + +namespace TelloCommander.Data.InMemory +{ + [ExcludeFromCodeCoverage] + public class TelloCommanderDbContext : DbContext, ITelloCommanderDbContext + { + public DbSet Drones { get; set; } + public DbSet Sessions { get; set; } + public DbSet Properties { get; set; } + public DbSet DataPoints { get; set; } + public DbSet Errors { get; set; } + + public TelloCommanderDbContext(DbContextOptions options) : base(options) + { + } + } +} diff --git a/src/TelloCommander.Data.InMemory/TelloCommanderDbContextFactory.cs b/src/TelloCommander.Data.InMemory/TelloCommanderDbContextFactory.cs new file mode 100644 index 0000000..5a2286e --- /dev/null +++ b/src/TelloCommander.Data.InMemory/TelloCommanderDbContextFactory.cs @@ -0,0 +1,16 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; + +namespace TelloCommander.Data.InMemory +{ + public class TelloCommanderDbContextFactory : IDesignTimeDbContextFactory + { + public TelloCommanderDbContext CreateDbContext(string[] args) + { + var optionsBuilder = new DbContextOptionsBuilder(); + optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString()); + return new TelloCommanderDbContext(optionsBuilder.Options); + } + } +} diff --git a/src/TelloCommander.Data.Migrations/Program.cs b/src/TelloCommander.Data.Migrations/Program.cs new file mode 100644 index 0000000..e708a02 --- /dev/null +++ b/src/TelloCommander.Data.Migrations/Program.cs @@ -0,0 +1,14 @@ +using TelloCommander.Data.Sqlite; +using Microsoft.EntityFrameworkCore; + +namespace TelloCommander.Data.Migrations +{ + public class Program + { + public static void Main(string[] args) + { + TelloCommanderDbContext context = new TelloCommanderDbContextFactory().CreateDbContext(null); + context.Database.Migrate(); + } + } +} diff --git a/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj b/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj new file mode 100644 index 0000000..e291a40 --- /dev/null +++ b/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj @@ -0,0 +1,28 @@ + + + + Exe + netcoreapp3.1 + 1.0.0.4 + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + PreserveNewest + + + diff --git a/src/TelloCommander.Data.Migrations/appsettings.json b/src/TelloCommander.Data.Migrations/appsettings.json new file mode 100644 index 0000000..b896c51 --- /dev/null +++ b/src/TelloCommander.Data.Migrations/appsettings.json @@ -0,0 +1,5 @@ +{ + "ConnectionStrings": { + "TelloCommanderDb": "Data Source=/Users/dave/tellocommander.db" + } +} \ No newline at end of file diff --git a/src/TelloCommander.Data.Sqlite/Content/TelloCommanderDbLicense.txt b/src/TelloCommander.Data.Sqlite/Content/TelloCommanderDbLicense.txt new file mode 100644 index 0000000..97d4e70 --- /dev/null +++ b/src/TelloCommander.Data.Sqlite/Content/TelloCommanderDbLicense.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Dave Walker + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/TelloCommander.Data.Sqlite/Migrations/20200121152421_initial.Designer.cs b/src/TelloCommander.Data.Sqlite/Migrations/20200121152421_initial.Designer.cs new file mode 100644 index 0000000..610153e --- /dev/null +++ b/src/TelloCommander.Data.Sqlite/Migrations/20200121152421_initial.Designer.cs @@ -0,0 +1,156 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using TelloCommander.Data.Sqlite; + +namespace TelloCommander.Data.Sqlite.Migrations +{ + [DbContext(typeof(TelloCommanderDbContext))] + [Migration("20200121152421_initial")] + partial class initial + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.1"); + + modelBuilder.Entity("TelloCommander.Data.Entities.Drone", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Drones"); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetryDataPoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("PropertyId") + .HasColumnType("INTEGER"); + + b.Property("Sequence") + .HasColumnType("INTEGER"); + + b.Property("SessionId") + .HasColumnType("INTEGER"); + + b.Property("Time") + .HasColumnType("INTEGER"); + + b.Property("Value") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("PropertyId"); + + b.HasIndex("SessionId"); + + b.ToTable("DataPoints"); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetryError", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Message") + .HasColumnType("TEXT"); + + b.Property("TelemetrySessionId") + .HasColumnType("INTEGER"); + + b.Property("Time") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("TelemetrySessionId"); + + b.ToTable("Errors"); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetryProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Properties"); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetrySession", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("DroneId") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Start") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("DroneId"); + + b.ToTable("Sessions"); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetryDataPoint", b => + { + b.HasOne("TelloCommander.Data.Entities.TelemetryProperty", "Property") + .WithMany() + .HasForeignKey("PropertyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TelloCommander.Data.Entities.TelemetrySession", "Session") + .WithMany("DataPoints") + .HasForeignKey("SessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetryError", b => + { + b.HasOne("TelloCommander.Data.Entities.TelemetrySession", null) + .WithMany("Errors") + .HasForeignKey("TelemetrySessionId"); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetrySession", b => + { + b.HasOne("TelloCommander.Data.Entities.Drone", "Drone") + .WithMany("Sessions") + .HasForeignKey("DroneId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/TelloCommander.Data.Sqlite/Migrations/20200121152421_initial.cs b/src/TelloCommander.Data.Sqlite/Migrations/20200121152421_initial.cs new file mode 100644 index 0000000..ea6eb4b --- /dev/null +++ b/src/TelloCommander.Data.Sqlite/Migrations/20200121152421_initial.cs @@ -0,0 +1,146 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace TelloCommander.Data.Sqlite.Migrations +{ + public partial class initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Drones", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Name = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Drones", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Properties", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Name = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Properties", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Sessions", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Name = table.Column(nullable: true), + Start = table.Column(nullable: false), + DroneId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Sessions", x => x.Id); + table.ForeignKey( + name: "FK_Sessions_Drones_DroneId", + column: x => x.DroneId, + principalTable: "Drones", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DataPoints", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + PropertyId = table.Column(nullable: false), + SessionId = table.Column(nullable: false), + Time = table.Column(nullable: false), + Sequence = table.Column(nullable: false), + Value = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DataPoints", x => x.Id); + table.ForeignKey( + name: "FK_DataPoints_Properties_PropertyId", + column: x => x.PropertyId, + principalTable: "Properties", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DataPoints_Sessions_SessionId", + column: x => x.SessionId, + principalTable: "Sessions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Errors", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Time = table.Column(nullable: false), + Message = table.Column(nullable: true), + TelemetrySessionId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Errors", x => x.Id); + table.ForeignKey( + name: "FK_Errors_Sessions_TelemetrySessionId", + column: x => x.TelemetrySessionId, + principalTable: "Sessions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_DataPoints_PropertyId", + table: "DataPoints", + column: "PropertyId"); + + migrationBuilder.CreateIndex( + name: "IX_DataPoints_SessionId", + table: "DataPoints", + column: "SessionId"); + + migrationBuilder.CreateIndex( + name: "IX_Errors_TelemetrySessionId", + table: "Errors", + column: "TelemetrySessionId"); + + migrationBuilder.CreateIndex( + name: "IX_Sessions_DroneId", + table: "Sessions", + column: "DroneId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "DataPoints"); + + migrationBuilder.DropTable( + name: "Errors"); + + migrationBuilder.DropTable( + name: "Properties"); + + migrationBuilder.DropTable( + name: "Sessions"); + + migrationBuilder.DropTable( + name: "Drones"); + } + } +} diff --git a/src/TelloCommander.Data.Sqlite/Migrations/TelloCommanderDbContextModelSnapshot.cs b/src/TelloCommander.Data.Sqlite/Migrations/TelloCommanderDbContextModelSnapshot.cs new file mode 100644 index 0000000..7e2ebd0 --- /dev/null +++ b/src/TelloCommander.Data.Sqlite/Migrations/TelloCommanderDbContextModelSnapshot.cs @@ -0,0 +1,154 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using TelloCommander.Data.Sqlite; + +namespace TelloCommander.Data.Sqlite.Migrations +{ + [DbContext(typeof(TelloCommanderDbContext))] + partial class TelloCommanderDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.1"); + + modelBuilder.Entity("TelloCommander.Data.Entities.Drone", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Drones"); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetryDataPoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("PropertyId") + .HasColumnType("INTEGER"); + + b.Property("Sequence") + .HasColumnType("INTEGER"); + + b.Property("SessionId") + .HasColumnType("INTEGER"); + + b.Property("Time") + .HasColumnType("INTEGER"); + + b.Property("Value") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("PropertyId"); + + b.HasIndex("SessionId"); + + b.ToTable("DataPoints"); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetryError", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Message") + .HasColumnType("TEXT"); + + b.Property("TelemetrySessionId") + .HasColumnType("INTEGER"); + + b.Property("Time") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("TelemetrySessionId"); + + b.ToTable("Errors"); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetryProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Properties"); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetrySession", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("DroneId") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Start") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("DroneId"); + + b.ToTable("Sessions"); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetryDataPoint", b => + { + b.HasOne("TelloCommander.Data.Entities.TelemetryProperty", "Property") + .WithMany() + .HasForeignKey("PropertyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TelloCommander.Data.Entities.TelemetrySession", "Session") + .WithMany("DataPoints") + .HasForeignKey("SessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetryError", b => + { + b.HasOne("TelloCommander.Data.Entities.TelemetrySession", null) + .WithMany("Errors") + .HasForeignKey("TelemetrySessionId"); + }); + + modelBuilder.Entity("TelloCommander.Data.Entities.TelemetrySession", b => + { + b.HasOne("TelloCommander.Data.Entities.Drone", "Drone") + .WithMany("Sessions") + .HasForeignKey("DroneId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj b/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj new file mode 100644 index 0000000..df049bf --- /dev/null +++ b/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj @@ -0,0 +1,48 @@ + + + + netstandard2.1 + TelloCommander.Data.Sqlite + 1.0.0.5 + 1.0.0.5 + true + Dave Walker + Copyright (c) 2020 Dave Walker + true + Dave Walker + First Release + TelloCommander Drone Telemetry SqlIte Database + TelloCommander Tello Data Collector Memory Sqlite + TelloCommander Drone Telemetry SqlIte Database + TelloCommander Drone Telemetry SqlIte Database + + + + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + PreserveNewest + + + + + + + + + diff --git a/src/TelloCommander.Data.Sqlite/TelloCommanderDbContext.cs b/src/TelloCommander.Data.Sqlite/TelloCommanderDbContext.cs new file mode 100644 index 0000000..ff187dd --- /dev/null +++ b/src/TelloCommander.Data.Sqlite/TelloCommanderDbContext.cs @@ -0,0 +1,21 @@ +using System.Diagnostics.CodeAnalysis; +using Microsoft.EntityFrameworkCore; +using TelloCommander.Data.Entities; +using TelloCommander.Data.Interfaces; + +namespace TelloCommander.Data.Sqlite +{ + [ExcludeFromCodeCoverage] + public class TelloCommanderDbContext : DbContext, ITelloCommanderDbContext + { + public DbSet Drones { get; set; } + public DbSet Sessions { get; set; } + public DbSet Properties { get; set; } + public DbSet DataPoints { get; set; } + public DbSet Errors { get; set; } + + public TelloCommanderDbContext(DbContextOptions options) : base(options) + { + } + } +} diff --git a/src/TelloCommander.Data.Sqlite/TelloCommanderDbContextFactory.cs b/src/TelloCommander.Data.Sqlite/TelloCommanderDbContextFactory.cs new file mode 100644 index 0000000..8b4a66b --- /dev/null +++ b/src/TelloCommander.Data.Sqlite/TelloCommanderDbContextFactory.cs @@ -0,0 +1,27 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; + +namespace TelloCommander.Data.Sqlite +{ + public class TelloCommanderDbContextFactory : IDesignTimeDbContextFactory + { + public TelloCommanderDbContext CreateDbContext(string[] args) + { + // Construct a configuration object that contains the key/value pairs from the settings file + // at the root of the main application + IConfigurationRoot configuration = new ConfigurationBuilder() + .SetBasePath(AppDomain.CurrentDomain.BaseDirectory) + .AddJsonFile("appsettings.json") + .Build(); + + // Use the configuration object to read the connection string + var optionsBuilder = new DbContextOptionsBuilder(); + optionsBuilder.UseSqlite(configuration.GetConnectionString("TelloCommanderDb")); + + // Construct and return a database context + return new TelloCommanderDbContext(optionsBuilder.Options); + } + } +} diff --git a/src/TelloCommander.Data.Tests/TelemetryCollectorTest.cs b/src/TelloCommander.Data.Tests/TelemetryCollectorTest.cs new file mode 100644 index 0000000..2cf0e63 --- /dev/null +++ b/src/TelloCommander.Data.Tests/TelemetryCollectorTest.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TelloCommander.Data.Collector; +using TelloCommander.Data.Entities; +using TelloCommander.Data.InMemory; +using TelloCommander.Interfaces; +using TelloCommander.Simulator; + +namespace TelloCommander.Data.Tests +{ + [TestClass] + public class TelemetryCollectorTest + { + private const string DroneName = "TELLO-1234"; + private readonly string SessionName = $"{DroneName} telemetry session"; + + private IDroneStatusMonitor _monitor; + private TelloCommanderDbContext _context; + private TelemetryCollector _collector; + + [TestInitialize] + public void TestInitialise() + { + _context = new TelloCommanderDbContextFactory().CreateDbContext(null); + _monitor = new MockDroneStatusMonitor(); + _collector = new TelemetryCollector(_context, _monitor); + _monitor.Listen(0); + } + + [TestCleanup] + public void TestCleanup() + { + _monitor.Stop(); + } + + [TestMethod] + public void CollectionTest() + { + DateTime start = DateTime.Now; + _collector.Start(DroneName, SessionName, 1000, null); + DateTime end = DateTime.Now; + Thread.Sleep(3000); + _collector.Stop(); + + Assert.AreEqual(1, _context.Drones.Count()); + Drone drone = _context.Drones.First(); + Assert.AreEqual(DroneName, drone.Name); + + Assert.AreEqual(1, _context.Sessions.Count()); + TelemetrySession session = _context.Sessions.First(); + Assert.AreEqual(drone.Id, session.DroneId); + Assert.AreEqual(SessionName, session.Name); + Assert.IsTrue(session.Start >= start); + Assert.IsTrue(session.Start <= end); + + Assert.IsTrue(_context.Properties.Count() > 0); + IEnumerable propertyNames = _context.Properties.Select(p => p.Name).Distinct(); + Assert.IsTrue(propertyNames.Count() > 1); + + Assert.IsTrue(_context.DataPoints.Count() > 0); + } + } +} diff --git a/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj b/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj new file mode 100644 index 0000000..7994574 --- /dev/null +++ b/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj @@ -0,0 +1,29 @@ + + + + netcoreapp3.1 + + false + 1.0.0.4 + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive +all + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/src/TelloCommander.Data/Collector/TelemetryCollector.cs b/src/TelloCommander.Data/Collector/TelemetryCollector.cs new file mode 100644 index 0000000..cc14328 --- /dev/null +++ b/src/TelloCommander.Data/Collector/TelemetryCollector.cs @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using TelloCommander.Data.Entities; +using TelloCommander.Data.Interfaces; +using TelloCommander.Interfaces; +using TelloCommander.Response; +using TelloCommander.Status; + +namespace TelloCommander.Data.Collector +{ + public class TelemetryCollector + { + private readonly Dictionary _properties = new Dictionary(); + private readonly static object _lock = new object(); + private ITelloCommanderDbContext _context; + private TelemetrySession _session; + private IDroneStatusMonitor _monitor; + private IEnumerable _propertiesToCapture; + private long _intervalMilliseconds; + private long _lastWritten; + + public bool LogToConsole { get; set; } + + public TelemetryCollector(ITelloCommanderDbContext context, IDroneStatusMonitor monitor) + { + _context = context; + _monitor = monitor; + } + + /// + /// Start a new telemetry collection session, collecting at the specified interval + /// + /// + /// + /// + /// + public void Start(string droneName, string sessionName, long intervalMilliseconds, IEnumerable propertyNames = null) + { + Drone drone = _context.Drones.FirstOrDefault(d => d.Name == droneName); + if (drone == null) + { + drone = new Drone { Name = droneName }; + _context.Drones.Add(drone); + _context.SaveChanges(); + } + + _session = new TelemetrySession + { + DroneId = drone.Id, + Name = sessionName, + Start = DateTime.Now + }; + + _context.Sessions.Add(_session); + _context.SaveChanges(); + + _propertiesToCapture = propertyNames; + _intervalMilliseconds = intervalMilliseconds; + _lastWritten = 0; + _monitor.DroneStatusUpdated += OnDroneStatusUpdated; + } + + /// + /// Stop collecting data + /// + public void Stop() + { + _monitor.DroneStatusUpdated -= OnDroneStatusUpdated; + } + + /// + /// Callback to handle data collection events from the status monitor + /// + /// + /// + private void OnDroneStatusUpdated(object sender, DroneStatusEventArgs e) + { + lock (_lock) + { + DateTime now = DateTime.Now; + long timeSinceStart = (long)(now - _session.Start).TotalMilliseconds; + long interval = timeSinceStart - _lastWritten; + if (interval >= _intervalMilliseconds) + { + if (LogToConsole) + { + Console.WriteLine($"Writing data for sequence {e.Status.Sequence}"); + } + + if (!string.IsNullOrEmpty(e.Status.Error)) + { + _context.Errors.Add(new TelemetryError { Time = timeSinceStart, Message = e.Status.Error }); + } + else if (!string.IsNullOrEmpty(e.Status.Status)) + { + foreach (string key in e.Status.RawValues.Keys) + { + if ((_propertiesToCapture == null) || ((_propertiesToCapture != null) && (_propertiesToCapture.Contains(key)))) + { + _context.DataPoints.Add(new TelemetryDataPoint + { + Property = GetProperty(key), + SessionId = _session.Id, + Time = timeSinceStart, + Sequence = e.Status.Sequence, + Value = ResponseParser.ParseToNumber(e.Status.RawValues[key]) + }); + } + } + } + + _context.SaveChanges(); + _lastWritten = timeSinceStart; + } + } + } + + /// + /// Get the property corresponding to a specified key using the local cache of + /// properties first and falling back to retrieval from the database and, if + /// required, creation of a new property + /// + /// + /// + private TelemetryProperty GetProperty(string key) + { + TelemetryProperty property; + + if (_properties.ContainsKey(key)) + { + property = _properties[key]; + } + else + { + property = _context.Properties.FirstOrDefault(p => p.Name == key); + if (property == null) + { + property = new TelemetryProperty { Name = key }; + _context.Properties.Add(property); + } + _properties.Add(key, property); + } + + return property; + } + } +} diff --git a/src/TelloCommander.Data/Content/TelloCommanderDbLicense.txt b/src/TelloCommander.Data/Content/TelloCommanderDbLicense.txt new file mode 100644 index 0000000..97d4e70 --- /dev/null +++ b/src/TelloCommander.Data/Content/TelloCommanderDbLicense.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Dave Walker + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/TelloCommander.Data/Entities/Drone.cs b/src/TelloCommander.Data/Entities/Drone.cs new file mode 100644 index 0000000..f019e2d --- /dev/null +++ b/src/TelloCommander.Data/Entities/Drone.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; + +namespace TelloCommander.Data.Entities +{ + [ExcludeFromCodeCoverage] + public class Drone + { + [Key] + public int Id { get; set; } + public string Name { get; set; } + + public IList Sessions { get; set; } + } +} diff --git a/src/TelloCommander.Data/Entities/TelemetryDataPoint.cs b/src/TelloCommander.Data/Entities/TelemetryDataPoint.cs new file mode 100644 index 0000000..481587f --- /dev/null +++ b/src/TelloCommander.Data/Entities/TelemetryDataPoint.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; + +namespace TelloCommander.Data.Entities +{ + [ExcludeFromCodeCoverage] + public class TelemetryDataPoint + { + [Key] + public int Id { get; set; } + public int PropertyId { get; set; } + public int SessionId { get; set; } + public long Time { get; set; } + public int Sequence { get; set; } + public decimal Value { get; set; } + + public TelemetryProperty Property { get; set; } + public TelemetrySession Session { get; set; } + } +} diff --git a/src/TelloCommander.Data/Entities/TelemetryError.cs b/src/TelloCommander.Data/Entities/TelemetryError.cs new file mode 100644 index 0000000..d7f69d4 --- /dev/null +++ b/src/TelloCommander.Data/Entities/TelemetryError.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; + +namespace TelloCommander.Data.Entities +{ + [ExcludeFromCodeCoverage] + public class TelemetryError + { + [Key] + public int Id { get; set; } + public long Time { get; set; } + public string Message { get; set; } + } +} diff --git a/src/TelloCommander.Data/Entities/TelemetryProperty.cs b/src/TelloCommander.Data/Entities/TelemetryProperty.cs new file mode 100644 index 0000000..517132d --- /dev/null +++ b/src/TelloCommander.Data/Entities/TelemetryProperty.cs @@ -0,0 +1,13 @@ +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; + +namespace TelloCommander.Data.Entities +{ + [ExcludeFromCodeCoverage] + public class TelemetryProperty + { + [Key] + public int Id { get; set; } + public string Name { get; set; } + } +} diff --git a/src/TelloCommander.Data/Entities/TelemetrySession.cs b/src/TelloCommander.Data/Entities/TelemetrySession.cs new file mode 100644 index 0000000..67a66b1 --- /dev/null +++ b/src/TelloCommander.Data/Entities/TelemetrySession.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; + +namespace TelloCommander.Data.Entities +{ + [ExcludeFromCodeCoverage] + public class TelemetrySession + { + [Key] + public int Id { get; set; } + public string Name { get; set; } + public DateTime Start { get; set; } + public int DroneId { get; set; } + + public Drone Drone { get; set; } + public IList DataPoints { get; set; } + public IList Errors { get; set; } + } +} diff --git a/src/TelloCommander.Data/Interfaces/ITelloCommanderDbContext.cs b/src/TelloCommander.Data/Interfaces/ITelloCommanderDbContext.cs new file mode 100644 index 0000000..f826001 --- /dev/null +++ b/src/TelloCommander.Data/Interfaces/ITelloCommanderDbContext.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using TelloCommander.Data.Entities; + +namespace TelloCommander.Data.Interfaces +{ + public interface ITelloCommanderDbContext + { + DbSet Drones { get; set; } + DbSet Sessions { get; set; } + DbSet Properties { get; set; } + DbSet DataPoints { get; set; } + DbSet Errors { get; set; } + + int SaveChanges(); + } +} diff --git a/src/TelloCommander.Data/TelloCommander.Data.csproj b/src/TelloCommander.Data/TelloCommander.Data.csproj new file mode 100644 index 0000000..1948257 --- /dev/null +++ b/src/TelloCommander.Data/TelloCommander.Data.csproj @@ -0,0 +1,39 @@ + + + + netstandard2.1 + TelloCommander.Data + 1.0.0.5 + 1.0.0.5 + true + Dave Walker + Copyright (c) 2020 Dave Walker + Dave Walker + First release + Database Collector for TelloCommander Drone Telemetry + Tello TelloCommander Data Collector + Database Collector for TelloCommander Drone Telemetry + Database Collector for TelloCommander Drone Telemetry + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + + + PreserveNewest + + + diff --git a/src/TelloCommanderDb.sln b/src/TelloCommanderDb.sln new file mode 100644 index 0000000..00dcb7f --- /dev/null +++ b/src/TelloCommanderDb.sln @@ -0,0 +1,45 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Migrations", "TelloCommander.Data.Migrations\TelloCommander.Data.Migrations.csproj", "{3DCA2825-C7FD-43C8-A600-EEA1E633E73B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data", "TelloCommander.Data\TelloCommander.Data.csproj", "{46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Sqlite", "TelloCommander.Data.Sqlite\TelloCommander.Data.Sqlite.csproj", "{C4B64EBF-BC2C-4DF8-83FE-8002E8F870D8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.InMemory", "TelloCommander.Data.InMemory\TelloCommander.Data.InMemory.csproj", "{61687173-4333-42A9-B2EC-D5511C52E009}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Tests", "TelloCommander.Data.Tests\TelloCommander.Data.Tests.csproj", "{E11C767F-5505-45A5-9FA6-9B3DED41A946}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3DCA2825-C7FD-43C8-A600-EEA1E633E73B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3DCA2825-C7FD-43C8-A600-EEA1E633E73B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3DCA2825-C7FD-43C8-A600-EEA1E633E73B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3DCA2825-C7FD-43C8-A600-EEA1E633E73B}.Release|Any CPU.Build.0 = Release|Any CPU + {46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}.Release|Any CPU.Build.0 = Release|Any CPU + {C4B64EBF-BC2C-4DF8-83FE-8002E8F870D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C4B64EBF-BC2C-4DF8-83FE-8002E8F870D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C4B64EBF-BC2C-4DF8-83FE-8002E8F870D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C4B64EBF-BC2C-4DF8-83FE-8002E8F870D8}.Release|Any CPU.Build.0 = Release|Any CPU + {61687173-4333-42A9-B2EC-D5511C52E009}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {61687173-4333-42A9-B2EC-D5511C52E009}.Debug|Any CPU.Build.0 = Debug|Any CPU + {61687173-4333-42A9-B2EC-D5511C52E009}.Release|Any CPU.ActiveCfg = Release|Any CPU + {61687173-4333-42A9-B2EC-D5511C52E009}.Release|Any CPU.Build.0 = Release|Any CPU + {E11C767F-5505-45A5-9FA6-9B3DED41A946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E11C767F-5505-45A5-9FA6-9B3DED41A946}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E11C767F-5505-45A5-9FA6-9B3DED41A946}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E11C767F-5505-45A5-9FA6-9B3DED41A946}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + description = Database Collector for TelloCommander Drone Telemetry + version = 1.0.0.4 + EndGlobalSection +EndGlobal From 623ec3c503c5154926bc0cc5575589ae31d0b724 Mon Sep 17 00:00:00 2001 From: David Walker Date: Wed, 22 Jan 2020 20:25:01 +0000 Subject: [PATCH 11/46] NuGet packaging for first release --- src/.DS_Store | Bin 8196 -> 8196 bytes src/TelloCommander.Data.InMemory/.DS_Store | Bin 0 -> 6148 bytes src/TelloCommander.Data.InMemory/Class1.cs | 8 ---- .../TelloCommander.Data.InMemory.csproj | 44 +++++++++++++++++- .../TelloCommander.Data.Migrations.csproj | 1 - src/TelloCommander.Data.Sqlite/.DS_Store | Bin 0 -> 6148 bytes .../TelloCommander.Data.Sqlite.csproj | 29 ++++-------- .../TelloCommander.Data.csproj | 1 - src/TelloCommanderDb.sln | 12 ++--- 9 files changed, 57 insertions(+), 38 deletions(-) create mode 100644 src/TelloCommander.Data.InMemory/.DS_Store delete mode 100644 src/TelloCommander.Data.InMemory/Class1.cs create mode 100644 src/TelloCommander.Data.Sqlite/.DS_Store diff --git a/src/.DS_Store b/src/.DS_Store index 6e635a67eef17c157f6409ce7ae03686194e3063..ee9c2b2f12edc42d747be39c8c1aaef5b1c46c95 100644 GIT binary patch delta 306 zcmZp1XmQw3Ccw<}>e*y_0WFc-d>5CboctsP1_lo0M7{XzHwPV|5-C_ECd&)*GO-v; z))Vw%W@hD`tS@MTVhE#`&Wn7IArJ|KA;=Pw!-aU6SsWN9#|t}bUM}Rz$jstaFnPVO z#bkXE9@c{9UztUd9YoyWEbGa~MR=K68yF^U6g8X7E6U5vUabmZ3nIIpSEsu$WAZvt e%gJ*^d01gQHztk)8w&-QHnU3zvy!Zjj|l+X^IGKq delta 306 zcmZp1XmQw3Ccw;~RX*8XKuaVy-^C>Q ZhZV+iV`5O)SSZM}nO#Ddm1KQq85(0Ug!)3*&#fm(uxtYjk1?K}Hr1jRr-r}F z0KdBd6?94U{Ji`Ao@Xmh)#Q0GZwgqlgPY;z$=lOm*IRz$U0ifVHT<2?1|3mDHQmw~ z>$q;Z-;e0lzcw$ArPTj4PSvdDu|6uAkN@tm{ss(OMe{HZuYQHz)2+XEU+)$l>kr;l z-M%-fmpBZnq6{bl%D}HPfIXWf+Y(f*3@8K2z>)#}KUg$I7qAudzYZvW1puZndqLly z@qm^MKo_tTgau+G6)34DTrrHK!)`;I3)l)uIvHOX-WSpRCWk4B- z85qdpi1+{F_4ofcNuQJfW#C^iVA6b=Pq3u0xAqptd#y#Ap|NmWE4WNS$8W`m<*j%J a%?s?7J3tq(6@&$%2LVrmDrMkD8F&X2JYQP? literal 0 HcmV?d00001 diff --git a/src/TelloCommander.Data.InMemory/Class1.cs b/src/TelloCommander.Data.InMemory/Class1.cs deleted file mode 100644 index 510cd3f..0000000 --- a/src/TelloCommander.Data.InMemory/Class1.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace TelloCommander.Data.InMemory -{ - public class Class1 - { - } -} diff --git a/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj b/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj index f50bf46..2585d84 100644 --- a/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj +++ b/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj @@ -30,14 +30,54 @@ - + + + TelloCommander + 1.0.0.5 + Content + PreserveNewest + Content/CommandDictionary.xsd + Content/ + True + Content/CommandDictionary.xsd + + + TelloCommander + 1.0.0.5 + Content + PreserveNewest + Content/CommandDictionary-1.3.0.0.xml + Content/ + True + Content/CommandDictionary-1.3.0.0.xml + + + TelloCommander + 1.0.0.5 + Content + PreserveNewest + Content/CommandDictionary-2.0.0.0.xml + Content/ + True + Content/CommandDictionary-2.0.0.0.xml + PreserveNewest + + TelloCommander + 1.0.0.5 + Content + PreserveNewest + Content/TelloCommanderLicense.txt + Content/ + True + Content/TelloCommanderLicense.txt + - + diff --git a/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj b/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj index e291a40..efe3550 100644 --- a/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj +++ b/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj @@ -15,7 +15,6 @@ - diff --git a/src/TelloCommander.Data.Sqlite/.DS_Store b/src/TelloCommander.Data.Sqlite/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f27bd2cf02c0d0aa8d6a028fae9c8db466ed4467 GIT binary patch literal 6148 zcmeHKy-ve05I&b60xaEN%*cj1z)C1#Wa-srz$^lo`IJ@JOO*c4hdlXfYjPh!Pmhfo%@tC{c6Q|2r6true Dave Walker Copyright (c) 2020 Dave Walker - true Dave Walker - First Release - TelloCommander Drone Telemetry SqlIte Database - TelloCommander Tello Data Collector Memory Sqlite - TelloCommander Drone Telemetry SqlIte Database - TelloCommander Drone Telemetry SqlIte Database + First release + TelloCommander Tello Database Collector Sqlite + TelloCommander Drone Telemetry Sqlite Database + TelloCommander Drone Telemetry Sqlite Database @@ -24,25 +22,16 @@ - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - + + + + + PreserveNewest - - - - - - diff --git a/src/TelloCommander.Data/TelloCommander.Data.csproj b/src/TelloCommander.Data/TelloCommander.Data.csproj index 1948257..4887f2b 100644 --- a/src/TelloCommander.Data/TelloCommander.Data.csproj +++ b/src/TelloCommander.Data/TelloCommander.Data.csproj @@ -26,7 +26,6 @@ - diff --git a/src/TelloCommanderDb.sln b/src/TelloCommanderDb.sln index 00dcb7f..0eab6a4 100644 --- a/src/TelloCommanderDb.sln +++ b/src/TelloCommanderDb.sln @@ -5,12 +5,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Migrati EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data", "TelloCommander.Data\TelloCommander.Data.csproj", "{46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Sqlite", "TelloCommander.Data.Sqlite\TelloCommander.Data.Sqlite.csproj", "{C4B64EBF-BC2C-4DF8-83FE-8002E8F870D8}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.InMemory", "TelloCommander.Data.InMemory\TelloCommander.Data.InMemory.csproj", "{61687173-4333-42A9-B2EC-D5511C52E009}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Tests", "TelloCommander.Data.Tests\TelloCommander.Data.Tests.csproj", "{E11C767F-5505-45A5-9FA6-9B3DED41A946}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Sqlite", "TelloCommander.Data.Sqlite\TelloCommander.Data.Sqlite.csproj", "{1C87AB08-A731-4F05-8AD1-B2A530EB8FAD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -25,10 +25,6 @@ Global {46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}.Debug|Any CPU.Build.0 = Debug|Any CPU {46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}.Release|Any CPU.ActiveCfg = Release|Any CPU {46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}.Release|Any CPU.Build.0 = Release|Any CPU - {C4B64EBF-BC2C-4DF8-83FE-8002E8F870D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C4B64EBF-BC2C-4DF8-83FE-8002E8F870D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C4B64EBF-BC2C-4DF8-83FE-8002E8F870D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C4B64EBF-BC2C-4DF8-83FE-8002E8F870D8}.Release|Any CPU.Build.0 = Release|Any CPU {61687173-4333-42A9-B2EC-D5511C52E009}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {61687173-4333-42A9-B2EC-D5511C52E009}.Debug|Any CPU.Build.0 = Debug|Any CPU {61687173-4333-42A9-B2EC-D5511C52E009}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -37,6 +33,10 @@ Global {E11C767F-5505-45A5-9FA6-9B3DED41A946}.Debug|Any CPU.Build.0 = Debug|Any CPU {E11C767F-5505-45A5-9FA6-9B3DED41A946}.Release|Any CPU.ActiveCfg = Release|Any CPU {E11C767F-5505-45A5-9FA6-9B3DED41A946}.Release|Any CPU.Build.0 = Release|Any CPU + {1C87AB08-A731-4F05-8AD1-B2A530EB8FAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1C87AB08-A731-4F05-8AD1-B2A530EB8FAD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1C87AB08-A731-4F05-8AD1-B2A530EB8FAD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1C87AB08-A731-4F05-8AD1-B2A530EB8FAD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution description = Database Collector for TelloCommander Drone Telemetry From 7e040c3378f5a8c720b0226f7904e213cff7a1e3 Mon Sep 17 00:00:00 2001 From: David Walker Date: Wed, 22 Jan 2020 20:26:36 +0000 Subject: [PATCH 12/46] NuGet packaging for first release --- src/TelloCommander.Data.InMemory/.DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/TelloCommander.Data.InMemory/.DS_Store diff --git a/src/TelloCommander.Data.InMemory/.DS_Store b/src/TelloCommander.Data.InMemory/.DS_Store deleted file mode 100644 index 5857b90166fc7f34b740ffbb22aea420a97e9fce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKy-ve05I(1oNP(dvqs7FAIq85(0Ug!)3*&#fm(uxtYjk1?K}Hr1jRr-r}F z0KdBd6?94U{Ji`Ao@Xmh)#Q0GZwgqlgPY;z$=lOm*IRz$U0ifVHT<2?1|3mDHQmw~ z>$q;Z-;e0lzcw$ArPTj4PSvdDu|6uAkN@tm{ss(OMe{HZuYQHz)2+XEU+)$l>kr;l z-M%-fmpBZnq6{bl%D}HPfIXWf+Y(f*3@8K2z>)#}KUg$I7qAudzYZvW1puZndqLly z@qm^MKo_tTgau+G6)34DTrrHK!)`;I3)l)uIvHOX-WSpRCWk4B- z85qdpi1+{F_4ofcNuQJfW#C^iVA6b=Pq3u0xAqptd#y#Ap|NmWE4WNS$8W`m<*j%J a%?s?7J3tq(6@&$%2LVrmDrMkD8F&X2JYQP? From 9916f290b136d38eb94b631d2755d44a2db0d3f0 Mon Sep 17 00:00:00 2001 From: David Walker Date: Wed, 22 Jan 2020 20:35:21 +0000 Subject: [PATCH 13/46] Added README --- README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..6c80e4a --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +# TelloCommanderDb + +[![Build Status](https://github.com/davewalker5/TelloCommanderDb/workflows/.NET%20Core%20CI%20Build/badge.svg)](https://github.com/davewalker5/TelloCommanderDb/actions) +[![GitHub issues](https://img.shields.io/github/issues/davewalker5/TelloCommanderDb)](https://github.com/davewalker5/TelloCommanderDb/issues) +[![Coverage Status](https://coveralls.io/repos/github/davewalker5/TelloCommanderDb/badge.svg?branch=master)](https://coveralls.io/github/davewalker5/TelloCommanderDb?branch=master) +[![Releases](https://img.shields.io/github/v/release/davewalker5/TelloCommanderDb.svg?include_prereleases)](https://github.com/davewalker5/TelloCommanderDb/releases) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/davewalker5/TelloCommanderDb/blob/master/LICENSE) +[![Language](https://img.shields.io/badge/language-c%23-blue.svg)](https://github.com/davewalker5/TelloCommanderDb/) +[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/davewalker5/TelloCommanderDb)](https://github.com/davewalker5/TelloCommanderDb/) + +## About + +TelloCommanderDb is a companion library for [TelloCommander API](https://github.com/davewalker5/TelloCommander) that extends the drone monitoring and status capture facilities with the ability to write drone telemetry information to a SQL database. + +It supports the following databas types: + +| Type | Purpose | +| --- | --- | +| In Memory | In-memory database for transient storage and primarily targetted at unit testing | +| SQLite | Permanent storage in a SQLite database| + +## Pre-requisites + +You will need .NET Core 3.1.101 and the .NET CLI installed to build the library. Instructions for downloading and installing are on the .NET website: + +[https://dotnet.microsoft.com/download](https://dotnet.microsoft.com/download) + +## Building the Application + +* Clone or download the repository +* Open a terminal window and CD to the folder containing the TelloCommanderDb.sln solution file +* Enter the following command to build the application: + +``` +dotnet build +``` + +## Getting Started + +To be completed + +## Wiki + +* [TelloCommander Wiki](https://github.com/davewalker5/TelloCommander/wiki/Home) + +## Authors + +- **Dave Walker** - *Initial work* - [LinkedIn](https://www.linkedin.com/in/davewalker5/) + +## Feedback + +To file issues or suggestions, please use the [Issues](https://github.com/davewalker5/TelloCommanderDb/issues) page for this project on GitHub. + +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details + +## Trello + +* [TelloCommander on Trello](https://trello.com/b/VCFq6tAk) From dc3ddbdcad1d07f2cddc0b852c75ca0745925612 Mon Sep 17 00:00:00 2001 From: David Walker Date: Wed, 22 Jan 2020 20:39:46 +0000 Subject: [PATCH 14/46] Fix build issue --- .gitignore | 405 ++++++++++++++++++ .../TelloCommander.Data.Migrations.csproj | 1 + 2 files changed, 406 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed9dbcb --- /dev/null +++ b/.gitignore @@ -0,0 +1,405 @@ +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# content below from: https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ \ No newline at end of file diff --git a/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj b/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj index efe3550..e291a40 100644 --- a/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj +++ b/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj @@ -15,6 +15,7 @@ + From 76c64f898479f4646e93398a0735d1fb0f8af294 Mon Sep 17 00:00:00 2001 From: David Walker Date: Wed, 22 Jan 2020 20:43:25 +0000 Subject: [PATCH 15/46] Fix build issue --- .../TelloCommander.Data.InMemory.csproj | 42 +------------------ 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj b/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj index 2585d84..6c45d15 100644 --- a/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj +++ b/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj @@ -3,7 +3,7 @@ netstandard2.1 TelloCommander.Data.InMemory - 1.0.0.5 + 1.0.0.4 1.0.0.5 true Dave Walker @@ -33,49 +33,9 @@ - - TelloCommander - 1.0.0.5 - Content - PreserveNewest - Content/CommandDictionary.xsd - Content/ - True - Content/CommandDictionary.xsd - - - TelloCommander - 1.0.0.5 - Content - PreserveNewest - Content/CommandDictionary-1.3.0.0.xml - Content/ - True - Content/CommandDictionary-1.3.0.0.xml - - - TelloCommander - 1.0.0.5 - Content - PreserveNewest - Content/CommandDictionary-2.0.0.0.xml - Content/ - True - Content/CommandDictionary-2.0.0.0.xml - PreserveNewest - - TelloCommander - 1.0.0.5 - Content - PreserveNewest - Content/TelloCommanderLicense.txt - Content/ - True - Content/TelloCommanderLicense.txt - From 260654d17206252989678223beb03587c3650757 Mon Sep 17 00:00:00 2001 From: David Walker Date: Wed, 22 Jan 2020 21:41:01 +0000 Subject: [PATCH 16/46] Implement the command line library --- .../ConsoleCommander.cs | 127 ++++++++++++++++++ .../ConsoleCommanderWrapper.cs | 121 +++++++++++++++++ .../TelloCommander.CommandLine.csproj | 23 ++++ src/TelloCommanderConsole.sln | 8 +- src/TelloCommanderConsole/Program.cs | 2 +- .../TelloCommander.ConsoleApp.csproj | 19 +++ .../TelloCommanderConsole.csproj | 11 -- src/TelloCommanderConsole/appsettings.json | 5 + 8 files changed, 303 insertions(+), 13 deletions(-) create mode 100644 src/TelloCommander.CommandLine/ConsoleCommander.cs create mode 100644 src/TelloCommander.CommandLine/ConsoleCommanderWrapper.cs create mode 100644 src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj create mode 100644 src/TelloCommanderConsole/TelloCommander.ConsoleApp.csproj delete mode 100644 src/TelloCommanderConsole/TelloCommanderConsole.csproj create mode 100644 src/TelloCommanderConsole/appsettings.json diff --git a/src/TelloCommander.CommandLine/ConsoleCommander.cs b/src/TelloCommander.CommandLine/ConsoleCommander.cs new file mode 100644 index 0000000..e9dacce --- /dev/null +++ b/src/TelloCommander.CommandLine/ConsoleCommander.cs @@ -0,0 +1,127 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using TelloCommander.CommandDictionaries; +using TelloCommander.Commander; +using TelloCommander.Interfaces; +using TelloCommander.Status; + +namespace TelloCommander.CommandLine +{ + [ExcludeFromCodeCoverage] + public class ConsoleCommander : DroneCommander + { + private readonly DroneStatusMonitor _monitor = new DroneStatusMonitor(); + + public ConsoleCommander(ITelloConnection connection, CommandDictionary dictionary) : base(connection, dictionary) + { + + } + + /// + /// Connect to the drone then repeatedly prompt for and send commands + /// + /// + public void Run(bool enableStatusMonitor = true) + { + char[] separators = { ' ' }; + + try + { + Connect(); + + if (enableStatusMonitor) + { + _monitor.Listen(DroneStatusMonitor.DefaultTelloStatusPort); + } + + Console.WriteLine(); + Console.WriteLine("You are connected to the Tello in API mode"); + + bool haveCommand; + do + { + Console.WriteLine(); + Console.Write("Enter command or hit ENTER to quit : "); + string command = Console.ReadLine(); + + haveCommand = !string.IsNullOrEmpty(command); + if (haveCommand) + { + Console.WriteLine($"Command : {command}"); + + try + { + string[] words = command.Trim().Split(separators, StringSplitOptions.RemoveEmptyEntries); + switch (words[0]) + { + case "?": + ReportDroneStatus(); + LastResponse = "ok"; + break; + case "startcapture": + int.TryParse(words[2], out int intervalMilliseconds); + _monitor.StartCapture(words[1], intervalMilliseconds); + LastResponse = "ok"; + break; + case "stopcapture": + _monitor.StopCapture(); + LastResponse = "ok"; + break; + default: + RunCommand(command); + break; + } + } +#pragma warning disable RECS0022 + catch +#pragma warning restore RECS0022 + { + // The error is logged to the history and set as the last response, + // which is output below, so no action is required here + } + + Console.WriteLine($"Response: {LastResponse}"); + } + } + while (haveCommand); + + _monitor.Stop(); + Disconnect(); + } + catch (Exception ex) + { + Console.WriteLine($"Error Connecting: {ex.Message}"); + } + } + + /// + /// Report the current status of the drone + /// + private void ReportDroneStatus() + { + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Status : {_monitor.Status}"); + if (!string.IsNullOrEmpty(_monitor.Error)) + { + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Error : {_monitor.Error}"); + } + else if (!string.IsNullOrEmpty(_monitor.Status)) + { + // If there's no error and the status has a value, it's been successfully read and + // the public properties on the monitor will be populated. The sequence number is + // incremented every time the status is read from the drone. If it stops increasing + // for any length of time, then either the monitor has stopped or the drone has + // stopped broadcasting its status + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Sequence : {_monitor.Sequence}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Attitude : {_monitor.Attitude.ToString()}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Speed : {_monitor.Speed.ToString()}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Temperature : {_monitor.Temperature.ToString()}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} TOF : {_monitor.TOF}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Height : {_monitor.Height}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Battery : {_monitor.Battery}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Barometer : {_monitor.Barometer}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Time : {_monitor.Time}"); + Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss.fff")} Acceleration : {_monitor.Acceleration.ToString()}"); + } + } + } +} diff --git a/src/TelloCommander.CommandLine/ConsoleCommanderWrapper.cs b/src/TelloCommander.CommandLine/ConsoleCommanderWrapper.cs new file mode 100644 index 0000000..e885117 --- /dev/null +++ b/src/TelloCommander.CommandLine/ConsoleCommanderWrapper.cs @@ -0,0 +1,121 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using TelloCommander.CommandDictionaries; +using TelloCommander.Commander; +using TelloCommander.Connections; +using TelloCommander.Interfaces; + +namespace TelloCommander.CommandLine +{ + [ExcludeFromCodeCoverage] + public class ConsoleCommanderWrapper + { + /// + /// Prompt for the data necessary to create the console commander, + /// create it and run it + /// + public void Run() + { + Console.WriteLine($"Tello Commander {DroneCommander.Version}"); + + string version = PromptForDictionaryVersion(); + if (!string.IsNullOrEmpty(version)) + { + ConnectionType connectionType = PromptForConnectionType(); + if (connectionType != ConnectionType.None) + { + CommandDictionary dictionary = CommandDictionary.ReadStandardDictionary(version); + switch (connectionType) + { + case ConnectionType.Mock: + ITelloConnection mockConnection = new MockTelloConnection(dictionary); + new ConsoleCommander(mockConnection, dictionary).Run(false); + break; + case ConnectionType.Simulator: + ITelloConnection connection = new TelloConnection(IPAddress.Loopback.ToString(), TelloConnection.DefaultTelloPort, connectionType); + new ConsoleCommander(connection, dictionary).Run(true); + break; + case ConnectionType.Drone: + new ConsoleCommander(new TelloConnection(), dictionary).Run(true); + break; + default: + break; + } + + } + } + } + + /// + /// Prompt the user for an option from a numbered list + /// + /// + private int PromptForOption(string title, string[] options) + { + Console.WriteLine(); + Console.WriteLine(title); + Console.WriteLine(); + + for (int i = 0; i < options.Length; i++) + { + Console.WriteLine($"[{i + 1}] {options[i]}"); + } + + Console.WriteLine(); + + int option = -1; + do + { + Console.Write($"Please enter your option between 1 and {options.Length} or enter 0 to quit: "); + string input = Console.ReadLine(); + int.TryParse(input, out option); + } + while ((option < 0) || (option > options.Length)); + + return option; + } + + /// + /// Prompt for and return the API (dictionary) version to use + /// + /// + private string PromptForDictionaryVersion() + { + string[] versions = CommandDictionary.GetAvailableDictionaryVersions(); + string version = null; + + if (versions.Length == 1) + { + version = versions[0]; + Console.WriteLine($"Using dictionary version {version}"); + } + else + { + int selection = PromptForOption("Dictionary Version:", versions); + if (selection > 0) + { + version = versions[selection - 1]; + } + } + + return version; + } + + /// + /// Prompt for the type of connection to use + /// + /// + private ConnectionType PromptForConnectionType() + { + int connectionType = PromptForOption("Connection:", new string[] + { + "Mock connection", + "Simulator connection", + "Real connection" + }); + + return (ConnectionType)connectionType; + } + } +} diff --git a/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj b/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj new file mode 100644 index 0000000..2a83c31 --- /dev/null +++ b/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj @@ -0,0 +1,23 @@ + + + + netstandard2.1 + TelloCommander.CommandLine + 1.0.0.5 + 1.0.0.5 + Dave Walker + Copyright (c) 2020 Dave Walker + Dave Walker + https://github.com/davewalker5/TelloCommanderConsole + Extracted from the + C# command line utilities for controlling a Tello drone + Tello API Console CommandLine + TelloCommander.CommandLine + C# command line utilities for controlling a Tello drone + true + + + + + + diff --git a/src/TelloCommanderConsole.sln b/src/TelloCommanderConsole.sln index a030258..f4f5fbc 100644 --- a/src/TelloCommanderConsole.sln +++ b/src/TelloCommanderConsole.sln @@ -1,7 +1,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommanderConsole", "TelloCommanderConsole\TelloCommanderConsole.csproj", "{292CB991-4AAD-4D7E-BB9D-8AFB1EA3693B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.ConsoleApp", "TelloCommanderConsole\TelloCommander.ConsoleApp.csproj", "{292CB991-4AAD-4D7E-BB9D-8AFB1EA3693B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.CommandLine", "TelloCommander.CommandLine\TelloCommander.CommandLine.csproj", "{8CE981A8-72BC-4E6B-A15C-BA48E69AAF0A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -13,5 +15,9 @@ Global {292CB991-4AAD-4D7E-BB9D-8AFB1EA3693B}.Debug|Any CPU.Build.0 = Debug|Any CPU {292CB991-4AAD-4D7E-BB9D-8AFB1EA3693B}.Release|Any CPU.ActiveCfg = Release|Any CPU {292CB991-4AAD-4D7E-BB9D-8AFB1EA3693B}.Release|Any CPU.Build.0 = Release|Any CPU + {8CE981A8-72BC-4E6B-A15C-BA48E69AAF0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8CE981A8-72BC-4E6B-A15C-BA48E69AAF0A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8CE981A8-72BC-4E6B-A15C-BA48E69AAF0A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8CE981A8-72BC-4E6B-A15C-BA48E69AAF0A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/TelloCommanderConsole/Program.cs b/src/TelloCommanderConsole/Program.cs index 5a8dc58..9495f7f 100644 --- a/src/TelloCommanderConsole/Program.cs +++ b/src/TelloCommanderConsole/Program.cs @@ -1,4 +1,4 @@ -using TelloCommander.Commander; +using TelloCommander.CommandLine; namespace TelloCommander { diff --git a/src/TelloCommanderConsole/TelloCommander.ConsoleApp.csproj b/src/TelloCommanderConsole/TelloCommander.ConsoleApp.csproj new file mode 100644 index 0000000..8bb8b82 --- /dev/null +++ b/src/TelloCommanderConsole/TelloCommander.ConsoleApp.csproj @@ -0,0 +1,19 @@ + + + + Exe + netcoreapp3.1 + + + + + + + + + + + PreserveNewest + + + diff --git a/src/TelloCommanderConsole/TelloCommanderConsole.csproj b/src/TelloCommanderConsole/TelloCommanderConsole.csproj deleted file mode 100644 index ea24ff2..0000000 --- a/src/TelloCommanderConsole/TelloCommanderConsole.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - Exe - netcoreapp3.1 - - - - - - diff --git a/src/TelloCommanderConsole/appsettings.json b/src/TelloCommanderConsole/appsettings.json new file mode 100644 index 0000000..b896c51 --- /dev/null +++ b/src/TelloCommanderConsole/appsettings.json @@ -0,0 +1,5 @@ +{ + "ConnectionStrings": { + "TelloCommanderDb": "Data Source=/Users/dave/tellocommander.db" + } +} \ No newline at end of file From 540b4c5cf5f66736a4be630e3d6865dde5f8a37c Mon Sep 17 00:00:00 2001 From: David Walker Date: Wed, 22 Jan 2020 22:03:26 +0000 Subject: [PATCH 17/46] Reorganised project structure --- .../Content/TelloCommanderConsoleLicense.txt | 21 +++++++++++++++++++ .../TelloCommander.CommandLine.csproj | 12 ++++++++++- .../Program.cs | 0 .../TelloCommander.ConsoleApp.csproj | 0 .../appsettings.json | 0 src/TelloCommanderConsole.sln | 2 +- 6 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 src/TelloCommander.CommandLine/Content/TelloCommanderConsoleLicense.txt rename src/{TelloCommanderConsole => TelloCommander.ConsoleApp}/Program.cs (100%) rename src/{TelloCommanderConsole => TelloCommander.ConsoleApp}/TelloCommander.ConsoleApp.csproj (100%) rename src/{TelloCommanderConsole => TelloCommander.ConsoleApp}/appsettings.json (100%) diff --git a/src/TelloCommander.CommandLine/Content/TelloCommanderConsoleLicense.txt b/src/TelloCommander.CommandLine/Content/TelloCommanderConsoleLicense.txt new file mode 100644 index 0000000..97d4e70 --- /dev/null +++ b/src/TelloCommander.CommandLine/Content/TelloCommanderConsoleLicense.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Dave Walker + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj b/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj index 2a83c31..1ae81c6 100644 --- a/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj +++ b/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj @@ -3,7 +3,6 @@ netstandard2.1 TelloCommander.CommandLine - 1.0.0.5 1.0.0.5 Dave Walker Copyright (c) 2020 Dave Walker @@ -20,4 +19,15 @@ + + + + + + + + + PreserveNewest + + diff --git a/src/TelloCommanderConsole/Program.cs b/src/TelloCommander.ConsoleApp/Program.cs similarity index 100% rename from src/TelloCommanderConsole/Program.cs rename to src/TelloCommander.ConsoleApp/Program.cs diff --git a/src/TelloCommanderConsole/TelloCommander.ConsoleApp.csproj b/src/TelloCommander.ConsoleApp/TelloCommander.ConsoleApp.csproj similarity index 100% rename from src/TelloCommanderConsole/TelloCommander.ConsoleApp.csproj rename to src/TelloCommander.ConsoleApp/TelloCommander.ConsoleApp.csproj diff --git a/src/TelloCommanderConsole/appsettings.json b/src/TelloCommander.ConsoleApp/appsettings.json similarity index 100% rename from src/TelloCommanderConsole/appsettings.json rename to src/TelloCommander.ConsoleApp/appsettings.json diff --git a/src/TelloCommanderConsole.sln b/src/TelloCommanderConsole.sln index f4f5fbc..4aa22ee 100644 --- a/src/TelloCommanderConsole.sln +++ b/src/TelloCommanderConsole.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.ConsoleApp", "TelloCommanderConsole\TelloCommander.ConsoleApp.csproj", "{292CB991-4AAD-4D7E-BB9D-8AFB1EA3693B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.ConsoleApp", "TelloCommander.ConsoleApp\TelloCommander.ConsoleApp.csproj", "{292CB991-4AAD-4D7E-BB9D-8AFB1EA3693B}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.CommandLine", "TelloCommander.CommandLine\TelloCommander.CommandLine.csproj", "{8CE981A8-72BC-4E6B-A15C-BA48E69AAF0A}" EndProject From ad721577344789f163c0beaa328b5689856eb2cd Mon Sep 17 00:00:00 2001 From: David Walker Date: Wed, 22 Jan 2020 22:03:54 +0000 Subject: [PATCH 18/46] Tidying up prior to publication --- src/.DS_Store | Bin 8196 -> 8196 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/.DS_Store b/src/.DS_Store index ee9c2b2f12edc42d747be39c8c1aaef5b1c46c95..49e4b6cbe49cd565d3682c2540bd8711bc713430 100644 GIT binary patch delta 356 zcmZp1XmQw3Ccw;SIAOBAfR;#ZzKcszPJR*t0|UqL$8NE;Zw@*_B~q|TOqLhqWn%m= zSx?Z5nbACHvc8}ViXoq$WJiMyfk+?>L6(>tF2u{scz|JYys*RM@Cd03gZPZF$qjwC+x<|Y$P>#y|Be(eGwkkgOg_il{$#H!&%mokBjg! zGe2OMyiwF_GOs8vGsneh5F5pcyK}^W`qqhBPM#~u!wTcMF>xwvEEHtg%q}6!O0qsa FCIF3WbL9X4 delta 356 zcmZp1XmQw3Ccw<}>e*y_0WFc-d>5CboctsP1_lo0M7{XzHwPV|5-C_ECd&)*GO-v; z))Vw%W@hD`tS@MTVhE#`&Wn7IArJ|KA;=Pw!-aU6SsWN9#|t}5UJhh4uzmrt1(BWe z!Tof1+T<8v=gHo}JghKY02713m02{|LBt)-vYvcg zgqNAMfnoASQM1XsqP)!P)v6#iiWR&%-Gv#G*NIwAo-4}33gfvkaU9rKD9E&#T|$_Z IWPN;00Qs Date: Thu, 23 Jan 2020 11:26:22 +0000 Subject: [PATCH 19/46] NuGet packaging for 1.0.0.5 release --- ... TelloCommander.Data.InMemory.License.txt} | 0 .../TelloCommander.Data.InMemory.csproj | 17 ++---- .../TelloCommander.Data.Migrations.csproj | 15 ++--- .../appsettings.json | 2 +- src/TelloCommander.Data.Sqlite/.DS_Store | Bin 6148 -> 0 bytes ...=> TelloCommander.Data.Sqlite.License.txt} | 0 .../TelloCommander.Data.Sqlite.csproj | 11 +++- .../TelloCommander.Data.Tests.csproj | 3 - ...se.txt => TelloCommander.Data.License.txt} | 2 +- .../TelloCommander.Data.csproj | 20 ++----- src/TelloCommanderDb.sln | 54 ++++++++---------- 11 files changed, 51 insertions(+), 73 deletions(-) rename src/TelloCommander.Data.InMemory/Content/{TelloCommanderDbLicense.txt => TelloCommander.Data.InMemory.License.txt} (100%) delete mode 100644 src/TelloCommander.Data.Sqlite/.DS_Store rename src/TelloCommander.Data.Sqlite/Content/{TelloCommanderDbLicense.txt => TelloCommander.Data.Sqlite.License.txt} (100%) rename src/TelloCommander.Data/Content/{TelloCommanderDbLicense.txt => TelloCommander.Data.License.txt} (98%) diff --git a/src/TelloCommander.Data.InMemory/Content/TelloCommanderDbLicense.txt b/src/TelloCommander.Data.InMemory/Content/TelloCommander.Data.InMemory.License.txt similarity index 100% rename from src/TelloCommander.Data.InMemory/Content/TelloCommanderDbLicense.txt rename to src/TelloCommander.Data.InMemory/Content/TelloCommander.Data.InMemory.License.txt diff --git a/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj b/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj index 6c45d15..c7477d6 100644 --- a/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj +++ b/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj @@ -3,7 +3,6 @@ netstandard2.1 TelloCommander.Data.InMemory - 1.0.0.4 1.0.0.5 true Dave Walker @@ -15,29 +14,23 @@ TelloCommander Drone Telemetry InMemory Database - - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - + - - PreserveNewest + + Always - - - diff --git a/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj b/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj index e291a40..1df4390 100644 --- a/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj +++ b/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj @@ -3,16 +3,8 @@ Exe netcoreapp3.1 - 1.0.0.4 - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - @@ -21,8 +13,11 @@ - - PreserveNewest + + Always + + + diff --git a/src/TelloCommander.Data.Migrations/appsettings.json b/src/TelloCommander.Data.Migrations/appsettings.json index b896c51..703af5a 100644 --- a/src/TelloCommander.Data.Migrations/appsettings.json +++ b/src/TelloCommander.Data.Migrations/appsettings.json @@ -1,5 +1,5 @@ { "ConnectionStrings": { - "TelloCommanderDb": "Data Source=/Users/dave/tellocommander.db" + "TelloCommanderDb": "Data Source=tellocommander.db" } } \ No newline at end of file diff --git a/src/TelloCommander.Data.Sqlite/.DS_Store b/src/TelloCommander.Data.Sqlite/.DS_Store deleted file mode 100644 index f27bd2cf02c0d0aa8d6a028fae9c8db466ed4467..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKy-ve05I&b60xaEN%*cj1z)C1#Wa-srz$^lo`IJ@JOO*c4hdlXfYjPh!Pmhfo%@tC{c6Q|2r6 + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + - + - - PreserveNewest + + Always diff --git a/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj b/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj index 7994574..7088a77 100644 --- a/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj +++ b/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj @@ -4,7 +4,6 @@ netcoreapp3.1 false - 1.0.0.4 @@ -14,8 +13,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/TelloCommander.Data/Content/TelloCommanderDbLicense.txt b/src/TelloCommander.Data/Content/TelloCommander.Data.License.txt similarity index 98% rename from src/TelloCommander.Data/Content/TelloCommanderDbLicense.txt rename to src/TelloCommander.Data/Content/TelloCommander.Data.License.txt index 97d4e70..6fc2c54 100644 --- a/src/TelloCommander.Data/Content/TelloCommanderDbLicense.txt +++ b/src/TelloCommander.Data/Content/TelloCommander.Data.License.txt @@ -1,4 +1,4 @@ -MIT License +MIT License Copyright (c) 2020 Dave Walker diff --git a/src/TelloCommander.Data/TelloCommander.Data.csproj b/src/TelloCommander.Data/TelloCommander.Data.csproj index 4887f2b..60dea60 100644 --- a/src/TelloCommander.Data/TelloCommander.Data.csproj +++ b/src/TelloCommander.Data/TelloCommander.Data.csproj @@ -3,7 +3,6 @@ netstandard2.1 TelloCommander.Data - 1.0.0.5 1.0.0.5 true Dave Walker @@ -17,22 +16,15 @@ - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - + - + + Always + - - PreserveNewest - + + diff --git a/src/TelloCommanderDb.sln b/src/TelloCommanderDb.sln index 0eab6a4..4e7e415 100644 --- a/src/TelloCommanderDb.sln +++ b/src/TelloCommanderDb.sln @@ -1,15 +1,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Migrations", "TelloCommander.Data.Migrations\TelloCommander.Data.Migrations.csproj", "{3DCA2825-C7FD-43C8-A600-EEA1E633E73B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data", "TelloCommander.Data\TelloCommander.Data.csproj", "{D7475533-B6CD-4130-BF25-7CFE51287CF7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data", "TelloCommander.Data\TelloCommander.Data.csproj", "{46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Tests", "TelloCommander.Data.Tests\TelloCommander.Data.Tests.csproj", "{9914E4CC-1EC7-46E3-8757-244467435D15}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.InMemory", "TelloCommander.Data.InMemory\TelloCommander.Data.InMemory.csproj", "{61687173-4333-42A9-B2EC-D5511C52E009}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.InMemory", "TelloCommander.Data.InMemory\TelloCommander.Data.InMemory.csproj", "{146C11D4-B515-4E1D-BFDC-6AAFD5142FBF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Tests", "TelloCommander.Data.Tests\TelloCommander.Data.Tests.csproj", "{E11C767F-5505-45A5-9FA6-9B3DED41A946}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Sqlite", "TelloCommander.Data.Sqlite\TelloCommander.Data.Sqlite.csproj", "{EDD518DD-852A-499A-AD2C-733CEC87C0A7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Sqlite", "TelloCommander.Data.Sqlite\TelloCommander.Data.Sqlite.csproj", "{1C87AB08-A731-4F05-8AD1-B2A530EB8FAD}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelloCommander.Data.Migrations", "TelloCommander.Data.Migrations\TelloCommander.Data.Migrations.csproj", "{C19CCCF8-DC57-4FBE-98EB-773BC8DB2063}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -17,29 +17,25 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3DCA2825-C7FD-43C8-A600-EEA1E633E73B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3DCA2825-C7FD-43C8-A600-EEA1E633E73B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3DCA2825-C7FD-43C8-A600-EEA1E633E73B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3DCA2825-C7FD-43C8-A600-EEA1E633E73B}.Release|Any CPU.Build.0 = Release|Any CPU - {46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {46F57089-4D48-495C-ACDD-0DC3C6F6BEC0}.Release|Any CPU.Build.0 = Release|Any CPU - {61687173-4333-42A9-B2EC-D5511C52E009}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {61687173-4333-42A9-B2EC-D5511C52E009}.Debug|Any CPU.Build.0 = Debug|Any CPU - {61687173-4333-42A9-B2EC-D5511C52E009}.Release|Any CPU.ActiveCfg = Release|Any CPU - {61687173-4333-42A9-B2EC-D5511C52E009}.Release|Any CPU.Build.0 = Release|Any CPU - {E11C767F-5505-45A5-9FA6-9B3DED41A946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E11C767F-5505-45A5-9FA6-9B3DED41A946}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E11C767F-5505-45A5-9FA6-9B3DED41A946}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E11C767F-5505-45A5-9FA6-9B3DED41A946}.Release|Any CPU.Build.0 = Release|Any CPU - {1C87AB08-A731-4F05-8AD1-B2A530EB8FAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1C87AB08-A731-4F05-8AD1-B2A530EB8FAD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1C87AB08-A731-4F05-8AD1-B2A530EB8FAD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1C87AB08-A731-4F05-8AD1-B2A530EB8FAD}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - description = Database Collector for TelloCommander Drone Telemetry - version = 1.0.0.4 + {D7475533-B6CD-4130-BF25-7CFE51287CF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7475533-B6CD-4130-BF25-7CFE51287CF7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7475533-B6CD-4130-BF25-7CFE51287CF7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7475533-B6CD-4130-BF25-7CFE51287CF7}.Release|Any CPU.Build.0 = Release|Any CPU + {9914E4CC-1EC7-46E3-8757-244467435D15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9914E4CC-1EC7-46E3-8757-244467435D15}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9914E4CC-1EC7-46E3-8757-244467435D15}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9914E4CC-1EC7-46E3-8757-244467435D15}.Release|Any CPU.Build.0 = Release|Any CPU + {146C11D4-B515-4E1D-BFDC-6AAFD5142FBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {146C11D4-B515-4E1D-BFDC-6AAFD5142FBF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {146C11D4-B515-4E1D-BFDC-6AAFD5142FBF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {146C11D4-B515-4E1D-BFDC-6AAFD5142FBF}.Release|Any CPU.Build.0 = Release|Any CPU + {EDD518DD-852A-499A-AD2C-733CEC87C0A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDD518DD-852A-499A-AD2C-733CEC87C0A7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EDD518DD-852A-499A-AD2C-733CEC87C0A7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EDD518DD-852A-499A-AD2C-733CEC87C0A7}.Release|Any CPU.Build.0 = Release|Any CPU + {C19CCCF8-DC57-4FBE-98EB-773BC8DB2063}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C19CCCF8-DC57-4FBE-98EB-773BC8DB2063}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C19CCCF8-DC57-4FBE-98EB-773BC8DB2063}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C19CCCF8-DC57-4FBE-98EB-773BC8DB2063}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal From ffb62bd03d0c57a1f42801dd272e5f617e44ca69 Mon Sep 17 00:00:00 2001 From: David Walker Date: Thu, 23 Jan 2020 11:26:52 +0000 Subject: [PATCH 20/46] NuGet packaging for 1.0.0.5 release --- .../ConsoleCommander.cs | 35 +++++++++++++------ .../ConsoleCommanderWrapper.cs | 2 -- ...=> TelloCommander.CommandLine.License.txt} | 2 +- .../TelloCommander.CommandLine.csproj | 15 ++++---- .../appsettings.json | 4 +-- 5 files changed, 37 insertions(+), 21 deletions(-) rename src/TelloCommander.CommandLine/Content/{TelloCommanderConsoleLicense.txt => TelloCommander.CommandLine.License.txt} (98%) diff --git a/src/TelloCommander.CommandLine/ConsoleCommander.cs b/src/TelloCommander.CommandLine/ConsoleCommander.cs index e9dacce..7b1b9fa 100644 --- a/src/TelloCommander.CommandLine/ConsoleCommander.cs +++ b/src/TelloCommander.CommandLine/ConsoleCommander.cs @@ -1,20 +1,19 @@ using System; -using System.Diagnostics.CodeAnalysis; using TelloCommander.CommandDictionaries; using TelloCommander.Commander; +using TelloCommander.Data.Collector; +using TelloCommander.Data.Sqlite; using TelloCommander.Interfaces; using TelloCommander.Status; namespace TelloCommander.CommandLine { - [ExcludeFromCodeCoverage] public class ConsoleCommander : DroneCommander { private readonly DroneStatusMonitor _monitor = new DroneStatusMonitor(); public ConsoleCommander(ITelloConnection connection, CommandDictionary dictionary) : base(connection, dictionary) { - } /// @@ -24,6 +23,8 @@ public ConsoleCommander(ITelloConnection connection, CommandDictionary dictionar public void Run(bool enableStatusMonitor = true) { char[] separators = { ' ' }; + TelemetryCollector collector = null; + TelloCommanderDbContext context = null; try { @@ -67,20 +68,34 @@ public void Run(bool enableStatusMonitor = true) _monitor.StopCapture(); LastResponse = "ok"; break; + case "startdbcapture": + int.TryParse(words[3], out int collectionInterval); + string[] filters = (words.Length > 4) ? words[4].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries) : null; + context = new TelloCommanderDbContextFactory().CreateDbContext(null); + collector = new TelemetryCollector(context, _monitor); + collector.Start(words[1], words[2], collectionInterval, filters); + LastResponse = "ok"; + break; + case "stopdbcapture": + if (collector != null) + { + collector.Stop(); + context.Dispose(); + collector = null; + } + LastResponse = "ok"; + break; default: RunCommand(command); break; } + + Console.WriteLine($"Response: {LastResponse}"); } -#pragma warning disable RECS0022 - catch -#pragma warning restore RECS0022 + catch (Exception ex) { - // The error is logged to the history and set as the last response, - // which is output below, so no action is required here + Console.WriteLine($"Error : {ex.Message}"); } - - Console.WriteLine($"Response: {LastResponse}"); } } while (haveCommand); diff --git a/src/TelloCommander.CommandLine/ConsoleCommanderWrapper.cs b/src/TelloCommander.CommandLine/ConsoleCommanderWrapper.cs index e885117..9938f43 100644 --- a/src/TelloCommander.CommandLine/ConsoleCommanderWrapper.cs +++ b/src/TelloCommander.CommandLine/ConsoleCommanderWrapper.cs @@ -1,5 +1,4 @@ using System; -using System.Diagnostics.CodeAnalysis; using System.Net; using TelloCommander.CommandDictionaries; using TelloCommander.Commander; @@ -8,7 +7,6 @@ namespace TelloCommander.CommandLine { - [ExcludeFromCodeCoverage] public class ConsoleCommanderWrapper { /// diff --git a/src/TelloCommander.CommandLine/Content/TelloCommanderConsoleLicense.txt b/src/TelloCommander.CommandLine/Content/TelloCommander.CommandLine.License.txt similarity index 98% rename from src/TelloCommander.CommandLine/Content/TelloCommanderConsoleLicense.txt rename to src/TelloCommander.CommandLine/Content/TelloCommander.CommandLine.License.txt index 97d4e70..6fc2c54 100644 --- a/src/TelloCommander.CommandLine/Content/TelloCommanderConsoleLicense.txt +++ b/src/TelloCommander.CommandLine/Content/TelloCommander.CommandLine.License.txt @@ -1,4 +1,4 @@ -MIT License +MIT License Copyright (c) 2020 Dave Walker diff --git a/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj b/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj index 1ae81c6..549e656 100644 --- a/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj +++ b/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj @@ -8,7 +8,7 @@ Copyright (c) 2020 Dave Walker Dave Walker https://github.com/davewalker5/TelloCommanderConsole - Extracted from the + Extracted from the TelloCommander API library C# command line utilities for controlling a Tello drone Tello API Console CommandLine TelloCommander.CommandLine @@ -17,17 +17,20 @@ - + + - + + Always + - - PreserveNewest - + + + diff --git a/src/TelloCommander.ConsoleApp/appsettings.json b/src/TelloCommander.ConsoleApp/appsettings.json index b896c51..7374fbf 100644 --- a/src/TelloCommander.ConsoleApp/appsettings.json +++ b/src/TelloCommander.ConsoleApp/appsettings.json @@ -1,5 +1,5 @@ { "ConnectionStrings": { - "TelloCommanderDb": "Data Source=/Users/dave/tellocommander.db" + "TelloCommanderDb": "Data Source=tellocommander.db" } -} \ No newline at end of file +} From a886814cd228d7315569a7e17373d8dbc26c97dc Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Thu, 23 Jan 2020 12:46:08 +0000 Subject: [PATCH 21/46] Create dotnetcore.yml --- .github/workflows/dotnetcore.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/dotnetcore.yml diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml new file mode 100644 index 0000000..e9330fa --- /dev/null +++ b/.github/workflows/dotnetcore.yml @@ -0,0 +1,24 @@ +name: .NET Core CI Build + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.101 + - name: Build + run: dotnet build --configuration Release src/TelloCommanderDb.sln + - name: Run unit tests and generate code coverage + run: dotnet test src/TelloCommanderDb.sln /p:CollectCoverage=true /p:CoverletOutput=coverage/ /p:CoverletOutputFormat=lcov + - name: Generage Coveralls code coverage + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: src/TelloCommander.Data.Tests/coverage/coverage.info From eacf9c4c696364b5ad1613d85ea965580146ccd2 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Thu, 23 Jan 2020 14:19:33 +0000 Subject: [PATCH 22/46] Remove redundant file --- src/.DS_Store | Bin 8196 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/.DS_Store diff --git a/src/.DS_Store b/src/.DS_Store deleted file mode 100644 index 49e4b6cbe49cd565d3682c2540bd8711bc713430..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeI1%SyyB6oyY67b9*25if`o+zaEzZPhBcnANyb!MS)DoKDrzg^18c5Ok*xqbt`w zfFS5nQ1Au(PZDQZMxnMMq9-N!Ly~ive5B2s4iTxj!&-r8goyIUtONZhK1kfpxhwV9 zmLaHuJyAgO$Ud%e*Jx=F0zyCt2mv7=1bzbnoY|c6pPc)qS4tru1pXxfem^+KtghA2 zsD5>z&>;Y{7tK1MjyOQuI96S&p;2uLpC)=x)>PRLLm6}QJ3JifS`CdFb5h2fl)baE z5sK1xhn=H`lX8tpDFlQ-Hvx{_2Wgo$sDUdQzc;Cd)_s~H57GPql{agxY9$C7`~)U6 zX>1ir)xh7?_f>_{3a4n*0l`QyW7!OzwqS8lOY1EC2CR; z;C#T`r=vK58D39nUr{Enk2@=tNd|u%O5fox&h3i1O(f=4q&jVZ7;m*Y*fpsYXLmlC z)nAm~{o?bg<(FxWe$Zj~T|Q$Rd-Q=emY8FS_V6IrL2)C-FE>2~eyRLKxm}-KymL$G ztHUd+uNbG?J(fqKi8=8ruLVl+U6#K+PUj`c=6LRacKJw fL)0DH=UNSoq6g{cKLj9@!S8fA|22Lo{waYs3TcKk From 4a1b012477cd80f467e6e43630b9718cd6387570 Mon Sep 17 00:00:00 2001 From: David Walker Date: Thu, 23 Jan 2020 16:50:58 +0000 Subject: [PATCH 23/46] Added details on DB capture commands --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c818dd..c5af926 100644 --- a/README.md +++ b/README.md @@ -114,8 +114,10 @@ In addition to the commands supported by the drone and the custom commands provi | Command | Parameters | Purpose | | --- | --- | --- | | ? | None | Report the current status to the console | -| startcapture | file interval | Start writing status records to the specified file (in CSV format) at the specified interval (in milliseconds) | +| startcapture | file interval | Start writing telemetry to the specified file (in CSV format) at the specified interval (in milliseconds) | | stopcapture | None | Stop file capture if it's in progress | +| startdbcapture | drone session interval [property list] | Start writing telemetry to th SQLite database defined in the appsettings.json file | +| stopdbcapture | None | Stop writing telemetry to a database if it's in progress | ### Closing the Connection From a0cff93aa3289f92380d722cc1d26c0b0d78a775 Mon Sep 17 00:00:00 2001 From: David Walker Date: Thu, 23 Jan 2020 17:11:22 +0000 Subject: [PATCH 24/46] Added DB capture command details --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index c5af926..ec242a6 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,15 @@ In addition to the commands supported by the drone and the custom commands provi | startdbcapture | drone session interval [property list] | Start writing telemetry to th SQLite database defined in the appsettings.json file | | stopdbcapture | None | Stop writing telemetry to a database if it's in progress | +The arguments to the "startdbcapture" command are as follows: + +| Name | Description | +| --- | --- | +| drone | Name of the drone, as a single word e.g. TELLO-12345 | +| session | Name of the capture session, as a single word e.g. LoopTheLoop-001 | +| interval | The collection interval, in milliseconds e.g. 1000 = 1 second. A value <= 0 defaults to 1000 ms | +| property list | A comma-separated list of the properties to capture e.g. pitch,roll,yaw | + ### Closing the Connection Before closing the application, please: From 906c1a1bc044437efd31e17f678974e0cea2aad9 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Thu, 23 Jan 2020 18:07:43 +0000 Subject: [PATCH 25/46] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index ec242a6..d832281 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,16 @@ The arguments to the "startdbcapture" command are as follows: | interval | The collection interval, in milliseconds e.g. 1000 = 1 second. A value <= 0 defaults to 1000 ms | | property list | A comma-separated list of the properties to capture e.g. pitch,roll,yaw | +Valid properties for the property list are those returned in the Tello status, as documented in the drone APIs: + +* [Tello SDK Documentation EN_1.3.pdf](https://dl-cdn.ryzerobotics.com/downloads/tello/20180910/Tello%20SDK%20Documentation%20EN_1.3.pdf) + +For example, to collect the height and battery at 1s intervals, use the folowing: + +``` +startdbcapture MY-TELLO My-Session-1 1000 h,bat +``` + ### Closing the Connection Before closing the application, please: From 5ae6d6d594e67492dab159bd626764ad79a51b40 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Thu, 23 Jan 2020 18:08:20 +0000 Subject: [PATCH 26/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d832281..6640d62 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ Valid properties for the property list are those returned in the Tello status, a * [Tello SDK Documentation EN_1.3.pdf](https://dl-cdn.ryzerobotics.com/downloads/tello/20180910/Tello%20SDK%20Documentation%20EN_1.3.pdf) -For example, to collect the height and battery at 1s intervals, use the folowing: +For example, to collect the height and battery charge at 1s intervals, use the folowing: ``` startdbcapture MY-TELLO My-Session-1 1000 h,bat From d4162f5ecb14db9dbadcd6765dec2213a7663e85 Mon Sep 17 00:00:00 2001 From: David Walker Date: Fri, 24 Jan 2020 08:55:30 +0000 Subject: [PATCH 27/46] Test coverage improvements --- .../TelemetryCollectorTest.cs | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/TelloCommander.Data.Tests/TelemetryCollectorTest.cs b/src/TelloCommander.Data.Tests/TelemetryCollectorTest.cs index 2cf0e63..0626a76 100644 --- a/src/TelloCommander.Data.Tests/TelemetryCollectorTest.cs +++ b/src/TelloCommander.Data.Tests/TelemetryCollectorTest.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; +using System.Text; using System.Threading; using Microsoft.VisualStudio.TestTools.UnitTesting; using TelloCommander.Data.Collector; @@ -62,5 +64,49 @@ public void CollectionTest() Assert.IsTrue(_context.DataPoints.Count() > 0); } + + [TestMethod] + public void CollectForExistingDroneTest() + { + Drone drone = new Drone { Name = DroneName }; + _context.Drones.Add(drone); + _context.SaveChanges(); + + _collector.Start(DroneName, SessionName, 1000, null); + Thread.Sleep(3000); + _collector.Stop(); + + Assert.AreEqual(1, _context.Sessions.Count()); + TelemetrySession session = _context.Sessions.First(); + Assert.AreEqual(drone.Id, session.DroneId); + Assert.IsTrue(_context.Properties.Count() > 0); + Assert.IsTrue(_context.DataPoints.Count() > 0); + } + + [TestMethod] + public void CollectAndLogToConsoleTest() + { + string output; + + using (MemoryStream stream = new MemoryStream()) + { + using (StreamWriter writer = new StreamWriter(stream)) + { + TextWriter original = Console.Out; + Console.SetOut(writer); + + _collector.LogToConsole = true; + _collector.Start(DroneName, SessionName, 1000, null); + Thread.Sleep(3000); + _collector.Stop(); + + Console.SetOut(original); + } + + output = Encoding.UTF8.GetString(stream.ToArray()); + } + + Assert.IsTrue(output.Contains("Writing data for sequence")); + } } } From 91b00c551a62201699c6931ec4f3362f9478df66 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Fri, 24 Jan 2020 21:33:52 +0000 Subject: [PATCH 28/46] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6640d62..b2de838 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,10 @@ You will need .NET Core 3.1.101 and the .NET CLI installed to build and run the dotnet build ``` +## Creating the Telemetry Capture Database + +The application includes support for writing drone telemetry to a SQLite database. If you intend to use this facility, you must first fulfil the [prerequisites for SQLite database capture](https://github.com/davewalker5/TelloCommander/wiki/Writing-Drone-Telemetry-to-a-SQLite-Database). + ## Running the Application To run the application, open a terminal window, change to the folder containing the compiled output for the TelloCommanderConsole project and run the following command: From 340b2ef05347b5ffc470f3ab29ff9b351a28fdac Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Fri, 24 Jan 2020 21:39:13 +0000 Subject: [PATCH 29/46] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6c80e4a..be27582 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ You will need .NET Core 3.1.101 and the .NET CLI installed to build the library. [https://dotnet.microsoft.com/download](https://dotnet.microsoft.com/download) -## Building the Application +## Building the Library * Clone or download the repository * Open a terminal window and CD to the folder containing the TelloCommanderDb.sln solution file @@ -37,7 +37,7 @@ dotnet build ## Getting Started -To be completed +Details on how to use the drone telemetry capture facilities are provided in the [TelloCommander Wiki](https://github.com/davewalker5/TelloCommander/wiki) ## Wiki From e8352f7d52823d51cd5e5b22703ab61fc49d45f5 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Mon, 10 Feb 2020 03:42:00 +0000 Subject: [PATCH 30/46] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index be27582..bcd6836 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![GitHub issues](https://img.shields.io/github/issues/davewalker5/TelloCommanderDb)](https://github.com/davewalker5/TelloCommanderDb/issues) [![Coverage Status](https://coveralls.io/repos/github/davewalker5/TelloCommanderDb/badge.svg?branch=master)](https://coveralls.io/github/davewalker5/TelloCommanderDb?branch=master) [![Releases](https://img.shields.io/github/v/release/davewalker5/TelloCommanderDb.svg?include_prereleases)](https://github.com/davewalker5/TelloCommanderDb/releases) +[![NuGet](https://img.shields.io/nuget/v/TelloCommander.Data)](https://www.nuget.org/packages?q=tellocommander.data) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/davewalker5/TelloCommanderDb/blob/master/LICENSE) [![Language](https://img.shields.io/badge/language-c%23-blue.svg)](https://github.com/davewalker5/TelloCommanderDb/) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/davewalker5/TelloCommanderDb)](https://github.com/davewalker5/TelloCommanderDb/) From 558a5f89c98c0581a1aa91aed2cd0b626f799ee8 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Mon, 10 Feb 2020 03:46:58 +0000 Subject: [PATCH 31/46] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b2de838..dcb85c3 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://github.com/davewalker5/TelloCommanderConsole/workflows/.NET%20Core%20CI%20Build/badge.svg)](https://github.com/davewalker5/TelloCommanderConsole/actions) [![GitHub issues](https://img.shields.io/github/issues/davewalker5/TelloCommanderConsole)](https://github.com/davewalker5/TelloCommander/issues) [![Releases](https://img.shields.io/github/v/release/davewalker5/TelloCommanderConsole.svg?include_prereleases)](https://github.com/davewalker5/TelloCommanderConsole/releases) +[![NuGet](https://img.shields.io/nuget/v/TelloCommander.CommandLine)](https://www.nuget.org/packages?q=tellocommander.commandline) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/davewalker5/TelloCommanderConsole/blob/master/LICENSE) [![Language](https://img.shields.io/badge/language-c%23-blue.svg)](https://github.com/davewalker5/TelloCommanderConsole/) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/davewalker5/TelloCommanderConsole)](https://github.com/davewalker5/TelloCommanderConsole/) From c65875caf90b4cc8c2542bcbb51a65f6078b6a8f Mon Sep 17 00:00:00 2001 From: David Walker Date: Fri, 20 Mar 2020 13:59:32 +0000 Subject: [PATCH 32/46] Updgraded to .NET Core 3.1 --- .../TelloCommander.Data.InMemory.csproj | 6 +++--- .../TelloCommander.Data.Sqlite.csproj | 10 +++++----- .../TelloCommander.Data.Tests.csproj | 6 +++--- src/TelloCommander.Data/TelloCommander.Data.csproj | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj b/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj index c7477d6..f8300d0 100644 --- a/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj +++ b/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj @@ -18,9 +18,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj b/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj index f173cb1..5b4c938 100644 --- a/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj +++ b/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj @@ -22,14 +22,14 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - + + + diff --git a/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj b/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj index 7088a77..4fe19ca 100644 --- a/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj +++ b/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj @@ -7,9 +7,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/TelloCommander.Data/TelloCommander.Data.csproj b/src/TelloCommander.Data/TelloCommander.Data.csproj index 60dea60..cdbada7 100644 --- a/src/TelloCommander.Data/TelloCommander.Data.csproj +++ b/src/TelloCommander.Data/TelloCommander.Data.csproj @@ -25,6 +25,6 @@ - + From 113d17a1e0fd4a7a851136c5ffc5e84372c6f40d Mon Sep 17 00:00:00 2001 From: David Walker Date: Sat, 2 Oct 2021 08:37:29 +0100 Subject: [PATCH 33/46] Updated dependencies --- .github/workflows/dotnetcore.yml | 2 +- .../TelloCommander.Data.InMemory.License.txt | 21 -------------- .../TelloCommander.Data.InMemory.csproj | 22 ++++++--------- .../TelloCommander.Data.Migrations.csproj | 2 +- .../TelloCommander.Data.Sqlite.License.txt | 21 -------------- .../TelloCommander.Data.Sqlite.csproj | 28 ++++++++----------- .../TelloCommander.Data.Tests.csproj | 12 ++++---- .../Content/TelloCommander.Data.License.txt | 21 -------------- .../TelloCommander.Data.csproj | 20 +++++-------- 9 files changed, 34 insertions(+), 115 deletions(-) delete mode 100644 src/TelloCommander.Data.InMemory/Content/TelloCommander.Data.InMemory.License.txt delete mode 100644 src/TelloCommander.Data.Sqlite/Content/TelloCommander.Data.Sqlite.License.txt delete mode 100644 src/TelloCommander.Data/Content/TelloCommander.Data.License.txt diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index e9330fa..11cddca 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.101 + dotnet-version: 5.0.100 - name: Build run: dotnet build --configuration Release src/TelloCommanderDb.sln - name: Run unit tests and generate code coverage diff --git a/src/TelloCommander.Data.InMemory/Content/TelloCommander.Data.InMemory.License.txt b/src/TelloCommander.Data.InMemory/Content/TelloCommander.Data.InMemory.License.txt deleted file mode 100644 index 97d4e70..0000000 --- a/src/TelloCommander.Data.InMemory/Content/TelloCommander.Data.InMemory.License.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Dave Walker - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj b/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj index f8300d0..378c528 100644 --- a/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj +++ b/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj @@ -3,34 +3,28 @@ netstandard2.1 TelloCommander.Data.InMemory - 1.0.0.5 + 1.0.0.6 true Dave Walker - Copyright (c) 2020 Dave Walker + Copyright (c) 2020, 2021 Dave Walker Dave Walker - First release + Dependency updates TelloCommander Tello Database Collector Memory TelloCommander Drone Telemetry InMemory Database TelloCommander Drone Telemetry InMemory Database + MIT + false - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - - Always - - diff --git a/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj b/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj index 1df4390..f2ce961 100644 --- a/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj +++ b/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net5.0 diff --git a/src/TelloCommander.Data.Sqlite/Content/TelloCommander.Data.Sqlite.License.txt b/src/TelloCommander.Data.Sqlite/Content/TelloCommander.Data.Sqlite.License.txt deleted file mode 100644 index 97d4e70..0000000 --- a/src/TelloCommander.Data.Sqlite/Content/TelloCommander.Data.Sqlite.License.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Dave Walker - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj b/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj index 5b4c938..6899c90 100644 --- a/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj +++ b/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj @@ -3,16 +3,18 @@ netstandard2.1 TelloCommander.Data.Sqlite - 1.0.0.5 - 1.0.0.5 + 1.0.0.6 + 1.0.0.6 true Dave Walker - Copyright (c) 2020 Dave Walker + Copyright (c) 2020, 2021 Dave Walker Dave Walker - First release + Dependency updates TelloCommander Tello Database Collector Sqlite TelloCommander Drone Telemetry Sqlite Database TelloCommander Drone Telemetry Sqlite Database + MIT + false @@ -22,21 +24,13 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - - - - - - Always - + + + diff --git a/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj b/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj index 4fe19ca..ea78d40 100644 --- a/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj +++ b/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj @@ -1,19 +1,19 @@ - netcoreapp3.1 + net5.0 false - - - - runtime; build; native; contentfiles; analyzers; buildtransitive + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/TelloCommander.Data/Content/TelloCommander.Data.License.txt b/src/TelloCommander.Data/Content/TelloCommander.Data.License.txt deleted file mode 100644 index 6fc2c54..0000000 --- a/src/TelloCommander.Data/Content/TelloCommander.Data.License.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Dave Walker - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/TelloCommander.Data/TelloCommander.Data.csproj b/src/TelloCommander.Data/TelloCommander.Data.csproj index cdbada7..05d9ea4 100644 --- a/src/TelloCommander.Data/TelloCommander.Data.csproj +++ b/src/TelloCommander.Data/TelloCommander.Data.csproj @@ -3,28 +3,22 @@ netstandard2.1 TelloCommander.Data - 1.0.0.5 + 1.0.0.6 true Dave Walker - Copyright (c) 2020 Dave Walker + Copyright (c) 2020, 2021 Dave Walker Dave Walker - First release + Dependency updates Database Collector for TelloCommander Drone Telemetry Tello TelloCommander Data Collector Database Collector for TelloCommander Drone Telemetry Database Collector for TelloCommander Drone Telemetry + MIT + false - - - - - Always - - - - - + + From d379401c9080688230770c739bbcfcde02fcb8a0 Mon Sep 17 00:00:00 2001 From: David Walker Date: Sat, 2 Oct 2021 09:03:41 +0100 Subject: [PATCH 34/46] Updated dependencies --- .github/workflows/dotnetcore.yml | 2 +- .../TelloCommander.CommandLine.License.txt | 21 ------------------- .../TelloCommander.CommandLine.csproj | 21 +++++++------------ src/TelloCommander.ConsoleApp/Program.cs | 1 - .../TelloCommander.ConsoleApp.csproj | 2 +- 5 files changed, 9 insertions(+), 38 deletions(-) delete mode 100644 src/TelloCommander.CommandLine/Content/TelloCommander.CommandLine.License.txt diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 3500c8f..1a5d4ac 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,6 +12,6 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.101 + dotnet-version: 5.0.100 - name: Build run: dotnet build --configuration Release src/TelloCommanderConsole.sln diff --git a/src/TelloCommander.CommandLine/Content/TelloCommander.CommandLine.License.txt b/src/TelloCommander.CommandLine/Content/TelloCommander.CommandLine.License.txt deleted file mode 100644 index 6fc2c54..0000000 --- a/src/TelloCommander.CommandLine/Content/TelloCommander.CommandLine.License.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Dave Walker - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj b/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj index 549e656..7df15a8 100644 --- a/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj +++ b/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj @@ -3,34 +3,27 @@ netstandard2.1 TelloCommander.CommandLine - 1.0.0.5 + 1.0.0.6 Dave Walker Copyright (c) 2020 Dave Walker Dave Walker https://github.com/davewalker5/TelloCommanderConsole - Extracted from the TelloCommander API library + Dependency updates C# command line utilities for controlling a Tello drone Tello API Console CommandLine TelloCommander.CommandLine C# command line utilities for controlling a Tello drone true + MIT + false - - - - - - Always - - - - - - + + + diff --git a/src/TelloCommander.ConsoleApp/Program.cs b/src/TelloCommander.ConsoleApp/Program.cs index 9495f7f..f157c2a 100644 --- a/src/TelloCommander.ConsoleApp/Program.cs +++ b/src/TelloCommander.ConsoleApp/Program.cs @@ -4,7 +4,6 @@ namespace TelloCommander { public class Program { - public static void Main(string[] args) { new ConsoleCommanderWrapper().Run(); diff --git a/src/TelloCommander.ConsoleApp/TelloCommander.ConsoleApp.csproj b/src/TelloCommander.ConsoleApp/TelloCommander.ConsoleApp.csproj index 8bb8b82..a392e9e 100644 --- a/src/TelloCommander.ConsoleApp/TelloCommander.ConsoleApp.csproj +++ b/src/TelloCommander.ConsoleApp/TelloCommander.ConsoleApp.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net5.0 From e5a1e8f9c9ae1d3c088e01e905921f411ba6667e Mon Sep 17 00:00:00 2001 From: Dave Walker Date: Mon, 10 Apr 2023 17:55:40 +0100 Subject: [PATCH 35/46] Remove Trello link from README --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index dcb85c3..746758d 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,3 @@ To file issues or suggestions, please use the [Issues](https://github.com/davewa ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details - -## Trello - -* [TelloCommander on Trello](https://trello.com/b/VCFq6tAk) From d3061745e8a0d116d4b1d2a625f661f0c9aa6c05 Mon Sep 17 00:00:00 2001 From: Dave Walker Date: Mon, 10 Apr 2023 17:55:54 +0100 Subject: [PATCH 36/46] Remove Trello link from README --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index bcd6836..11e0697 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,3 @@ To file issues or suggestions, please use the [Issues](https://github.com/davewa ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details - -## Trello - -* [TelloCommander on Trello](https://trello.com/b/VCFq6tAk) From 8b3086e4a99449e016ed81bcfd49733285581f7f Mon Sep 17 00:00:00 2001 From: Dave Walker Date: Tue, 11 Apr 2023 14:00:38 +0100 Subject: [PATCH 37/46] Target .NET 6.0 ; Update NuGet references --- .../TelloCommander.Data.InMemory.csproj | 14 +++++++------- .../TelloCommander.Data.Migrations.csproj | 2 +- .../TelloCommander.Data.Sqlite.csproj | 18 +++++++++--------- .../TelloCommander.Data.Tests.csproj | 12 ++++++------ .../TelloCommander.Data.csproj | 12 ++++++------ 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj b/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj index 378c528..cb6fa82 100644 --- a/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj +++ b/src/TelloCommander.Data.InMemory/TelloCommander.Data.InMemory.csproj @@ -1,12 +1,12 @@ - + - netstandard2.1 + net6.0 TelloCommander.Data.InMemory - 1.0.0.6 + 1.0.0.7 true Dave Walker - Copyright (c) 2020, 2021 Dave Walker + Copyright (c) 2020, 2021, 2023 Dave Walker Dave Walker Dependency updates TelloCommander Tello Database Collector Memory @@ -20,9 +20,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj b/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj index f2ce961..62389e9 100644 --- a/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj +++ b/src/TelloCommander.Data.Migrations/TelloCommander.Data.Migrations.csproj @@ -2,7 +2,7 @@ Exe - net5.0 + net6.0 diff --git a/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj b/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj index 6899c90..7a2a016 100644 --- a/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj +++ b/src/TelloCommander.Data.Sqlite/TelloCommander.Data.Sqlite.csproj @@ -1,13 +1,13 @@ - netstandard2.1 + net6.0 TelloCommander.Data.Sqlite - 1.0.0.6 - 1.0.0.6 + 1.0.0.7 + 1.0.0.7 true Dave Walker - Copyright (c) 2020, 2021 Dave Walker + Copyright (c) 2020, 2021, 2023 Dave Walker Dave Walker Dependency updates TelloCommander Tello Database Collector Sqlite @@ -24,13 +24,13 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - + + + diff --git a/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj b/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj index ea78d40..31f0da7 100644 --- a/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj +++ b/src/TelloCommander.Data.Tests/TelloCommander.Data.Tests.csproj @@ -1,19 +1,19 @@ - net5.0 + net6.0 false - - - - runtime; build; native; contentfiles; analyzers; buildtransitive + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/TelloCommander.Data/TelloCommander.Data.csproj b/src/TelloCommander.Data/TelloCommander.Data.csproj index 05d9ea4..fda629a 100644 --- a/src/TelloCommander.Data/TelloCommander.Data.csproj +++ b/src/TelloCommander.Data/TelloCommander.Data.csproj @@ -1,12 +1,12 @@ - + - netstandard2.1 + net6.0 TelloCommander.Data - 1.0.0.6 + 1.0.0.8 true Dave Walker - Copyright (c) 2020, 2021 Dave Walker + Copyright (c) 2020, 2021, 2023 Dave Walker Dave Walker Dependency updates Database Collector for TelloCommander Drone Telemetry @@ -18,7 +18,7 @@ - - + + From 6c2edc59600bb0dd6a7ac12776c6cddf924d7f39 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Tue, 11 Apr 2023 14:03:11 +0100 Subject: [PATCH 38/46] Update dotnetcore.yml --- .github/workflows/dotnetcore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 11cddca..1db33b8 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.100 + dotnet-version: 6.0.310 - name: Build run: dotnet build --configuration Release src/TelloCommanderDb.sln - name: Run unit tests and generate code coverage From fc4d72772a7603302c14afb94b07bda0da7c8239 Mon Sep 17 00:00:00 2001 From: Dave Walker Date: Tue, 11 Apr 2023 14:18:54 +0100 Subject: [PATCH 39/46] Target .NET 6.0 ; Update NuGet references --- .../TelloCommander.CommandLine.csproj | 23 ++++++++++++++----- .../TelloCommander.ConsoleApp.csproj | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj b/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj index 7df15a8..235427f 100644 --- a/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj +++ b/src/TelloCommander.CommandLine/TelloCommander.CommandLine.csproj @@ -1,11 +1,11 @@ - netstandard2.1 + net6.0 TelloCommander.CommandLine - 1.0.0.6 + 1.0.0.9 Dave Walker - Copyright (c) 2020 Dave Walker + Copyright (c) 2020, 2023 Dave Walker Dave Walker https://github.com/davewalker5/TelloCommanderConsole Dependency updates @@ -22,8 +22,19 @@ - - - + + + + + + + Always + + + Always + + + Always + diff --git a/src/TelloCommander.ConsoleApp/TelloCommander.ConsoleApp.csproj b/src/TelloCommander.ConsoleApp/TelloCommander.ConsoleApp.csproj index a392e9e..e67cd73 100644 --- a/src/TelloCommander.ConsoleApp/TelloCommander.ConsoleApp.csproj +++ b/src/TelloCommander.ConsoleApp/TelloCommander.ConsoleApp.csproj @@ -2,7 +2,7 @@ Exe - net5.0 + net6.0 From 9040cd82d21ee417087ac8a744b762610dc98a62 Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Tue, 11 Apr 2023 14:19:35 +0100 Subject: [PATCH 40/46] Update dotnetcore.yml --- .github/workflows/dotnetcore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 1a5d4ac..3780379 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,6 +12,6 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.100 + dotnet-version: 6.0.310 - name: Build run: dotnet build --configuration Release src/TelloCommanderConsole.sln From b5fa3b0d74131e107d5ff06bfd3cd0712a32235c Mon Sep 17 00:00:00 2001 From: Dave Walker <56451830+davewalker5@users.noreply.github.com> Date: Thu, 21 Dec 2023 13:45:21 +0000 Subject: [PATCH 41/46] Update dotnetcore.yml --- .github/workflows/dotnetcore.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index caaf6cd..908d8b8 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -11,7 +11,8 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.310 + dotnet-version: "7.0.302" + include-prerelease: true - name: Build run: dotnet build --configuration Release src/TelloCommander.sln - name: Run unit tests and generate code coverage From 7a607754e3015822796b6c191fa5478c2f08f59f Mon Sep 17 00:00:00 2001 From: Dave Walker Date: Thu, 21 Dec 2023 13:50:09 +0000 Subject: [PATCH 42/46] Added info on the data capture capabilities to the README --- README.md | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 25a1fc8..ef0841c 100644 --- a/README.md +++ b/README.md @@ -22,24 +22,14 @@ Tello Commander is a C# API for controlling a Tello drone, offering the followin - Capture of drone telemetry information to CSV - Capture of drone telemetry to a SQL database -## Version 1.0.0.5 +It includes companion libraries to extends the basic drone monitoring and status capture facilities with the ability to write drone telemetry information to a SQL database. -Release 1.0.0.5 of TelloCommander introduces the ability to stream drone telemetry to a SQL database for subsequent analysis and splits the project into the following repos/libraries/NuGet packages: +The following database types are supported: -| Repo | NuGet Package | Purpose | -| ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| [TelloCommander](https://github.com/davewalker5/TelloCommander/) | [TelloCommander](https://www.nuget.org/packages/TelloCommander/) | Core Tello control API | -| [TelloCommanderDb](https://github.com/davewalker5/TelloCommanderDb/) | [TelloCommander.Data](https://www.nuget.org/packages/TelloCommander.Data/) | Core SQL telemetry capture API | -| [TelloCommanderDb](https://github.com/davewalker5/TelloCommanderDb/) | [TelloCommander.Data.InMemory](https://www.nuget.org/packages/TelloCommander.Data.InMemory/) | EF Core database context for capturing telemetry to an in-memory database | -| [TelloCommanderDb](https://github.com/davewalker5/TelloCommanderDb/) | [TelloCommander.Data.Sqlite](https://www.nuget.org/packages/TelloCommander.Data.Sqlite/) | EF Core database context for capturing telemetry to a SQLite database | -| [TelloCommanderConsole](https://github.com/davewalker5/TelloCommanderConsole) | [TelloCommander.CommandLine](https://www.nuget.org/packages/TelloCommander.CommandLine/) | Basis for a command-line controller for the Tello with example application | - -Release 1.0.0.5 also changed the location of the following classes and, with it, the repo/library/NuGet package that they reside in: - -| Class | Original Namespace | New Namespace | -| ----------------------- | ------------------------ | -------------------------- | -| ConsoleCommander | TelloCommander.Commander | TelloCommander.CommandLine | -| ConsoleCommanderWrapper | TelloCommander.Commander | TelloCommander.CommandLine | +| Type | Purpose | +| --------- | -------------------------------------------------------------------------------- | +| In Memory | In-memory database for transient storage and primarily targetted at unit testing | +| SQLite | Permanent storage in a SQLite database | ## Getting Started @@ -115,12 +105,9 @@ More complete information on the capabilities and use of the API are provided in ## Feedback -<<<<<<< HEAD To file issues or suggestions, please use the [Issues](https://github.com/davewalker5/TelloCommander/issues) page for this project on GitHub. -======= -To file issues or suggestions, please use the [Issues](https://github.com/davewalker5/TelloCommanderDb/issues) page for this project on GitHub. -> > > > > > > db/master +To file issues or suggestions, please use the [Issues](https://github.com/davewalker5/TelloCommanderDb/issues) page for this project on GitHub. ## License From f1c0e195b28766f8a9bc139fec49226c1d3f5c9c Mon Sep 17 00:00:00 2001 From: Dave Walker Date: Thu, 21 Dec 2023 13:51:18 +0000 Subject: [PATCH 43/46] Added info on the data capture capabilities to the README --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index ef0841c..4259690 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,6 @@ Tello Commander is a C# API for controlling a Tello drone, offering the followin - Capture of drone telemetry information to CSV - Capture of drone telemetry to a SQL database -It includes companion libraries to extends the basic drone monitoring and status capture facilities with the ability to write drone telemetry information to a SQL database. - The following database types are supported: | Type | Purpose | From d0c480d766203c719775b2cf6835d0442f9e408f Mon Sep 17 00:00:00 2001 From: Dave Walker Date: Thu, 21 Dec 2023 13:51:47 +0000 Subject: [PATCH 44/46] Added info on the data capture capabilities to the README --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 4259690..f586e86 100644 --- a/README.md +++ b/README.md @@ -105,8 +105,6 @@ More complete information on the capabilities and use of the API are provided in To file issues or suggestions, please use the [Issues](https://github.com/davewalker5/TelloCommander/issues) page for this project on GitHub. -To file issues or suggestions, please use the [Issues](https://github.com/davewalker5/TelloCommanderDb/issues) page for this project on GitHub. - ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details From 25ff5f3b369c7004a87549afd17dffb718ad8e8b Mon Sep 17 00:00:00 2001 From: Dave Walker Date: Thu, 21 Dec 2023 14:39:40 +0000 Subject: [PATCH 45/46] Added repo merge note to the README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 452c11a..ba815d4 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ [![Language](https://img.shields.io/badge/language-c%23-blue.svg)](https://github.com/davewalker5/TelloCommander/) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/davewalker5/TelloCommander)](https://github.com/davewalker5/TelloCommander/) +> **_NOTE:_** The separate Tello Commander Database and demo application repositories have been merged with the TelloCommander repository. The README has been updated and the Wiki is being updated and the intention is to provide better "getting started" documentation as part of the updates + ## About Tello Commander is a C# API for controlling a Tello drone, offering the following features: From 87221f00e885168ea8ece0d96e8b28ab3bf78f52 Mon Sep 17 00:00:00 2001 From: Dave Walker Date: Thu, 21 Dec 2023 14:40:42 +0000 Subject: [PATCH 46/46] Added repo merge note to the README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba815d4..a0a6881 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Language](https://img.shields.io/badge/language-c%23-blue.svg)](https://github.com/davewalker5/TelloCommander/) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/davewalker5/TelloCommander)](https://github.com/davewalker5/TelloCommander/) -> **_NOTE:_** The separate Tello Commander Database and demo application repositories have been merged with the TelloCommander repository. The README has been updated and the Wiki is being updated and the intention is to provide better "getting started" documentation as part of the updates +> **_NOTE:_** The separate Tello Commander Database and demo application repositories have been merged with the TelloCommander repository. The intention is to update the README and the Wiki to provide further guidance on the merged repository structure ## About