Coder Social home page Coder Social logo

son32java's Introduction

Son32Java - A Java wrapper for the Son32 library

This library is a simple wrapper for the son32.dll. The wrapper is based on the jna project. The wrapper is not complete, a lot of the orginal SON32 functions are missing, but the basics (reading from a .smr file) are implemented.

##How to use?

This library only works with the 32bit jvm on windwos!

First install the son32.dll in the deafult path (C:\SON Library). Then go ahead and download the jna.jar and jna-platform.jar from the jna project and add them to the imports of your java project.

The following example will read the first second from channel 0. This assumes, that channel 0 is a real data channel.

	import son32java.son32reader.Son32Reader;
	import son32java.son32reader.Son32Channel;
	import son32java.son32Exceptions.*;

    String path = "path to your .smr file"
    Son32Reader reader = new Son32Reader(path, 1);
    try{
        Son32Channel channel = reader.getChannel(0);
        int array_size = channel.calculateArraySizeByTime(1);
        double[] target = new double[array_size];
        channel.getRealDataByTime(0, 1, target);
        for(int i=0;i<x;i++){
            System.out.println(target[i]);
        }            
    } catch(Exception e){
        System.out.println(e);
    }
    reader.SONCloseFile();

Support

If you have any problems, want more features added or of you have found a bug, feel free to open an issue, write a message on github or open a pull request.

son32java's People

Contributors

panzki avatar

Watchers

 avatar  avatar

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.