Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 358 → Rev 359

/cvi/apps/RedPitaya/sockserv/calib.h
File deleted
/cvi/apps/RedPitaya/sockserv/sockserv.c
File deleted
/cvi/apps/RedPitaya/sockserv/fpga_osc.c
File deleted
/cvi/apps/RedPitaya/sockserv/daq.h
File deleted
/cvi/apps/RedPitaya/sockserv/www/apps/assets/desktop.js
File deleted
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/fpga.conf
===================================================================
--- apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/fpga.conf (revision 358)
+++ apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/fpga.conf (nonexistent)
@@ -1 +0,0 @@
-/opt/redpitaya/fpga/fpga_0.94.bit
/apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/fpga.conf
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/nginx.conf
===================================================================
--- apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/nginx.conf (revision 358)
+++ apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/nginx.conf (nonexistent)
@@ -1,68 +0,0 @@
- location /get_tcpsocket_status {
- add_header 'Access-Control-Allow-Origin' '*';
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
-
- default_type application/json;
-
- content_by_lua '
- local f = io.popen("systemctl is-active redpitaya_tcpsocket.service")
- local content = f:read("*all")
- f:close()
- ngx.say(content)
- ';
- }
-
- location /start_tcpsocket_manager {
- add_header 'Access-Control-Allow-Origin' '*';
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
-
- default_type application/json;
-
- content_by_lua '
- local f = io.popen("systemctl start redpitaya_tcpsocket.service")
- f:close()
- ngx.say("OK")
- ';
- }
-
- location /stop_tcpsocket_manager {
- add_header 'Access-Control-Allow-Origin' '*';
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
-
- default_type application/json;
-
- content_by_lua '
- local f = io.popen("systemctl stop redpitaya_tcpsocket.service")
- f:close()
- ngx.say("OK")
- ';
- }
-
-
-
-
-
- location /get_rpip {
- add_header 'Access-Control-Allow-Origin' '*';
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
-
- default_type application/json;
-
- content_by_lua '
- local eth = io.popen("ip -4 addr list eth0")
- local wlan = io.popen("ip addr list wlan0wext")
- local eth_content = eth:read("*all")
- local wlan_content = wlan:read("*all")
- eth:close()
- wlan:close()
- ngx.say(eth_content..";"..wlan_content)
- ';
- }
/apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/nginx.conf
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/css/style.css
===================================================================
--- apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/css/style.css (revision 358)
+++ apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/css/style.css (nonexistent)
@@ -1,278 +0,0 @@
-html, body {
- width: 100%;
- height: 100%;
-}
-
-body {
- color: #cdcccc;
- overflow: auto;
- padding-right: 0 !important;
-}
-
-* {
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-.clear:before, .clear:after {
- content: "";
- display: table;
-}
-
-.clear:after {
- clear: both;
-}
-
-.modal {
-
-}
-
-.left-content-tcpsocket > p {
- color: #48b3d2;
-}
-
-.left-content-tcpsocket > ul > li {
- list-style-type: none;
- color: #cccccc;
- }
-
-
-.left-content-tcpsocket > ul > li:before
-{
- content: "- ";
-}
-
-input, #info div, #info span, .selectable {
- -webkit-touch-callout: text;
- -webkit-user-select: text;
- -khtml-user-select: text;
- -moz-user-select: text;
- -ms-user-select: text;
- user-select: text;
-}
-
-input {
- -webkit-user-modify: read-write-plaintext-only;
- -webkit-tap-highlight-color: transparent;
-}
-
-button:focus, button:active, select:focus, input:focus, option:focus {
- outline: 0 !important;
- -webkit-appearance: none !important;
-}
-
-area:hover {
- cursor: pointer;
-}
-
-.full-content {
- /*min-width: 1024px;*/
- margin: 0 auto;
- position: relative;
-}
-
-.container-fluid {
- margin-top: 20px;
-}
-
-.container {
- width: 100%;
- padding-left: 0px;
- padding-right: 0px;
-}
-
-.navbar-collapse {
- padding-left: 0px;
- padding-right: 0px;
-}
-
-.navbar-collapse {
- float: right;
-}
-
-.navbar-nav li {
- width: 131px;
- text-align: center;
-}
-
-.nav > li > a {
- position: relative;
- display: block;
- padding: 10px 30px;
- border-left: 1px solid #999;
-
-}
-
-.navbar-inverse .navbar-nav > li > a {
- color: #cdcccc;
- outline: none;
-}
-
-.nav > li > a:hover {
- background-color: #444 !important;
- color: #E5D5D5;
-}
-
-.navbar {
- border-radius: 0px;
- background-color: #343433;
- background-image: linear-gradient(to bottom, #343433 0, #343433 100%);
- border: 1px solid #999;
- min-height: 42px;
- border-left: 1px solid #999;
-}
-
-.back-btn {
- height: 22px;
- float: left;
- margin: -6px 0px 0px 11px;
-}
-
-.logo {
- margin: 5px 0px 0px 15px;
- float: left;
-}
-
-.navbar-collapse collapse in {
- width: 100%;
- overflow: hidden;
-}
-
-.navbar-brand {
- height: 40px;
-}
-
-.close {
- color: #CAB7B7;
- opacity: 1;
- text-shadow: 0 0 0 !important;
-}
-
-.modal-content {
- background-color: #343433;
- border: 1px solid #999;
- border-radius: 0px;
- outline: 0;
-}
-
-#main {
- margin-right: 188px;
-}
-
-.dialog {
- margin-right: 0px;
- display: none;
-}
-
-.close:hover, .close:focus {
- color: #fff !important;
- text-decoration: none;
- cursor: pointer;
- opacity: 1;
-}
-
-.btn {
- background-image: none;
- border: 0 solid transparent;
- white-space: nowrap;
- padding: 6px 12px;
- line-height: 1.42857143;
- border-radius: 0;
- width: 100%;
- background-color: transparent;
- text-shadow: 0px 0px;
- /* box-shadow: 0 0 0 1px #777; */
- color:#cdcccc !important;
-}
-
-.btn:hover, btn:active {
- color: #fff !important;
- background-image: none;
-}
-
-.btn.focus {
- color: #777;
- border: 0px solid transparent;
-}
-
-.btn:active, .btn.active {
- background-image: none;
- background-color: #999;
- color: #111 !important;
-}
-
-.left-tcpsocket {
- float:left;
- width:100%;
-}
-
-.left-content-tcpsocket {
- margin-right:120px;
-}
-
-.right-tcpsocket {
- float:right;
- width: 120px;
- margin-left: -120px;
-}
-
-#header {
- background-color: black;
- color: #CCC;
- text-align: center;
- padding: 6px;
- overflow: hidden;
- height: 30px;
- width: 100%;
- white-space: nowrap;
-}
-
-.example_button
-{
- margin-top: 20px;
- width: 131px;
- text-align: center;
- list-style: none;
- height: 40px;
- padding-top:10px;
- border: 1px solid;
-}
-
-.example_button:hover
-{
- background: gray;
- cursor: pointer;
-}
-
-.example_button span {
- color: #337ab7;
-}
-
-.run_buttons {
- display: inline-block;
- text-align: center;
- border: 1px solid;
- border-color: #cccccc;;
- background-color: #47b2d1;
- color: #000000;
- margin: 0 auto;
- margin-top: 15px;
- margin-bottom: 15px;
- font-size: 16pt;
- padding: 6px 20px 6px 20px;
- width: 120px;
-}
-
-.run_buttons:hover {
- background-color: #69d4d1;
- cursor: pointer;
-}
-
-.run_buttons a {
- color: #000000;
- text-decoration: none;
-}
/apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/css/style.css
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/index.html
===================================================================
--- apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/index.html (revision 358)
+++ apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/index.html (nonexistent)
@@ -1,168 +0,0 @@
-<!-- $Id$
- *
- * Red Pitaya TCPSOCKET service manager
- *
- * Author: Dakus <info@eskala.eu>
- *
- * (c) Red Pitaya http://www.redpitaya.com
- *
--->
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8"></meta>
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
- <title>Red Pitaya</title>
- <link rel="stylesheet" href="../assets/bootstrap/css/bootstrap.min.css">
- <link rel="stylesheet" href="../assets/popupstack.css" type="text/css" />
- <link rel="stylesheet" href="../assets/help-system/help-system.css" type="text/css" />
- <link rel="stylesheet" href="css/style.css?2">
- <script src="../assets/jquery/jquery-2.1.3.min.js"></script>
- <script src="../assets/jquery/jquery-ui.min.js"></script>
- <script src="../assets/jquery/jquery.ui.touch-punch.min.js"></script>
- <script src="../assets/jquery/jquery.cookie.js?3"></script>
- <script src="../assets/jquery/jquery.browser.js"></script>
- <script src="../assets/bootstrap/js/bootstrap.min.js"></script>
- <script src="../assets/browsercheck.js?1"></script>
- <script src="../assets/analytics-core.js"></script>
- <script src="../assets/popupstack.js?1"></script>
- <script src="../assets/help-system/help-system.js"></script>
- <script src="js/help-tcpsocket.js"></script>
- <script src="js/manager.js?3"></script>
- <script src="js/analytics-main.js?1"></script>
-
-</head>
-
-<body>
- <div id="loader-wrapper">
- <div id="loader"></div>
- </div>
- <div id="header">
- <div id="description">&nbsp;</div>
- </div>
- <div class="full-content">
- <div class="container-fluid">
- <div class="navbar navbar-inverse" role="navigation">
- <div class="container">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
- <span class="sr-only">T</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="/">
- <img class="back-btn" src="../assets/images/navigation_arrow_left.png">
- </a>
- <img class="logo" width=110 src="../assets/images/navigation_logo.png">
- </div>
- <div class="collapse navbar-collapse">
- <ul class="nav navbar-nav">
- </ul>
- </div>
- </div>
- </div>
- <div id="global_container" style="position: relative;">
- <div id="main">
- <div class="left-tcpsocket">
- <div class="left-content-tcpsocket" style="font-size: 18pt; color: gray;">
- <p>TCPSOCKET server application</p>
- <ul>
- <li>Enables remote control of Red Pitaya using multievent binary buffer</li>
- <li>Provides access to Red Pitaya waveform sampler (fast ADC).</li>
- <li>Supports WIFI or LAN remote interface</li>
- </ul>
- </div>
- </div>
- <div class="right-tcpsocket">
- <br>
- <br>
- <br>
- <img src="img/apps.png" width="200%">
- </div>
- <div>
- <div id="label-is-runnung" align=center style="font-size: 16pt; color: red;">
- TCPSOCKET server is not running, press RUN button to start it
- </div>
- <div id="label-is-not-runnung" align=center style="font-size: 16pt; color: green; display: none;">
- TCPSOCKET server is running... (IP="<span id="ip-addr">127.0.0.1</span>", port="9930")
- </div>
- <div align="center">
- <ul class="">
- <li class="run_buttons" id="TCPSOCKET_RUN">
- <a href="#" id="a_run" style="">RUN</a>
- </li>
- <li class="run_buttons" id="TCPSOCKET_STOP" style="display:none;">
- <a href="#" id="a_stop">STOP</a>
- </li>
- </ul>
- </div>
- <div align=center>
- Example about how to Control your Red Pitaya using MATLAB/Python/LabVIEW/Scilab.
- Are available on link below
- <div align="center">
- <ul class="">
- <li class="example_button" id="TCPSOCKET_EXAMPLES">
- <span>Examples</span>
- </li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div>
- <div id="sys_info_view" style="display:none; position:fixed; bottom:0; left: 0; background-color: rgba(0, 0, 0, 0.2); text-align:left; padding: 5px; font-size:12px; color:white; ">
- FPS:<span id="fps_view">0</span> Throughput:<span id="throughput_view">0</span> CPU Load:<span id="cpu_load">0</span>
- <br/> Memory total:<span id="totalmem_view">0</span> Free:<span id="freemem_view">0</span> Usage:<span id="usagemem_view">0</span>
- </div>
- </div>
- <div class="modal fade" id="feedback_error" tabindex="-1" role="dialog" aria-labelledby="bazaar_naLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
- <h4 class="modal-title" id="oops_label">Oops, something went wrong</h4>
- </div>
- <div class="modal-body" style="text-align: center; font-size: 18px;">
- <p>Please send us the report and help us to fix this issue</p>
- <p>Thank you!</p>
- </div>
- <div class="modal-footer">
- <div class="bazaar-link" style="float: left; width: 50%;">
- <a href="#" style="border: 1px solid; width: 100%" id="send_report_btn" data-dismiss="modal" class="list-group-item btn">Send report</a>
- </div>
- <div class="bazaar-link" style="float: left; width: 50%;">
- <a href="#" style="border: 1px solid; width: 100%" id="restart_app_btn" data-dismiss="modal" class="list-group-item btn">Restart Application</a>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal fade" id="analytics_dialog" tabindex="-1" role="dialog" aria-labelledby="bazaar_naLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
- <h4 class="modal-title" id="bazaar_naLabel">Diagnostic & Usage</h4>
- </div>
- <div class="modal-body">
- <p>Would you like to help Red Pitaya team to improve its product and services by occasionally providing anonymous diagnostic and usage information?</p>
- </div>
- <div class="modal-footer">
- <div class="bazaar-link" style="float: left; width: 50%;">
- <a href="#" data-dismiss="modal" id="enable_analytics" class="list-group-item btn">Yes</a>
- </div>
- <div class="bazaar-link" style="float: left; width: 50%;">
- <a href="#" data-dismiss="modal" id="disable_analytics" class="list-group-item btn">No</a>
- </div>
- </div>
- </div>
- </div>
- </div>
-</body>
-
-</html>
/apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/index.html
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/info/info.json
===================================================================
--- apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/info/info.json (revision 358)
+++ apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/info/info.json (nonexistent)
@@ -1,6 +0,0 @@
-{
- "name": "TcpSocket",
- "version": "0.96-336",
- "revision": "4506f6e",
- "description": "Remote access and binary multievent transfer of waveforms"
-}
/apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/info/info.json
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/info/icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/info/icon.png
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/img/apps.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/img/apps.png
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/img/dummy.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/img/dummy.png
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/js/manager.js
===================================================================
--- apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/js/manager.js (revision 358)
+++ apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/js/manager.js (nonexistent)
@@ -1,120 +0,0 @@
-/*
- * Red Pitaya TCPSOCKET service manager
- *
- * Author: Artem Kokos <a.kokos@integrasources.eu>
- *
- * (c) Red Pitaya http://www.redpitaya.com
- *
- */
-
-(function(TCPSOCKET, $, undefined) {
- TCPSOCKET.CheckServerStatus = function() {
- $.ajax({
- url: '/get_tcpsocket_status',
- type: 'GET',
- timeout: 1500
- })
- .fail(function(msg) {
- if (msg.responseText.split('\n')[0] == "active") {
- $('#TCPSOCKET_RUN').hide();
- $('#TCPSOCKET_STOP').css('display', 'block');
- $('#label-is-runnung').hide();
- $('#label-is-not-runnung').show();
- } else {
- $('#TCPSOCKET_STOP').hide();
- $('#TCPSOCKET_RUN').css('display', 'block');
- $('#label-is-not-runnung').hide();
- $('#label-is-runnung').show();
- }
- })
- }
-
- TCPSOCKET.StartServer = function() {
- $.ajax({
- url: '/start_tcpsocket_manager',
- type: 'GET',
- timeout: 1500
- })
- .fail(function(msg) {
- if (msg.responseText) {} else {}
- })
- }
-
- TCPSOCKET.StopServer = function() {
- $.ajax({
- url: '/stop_tcpsocket_manager',
- type: 'GET',
- timeout: 1500
- })
- .fail(function(msg) {
- if (msg.responseText) {} else {}
- })
- }
-
- TCPSOCKET.GetIP = function() {
- $.ajax({
- url: '/get_rpip',
- type: 'GET',
- }).fail(function(msg) {
-
- var res = msg.responseText.split(";");
-
- var ethIP = res[0].match(/inet\s+\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/2[0-90]\b/);
- var wlanIP = res[1].match(/inet\s+\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/2[0-90]\b/);
-
- if (ethIP != null){
- ethIP = ethIP[0].split(" ")[1].split("/")[0];
- $('#ip-addr').text(ethIP);
- }
- else if (wlanIP != null){
- wlanIP = wlanIP[0].split(" ")[1].split("/")[0];
- $('#ip-addr').text(wlanIP);
- }
- else $('#ip-addr').text("None");
-
-
-
- }).done(function(msg) {
-
- var res = msg.responseText.split(";");
-
- var ethIP = res[0].match(/inet\s+\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/2[0-90]\b/);
- var wlanIP = res[1].match(/inet\s+\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/2[0-90]\b/);
-
- if (ethIP != null){
- ethIP = ethIP[0].split(" ")[1].split("/")[0];
- $('#ip-addr').text(ethIP);
- }
- else if (wlanIP != null){
- wlanIP = wlanIP[0].split(" ")[1].split("/")[0];
- $('#ip-addr').text(wlanIP);
- }
- else $('#ip-addr').text("None");
-
- });
- }
-
-}(window.TCPSOCKET = window.TCPSOCKET || {}, jQuery));
-
-
-
-
-// Page onload event handler
-$(function() {
-
- // Init help
- Help.init(helpListTCPSOCKET);
- Help.setState("idle");
-
- TCPSOCKET.CheckServerStatus();
- setInterval(TCPSOCKET.GetIP, 1000);
- setInterval(TCPSOCKET.CheckServerStatus, 3000);
-
- $('#TCPSOCKET_RUN').click(TCPSOCKET.StartServer);
-
- $('#TCPSOCKET_STOP').click(TCPSOCKET.StopServer);
-
- $('#TCPSOCKET_EXAMPLES').click(function(){
- window.open('http://redpitaya.com/examples-new/','_blank');
- });
-});
/apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/js/manager.js
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/js/help-tcpsocket.js
===================================================================
--- apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/js/help-tcpsocket.js (revision 358)
+++ apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/js/help-tcpsocket.js (nonexistent)
@@ -1,27 +0,0 @@
-var helpListTCPSOCKET =
-{
- idle: [
- {
- Text: "How to control your Red Pitaya remotely?",
- URL: "http://redpitaya.com/control/",
- Img: "pool"
- },
- {
- Text: "Red Pitaya's Forum",
- URL: "http://forum.redpitaya.com/",
- Img: "star"
- }
- ],
- loaded: [
- {
- Text: "Description3",
- URL: "http://redpitaya.com",
- Img: "star"
- },
- {
- Text: "Description4",
- URL: "http://redpitaya.com",
- Img: "pool"
- }
- ]
-};
/apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/js/help-tcpsocket.js
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/js/analytics-main.js
===================================================================
--- apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/js/analytics-main.js (revision 358)
+++ apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/js/analytics-main.js (nonexistent)
@@ -1,21 +0,0 @@
-//-------------------------------------------------
-// Redpitaya analytics system
-// Created by Alexey Kaygorodov
-//-------------------------------------------------
-
-(function($) {
- var startUsing = 0;
- $(document).ready(function($) {
- AnalyticsCore.init(function(){
- AnalyticsCore.sendExecTime('/tcpsocket_manager', 'tcpsocket_manager');
- AnalyticsCore.sendScreenView('/tcpsocket_manager', 'Redpitaya', 'Remote control');
- AnalyticsCore.sendSysInfo('/tcpsocket_manager');
- startUsing = performance.now();
- });
- });
-
- $(window).on('beforeunload', function(){
- $.cookie('tcpsocket_manager-run', performance.now() - startUsing);
- });
-
-})(jQuery);
/apps/RedPitaya/sockserv/www/apps/tcpsocket_manager/js/analytics-main.js
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: apps/RedPitaya/sockserv/fpga_osc.h
===================================================================
--- apps/RedPitaya/sockserv/fpga_osc.h (revision 358)
+++ apps/RedPitaya/sockserv/fpga_osc.h (nonexistent)
@@ -1,261 +0,0 @@
-/**
- * $Id: fpga_osc.h 881 2013-12-16 05:37:34Z rp_jmenart $
- *
- * @brief Red Pitaya Oscilloscope FPGA controller.
- *
- * @Author Jure Menart <juremenart@gmail.com>
- *
- * (c) Red Pitaya http://www.redpitaya.com
- *
- * This part of code is written in C programming language.
- * Please visit http://en.wikipedia.org/wiki/C_(programming_language)
- * for more details on the language used herein.
- */
-
-#ifndef __FPGA_OSC_H
-#define __FPGA_OSC_H
-
-#include <stdint.h>
-
-/** @defgroup fpga_osc_h fpga_osc_h
- * @{
- */
-
-/** Base OSC FPGA address */
-#define OSC_FPGA_BASE_ADDR 0x40100000
-/** Base OSC FPGA core size */
-#define OSC_FPGA_BASE_SIZE 0x30000
-/** OSC FPGA input signal buffer length */
-#define OSC_FPGA_SIG_LEN (16*1024)
-/** OSC FPGA ARM bit in configuration register */
-#define OSC_FPGA_CONF_ARM_BIT 1
-/** OSC FPGA reset bit in configuration register */
-#define OSC_FPGA_CONF_RST_BIT 2
-
-/** OSC FPGA trigger source register mask */
-#define OSC_FPGA_TRIG_SRC_MASK 0x00000007
-/** OSC FPGA Channel A threshold register mask */
-#define OSC_FPGA_CHA_THR_MASK 0x00003fff
-/** OSC FPGA Channel B threshold register mask */
-#define OSC_FPGA_CHB_THR_MASK 0x00003fff
-/** OSC FPGA trigger delay register register mask */
-#define OSC_FPGA_TRIG_DLY_MASK 0xffffffff
-/** OSC FPGA data decimation mask */
-#define OSC_FPGA_DATA_DEC_MASK 0x0001ffff
-
-/** OSC FPGA Channel A input signal buffer offset */
-#define OSC_FPGA_CHA_OFFSET 0x10000
-/** OSC FPGA Channel B input signal buffer offset */
-#define OSC_FPGA_CHB_OFFSET 0x20000
-
-/** @brief OSC FPGA registry structure.
- *
- * This structure is direct image of physical FPGA memory. When accessing it all
- * reads/writes are performed directly from/to FPGA OSC core.
- */
-typedef struct osc_fpga_reg_mem_s {
- /** @brief Offset 0x00 - configuration register
- *
- * Configuration register (offset 0x00):
- * bit [0] - arm_trigger
- * bit [1] - rst_wr_state_machine
- * bits [31:2] - reserved
- */
- uint32_t conf;
-
- /** @brief Offset 0x04 - trigger source register
- *
- * Trigger source register (offset 0x04):
- * bits [ 2 : 0] - trigger source:
- * 1 - trig immediately
- * 2 - ChA positive edge
- * 3 - ChA negative edge
- * 4 - ChB positive edge
- * 5 - ChB negative edge
- * 6 - External trigger 0
- * 7 - External trigger 1
- * bits [31 : 3] -reserved
- */
- uint32_t trig_source;
-
- /** @brief Offset 0x08 - Channel A threshold register
- *
- * Channel A threshold register (offset 0x08):
- * bits [13: 0] - ChA threshold
- * bits [31:14] - reserved
- */
- uint32_t cha_thr;
-
- /** @brief Offset 0x0C - Channel B threshold register
- *
- * Channel B threshold register (offset 0x0C):
- * bits [13: 0] - ChB threshold
- * bits [31:14] - reserved
- */
- uint32_t chb_thr;
-
- /** @brief Offset 0x10 - After trigger delay register
- *
- * After trigger delay register (offset 0x10)
- * bits [31: 0] - trigger delay
- * 32 bit number - how many decimated samples should be stored into a buffer.
- * (max 16k samples)
- */
- uint32_t trigger_delay;
-
- /** @brief Offset 0x14 - Data decimation register
- *
- * Data decimation register (offset 0x14):
- * bits [16: 0] - decimation factor, legal values:
- * 1, 8, 64, 1024, 8192 65536
- * If other values are written data is undefined
- * bits [31:17] - reserved
- */
- uint32_t data_dec;
-
- /** @brief Offset 0x18 - Current write pointer register
- *
- * Current write pointer register (offset 0x18), read only:
- * bits [13: 0] - current write pointer
- * bits [31:14] - reserved
- */
- uint32_t wr_ptr_cur;
- /** @brief Offset 0x1C - Trigger write pointer register
- *
- * Trigger write pointer register (offset 0x1C), read only:
- * bits [13: 0] - trigger pointer (pointer where trigger was detected)
- * bits [31:14] - reserved
- */
- uint32_t wr_ptr_trigger;
-
- /** @brief ChA & ChB hysteresis - both of the format:
- * bits [13: 0] - hysteresis threshold
- * bits [31:14] - reserved
- */
- uint32_t cha_hystersis;
- uint32_t chb_hystersis;
-
- /** @brief
- * bits [0] - enable signal average at decimation
- * bits [31:1] - reserved
- */
- uint32_t other;
-
- uint32_t reseved;
-
- /** @brief ChA Equalization filter
- * bits [17:0] - AA coefficient (pole)
- * bits [31:18] - reserved
- */
- uint32_t cha_filt_aa;
-
- /** @brief ChA Equalization filter
- * bits [24:0] - BB coefficient (zero)
- * bits [31:25] - reserved
- */
- uint32_t cha_filt_bb;
-
- /** @brief ChA Equalization filter
- * bits [24:0] - KK coefficient (gain)
- * bits [31:25] - reserved
- */
- uint32_t cha_filt_kk;
-
- /** @brief ChA Equalization filter
- * bits [24:0] - PP coefficient (pole)
- * bits [31:25] - reserved
- */
- uint32_t cha_filt_pp;
-
-
-
-
- /** @brief ChB Equalization filter
- * bits [17:0] - AA coefficient (pole)
- * bits [31:18] - reserved
- */
- uint32_t chb_filt_aa;
-
- /** @brief ChB Equalization filter
- * bits [24:0] - BB coefficient (zero)
- * bits [31:25] - reserved
- */
- uint32_t chb_filt_bb;
-
- /** @brief ChB Equalization filter
- * bits [24:0] - KK coefficient (gain)
- * bits [31:25] - reserved
- */
- uint32_t chb_filt_kk;
-
- /** @brief ChB Equalization filter
- * bits [24:0] - PP coefficient (pole)
- * bits [31:25] - reserved
- */
- uint32_t chb_filt_pp;
-
- /* ChA & ChB data - 14 LSB bits valid starts from 0x10000 and
- * 0x20000 and are each 16k samples long */
-} osc_fpga_reg_mem_t;
-
-/** @} */
-
-// TODO: Move to a shared folder and share with scope & spectrum.
-/** Equalization & shaping filter coefficients */
-typedef struct {
- uint32_t aa;
- uint32_t bb;
- uint32_t pp;
- uint32_t kk;
-} ecu_shape_filter_t;
-
-int osc_fpga_init(void);
-int osc_fpga_exit(void);
-
-void get_equ_shape_filter(ecu_shape_filter_t *filt, uint32_t equal,
- uint32_t shaping, uint32_t gain);
-int osc_fpga_update_params(int trig_imm, int trig_source, int trig_edge,
- float trig_delay, float trig_level, int time_range,
- int equal, int shaping, int gain1, int gain2);
-int osc_fpga_reset(void);
-int osc_fpga_arm_trigger(void);
-int osc_fpga_set_trigger(uint32_t trig_source);
-int osc_fpga_set_trigger_delay(uint32_t trig_delay);
-
-/* Returns 0 if no trigger, 1 if trigger */
-int osc_fpga_triggered(void);
-
-/* Returns pointer to the ChA and ChB signals (of length OSC_FPGA_SIG_LEN) */
-int osc_fpga_get_sig_ptr(int **cha_signal, int **chb_signal);
-
-/* Returns signal pointers from the FPGA */
-int osc_fpga_get_wr_ptr(int *wr_ptr_curr, int *wr_ptr_trig);
-
-/* Returnes signal content */
-/* various constants */
-extern const float c_osc_fpga_smpl_freq;
-extern const float c_osc_fpga_smpl_period;
-
-/* helper conversion functions */
-/* Convert correct value for FPGA trigger source from trig_immediately,
- * trig_source and trig_edge from application params.
- */
-int osc_fpga_cnv_trig_source(int trig_imm, int trig_source, int trig_edge);
-/* Converts time_range parameter (0-5) to decimation factor */
-int osc_fpga_cnv_time_range_to_dec(int time_range);
-/* Converts time in [s] to ADC samples (depends on decimation) */
-int osc_fpga_cnv_time_to_smpls(float time, int dec_factor);
-/* Converts voltage in [V] to ADC counts */
-int osc_fpga_cnv_v_to_cnt(float voltage);
-/* Converts ADC ounts to [V] */
-float osc_fpga_cnv_cnt_to_v(int cnts);
-
-/* Debug - dump to stderr current parameter settings (leave out data) */
-void osc_fpga_dump_regs(void);
-
-/* debugging - will be removed */
-extern osc_fpga_reg_mem_t *g_osc_fpga_reg_mem;
-extern int g_osc_fpga_mem_fd;
-int __osc_fpga_cleanup_mem(void);
-
-#endif /* __FPGA_OSC_H*/
Index: apps/RedPitaya/sockserv/version.h
===================================================================
--- apps/RedPitaya/sockserv/version.h (revision 358)
+++ apps/RedPitaya/sockserv/version.h (nonexistent)
@@ -1,34 +0,0 @@
-/**
- * $Id: $
- *
- * @brief Red Pitaya simple version strings. To be embedded in binaries
- * at build time for SW traceability.
- *
- * @Author Ales Bardorfer <ales.bardorfer@redpitaya.com>
- *
- * (c) Red Pitaya http://www.redpitaya.com
- *
- * This part of code is written in C programming language.
- * Please visit http://en.wikipedia.org/wiki/C_(programming_language)
- * for more details on the language used herein.
- */
-
-#ifndef VERSION_H
-#define VERSION_H
-
-#define XSTR(s) STR(s)
-#define STR(s) #s
-
-#ifndef VERSION
-#define VERSION_STR "0.00-0000"
-#else
-#define VERSION_STR XSTR(VERSION)
-#endif
-
-#ifndef REVISION
-#define REVISION_STR "unknown"
-#else
-#define REVISION_STR XSTR(REVISION)
-#endif
-
-#endif /* VERSION_H */
/apps/RedPitaya/sockserv/version.h
Property changes:
Deleted: svn:executable
Index: apps/RedPitaya/sockserv/sockserv.sh
===================================================================
--- apps/RedPitaya/sockserv/sockserv.sh (revision 358)
+++ apps/RedPitaya/sockserv/sockserv.sh (nonexistent)
@@ -1,4 +0,0 @@
-#!/bin/bash
-export LD_LIBRARY_PATH=/opt/redpitaya/lib/
-cat /opt/redpitaya/fpga/fpga_0.94.bit > /dev/xdevcfg
-./sockserv
Index: apps/RedPitaya/sockserv/calib.c
===================================================================
--- apps/RedPitaya/sockserv/calib.c (revision 358)
+++ apps/RedPitaya/sockserv/calib.c (nonexistent)
@@ -1,105 +0,0 @@
-/**
- * $Id: calib.c 881 2013-12-16 05:37:34Z rp_jmenart $
- *
- * @brief Red Pitaya Oscilloscope Calibration Module.
- *
- * @Author Jure Menart <juremenart@gmail.com>
- *
- * (c) Red Pitaya http://www.redpitaya.com
- *
- * This part of code is written in C programming language.
- * Please visit http://en.wikipedia.org/wiki/C_(programming_language)
- * for more details on the language used herein.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-
-#include "calib.h"
-
-const char eeprom_device[]="/sys/bus/i2c/devices/0-0050/eeprom";
-const int eeprom_calib_off=0x0008;
-
-
-/*----------------------------------------------------------------------------*/
-/**
- * @brief Read calibration parameters from EEPROM device.
- *
- * Function reads calibration parameters from EEPROM device and stores them to the
- * specified buffer. Communication to the EEPROM device is taken place through
- * appropriate system driver accessed through the file system device
- * /sys/bus/i2c/devices/0-0050/eeprom.
- *
- * @param[out] calib_params Pointer to destination buffer.
- * @retval 0 Success
- * @retval -1 Failure, error message is put on stderr device
- *
- */
-int rp_read_calib_params(rp_calib_params_t *calib_params)
-{
- FILE *fp;
- size_t size;
-
- /* sanity check */
- if(calib_params == NULL) {
- fprintf(stderr, "rp_read_calib_params(): input structure "
- "not initialized\n");
- return -1;
- }
-
- /* open eeprom device */
- fp=fopen(eeprom_device, "r");
- if(fp == NULL) {
- fprintf(stderr, "rp_read_calib_params(): Can not open EEPROM device: "
- " %s\n", strerror(errno));
- return -1;
- }
-
- /* ...and seek to the appropriate storage offset */
- if(fseek(fp, eeprom_calib_off, SEEK_SET) < 0) {
- fclose(fp);
- fprintf(stderr, "rp_read_calib_params(): fseek() failed: %s\n",
- strerror(errno));
- return -1;
- }
-
- /* read data from eeprom component and store it to the specified buffer */
- size=fread(calib_params, sizeof(char), sizeof(rp_calib_params_t), fp);
- if(size != sizeof(rp_calib_params_t)) {
- fclose(fp);
- fprintf(stderr, "rp_read_calib_params(): fread() failed, "
- "returned bytes: %d (should be :%d)\n", size,
- sizeof(rp_calib_params_t));
- return -1;
- }
- fclose(fp);
-
- return 0;
-}
-
-
-/*----------------------------------------------------------------------------*/
-/**
- * Initialize calibration parameters to default values.
- *
- * @param[out] calib_params Pointer to target buffer to be initialized.
- * @retval 0 Success, could never fail.
- */
-
-int rp_default_calib_params(rp_calib_params_t *calib_params)
-{
- calib_params->fe_ch1_fs_g_hi = 28101971; /* 0.6543 [V] */
- calib_params->fe_ch2_fs_g_hi = 28101971; /* 0.6543 [V] */
- calib_params->fe_ch1_fs_g_lo = 625682246; /* 14.56 [V] */
- calib_params->fe_ch2_fs_g_lo = 625682246; /* 14.56 [V] */
- calib_params->fe_ch1_dc_offs = 585;
- calib_params->fe_ch2_dc_offs = 585;
- calib_params->be_ch1_fs = 42949673; /* 1 [V] */
- calib_params->be_ch2_fs = 42949673; /* 1 [V] */
- calib_params->be_ch1_dc_offs = 0x3eac;
- calib_params->be_ch2_dc_offs = 0x3eac;
-
- return 0;
-}
Index: apps/RedPitaya/sockserv/etc/systemd/system/redpitaya_tcpsocket.service
===================================================================
--- apps/RedPitaya/sockserv/etc/systemd/system/redpitaya_tcpsocket.service (revision 358)
+++ apps/RedPitaya/sockserv/etc/systemd/system/redpitaya_tcpsocket.service (nonexistent)
@@ -1,21 +0,0 @@
-[Unit]
-Description=TCP socket server for binary transfers of waveforms on Red Pitaya
-After=network.target
-
-[Service]
-Type=simple
-Restart=always
-#PIDFile=/var/run/redpitaya_scpi.pid
-# TODO: it should be possible to use EnvironmentFile, but it is not working properly
-# complains about failing library path, or something else
-#EnvironmentFile=/etc/sysconfig/redpitaya
-Environment=PATH_REDPITAYA=/opt/redpitaya
-Environment=LD_LIBRARY_PATH=/opt/redpitaya/lib PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/redpitaya/sbin:/opt/redpitaya/bin
-ExecStartPre=/bin/sh -c "cat /opt/redpitaya/fpga/fpga_0.94.bit > /dev/xdevcfg"
-#ExecStart =/opt/redpitaya/bin/socket-server
-ExecStart =/root/sockserv/sockserv
-#ExecReload=
-ExecStop =/bin/kill -15 $MAINPID
-
-[Install]
-WantedBy=multi-user.target
Index: apps/RedPitaya/sockserv/Makefile
===================================================================
--- apps/RedPitaya/sockserv/Makefile (revision 358)
+++ apps/RedPitaya/sockserv/Makefile (nonexistent)
@@ -1,96 +0,0 @@
-CFLAGS = -DMRP
-#
-# $Id: Makefile 1249 2014-02-22 20:21:40Z ales.bardorfer $
-#
-# (c) Red Pitaya http://www.redpitaya.com
-#
-# Trigger
-# Trigger project source file.
-#
-# make CROSS_COMPILE=arm-linux-gnueabi- clean all
-# on PC and move to Red Pitaya:
-# scp trig root@172.16.255.27:/tmp
-#
-# This project file is written for GNU/Make software. For more details please
-# visit: http://www.gnu.org/software/make/manual/make.html
-# GNU Compiler Collection (GCC) tools are used for the compilation and linkage.
-# For the details about the usage and building please visit:
-# http://gcc.gnu.org/onlinedocs/gcc/
-#
-
-# Versioning system
-VERSION ?= 0.00-0000
-REVISION ?= devbuild
-
-# List of compiled object files (not yet linked to executable)
-OBJS = sockserv.o fpga_osc.o calib.o daq.o
-# List of raw source files (all object files, renamed from .o to .c)
-SRCS = $(subst .o,.c, $(OBJS)))
-
-# Executable name
-TARGET=sockserv
-
-# GCC compiling & linking flags
-CFLAGS += -g -std=gnu99 -Wall -Werror
-CFLAGS += -DVERSION=$(VERSION) -DREVISION=$(REVISION)
-CFLAGS += -DDEBUG
-CFLAGS += -I/opt/redpitaya/include
-CFLAGS += -L/opt/redpitaya/lib
-#LDLIBS = -lm -lpthread -lrp
-# Red Pitaya common SW directory
-SHARED=/opt/redpitaya
-
-# Additional libraries which needs to be dynamically linked to the executable
-# -lm - System math library (used by cos(), sin(), sqrt(), ... functions)
-LIBS=-lm -lpthread -lrp
-
-# Main GCC executable (used for compiling and linking)
-CC=$(CROSS_COMPILE)gcc
-# Installation directory
-INSTALL_DIR ?= .
-
-# Makefile is composed of so called 'targets'. They give basic structure what
-# needs to be execued during various stages of the building/removing/installing
-# of software package.
-# Simple Makefile targets have the following structure:
-# <name>: <dependencies>
-# <command1>
-# <command2>
-# ...
-# The target <name> is completed in the following order:
-# - list od <dependencies> finished
-# - all <commands> in the body of targets are executed succsesfully
-
-# Main Makefile target 'all' - it iterates over all targets listed in $(TARGET)
-# variable.
-all: $(TARGET)
-
-# Target with compilation rules to compile object from source files.
-# It applies to all files ending with .o. During partial building only new object
-# files are created for the source files (.c) which have newer timestamp then
-# objects (.o) files.
-%.o: %.c version.h
- $(CC) -c $(CFLAGS) $< -o $@
-
-# Makefile target with rules how to link executable for each target from $(TARGET)
-# list.
-$(TARGET): $(OBJS)
- $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
-
-# Version header for traceability
-version.h:
- cp $(SHARED)/include/redpitaya/version.h .
-
-# Clean target - when called it cleans all object files and executables.
-clean:
- rm -f $(TARGET) *.o
-
-# Install target - creates 'bin/' sub-directory in $(INSTALL_DIR) and copies all
-# executables to that location.
-install:
- mkdir -p $(INSTALL_DIR)/bin
- cp $(TARGET) $(INSTALL_DIR)/bin
- mkdir -p $(INSTALL_DIR)/src/utils/$(TARGET)
- -rm -f $(TARGET) *.o
- cp -r * $(INSTALL_DIR)/src/utils/$(TARGET)/
- -rm `find $(INSTALL_DIR)/src/tools/$(TARGET)/ -iname .svn` -rf
Index: apps/RedPitaya/sockserv/daq.c
===================================================================
--- apps/RedPitaya/sockserv/daq.c (revision 358)
+++ apps/RedPitaya/sockserv/daq.c (nonexistent)
@@ -1,447 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <signal.h>
-#include <time.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <ctype.h>
-#include <unistd.h>
-
-#ifdef MRP
-#include "redpitaya/rp.h"
-#else
-#include "calib.h"
-#endif
-
-#include "fpga_osc.h"
-
-#define TRUE -1
-#define FALSE 0
-
-int timer_out; struct sigaction oact;
-
-int ctrl_c=0;
-
-void SigInt (int sig) {
- ctrl_c = 1;
-}
-
-
-void timerast (signumber, code, context) int signumber, code; struct sigcontext context; {
- fprintf(stderr, "Timeout\n");
- timer_out = TRUE;
-}
-
-void tmlnk (tout) int tout; {
- struct sigaction act;
- struct itimerval tdelay;
-
- act.sa_handler = timerast;
- sigemptyset (&act.sa_mask);
- act.sa_flags = 0;
-
- tdelay.it_value.tv_sec = tout / 100;
- tdelay.it_value.tv_usec = 10000 * (tout % 100);
- tdelay.it_interval.tv_sec = 0;
- tdelay.it_interval.tv_usec = 0;
-
- if (sigaction (SIGALRM, &act, &oact) < 0)
- {
- perror ("sigaction(tmlnk)");
- exit (EXIT_FAILURE);
- }
- if (setitimer (ITIMER_REAL, &tdelay, NULL) < 0)
- {
- perror ("setitimer(tmlnk)");
- exit (EXIT_FAILURE);
- }
-}
-
-void tmulk () {
- struct itimerval tdelay;
-
- tdelay.it_value.tv_sec = 0;
- tdelay.it_value.tv_usec = 0;
- tdelay.it_interval.tv_sec = 0;
- tdelay.it_interval.tv_usec = 0;
-
- if (setitimer (ITIMER_REAL, &tdelay, NULL) < 0)
- {
- perror ("setitimer(tmulk)");
- exit (EXIT_FAILURE);
- }
- if (sigaction (SIGALRM, &oact, NULL) < 0)
- {
- perror ("sigaction(tmulk)");
- exit (EXIT_FAILURE);
- }
-}
-
-#ifndef MRP
-rp_calib_params_t rp_calib_params; /** Pointer to externally defined calibration parameters. */ rp_calib_params_t *gen_calib_params = NULL;
-#endif
-int daq_init (char * buff) {
-#ifdef DEBUG
- fprintf (stderr, "Server: init\n");
-#endif
- int * hdr = (int *) buff;
- int delay = hdr[0];
- int decimation = hdr[1];
- float threshold_voltage = hdr[2]/1000.;
- fprintf(stderr, "delay = %d\tdecimation = %d\tthreshold = %f\n", delay, decimation, threshold_voltage);
-
-/*
-
- rp_default_calib_params(&rp_calib_params);
- gen_calib_params = &rp_calib_params;
- if(rp_read_calib_params(gen_calib_params) < 0) {
- fprintf(stderr, "rp_read_calib_params() failed, using default"
- " parameters\n");
- }
-
-*/
-
- // use this to acquire calibrated offset: int offset = gen_calib_params->fe_ch1_dc_offs;
-#ifdef MRP
- if(rp_Init() != RP_OK){
- fprintf(stderr, "Rp api init failed!\n");
- }
- rp_AcqReset();
- const int rpdecimation[6]={RP_DEC_1 ,RP_DEC_8 ,RP_DEC_64,
- RP_DEC_1024 ,RP_DEC_8192 ,RP_DEC_65536 };
- rp_AcqSetDecimation(rpdecimation[decimation%6]);
- const int c[2] = {RP_CH_1, RP_CH_2};
- rp_AcqSetTriggerLevel(c[0],threshold_voltage); //Trig level is set in Volts while in SCPI
- rp_AcqSetTriggerLevel(c[1],threshold_voltage);
- rp_AcqSetTriggerDelay(delay);
- return 0;
-#else
- // initialization
- int start = osc_fpga_init();
- if(start)
- {
- printf("osc_fpga_init didn't work, retval = %d",start);
- return -1;
- }
-
- // set acquisition parameters
- osc_fpga_set_trigger_delay(delay);
- g_osc_fpga_reg_mem->data_dec = decimation;
- osc_fpga_reset();
- g_osc_fpga_reg_mem->chb_thr = osc_fpga_cnv_v_to_cnt(threshold_voltage); //sets trigger voltage
-#endif
- fprintf(stderr, "%s : %d\n", __FILE__, __LINE__);
- return 0;
-}
-
-int daq_end () {
-#ifdef DEBUG
- fprintf (stderr, "Server: end\n");
-#endif
-#ifdef MRP
- rp_Release();
-#else
- osc_fpga_exit();
-#endif
- return 0;
-}
-
-int daq_clear () {
-#ifdef DEBUG
- fprintf (stderr, "Server: clear\n");
-#endif
- return 0;
-}
-
-
-int16_t chdata[16*1024];
-float * chfdata = (float *) chdata;
-int daq_run (const char *par, char ** data, int *maxlen)
-
-{
-
- int *data_buf;
- int neve;
-
- unsigned short *sbuff = (unsigned short *) (par);
- unsigned short maxeve = sbuff[0];
- unsigned short nsamples = sbuff[1];
- unsigned short tout = sbuff[2];
- unsigned char trigger = par[6];
- unsigned char chmask = par[7];
- clock_t t,t0;
- neve = 0;
-
- t0=clock();
- int eventsize = 0;
- if (chmask & 0x1) eventsize += (nsamples+2);
- if (chmask & 0x2) eventsize += (nsamples+2);
- eventsize+=4;
- int required_size = eventsize * maxeve+3;
-
-#ifdef DEBUG
- time_t mtime;
- time(&mtime);
- fprintf (stderr, "daq_run:\tmaxeve %d\tnsamples=%d\ttimeout=%d\ttrigger=%d\tchmask=%d\t%s", maxeve ,nsamples,tout,trigger,chmask, ctime(&mtime)); //
-#endif
-
-
- if (required_size > *maxlen ) {
- free (*data);
- *data = (char *) malloc(required_size *sizeof(int));
- fprintf(stderr, "New Buffer with size %d allocated. Old size %d\n", required_size, *maxlen);
- *maxlen = required_size;
- }
-
- int *ibuf = (int *) (*data);
-
-
- data_buf = ibuf + 3;
- const int sleeptime = 135*nsamples/16386; //135 us for 16386 samples and to fill the 16k ADC buffer/
-
- for (int ieve=0; ieve < maxeve; ieve++)
- {
-
-#ifdef MRP
-
-rp_AcqStart();
-usleep(sleeptime);
-rp_AcqSetTriggerSrc(trigger);
-timer_out = FALSE;
-tmlnk (tout);
-rp_acq_trig_src_t source;
-do {
- rp_AcqGetTriggerSrc(&source);
- //printf("TRG %d src %d\n", trigger, source);
- if (timer_out || ctrl_c) break;
-} while (source == trigger);
-
-tmulk ();
-usleep(sleeptime);
-
-
-#else
-
- osc_fpga_arm_trigger();
- usleep(sleeptime);
- osc_fpga_set_trigger(trigger);
-
- while (g_osc_fpga_reg_mem->trig_source != 0){
- if (timer_out || ctrl_c) break;
- }
- // with this loop the program waits until the acquistion is completed before continue.
- int trig_ptr = g_osc_fpga_reg_mem->wr_ptr_trigger; // get pointer to mem. adress where trigger was met
- int * ch_signal[2];
- osc_fpga_get_sig_ptr(&ch_signal[0], &ch_signal[1]);
-#endif
- *(data_buf++) = 0x2;
- *(data_buf++) = chmask;
-
- for (int id = 0;id<2;id++){
- if ( !(chmask & (1 << id)) ) continue;
-
- *(data_buf++) = id;
- *(data_buf++) = nsamples;
-#ifdef MRP
- const int c[2] = {RP_CH_1, RP_CH_2};
- unsigned int isamples = nsamples;
- rp_AcqGetLatestDataV(c[id], &isamples, (float *) data_buf );
- data_buf+=nsamples;
-#else
-
- const int BUF = 16*1024;
- const int offset = 0;
- if (trig_ptr > (BUF-nsamples)) // Enter logic to transition from end to beginning of cha_signal buffer.
- {
- for (int i=trig_ptr;i<BUF;i++) *(data_buf++) = ch_signal[id][i]-offset;
- for (int i=0;i<nsamples-(BUF-trig_ptr);i++) *(data_buf++) = ch_signal[id][i]-offset;
- }
- else // Enter simple logic to send sampleSize from trigger point
- {
- for (int i=0;i<nsamples;i++) *(data_buf++) = ch_signal[id][trig_ptr + i]-offset;
- }
-#endif
- }
- *(data_buf++) = 0x3;
- *(data_buf++) = neve;
- neve++;
- if (ieve+1 % 500 == 0) fprintf(stderr, "Event %d\n", ieve);
- if (timer_out) break;
-
- }
-
-
-
- int *len = ibuf;
- int *nev = ibuf + 1;
- float *dt = (float *)(ibuf + 2);
-
- *len = (data_buf-len)*sizeof(int);
- *nev = neve;
- t = clock();
- *dt = t-t0;
- *dt /= CLOCKS_PER_SEC;
-
- return *len;
-}
-
-#define MAXLEN 0XFFFF
-struct RUNHDR {
- unsigned short neve;
- unsigned short nsamples;
- unsigned short tout;
- unsigned char trigger;
- unsigned char mask;
- int nloops ;
- int data [MAXLEN];
-} ;
-
-
-struct INIHDR {
- int delay ;
- int decimation;
- int threshold;
-};
-
-
-int daq_help(char *fname, struct INIHDR * i, struct RUNHDR *r, int verbosity){
-
- printf("-o filename ... output filename %s\n", fname);
- printf("-v verbose ... verbosity %d\n", verbosity);
- printf("-b decimation ... decimation %d\n", i->decimation);
- printf("-i timeout ... interrupt timeout %d\n", r->tout);
- printf("-s nsamples ... number of samples %d\n", r->nsamples);
- printf("-d delay ... delay %d\n", i->delay);
- printf("-t trigger ... trigger type %d\n", r->trigger);
- printf("-l level ... trigger level %f\n", i->threshold*0.001);
- printf("-m mask ... channel mask %d\n", r->mask );
- printf("-n neve ... number of events per call %d\n", r->neve);
- printf("-r nloops ... number of calls %d\n", r->nloops);
- return 0;
-}
-
-
-
-int daq_main( int argc , char ** argv) {
- // intercept routine
- if (signal (SIGINT, SigInt) == SIG_ERR) {
- perror ("sigignore");
- }
-
-
- char filename[0xFF]="";
-
-
-struct INIHDR inihdr = {
- .decimation = 1,
- .threshold = 100,
- .delay = 1024
-};
-
-
-
-struct RUNHDR runhdr;
-
-
- runhdr.neve =10000;
- runhdr.nsamples = 1024;
- runhdr.tout = 1000;
- runhdr.trigger = 1;
- runhdr.mask = 0x1;
- runhdr.nloops = 1;
-
- int verbose = 0;
- int argdata = 0;
-
- if (argc <2) {
- daq_help(filename, &inihdr, &runhdr, verbose);
- exit(-1);
- }
-
- opterr = 0;
- int c;
- while ((c = getopt (argc, argv, "o:v:b:i:s:d:t:l:m:n:r:h")) != -1)
- switch (c) {
- case 'o':
- sprintf(filename,"%s", optarg );
- break; // output
- case 'v':
- verbose = strtoul (optarg,NULL,0);
- break; // verbosity
- case 'b':
- inihdr.decimation = strtoul (optarg,NULL,0);
- break;
- case 'i':
- runhdr.tout = strtoul (optarg,NULL,0);
- break;
- case 's':
- runhdr.nsamples = strtoul (optarg,NULL,0);
- break;
- case 'd':
- inihdr.delay = strtoul (optarg,NULL,0);
- break;
- case 't':
- runhdr.trigger = strtoul (optarg,NULL,0);
- break;
- case 'm':
- runhdr.mask = strtoul (optarg,NULL,0);
- break;
- case 'n':
- runhdr.neve = atoi (optarg);
- break;
- case 'r':
- runhdr.nloops = atoi (optarg);
- break;
- case 'l':
- inihdr.threshold = (int) (1000*atof (optarg));
- break;
- case 'h':
- daq_help(filename, &inihdr, &runhdr, verbose);
- break;
- case '?':
- if (optopt == 'c')
- fprintf (stderr, "Option -%c requires an argument.\n", optopt);
- else if (isprint (optopt))
- fprintf (stderr, "Unknown option `-%c'.\n", optopt);
- else
- fprintf (stderr,
- "Unknown option character `\\x%x'.\n",
- optopt);
- return 1;
- default:
- abort ();
- }
- for (int i=optind; i<argc; i++) argdata = strtoul (argv[i],NULL,0);
- if (verbose) daq_help(filename, &inihdr, &runhdr, verbose);
-
- printf("argdata %d nloops %d\n",argdata,runhdr.nloops);
-
- daq_init((char *)&inihdr);
- FILE *fp=NULL;
- if (strlen(filename)>0) fp = fopen(filename, "wb");
-
-
- int maxlen = MAXLEN;
- char *data = (char *) malloc(maxlen * sizeof(int));
- time_t t,tstart;
- time(&tstart);
-
- for (int i=0;i< runhdr.nloops;i++){
- int nb =daq_run((const char*) &runhdr, &data, &maxlen);
- if (ctrl_c) break;
- time(&t);
- fprintf(stderr, "Loop %d dt=%d s\n", i, (int)(t-tstart));
-
- if (fp) {
- fprintf(stderr, "Writing %d to %s", nb, filename);
- fwrite(data, 1, nb, fp);
- }
-
- }
- time(&t);
- fprintf(stderr, "Total events %d in %d s\n", runhdr.nloops*runhdr.neve, (int)(t-tstart));
- if (fp) fclose(fp);
- if (data!=NULL) free(data);
- return 0;
-}