Browse Source

more tests about ajax and update from service but no chance

master
Ivan Hörler 1 year ago
parent
commit
095e8033e4
4 changed files with 173 additions and 148 deletions
  1. +2
    -2
      Client/Client/MainWindow.xaml.cs
  2. +5
    -1
      EHEC_Server/EHEC_Server/Service.svc.cs
  3. +153
    -144
      EHEC_Server/EHEC_Server/cluster.aspx
  4. +13
    -1
      EHEC_Server/EHEC_Server/cluster.aspx.cs

+ 2
- 2
Client/Client/MainWindow.xaml.cs View File

@@ -59,6 +59,7 @@ namespace Client
}
private void ButtonSend_Click(object sender, RoutedEventArgs e)
{
LabelRueckmeldungsfeld.Content = "Sende Daten... ";
// wenn die Anzahl im Feld "mehrere Automatisch generieren"
// grösser ist als 0 dann erstelle diese Anzahl automatisch.
// hierzu wird nur die Anzahl an den Server übertragen und
@@ -106,7 +107,6 @@ namespace Client
{
try
{
LabelRueckmeldungsfeld.Content = "Sende Daten. ";
// 1. Doctor
Doctor newDoctor = new Doctor(TextboxArztVorname.Text,
TextboxArztName.Text,
@@ -269,7 +269,7 @@ namespace Client
catch (Exception ex)
{
LabelRueckmeldungsfeld.Content = "Fehler in der löschung der felder";
System.Diagnostics.Trace.WriteLine(" --e-- Error in Client Save: " + ex);
System.Diagnostics.Trace.WriteLine(" --e-- Error in Client CleanExam: " + ex);
}
}
private void ButtonAutogenerateOne_Click(object sender, RoutedEventArgs e)


+ 5
- 1
EHEC_Server/EHEC_Server/Service.svc.cs View File

@@ -4,6 +4,9 @@ using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;


namespace EHEC_Server
@@ -89,7 +92,8 @@ namespace EHEC_Server

public void ReloadCluster()
{
cluster c = new cluster();
c.Refresh();
}
}
}

+ 153
- 144
EHEC_Server/EHEC_Server/cluster.aspx View File

@@ -1,160 +1,169 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="cluster.aspx.cs" Inherits="EHEC_Server.cluster" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head runat="server">
<title>CS-EHEC-II</title>
<script type="text/javascript" src="cluster_dependencies/jquery/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="cluster_dependencies/bootstrap/css/bootstrap.css" />
<script type="text/javascript" src="cluster_dependencies/bootstrap/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript" src="cluster_dependencies/visjs/dist/vis.js"></script>
<link href="cluster_dependencies/visjs/dist/vis.css" rel="stylesheet" type="text/css" />
<link href="cluster_dependencies/visjs/dist/vis-network.min.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#mynetwork {
width: 800px;
height: 800px;
border: 1px solid lightgray;
background-color: black
}
#infomessage {
font-family: Arial;
font-weight:bold
}
#buttons {
width: 119px;
}
#stabilisationBox {
width: 175px;
}
</style>

