{"id":20718506,"url":"https://github.com/knowm/waveforms4j","last_synced_at":"2025-04-23T14:13:32.967Z","repository":{"id":48530915,"uuid":"74207370","full_name":"knowm/waveforms4j","owner":"knowm","description":"Digilent Waveforms AD2 SDK Java Implementation","archived":false,"fork":false,"pushed_at":"2021-07-21T12:14:24.000Z","size":2878,"stargazers_count":16,"open_issues_count":8,"forks_count":3,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2024-03-25T22:12:46.189Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knowm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-19T12:31:58.000Z","updated_at":"2024-03-18T03:20:57.000Z","dependencies_parsed_at":"2022-08-23T16:00:27.331Z","dependency_job_id":null,"html_url":"https://github.com/knowm/waveforms4j","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowm%2Fwaveforms4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowm%2Fwaveforms4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowm%2Fwaveforms4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowm%2Fwaveforms4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knowm","download_url":"https://codeload.github.com/knowm/waveforms4j/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224992998,"owners_count":17403944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T03:13:51.785Z","updated_at":"2024-11-17T03:13:52.422Z","avatar_url":"https://github.com/knowm.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nThis library is a Java implementation of the Digilent Waveforms AD2 SDK. A C++ and Python SDK is provided by Digilent, but no Java SDK existed. The entire API is not yet implemented and this project is a work in progress.\n\n|OS | Progress |\n|---|---|\n|MacOS|Working|\n|Linux|Working|\n|Windows 10|Working|\n\nThis library should work for your Java-based Waveforms app by simply adding the jar to your app's classpath. However, if you need to add more API features that are not yet implemented, then the rest of this readme file explains how to do that.\n\n# Pre-requisites for Development\n\nSee separate instructions for different operating systems.\n\n## Accessing the AD2 SDK from Java\n\nThe SDK for the Digilent Analog Discovery 2 comes in the form of a compiled C++ framework. On Mac OSX, this comes in the form of a `*.framework` file, which is described above. On a Windows system, the SDK is a `.DLL`. In order to interact with the SDK with our Java app, we use Java JNI.\n\nIn single class called `DWF` is where our Java app code interacts with the SDK. DWF stands for `Digilent Waveform`. Note that in our `DWF` class, a static block is used to load the JNI library. We need to create this library manually and it's not provided By Digilent.\n\n```\nstatic {\n  try {\n    if (OSUtils.isMac()) {\n      NativeUtils.loadLibraryFromJar(\"/waveforms4j.dylib\");\n    }\n    else if (OSUtils.isLinux()) {\n      NativeUtils.loadLibraryFromJar(\"/waveforms4j.so\");\n    }\n    else if (OSUtils.isWindows()) {\n      NativeUtils.loadLibraryFromJar(\"/waveforms4j.dll\");\n    }\n  } catch (IOException e) {\n    e.printStackTrace();\n  }\n}\n```\n    \nThe `waveforms4j.dylib`, `waveforms4j.so` and `waveforms4j.dll` file is something we need to create ourselves. This file is the JNI bridge between our Java code and Digilent's binary SDK.\n\n## Test\n\nA simple test to see if the JNI library works is to run `AnalogOutSine.java`. If you don't see any exception thrown, that means it's probably working.\n\n## Some Resources\n\n1. [Adept SDK Docs](https://reference.digilentinc.com/reference/software/adept/start?redirect=1id=digilent_adept_2#software_downloads)\n1. [Waveforms Downloads](https://reference.digilentinc.com//reference/software/waveforms/waveforms-3/start?redirect=1id=waveforms3)\n1. [Analog Discovery 2 Reference Manual](https://reference.digilentinc.com/analog_discovery_2/refmanual)\n1. [Digilent's DWF library wrapper for python](https://github.com/amuramatsu/dwf)\n1. [Waveforms3 Manual](https://reference.digilentinc.com/waveforms3/refmanual)\n\n## Building the Jar\n\n#### general\n\n    mvn clean package  \n    mvn javadoc:javadoc \n    mvn com.coveo:fmt-maven-plugin:format \n    mvn versions:display-dependency-updates \n    \nSince we moved the JNI libs into `src/main/resources` in the above step, they are bundled in the jar.\n\n### maven-license-plugin\n\n    mvn license:check\n    mvn license:format\n    mvn license:remove\n    \n### Getting the Jar\n\nThe waveforms4j release artifacts are hosted on [Maven Central](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.knowm.waveforms4j%22).\n\nOr if you use Maven, add the following to your pom file:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.knowm\u003c/groupId\u003e\n    \u003cartifactId\u003ewaveforms4j\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.11\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknowm%2Fwaveforms4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknowm%2Fwaveforms4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknowm%2Fwaveforms4j/lists"}