Skip to content
Snippets Groups Projects
Commit 1d66db36 authored by Horst Schirmeier's avatar Horst Schirmeier
Browse files

visualfail: UNIX line endings

Change-Id: I5d26ec25d070e98b977ff3130c597a388a4c2c96
parent ea4c350b
No related branches found
No related tags found
No related merge requests found
<?php
//Datenbank
$host = "localhost";
$username = "";
$password = "";
$database = "";
// Name der result-Tabelle
$result_table = "result";
?>
<?php
//Datenbank
$host = "localhost";
$username = "";
$password = "";
$database = "";
// Name der result-Tabelle
$result_table = "result";
?>
This diff is collapsed.
body {
min-height: 2000px;
padding-top: 70px;
}
/* Custom container */
.container-full {
margin: 0 auto;
padding: 0 15px;
width: 100%;
}
.logo {
padding: 0 0 0 30px;
}
#analyse {
margin: 20px 0 0 0;
body {
min-height: 2000px;
padding-top: 70px;
}
/* Custom container */
.container-full {
margin: 0 auto;
padding: 0 15px;
width: 100%;
}
.logo {
padding: 0 0 0 30px;
}
#analyse {
margin: 20px 0 0 0;
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title>Visual FAIL*</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/myStyle.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy this line! -->
<!--[if lt IE 9]><script src="../../docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Fixed navbar -->
<div class="container-full">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--<div class="container"> -->
<!--<a class="navbar-brand" href="#">Visual FAIL*</a>-->
<img class="navbar-brand logo" src="images/logos/visualfaillogo_klein.png" alt="Visual Fail* logo" />
<!--</div>-->
</div>
<div class="container">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Rückabbildung</a></li>
<li><a href="#about">Aggregation</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Tools <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="adminer-3.7.1.php" target="_blank">Adminer</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="row">
<div class="col-md-2">
<!-- Main component for a primary marketing message or call to action -->
<div class="panel panel-default">
<div class="panel-heading">Färbung</div>
<div class="panel-body">
<select class="form-control" id="faerbung">
<option value="onlyRightEdge">Rechter Rand(trace.instr2)</option>
<option value="latestip">Letzte Instruktion(result.latest_ip)</option>
<option value="normal">Äquivalenzklassen</option>
</select>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Benchmark</div>
<div class="panel-body">
<select class="form-control" id="binary">
<option></option>
</select>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Variante</div>
<div class="panel-body">
<select class="form-control" id="variant">
<option></option>
</select>
<div class="text-center">
<button type="button" class="btn btn-default btn-lg" id="analyse">Analyse</button>
</div>
</div>
</div>
</div>
<div class="col-md-10">
<div class="panel-body">
<div class="row">
<div class="col-md-6">
<div class="btn-group" id="fehlertypenset" data-toggle="buttons">
</div>
</div>
<div class="col-md-6">
<select class="form-control" id="sourceFiles">
<option></option>
</select>
</div>
</div>
</div>
<div class="row">
<pre class="container col-md-6" id="asm">
</pre>
<pre class="container col-md-6" id="hcode">
</pre>
</div>
</div>
</div>
</div> <!-- /container-full -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/myscript.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title>Visual FAIL*</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/myStyle.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy this line! -->
<!--[if lt IE 9]><script src="../../docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Fixed navbar -->
<div class="container-full">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--<div class="container"> -->
<!--<a class="navbar-brand" href="#">Visual FAIL*</a>-->
<img class="navbar-brand logo" src="images/logos/visualfaillogo_klein.png" alt="Visual Fail* logo" />
<!--</div>-->
</div>
<div class="container">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Rückabbildung</a></li>
<li><a href="#about">Aggregation</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Tools <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="adminer-3.7.1.php" target="_blank">Adminer</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="row">
<div class="col-md-2">
<!-- Main component for a primary marketing message or call to action -->
<div class="panel panel-default">
<div class="panel-heading">Färbung</div>
<div class="panel-body">
<select class="form-control" id="faerbung">
<option value="onlyRightEdge">Rechter Rand(trace.instr2)</option>
<option value="latestip">Letzte Instruktion(result.latest_ip)</option>
<option value="normal">Äquivalenzklassen</option>
</select>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Benchmark</div>
<div class="panel-body">
<select class="form-control" id="binary">
<option></option>
</select>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Variante</div>
<div class="panel-body">
<select class="form-control" id="variant">
<option></option>
</select>
<div class="text-center">
<button type="button" class="btn btn-default btn-lg" id="analyse">Analyse</button>
</div>
</div>
</div>
</div>
<div class="col-md-10">
<div class="panel-body">
<div class="row">
<div class="col-md-6">
<div class="btn-group" id="fehlertypenset" data-toggle="buttons">
</div>
</div>
<div class="col-md-6">
<select class="form-control" id="sourceFiles">
<option></option>
</select>
</div>
</div>
</div>
<div class="row">
<pre class="container col-md-6" id="asm">
</pre>
<pre class="container col-md-6" id="hcode">
</pre>
</div>
</div>
</div>
</div> <!-- /container-full -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/myscript.js"></script>
</body>
</html>
$.ajaxSetup({
async: false
});
//Umwandlung von dezimal zu hexadezimal
function dec2hex(dec) {
var hex = "";
if (dec < 0) {
dec = 0xFFFFFFFF + dec + 1;
}
hex = parseInt(dec, 10).toString(16);
return hex;
}
//Berechne den Farbwert (z.B.: #FFFFFF) fuer gegebene Fehlerwerte
function calcColor(fehler, maxFehler) {
//console.log("Farbe Fehler: " + fehler + " Max: " + maxFehler);
var part = 0;
if (fehler != 0) {
var x = 255/Math.log(maxFehler);
part = x*Math.log(fehler);
}
//console.log("Farbe Fehler: " + fehler + " Max: " + maxFehler + " Part: " + part);
var hex = dec2hex(255-part);
//console.log("Farbe Fehler: " + fehler + " Max: " + maxFehler + " Part: " + part + " Farbcode: " + ("#FF" + hex + hex));
if (hex >= 0 && hex <= 9 ) {
return "#FF" + hex + hex + hex + hex;
} else {
return "#FF" + hex + hex;
}
}
//Tooltip für Instruktionszeilen mit Fehler
$('body').popover({
selector: ".hasFehler",
html: true,
title: function() { return $(this).attr("id"); },
content: function() {
var ausgabe = '';
var caller = $(this);
$.getJSON("core.php", {kommando: 'getResultTypes'}, function(data) {
$.each(data, function(key, val) {
ausgabe = ausgabe + val +': ' + caller.attr(val) + '<br>';
});
});
return ausgabe;
}
});
//Einblenden des Modal "Loading" fuer Ajax Requests
/*$(document).ajaxStart(function(){
//console.log("ajaxstart");
$("body").addClass("loading");
}).ajaxStop(function(){
//console.log("ajaxstop");
$("body").removeClass("loading");
});*/
//User-Interaktionen nachdem das DOM geladen ist
$(document).ready(function() {
//DB check
$.getJSON("core.php", {kommando: 'dbTest'}, function(data) {
if(data != "ok") {
$('html').html(data);
}
});
//Holen der Binarys, die in der DB in der Tabelle Variant vorkommen
$.getJSON("core.php", {kommando: 'getBinarys'}, function(data) {
$.each(data, function(key, val) {
$('#binary').append('<option value="' + val + '">' + val + '</option>');
});
});
//Auswahl eines Eintrages aus den Source-Files für die Darstellung des Hochsprachencode
$('#sourceFiles').change(function() {
if($(this).val() != 'none') {
$.getJSON("core.php", {kommando: 'getHighlevelCode', variant_id: $('#variant').val(), file_id: $(this).val(), version: $('#faerbung').val()}, function(data) {
$('#hcode').html(data);
$('.maxFehlerMapping').on( "calcColor", function( event, newMaxFehler, activeFehlertypes) {
var newFehler = 0;
var actualRow = $(this);
$.each(activeFehlertypes, function(key, val) {
newFehler = newFehler + parseInt(actualRow.attr(val));
});
console.log("jepp" + newMaxFehler + " " + newFehler);
$(this).prev().prev().prev().css("background-color", calcColor(newFehler, newMaxFehler))
.css('cursor', 'pointer');
});
$('.hasFehler').on( "calcColor", function( event, newMaxFehler, activeFehlertypes) {
var newFehler = 0;
var actualRow = $(this);
$.each(activeFehlertypes, function(key, val) {
newFehler = newFehler + parseInt(actualRow.attr(val));
});
$(this).css("background-color", calcColor(newFehler, newMaxFehler))
.css('cursor', 'pointer');
});
});
setTimeout(function(){
var activeFehlertypes = new Array();
var newMaxFehler = 0;
$('#fehlertypenset > .active').each(function(){
activeFehlertypes.push($(this).attr("id"));
//console.log("Hinzugefuegt: " + $(this).attr("id"));
});
$.each(activeFehlertypes,function(key, name){
//Neuen MaxFehler berechnen
newMaxFehler = newMaxFehler + parseInt($('#maxFehler').attr(name));
});
$('.hasFehler').trigger('calcColor', [ newMaxFehler, activeFehlertypes ]);
$('.maxFehlerMapping').trigger('calcColor', [ newMaxFehler, activeFehlertypes ]);
},100);
}
});
//Auswahl eines Eintrages aus den Binarys für die Darstellung des Assembler-Code
$('#binary').change(function() {
if($(this).val() != 'none') {
$('#variant').html('<option value="none" selected="selected"></option>');
$.getJSON("core.php", {kommando: 'getVariants', datei: $(this).val()}, function(data) {
$.each(data, function(key, val) {
$('#variant').append('<option value="' + key + '">' + val + '</option>');
});
});
}
});
//Analyse Button wird gedrueckt
$('#analyse').button().click( function () {
$.getJSON("core.php", {kommando: 'getAsmCode', variant_id: $('#variant').val(), version: $('#faerbung').val()}, function(data) {
$('#asm').html(data);
});
$.getJSON("core.php", {kommando: 'getSourceFiles', variant: $('#variant').val()}, function(data) {
$.each(data, function(key, val) {
$('#sourceFiles').append('<option value="' + key + '">' + val + '</option>');
});
});
$.getJSON("core.php", {kommando: 'getResultTypes'}, function(data) {
$('#fehlertypenset').html('');
$.each(data, function(key, val) {
$('#fehlertypenset').append('<label class="btn btn-default" id="' + val + '"><input type="checkbox" id="' + val + '">' + val + '</label>');
//$('#'+ val +'.btn').button('toggle');
});
$('.hasFehler').on( "calcColor", function( event, newMaxFehler, activeFehlertypes) {
var newFehler = 0;
var actualRow = $(this);
$.each(activeFehlertypes, function(key, val) {
newFehler = newFehler + parseInt(actualRow.attr(val));
});
$(this).css("background-color", calcColor(newFehler, newMaxFehler))
.css('cursor', 'pointer');
});
//Auf Änderungen bzgl. des Fehler-Buttonset horchen
$('#fehlertypenset input[type=checkbox]').change(function() {setTimeout(function(){
//console.log("aenderung!");
var activeFehlertypes = new Array();
var newMaxFehler = 0;
$('#fehlertypenset > .active').each(function(){
activeFehlertypes.push($(this).attr("id"));
});
$.each(activeFehlertypes,function(key, name){
//Neuen MaxFehler berechnen
newMaxFehler = newMaxFehler + parseInt($('#maxFehler').attr(name));
});
$('.hasFehler').trigger('calcColor', [ newMaxFehler, activeFehlertypes ]);
$('.maxFehlerMapping').trigger('calcColor', [ newMaxFehler, activeFehlertypes ]);
},100)});
});
});
});
$.ajaxSetup({
async: false
});
//Umwandlung von dezimal zu hexadezimal
function dec2hex(dec) {
var hex = "";
if (dec < 0) {
dec = 0xFFFFFFFF + dec + 1;
}
hex = parseInt(dec, 10).toString(16);
return hex;
}
//Berechne den Farbwert (z.B.: #FFFFFF) fuer gegebene Fehlerwerte
function calcColor(fehler, maxFehler) {
//console.log("Farbe Fehler: " + fehler + " Max: " + maxFehler);
var part = 0;
if (fehler != 0) {
var x = 255/Math.log(maxFehler);
part = x*Math.log(fehler);
}
//console.log("Farbe Fehler: " + fehler + " Max: " + maxFehler + " Part: " + part);
var hex = dec2hex(255-part);
//console.log("Farbe Fehler: " + fehler + " Max: " + maxFehler + " Part: " + part + " Farbcode: " + ("#FF" + hex + hex));
if (hex >= 0 && hex <= 9 ) {
return "#FF" + hex + hex + hex + hex;
} else {
return "#FF" + hex + hex;
}
}
//Tooltip für Instruktionszeilen mit Fehler
$('body').popover({
selector: ".hasFehler",
html: true,
title: function() { return $(this).attr("id"); },
content: function() {
var ausgabe = '';
var caller = $(this);
$.getJSON("core.php", {kommando: 'getResultTypes'}, function(data) {
$.each(data, function(key, val) {
ausgabe = ausgabe + val +': ' + caller.attr(val) + '<br>';
});
});
return ausgabe;
}
});
//Einblenden des Modal "Loading" fuer Ajax Requests
/*$(document).ajaxStart(function(){
//console.log("ajaxstart");
$("body").addClass("loading");
}).ajaxStop(function(){
//console.log("ajaxstop");
$("body").removeClass("loading");
});*/
//User-Interaktionen nachdem das DOM geladen ist
$(document).ready(function() {
//DB check
$.getJSON("core.php", {kommando: 'dbTest'}, function(data) {
if(data != "ok") {
$('html').html(data);
}
});
//Holen der Binarys, die in der DB in der Tabelle Variant vorkommen
$.getJSON("core.php", {kommando: 'getBinarys'}, function(data) {
$.each(data, function(key, val) {
$('#binary').append('<option value="' + val + '">' + val + '</option>');
});
});
//Auswahl eines Eintrages aus den Source-Files für die Darstellung des Hochsprachencode
$('#sourceFiles').change(function() {
if($(this).val() != 'none') {
$.getJSON("core.php", {kommando: 'getHighlevelCode', variant_id: $('#variant').val(), file_id: $(this).val(), version: $('#faerbung').val()}, function(data) {
$('#hcode').html(data);
$('.maxFehlerMapping').on( "calcColor", function( event, newMaxFehler, activeFehlertypes) {
var newFehler = 0;
var actualRow = $(this);
$.each(activeFehlertypes, function(key, val) {
newFehler = newFehler + parseInt(actualRow.attr(val));
});
console.log("jepp" + newMaxFehler + " " + newFehler);
$(this).prev().prev().prev().css("background-color", calcColor(newFehler, newMaxFehler))
.css('cursor', 'pointer');
});
$('.hasFehler').on( "calcColor", function( event, newMaxFehler, activeFehlertypes) {
var newFehler = 0;
var actualRow = $(this);
$.each(activeFehlertypes, function(key, val) {
newFehler = newFehler + parseInt(actualRow.attr(val));
});
$(this).css("background-color", calcColor(newFehler, newMaxFehler))
.css('cursor', 'pointer');
});
});
setTimeout(function(){
var activeFehlertypes = new Array();
var newMaxFehler = 0;
$('#fehlertypenset > .active').each(function(){
activeFehlertypes.push($(this).attr("id"));
//console.log("Hinzugefuegt: " + $(this).attr("id"));
});
$.each(activeFehlertypes,function(key, name){
//Neuen MaxFehler berechnen
newMaxFehler = newMaxFehler + parseInt($('#maxFehler').attr(name));
});
$('.hasFehler').trigger('calcColor', [ newMaxFehler, activeFehlertypes ]);
$('.maxFehlerMapping').trigger('calcColor', [ newMaxFehler, activeFehlertypes ]);
},100);
}
});
//Auswahl eines Eintrages aus den Binarys für die Darstellung des Assembler-Code
$('#binary').change(function() {
if($(this).val() != 'none') {
$('#variant').html('<option value="none" selected="selected"></option>');
$.getJSON("core.php", {kommando: 'getVariants', datei: $(this).val()}, function(data) {
$.each(data, function(key, val) {
$('#variant').append('<option value="' + key + '">' + val + '</option>');
});
});
}
});
//Analyse Button wird gedrueckt
$('#analyse').button().click( function () {
$.getJSON("core.php", {kommando: 'getAsmCode', variant_id: $('#variant').val(), version: $('#faerbung').val()}, function(data) {
$('#asm').html(data);
});
$.getJSON("core.php", {kommando: 'getSourceFiles', variant: $('#variant').val()}, function(data) {
$.each(data, function(key, val) {
$('#sourceFiles').append('<option value="' + key + '">' + val + '</option>');
});
});
$.getJSON("core.php", {kommando: 'getResultTypes'}, function(data) {
$('#fehlertypenset').html('');
$.each(data, function(key, val) {
$('#fehlertypenset').append('<label class="btn btn-default" id="' + val + '"><input type="checkbox" id="' + val + '">' + val + '</label>');
//$('#'+ val +'.btn').button('toggle');
});
$('.hasFehler').on( "calcColor", function( event, newMaxFehler, activeFehlertypes) {
var newFehler = 0;
var actualRow = $(this);
$.each(activeFehlertypes, function(key, val) {
newFehler = newFehler + parseInt(actualRow.attr(val));
});
$(this).css("background-color", calcColor(newFehler, newMaxFehler))
.css('cursor', 'pointer');
});
//Auf Änderungen bzgl. des Fehler-Buttonset horchen
$('#fehlertypenset input[type=checkbox]').change(function() {setTimeout(function(){
//console.log("aenderung!");
var activeFehlertypes = new Array();
var newMaxFehler = 0;
$('#fehlertypenset > .active').each(function(){
activeFehlertypes.push($(this).attr("id"));
});
$.each(activeFehlertypes,function(key, name){
//Neuen MaxFehler berechnen
newMaxFehler = newMaxFehler + parseInt($('#maxFehler').attr(name));
});
$('.hasFehler').trigger('calcColor', [ newMaxFehler, activeFehlertypes ]);
$('.maxFehlerMapping').trigger('calcColor', [ newMaxFehler, activeFehlertypes ]);
},100)});
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment