Giter Club home page Giter Club logo

msqur's Introduction

MSQur

MegaSquirt MSQ file sharing and viewing site.

Pronounced 'masker' I guess? Supposed to be a play on imgur.

Parses MSQ "XML" in tandem with an associated INI (config) file and displays it in a familiar format for viewing and comparing.

Try it now at: https://msqur.com

Build Status:

Development status

Firmware support:

  • MS1
  • MSnS-extra (partial)
  • MS2
  • MS2Extra
  • MS3
  • Speeduino
  • rusEFI

Contributing

This is basically a one-man operation. I welcome any contributions: code, styles, text content, or simply spelling & grammar. If you're interesting in helping out, please first take a look at the existing issues and see if you can offer any assistance with them. If you don't see your issue or new idea listed there you can create a new issue. Please be detailed.

If you'd like to run a copy to develop yourself, read the Installation section below.

Installation

Needed software

  • PHP 7.x with the following extensions:
    • PDO
    • OpenSSL
  • MySQL/MariaDB

Optional software

  • Web server (Apache/nginx/etc.)
  • phpMyAdmin - For managing the DB

Development Setup

These steps could be improved

  1. Clone repo to dev directory
  2. Create database for msqur, and assign it a user
  3. Copy script.config.dist to script.config and modify for use (setup DB connection information)
  4. Copy src/config.php.dist to src/config.php (setup DB information again)
  5. Update DB with update scripts in sequential order (patse into phpMyAdmin or piped to sqlcmd, etc.)
  6. Hit webserver to start using it (eg. php -S, etc.)

Source tree description

  • db - Database scripts
  • doxygen - Doxygen configuration and generated code documentation
  • src - PHP source
    • ini - Megasquirt configuration files
    • view - PHP/JS frontend source
      • lib - JS 3rd party libraries
      • img - Static images
    • tests - PHP Unit Tests (TODO)

Update & Deployment Instructions

These steps are outdated

  • Pull updates on host.
  • Update any configuration files (config.php, script.config) if needed.
  • Run any new DB scripts.
  • Run deploy.sh to copy web files to web server.

License

msqur is licensed under the GPL v3.0. A copy of this license is included in the LICENSE.md file in the source tree.

Who do I talk to?

Credits

This section needs to be updated

msqur's People

Contributors

camhenlin avatar dependabot[bot] avatar nearwood avatar rusefillc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msqur's Issues

Tune comments

Add comments field when uploading. One per file? One per upload?

Ugh, user login system

Allow logged in user to post MSQs, so they can search/browse/manage their MSQs. Also allow anonymous uploads, but perhaps they dissappear after a while/lack of hits.
OpenID? Definitely don't want to roll my own.

Link Image Previews

Linking the website on Facebook gives weird preview images for the main page or a specific tune file.

  • Fix preview images by putting a more relevant image higher in the HTML. Maybe an MSQ logo. Maybe a small VE table PNG. Surprise me.

MS3 support

My map for the supra I uploaded for 7m-gte does not have a detection for ms3 files

Use all of INI files to parse and organize data

#!ini

[Constants]
page = 5
;  name            = class,  type, offset,      shape,  units,       scale, translate,    lo,      hi, digits
      veTable1        = array ,  U08,      0,      [16x16], "%",        1.00000,   0.00000,  0.00,  255.00,      0 ; * (144 bytes)

[TableEditor]
   ;       table_id,    map3d_id,    "title",      page
table = veTable1Tbl, veTable1Map, "Fuel VE Table 1", 5
         topicHelp = "file://$getProjectsDirPath()/docs/Megasquirt2_TunerStudio_MS_Lite_Reference-3.3.pdf#ve1"
      ;             constant,   variable
      xBins       = frpm_table1, rpm
      yBins       = fmap_table1, fuelload
      zBins       = veTable1
      upDownLabel = "RICHER", "LEANER"
      gridOrient  = 250,   0, 340 ; Space 123 rotation of grid in degrees.