</head>
<body>
<div>
<h1>EHEC Clusteranalysis</h1>
</div>
<form id="form1" runat="server">
<asp:Button
ID="Button1"
runat="server"
Text="reload"
OnClick="Button1_Click"
Font-Bold="true"
ForeColor="DodgerBlue"
Height="25"
Width="80"
/>
</form>
<br />
<div id="mynetwork"></div>
<script type="text/javascript"> <%-- <%=Clusterdata%> --%>
// create an array with nodes
var nodes = new vis.DataSet(<%=ClusterNodes%>);
// create an array with edges
var edges = new vis.DataSet(<%=ClusterEdges%>);
// create a network
var container = document.getElementById('mynetwork');
// provide data in the normal fashion
var data = {
nodes: nodes,
edges: edges
};
//var options = {};
var options = {
autoResize: true,
height: '100%',
width: '100%',
physics: {
enabled: true,
forceAtlas2Based: {
gravitationalConstant: -50,
centralGravity: 0.01,
springConstant: 0.08,
springLength: 100,
damping: 0.4,
avoidOverlap: 0.5
},
maxVelocity: 50,
minVelocity: 0.1,
solver: 'forceAtlas2Based',
stabilization: {
enabled: true,
iterations: 1000,
updateInterval: 100,
onlyDynamicEdges: false,
fit: true
},
timestep: 0.5,
adaptiveTimestep: true
},
layout: {
//randomSeed: undefined,
improvedLayout: true,
hierarchical: {
enabled: false,
levelSeparation: 250,
nodeSpacing: 500,
treeSpacing: 100,
blockShifting: true,
edgeMinimization: true,
parentCentralization: true,
direction: 'UD', // UD, DU, LR, RL
sortMethod: 'directed' // hubsize, directed
<head runat="server">
<title>CS-EHEC-II</title>
<script type="text/javascript" src="cluster_dependencies/jquery/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="cluster_dependencies/bootstrap/css/bootstrap.css" />
<script type="text/javascript" src="cluster_dependencies/bootstrap/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript" src="cluster_dependencies/visjs/dist/vis.js"></script>
<link href="cluster_dependencies/visjs/dist/vis.css" rel="stylesheet" type="text/css" />
<link href="cluster_dependencies/visjs/dist/vis-network.min.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#mynetwork {
width: 800px;
height: 800px;
border: 1px solid lightgray;
background-color: black
}
#infomessage {
font-family: Arial;
font-weight:bold
}
#buttons {
width: 119px;
}
#stabilisationBox {
width: 175px;
}
</style>
</head>
<body>
<div>
<h1>EHEC Clusteranalysis</h1>
</div>
<form id="form1" runat="server">
<%--<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/cluster.aspx" />
</Services>
</asp:ScriptManager>
<script type="text/javascript">
function RefreshPage()
{
window.location.reload();
console.log("reload..");
}
},
groups: {
result: {
shape: 'triangle',
size: 40,
color: {
background: 'red'
</script>--%>
<asp:Button
ID="Button1"
runat="server"
Text="reload"
OnClick="Button1_Click"
Font-Bold="true"
ForeColor="DodgerBlue"
Height="25"
Width="80"
/>
</form>
<br />
<div id="mynetwork"></div>
<script type="text/javascript"> <%-- <%=Clusterdata%> --%>
// create an array with nodes
var nodes = new vis.DataSet(<%=ClusterNodes%>);
// create an array with edges
var edges = new vis.DataSet(<%=ClusterEdges%>);
// create a network
var container = document.getElementById('mynetwork');
// provide data in the normal fashion
var data = {
nodes: nodes,
edges: edges
};
//var options = {};
var options = {
autoResize: true,
height: '100%',
width: '100%',
physics: {
enabled: true,
forceAtlas2Based: {
gravitationalConstant: -50,
centralGravity: 0.01,
springConstant: 0.08,
springLength: 100,
damping: 0.4,
avoidOverlap: 1
},
font: {
color: '#FFFFFF'
maxVelocity: 50,
minVelocity: 0.1,
solver: 'forceAtlas2Based',
stabilization: {
enabled: true,
iterations: 1000,
updateInterval: 100,
onlyDynamicEdges: false,
fit: true
},
borderWidth: 1
timestep: 0.5,
adaptiveTimestep: true
},
layout: {
//randomSeed: undefined,
improvedLayout: true,
hierarchical: {
enabled: false,
levelSeparation: 250,
nodeSpacing: 500,
treeSpacing: 100,
blockShifting: true,
edgeMinimization: true,
parentCentralization: true,
direction: 'UD', // UD, DU, LR, RL
sortMethod: 'directed' // hubsize, directed
}
},
origin: {
shape: 'star',
size: 40,
color: {
background: 'green'
groups: {
result: {
shape: 'triangle',
size: 40,
color: {
background: 'red'
},
font: {
color: '#FFFFFF'
},
borderWidth: 1
},
font: {
color: '#FFFFFF'
origin: {
shape: 'star',
size: 40,
color: {
background: 'green'
},
font: {
color: '#FFFFFF'
},
borderWidth: 1
},
borderWidth: 1
patient: {
shape: 'ellipse',
size: 60,
color: {
background: 'yellow'
},
font: {
color: '#111111'
},
borderWidth: 1
}
},
patient: {
shape: 'ellipse',
size: 60,
color: {
background: 'yellow',
},
nodes: {
borderWidth: 1,
borderWidthSelected: 2,
font: {
color: '#111111'
},
borderWidth: 1
}
},
nodes: {
borderWidth: 1,
borderWidthSelected: 2,
font: {
size: 26
size: 26
}
},
edges: {
hoverWidth: function (width) {return width+1;}
}
},
edges: {
hoverWidth: function (width) {return width+1;},
}

};
};

// initialize your network!
var network = new vis.Network(container, data, options);
// initialize your network!
var network = new vis.Network(container, data, options);

</script>
</body>
</script>
</body>
</html>

+ 13
- 1
EHEC_Server/EHEC_Server/cluster.aspx.cs View File

@@ -17,20 +17,32 @@ namespace EHEC_Server
ClusterConverter cc = new ClusterConverter();
protected void Page_Load(object sender, EventArgs e)
{
System.Diagnostics.Trace.WriteLine(" --i-- Cluster Pageload: generating page...");
//Clusterdata = JsonConvert.SerializeObject(cc.WriteJson());
ClusterNodes = cc.WriteJsonNodes();
ClusterEdges = cc.WriteJsonEdges();
//ClusterNodes = JsonConvert.SerializeObject(clusterNodes.GetNodes());
//ClusterEdges = JsonConvert.SerializeObject(clusterEdges.GetEdges());
}
protected void Button1_Click(object sender, EventArgs e)
public void Button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Trace.WriteLine(" --i-- Cluster Click: refreshing data...");
//Clusterdata = JsonConvert.SerializeObject(cc.WriteJson());
ClusterNodes = cc.WriteJsonNodes();
ClusterEdges = cc.WriteJsonEdges();
//ClusterNodes = JsonConvert.SerializeObject(clusterNodes.GetNodes());
//ClusterEdges = JsonConvert.SerializeObject(clusterEdges.GetEdges());
}
public void Refresh()
{
System.Diagnostics.Trace.WriteLine(" --i-- Cluster Refresh: refreshing page...");
//ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "text", "RefreshPage()", true);
//ClientScript.RegisterStartupScript(GetType(), "hwa", "alert('Hello World');", true);
//ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "RefreshPage()", true);
//Response.Redirect(Request.RawUrl);
//Response.Redirect(Request.Url.AbsoluteUri);
//Server.TransferRequest(Request.Url.AbsolutePath, false);
}

}
}

Loading…
Cancel
Save