Giter Club home page Giter Club logo

qa401h's Introduction

QA401H

Releases (no source) for the QA401H "headless" application. This application allows a RESTful interface to the QA401 hardware.

Please refer to the wiki for getting started.

qa401h's People

Contributors

quantasylum avatar

Stargazers

Christian Ihle avatar Mike Grubenmann avatar  avatar

Watchers

Mike Grubenmann avatar

Forkers

philipclaesson

qa401h's Issues

Add SNR

Add ability to make SNR measurement

User port specification

The QA401 application opens a default port on 9401. The ability to specify a port on the command line would be helpful for installations that are running in networks that might have certain ranges blocked.

HTML Return type

HTML returns should specify "application/json" and force UTF-8

Support CORS headers

I've started making a simple web interface on top of this API, but the browser complains about missing CORS headers and refuses to connect:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:9401/Status/Version. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

More details here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin

Would it be possible to add the necessary headers to support my use case? Either by default or as an option?

If you want to test the web interface you can find it here: https://github.com/blurpy/qa401w

Decimal number format changes with language

I received a report from a German user that QA401W isn't displaying anything, but that requests seem to go OK between the browser and QA401H. I was able to reproduce, and it looks like this after doing an acquisition:

qa401-german

There are no errors in the log of QA401H, and no errors in the console or network tab of the developer tools in the browser.

What happens is that if you configure your OS (at least on Linux) to some languages, the number format changes, and QA401H adapts. The browser does not though, so the JSON parser fails to interpret the numbers.

This is how it is normally for me:

curl -d "" -X PUT http://localhost:9401/Settings/AudioGen/Gen1/On/1000/0 
{ "SessionId":"0" }

curl -d "" -X POST http://localhost:9401/Acquisition 
{ "SessionId":"2290222104" }

curl http://localhost:9401/Phase/Seconds 
{ "SessionId":"2290222104", "Left":"0.00020784909723370925", "Right":"0.00020576029083909996" }

curl http://localhost:9401/ThdDb/1000/20000
{ "SessionId":"2290222104", "Left":"-102.82025498084323", "Right":"-102.46467345532238" }

curl http://localhost:9401/ThdPct/1000/20000
{ "SessionId":"2290222104", "Left":"0.0007227485864607289", "Right":"0.0007529503287253446" }

Floats use period as the decimal separator.

This is how it looks if I change the language to German:

curl -d "" -X PUT http://localhost:9401/Settings/AudioGen/Gen1/On/1000/0 
{ "SessionId":"0" }

curl -d "" -X POST http://localhost:9401/Acquisition 
{ "SessionId":"3592625235" }

curl http://localhost:9401/Phase/Seconds 
{ "SessionId":"3592625235", "Left":"0,0005415564663523863", "Right":"0,0005391615949382826" }

curl http://localhost:9401/ThdDb/1000/20000
{ "SessionId":"3592625235", "Left":"-102,99914694724458", "Right":"-102,03344721080657" }

curl http://localhost:9401/ThdPct/1000/20000
{ "SessionId":"3592625235", "Left":"0,0007080153160940537", "Right":"0,00079127535504247" }

Suddenly floats use comma as the decimal separator.

I started QA401H like this to reproduce:

LANG="de_DE.UTF-8" dotnet QA401H.dll

It looks like the JSON standard expect floats to use period as the separator:

That also seems consistent with the behaviour the user experienced.
Is it possible to make QA401H return a consistent number format no matter the language?

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.