mirror of
https://github.com/simon987/wavelib.git
synced 2025-04-20 02:26:45 +00:00
Commit : Tentative Release commit
This commit is contained in:
parent
65cbe6e418
commit
5d7d9af435
27
about.html
Normal file
27
about.html
Normal file
@ -0,0 +1,27 @@
|
||||
<div data-ng-controller="TabsController">
|
||||
<tabset justified="true">
|
||||
<tab heading="About">
|
||||
<br/>
|
||||
<p>Wavelib is a web implementation of C/C++ 1D Wavelet Transform codebase using Emscripten and javascript.</p>
|
||||
<br/>
|
||||
<p><b>Requirements</b> : HTML5 compliant modern web browser with javascript enabled. This webapp uses asm.js and angularjs that are not compatible with
|
||||
older browsers.</p>
|
||||
<br/>
|
||||
<p><b>Inputs</b> : You can enter the data vector using either the file input interface or data input interface. In either case, the input is just a
|
||||
one dimensional data vector consisting only of numbers and only including common separators like commas or spaces. </p>
|
||||
</tab>
|
||||
<tab heading="Code">
|
||||
<br/>
|
||||
<p><b>C/C++ Codebase</b> is available at <a href="http://rafat.github.io/#/sites/wavelib/front" target="_blank">my github page</a></a></p>
|
||||
<br/>
|
||||
</tab>
|
||||
<tab heading="Thanks">
|
||||
<br/>
|
||||
<ul>
|
||||
<li><b>Emscripten</b> : <a href="https://kripken.github.io/emscripten-site/" target="_blank">https://kripken.github.io/emscripten-site/</a></li>
|
||||
<li><b>Angularjs</b> : <a href="https://angularjs.org" target="_blank">https://angularjs.org</a></a></li>
|
||||
<li><b>Dygraphs</b> : <a href="http://dygraphs.com/" target="_blank">http://dygraphs.com/</a></a></li>
|
||||
</ul>
|
||||
</tab>
|
||||
</tabset>
|
||||
</div>
|
14
display.html
14
display.html
@ -19,25 +19,25 @@
|
||||
<div class="row marketing">
|
||||
<div class="col-md-6">
|
||||
<select class="wide-control form-control default" data-ng-model="selected.family"
|
||||
data-ng-options="a.family for a in wavedb">
|
||||
data-ng-options="a.family for a in wavedb" required>
|
||||
<option value=""> Wavelet Family </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<select class="wide-control form-control default" data-ng-model="selected.wavelet"
|
||||
data-ng-options="b.wavelet for b in selected.family.wavelets" data-ng-change="getMaxIter()">
|
||||
data-ng-options="b.wavelet for b in selected.family.wavelets" data-ng-change="getMaxIter()" required>
|
||||
<option value=""> Wavelet </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<select class="wide-control form-control default" data-ng-model="selected.method"
|
||||
data-ng-options="c.method for c in methods">
|
||||
data-ng-options="c.method for c in methods" required>
|
||||
<option value=""> Wavelet Methods </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<select class="wide-control form-control default" data-ng-model="selected.level"
|
||||
data-ng-options="d for d in levels">
|
||||
data-ng-options="d for d in levels" required>
|
||||
<option value=""> Decomposition Levels </option>
|
||||
</select>
|
||||
</div>
|
||||
@ -63,12 +63,12 @@
|
||||
<p>HPR : [<span data-ng-repeat="hp2 in hpr track by $index">{{hp2}} {{$last ? '' : ', '}}</span>]</p>
|
||||
<p>Decomposition Levels : {{J}}</p>
|
||||
<p>APPX{{J}} : [<span data-ng-repeat="a1 in appx track by $index">{{a1}} {{$last ? '' : ', '}}</span>]</p>
|
||||
<div data-ng-repeat="j in iter">
|
||||
<p>DET{{j}} : [<span data-ng-repeat="a2 in det.slice(0,0)">{{a2}} {{$last ? '' : ', '}}</p>
|
||||
<div data-ng-repeat="detail in details">
|
||||
<p>DET : [<span data-ng-repeat="a2 in detail track by $index">{{a2}} {{$last ? '' : ', '}}</span>]</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary" type="button" ng-click="ok()" disabled>OK</button>
|
||||
<!--button class="btn btn-primary" type="button" ng-click="ok()" disabled>OK</button-->
|
||||
<button class="btn btn-warning" type="button" ng-click="cancel()">Cancel</button>
|
||||
</div>
|
||||
</script>
|
||||
|
73
front.html
73
front.html
@ -4,6 +4,43 @@
|
||||
|
||||
|
||||
<div class="row marketing">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4> Test Signals</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<button class="btn btn-primary btn-block"><span class="glyphicon glyphicon-hand-down pull-left" data-position="left">
|
||||
</span>Select Example</button>
|
||||
<select class="wide-control form-control default" data-ng-model="tvalue" data-ng-change="testInput()" id="testsig1">
|
||||
<option value=""> SELECT INPUT </option>
|
||||
<option>ECG</option>
|
||||
<option>Heavisine</option>
|
||||
<option>Piecewise Regular 256</option>
|
||||
<option>Piecewise Regular 2048</option>
|
||||
<option>Piecewise Polynomial</option>
|
||||
<option>Noisy Bumps</option>
|
||||
<option>Noisy Heavisine</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4>Data Input</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<input class="wide-control form-control default" type="text" data-ng-model="inp1" placeholder="Copy and Paste Data Vector">
|
||||
|
||||
<button class="btn btn-primary btn-block" data-ng-click="dataInput()">
|
||||
<span class="glyphicon glyphicon-share-alt pull-left" data-position="left"></span>GO</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
@ -18,39 +55,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4>Data Input</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<input class="wide-control form-control default" type="text" data-ng-model="inp1" placeholder="Copy and Paste Data Here">
|
||||
|
||||
<button class="btn btn-primary btn-block" data-ng-click="dataInput()">
|
||||
<span class="glyphicon glyphicon-share-alt pull-left" data-position="left"></span>GO</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4> Test Signals</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<button class="btn btn-primary btn-block"><span class="glyphicon glyphicon-hand-down pull-left" data-position="left">
|
||||
</span>Select Example</button>
|
||||
<select class="wide-control form-control default" data-ng-model="tvalue" data-ng-change="testInput()" id="testsig1">
|
||||
<option></option>
|
||||
<option>ECG</option>
|
||||
<option>Heavisine</option>
|
||||
<option>Piecewise Regular 256</option>
|
||||
<option>Piecewise Regular 2048</option>
|
||||
<option>Piecewise Polynomial</option>
|
||||
<option>Noisy Bumps</option>
|
||||
<option>Noisy Heavisine</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
17
index.html
17
index.html
@ -3,7 +3,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Wavelets Demo</title>
|
||||
<title>Wavelets Online</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="stylesheets/free.css">
|
||||
<script src="js/ie-emulation-modes-warning.js"></script>
|
||||
@ -19,13 +19,13 @@
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="index.html">WaveDemo</a>
|
||||
<a class="navbar-brand" href="index.html">Wavelib</a>
|
||||
</div>
|
||||
<!-- Collect the nav links, forms, and other content for toggling -->
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="#/inputs">Inputs</a>
|
||||
<a href="#/">Inputs</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#/about">About</a>
|
||||
@ -53,14 +53,13 @@
|
||||
|
||||
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
|
||||
<script src="js/ie10-viewport-bug-workaround.js"></script>
|
||||
<script src="js/app.js"></script>
|
||||
<script src="js/wavelet.js"></script>
|
||||
<script src="js/wavelib.js"></script>
|
||||
<!--<script src="js/index_user_scripts.js"></script> -->
|
||||
<script src="js/dygraph-combined-dev.js"></script>
|
||||
<script src="js/wavewrapper.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.js"></script>
|
||||
<!--<script src="js/dygraph-combined-dev.js"></script>-->
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/dygraph/1.1.1/dygraph-combined.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular-route.min.js"></script>
|
||||
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.0.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.13.0/ui-bootstrap-tpls.min.js"></script>
|
||||
<script src="js/ngfile.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
6
js/dygraph-combined.js
Normal file
6
js/dygraph-combined.js
Normal file
File diff suppressed because one or more lines are too long
80
js/ngfile.js
80
js/ngfile.js
@ -11,10 +11,6 @@ app.config(function($routeProvider){
|
||||
templateUrl: 'display.html',
|
||||
controller: 'displayController'
|
||||
})
|
||||
.when('/report', {
|
||||
templateUrl: 'report.html',
|
||||
controller: 'reportController'
|
||||
})
|
||||
.when('/about', {
|
||||
templateUrl: 'about.html',
|
||||
controller: 'mainController'
|
||||
@ -56,6 +52,12 @@ app.controller('mainController', function ($scope, $http, wave) {
|
||||
|
||||
|
||||
$scope.dataInput = function () {
|
||||
|
||||
if (typeof $scope.inp1 == 'undefined') {
|
||||
alert("Please input a valid Data Vector.");
|
||||
return;
|
||||
}
|
||||
|
||||
var x = $scope.inp1.valueOf().split(/[\s,;\t\r\n]+/);
|
||||
var i;
|
||||
var j = 0;
|
||||
@ -84,10 +86,30 @@ app.controller('mainController', function ($scope, $http, wave) {
|
||||
|
||||
$scope.fileInput = function () {
|
||||
var fileinput = document.getElementById('finp1');
|
||||
|
||||
var finp1 = fileinput.files[0];
|
||||
var reader = new FileReader();
|
||||
var temp = 3.14159;
|
||||
|
||||
if (typeof finp1 == 'undefined') {
|
||||
alert("Please input a valid Data File. ");
|
||||
return;
|
||||
}
|
||||
|
||||
reader.onerror = function (e) {
|
||||
switch (e.target.error.code) {
|
||||
case e.target.error.NOT_FOUND_ERR:
|
||||
alert('File Not Found!');
|
||||
break;
|
||||
case e.target.error.NOT_READABLE_ERR:
|
||||
alert('File is not readable');
|
||||
break;
|
||||
default:
|
||||
alert('An error occurred reading this file.');
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
reader.onload = function (e) {
|
||||
var x = reader.result.split(/[\s,;\t\r\n]+/);
|
||||
@ -330,6 +352,12 @@ app.controller('displayController', function ($scope, $http, $modal, wave) {
|
||||
var method;
|
||||
var ext = "NULL";
|
||||
|
||||
if (typeof $scope.selected.family == 'undefined' || typeof $scope.selected.wavelet == 'undefined' ||
|
||||
typeof $scope.selected.method == 'undefined' || typeof $scope.selected.level == 'undefined') {
|
||||
alert("Please Selct All Values : Family, Wavelet, Method and Levels");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($scope.selected.method.id == "0") {
|
||||
method = "dwt";
|
||||
ext = "sym";
|
||||
@ -549,50 +577,44 @@ app.controller('reportController', function ($scope, $modalInstance, items, wave
|
||||
//console.log(i + $scope.flength, i);
|
||||
}
|
||||
//console.log(wave.filter);
|
||||
|
||||
//console.log(wave.length);
|
||||
$scope.length = wave.length;
|
||||
$scope.outlength = wave.outLength;
|
||||
$scope.appx = [];
|
||||
$scope.det = [];
|
||||
$scope.details = [];
|
||||
|
||||
for (var i = 0; i < $scope.length[0]; i++) {
|
||||
$scope.appx[i] = wave.output[i];
|
||||
}
|
||||
var start = $scope.length[0];
|
||||
var end = start + $scope.length[1];
|
||||
for (var j = 0; j < J; j++) {
|
||||
var det = [];
|
||||
|
||||
for (var i = $scope.length[0]; i < wave.outLength; i++) {
|
||||
$scope.det[i - parseInt($scope.length[0])] = wave.output[i];
|
||||
}
|
||||
|
||||
$scope.iter = [];
|
||||
var detlen = wave.outLength - parseInt($scope.length[0]);
|
||||
$scope.liter = [];
|
||||
|
||||
$scope.liter[i] = 0;
|
||||
var i2 = 0;
|
||||
|
||||
for (var i = 0; i < J; i++) {
|
||||
$scope.iter[i] = i;
|
||||
i2 += wave.output[i + 1];
|
||||
$scope.liter[i+1] = i2;
|
||||
}
|
||||
|
||||
function chunk(array,start,end) {
|
||||
var newarr = [];
|
||||
for(var i = start; i < end;i++) {
|
||||
|
||||
for (i = start; i < end; i++) {
|
||||
det[i - start] = wave.output[i];
|
||||
}
|
||||
start = end;
|
||||
end = start + $scope.length[j + 2];
|
||||
$scope.details.push(det);
|
||||
}
|
||||
|
||||
//console.log($scope.details);
|
||||
|
||||
$scope.items = items;
|
||||
$scope.selected = {
|
||||
item: $scope.items[0]
|
||||
};
|
||||
|
||||
/*
|
||||
$scope.ok = function () {
|
||||
$modalInstance.close($scope.selected.item);
|
||||
};
|
||||
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
});
|
||||
|
||||
app.controller("TabsController", function ($scope, $window) {
|
||||
|
||||
});
|
16
js/wavelib.js
Normal file
16
js/wavelib.js
Normal file
File diff suppressed because one or more lines are too long
@ -104,8 +104,8 @@ footer {
|
||||
}
|
||||
|
||||
.large-Modal .modal-dialog{
|
||||
width:400px;
|
||||
height: 400px;
|
||||
width:640px;
|
||||
height: 480px;
|
||||
position: absolute;
|
||||
top:0; bottom: 0; left: 0; right: 0;
|
||||
margin: auto;
|
||||
|
Loading…
x
Reference in New Issue
Block a user