[Menu]
   ;----------------------------------------------------------------------------
   ;  There are five pre-defined values that may be used to define your menus.
   ;  The first four allow access to the "standard" dialog boxes, the last one
   ;  merely draws a separator (horizontal line) in the menu.
   ;
   ;     std_constants
   ;     std_enrichments
   ;     std_realtime
   ;     std_warmup
   ;     std_accel
   ;
   ;     std_separator
   ;
   ;  Additionally, to support MegaSquirt-II firmware, there are two standard
   ;  dialogs to generate its three embedded tables.  The first of these acts
   ;  like Roger Enns' EasyTherm, but only works for MS-II.  The second one
   ;  generates the internal AFR table required for proper closed loop operation
   ;  in MS-II.  Use these without page numbers, as they will just be ignored
   ;  in any case.
   ;
   ;     std_ms2gentherm
   ;     std_ms2geno2
   ;
   ;  If you use any of the std_constants, std_enrichments or std_warmup
   ;  editors, they may be optionally suffixed with a page number (only
   ;  useful for multi-page code variants), which causes them to edit the
   ;  specified page.  If you leave off the page specifier, they edit logical
   ;  page one as specified in the Constants section.
   ;
   ;  There are four special menu names, which when used append to the standard

   ;  menus of the same name instead of creating a new one.  The menu names
   ;  are "File", "Communications", "Tools" and "Help".
   ;
   ;----------------------------------------------------------------------------

      menuDialog = main
      menu = "Basic/Load Settings"
        subMenu = base,   "Engine and Sequential Settings"
        subMenu = generalsettings2, "General Settings"

      menu = "F&uel Settings"
        subMenu = overrun, "Over-Run Fuel Cut"
        subMenu = std_separator 
        subMenu = egoControl,      "&EGO Control"
        subMenu = afrTable1Tbl,    "A&FR Table 1",         0
        subMenu = afrTable2Tbl,    "AF&R Table 2",         0, { dualTable}
        subMenu = std_separator
        subMenu = veTable1Tbl,     "Fuel VE Table &1", 0,{ ((algorithm != 5) || ((algorithm == 5) && (feature7_maftrim))) && (feature4_0VEtblsize==0) }, { (feature4_0VEtblsize==0) }

      menu = "3D &Tuning Maps"
         subMenu = veTable1Map,     "Fuel VE Table &1", 0, { (feature4_0VEtblsize==0) && ( ((algorithm != 5) || ((algorithm == 5) && (feature7_maftrim))))}, { (feature4_0VEtblsize==0) }

[SettingContextHelp]
    veTable1 = "The main fuel table (1). Larger VE values mean more fuel, smaller mean less fuel."

Refactor error handling

Skip the try catch (unless we expect errors and can continue), and use the error_handler callback for major problems (and send a 500 response, for example).

Settings div is prepended to HTML, producing invalid HTML.

From a tune file:

<div id="settings">
  <img id="settingsIcon" src="view/img/settings3.png"/>
  <div id="settingsPanel" style="display:none;">
  <label><input id="colorizeData" type="checkbox" />Colorize</label>
  <label><input id="normalizeData" type="checkbox" title="Recalculate VE table values to a 5-250 unit scale"/>Normalize Data</label>
  <label><input id="normalizeAxis" type="checkbox" disabled />Normalize Axis</label>
  </div>
</div>
<!DOCTYPE html>
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" ng-app="msqur">
  <head>
  <title>MSQur</title>

Neutral build & deployment system

Update and configure msqur.com to take down the trunk and run any DB scripts, etc. to update once a week or so.
This will involve:

  • Moving larger tasks to a branch to be merged when complete
  • Setting up deployment keys for msqur.com
  • DB configuration management

DB Inconsistencies

Uploaded files were throwing errors about nullable columns. Prod doesn't seem to have this issue but a contributor did and I did upon starting up the project on my local.

$st = $this->db->prepare("INSERT INTO metadata (url,msq,engine,fileFormat,signature,uploadDate) VALUES (:url, :id, :engine, '4.0', 'unknown', :uploaded)");

The insert statement does not insert all metadata fields, but this works in prod somehow. Some DB update probably changed default behavior. Solution may be to just make the columns nullable. Yeah, that's real easy than trying to track this down.

SEO

Add some more SEO optimizations.

Modernization

Application is ancient by modern web standards. Works fine, but the combination of PHP + jQuery + custom CSS doesn't lend itself to mobile development very well. ~80% of traffic is from mobile.

Having a usable mobile interface would help people using a laptop (possibly without internet) to tune, but want to compare on a mobile.

Ideally, the data would be completely separate from the view (eg, split into API and front end).

Options:

  • Rewrite/migrate to Laravel
    • Pros: Has built in ORM, testing, frontend scaffolding and other nice features
    • Cons: Possibly overkill, but actively maintained.
  • Rewrite as API (with Laravel, Express/Koa)
    • Pros: Completely separates data from view. Allows other apps to access it (msdroid guy)
    • Cons: Have to come up with comprehensive API that handles all MSQ weirdness, and front-end
  • Rewrite as client-side app
    • Pros: Could be PWA, work offline (useful when on the road), fast React development
    • Cons: Have to rewrite everything in JS. Locked in to React/Redux.

Unparseable MSQs get cached

If an MSQ can't parse because of an error with the INI, for example, it caches that error so when the INI is added it won't try to reparse and will just return the cached error.

Round temperature and other values to integers.

In the warmup tables and whatnot it looks like some temperatures get output with lots of decimal places. This might due to unit preference, but regardless it's not hard to change. For Fahrenheit we might want to round, for Celsius maybe 10ths precision.

RESTful API

So other applications can use the service. Even uploading files via PUT and some engine details. That'd be cool. Note that I might want to dole out API keys to deter abuse.

Make/Engine code master database

For server-side suggested autocompletion, compile a list of engine codes and manufacturers. Will help keep out clutter, though users should still be able to enter in custom input.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.