s-celles / wnb

Weight and balance progressive web application for light aircrafts (SEP, gliders...)
GNU General Public License v3.0
2 stars 0 forks source link

Roadmap #1

Open s-celles opened 5 years ago

s-celles commented 5 years ago

Goal

Build an application for weight and balance of small aircrafts (SEP, glider...) https://en.wikipedia.org/wiki/Center_of_gravity_of_an_aircraft https://en.wikipedia.org/wiki/Center_of_gravity_of_an_aircraft

Example for a Cessna C150 https://www.aero-club-poitou.fr/acp/storage/app/media/FBUBK%20-%20Fiche%20de%20pes%C3%A9e%20V2.pdf https://www.aero-club-poitou.fr/acp/storage/app/media/FBUBK%20-%20Fiche%20de%20pes%C3%A9e%20V2.xlsx

Technical solution

Progressive web application pwa (HTML+JS)

Configuration of application

One folder per aicraft 1 configuration file JSON (or YAML or TOML or other) which contains

Units

User interface

should show centrogram should display position of center of mass (with current load but also with empty or full fuel) using a circle on plot and displaying coordinates of this point (mass and lever of arm) if center of mass is not inside centrogram a message should warm user ("Center of mass out of centrogram") and coordinates of center of mass should change from black to red.

Sliders should allow to change loads (mass for most load, volume for fuel)

Printing

PDF export of weight and balance sheet

s-celles commented 5 years ago

Example of a JSON config file (verified using https://jsonlint.com/ and beautified using https://jsonformatter.org/json-pretty-print )

s-celles commented 5 years ago

or YAML file (via https://www.json2yaml.com/ )

s-celles commented 5 years ago

Slider component https://quasar.dev/vue-components/slider

s-celles commented 5 years ago

check if a point is inside a polygon https://stackoverflow.com/questions/22521982/check-if-point-inside-a-polygon

https://www.npmjs.com/package/point-in-polygon https://www.npmjs.com/search?q=point%20in%20polygon

s-celles commented 5 years ago

Frameworks PWA https://hub.packtpub.com/top-frameworks-for-building-your-progressive-web-application-pwa/ https://www.techaheadcorp.com/blog/best-progressive-web-apps-frameworks/

Parsing YAML using JS https://stackoverflow.com/questions/9043765/how-to-parse-yaml-in-the-browser

s-celles commented 4 years ago

CHANGELOG

name property is renamed to designation in configuration file to avoid problems.

using jest https://jestjs.io/ for unit tests Added to dev dependencies using

yarn add --dev jest

using js-yaml https://github.com/nodeca/js-yaml for parsing YAML config files Added to dependencies using

yarn add js-yaml

coordinates of center of gravity is calculated and tested

ToDo: build user interface Adding sliders for each loads https://github.com/scls19fr/wnb/blob/master/data/f-bubk.yml#L33 to set current_value of each load

Creating a graph with centrogram First graph : mass = f(lever_arm) Second graph mass = f(moment)

ToDo: URL routing / should display list of aircrafts using .yml files from data directory (with name and immat of aircraft) /aircrafts/f-bubk should show centrogram for a given aircraft

https://codepen.io/pen/?&editable=true

<head>
    <!-- Load plotly.js into the DOM -->
    <script src='https://cdn.plot.ly/plotly-latest.min.js'></script>
</head>

<body>
    <div id='myDiv'><!-- Plotly chart will be drawn inside this DIV --></div>
</body>
var centrogram = {
  x: [0.8, 0.8, 0.835, 0.952, 0.952, 0.8],
  y: [250, 580, 726, 726, 250, 250],
  mode: 'lines',
  line: {
    color: 'rgb(55, 128, 191)',
    width: 3
  }
};

var data = [centrogram];

var layout = {
  title: 'Line and Scatter Styling'
};

Plotly.newPlot('myDiv', data, layout);

Display aicrafts list at app startup (sorted by owner, then by type, then by immat)... A LINQ like approach for Javascript should be considered https://sung.codes/blog/2018/02/24/approximate-equivalent-linq-methods-javascript/