Merge branch 'develop' of https://github.com/KettlerX7AvansA5/ErgometerDoctorApplication into develop
This commit is contained in:
@@ -28,13 +28,13 @@ namespace ErgometerDoctorApplication
|
|||||||
|
|
||||||
this.Location = new System.Drawing.Point(0, 0);
|
this.Location = new System.Drawing.Point(0, 0);
|
||||||
|
|
||||||
this.Size = new System.Drawing.Size(250, 200);
|
this.Size = new System.Drawing.Size(400, 250);
|
||||||
this.Controls.Add(chart);
|
this.Controls.Add(chart);
|
||||||
|
|
||||||
this.series = createSerie();
|
this.series = createSerie();
|
||||||
this.chartArea.Name = "chartArea";
|
this.chartArea.Name = "chartArea";
|
||||||
|
|
||||||
this.chart.Size = new System.Drawing.Size(250, 200);
|
this.chart.Size = new System.Drawing.Size(400, 250);
|
||||||
|
|
||||||
this.chart.Dock = DockStyle.Fill;
|
this.chart.Dock = DockStyle.Fill;
|
||||||
this.chart.Series.Add(series);
|
this.chart.Series.Add(series);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace ErgometerDoctorApplication
|
|||||||
window.Invoke(window.updateMetingen, new Object[] { command.Meting });
|
window.Invoke(window.updateMetingen, new Object[] { command.Meting });
|
||||||
break;
|
break;
|
||||||
case NetCommand.CommandType.CHAT:
|
case NetCommand.CommandType.CHAT:
|
||||||
ChatMessage chat = new ChatMessage(command.DisplayName, command.ChatMessage, false);
|
ChatMessage chat = new ChatMessage(command.DisplayName, command.ChatMessage, command.IsDoctor);
|
||||||
Chat.Add(chat);
|
Chat.Add(chat);
|
||||||
window.panelClientChat.Invoke(window.panelClientChat.passChatMessage, new Object[] { chat });
|
window.panelClientChat.Invoke(window.panelClientChat.passChatMessage, new Object[] { chat });
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ namespace ErgometerDoctorApplication
|
|||||||
private System.Windows.Forms.Panel panel2;
|
private System.Windows.Forms.Panel panel2;
|
||||||
private System.Windows.Forms.Label label1;
|
private System.Windows.Forms.Label label1;
|
||||||
private System.Windows.Forms.Panel panel1;
|
private System.Windows.Forms.Panel panel1;
|
||||||
private System.Windows.Forms.Button button1;
|
public System.Windows.Forms.Button button1;
|
||||||
private System.Windows.Forms.RichTextBox richTextBox1;
|
public System.Windows.Forms.RichTextBox richTextBox1;
|
||||||
private System.Windows.Forms.Label label2;
|
private System.Windows.Forms.Label label2;
|
||||||
private System.Windows.Forms.Panel panel3;
|
private System.Windows.Forms.Panel panel3;
|
||||||
private System.Windows.Forms.Label connectionLabel;
|
private System.Windows.Forms.Label connectionLabel;
|
||||||
@@ -153,7 +153,7 @@ namespace ErgometerDoctorApplication
|
|||||||
if (richTextBox1.TextLength > 1)
|
if (richTextBox1.TextLength > 1)
|
||||||
{
|
{
|
||||||
AddChatItem(new ChatMessage("Doctor", richTextBox1.Text, true));
|
AddChatItem(new ChatMessage("Doctor", richTextBox1.Text, true));
|
||||||
MainClient.SendNetCommand(new NetCommand(richTextBox1.Text, Session));
|
MainClient.SendNetCommand(new NetCommand(richTextBox1.Text, true, Session));
|
||||||
richTextBox1.ResetText();
|
richTextBox1.ResetText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,8 +42,11 @@ namespace ErgometerDoctorApplication
|
|||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
if (!ActiveSession)
|
if(! ActiveSession)
|
||||||
panelClientChat.Visible = false;
|
{
|
||||||
|
panelClientChat.richTextBox1.Enabled = false;
|
||||||
|
panelClientChat.button1.Enabled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClientApplicatie_Resize(object sender, EventArgs e)
|
public void ClientApplicatie_Resize(object sender, EventArgs e)
|
||||||
|
|||||||
@@ -9,18 +9,57 @@ namespace ErgometerDoctorApplication
|
|||||||
{
|
{
|
||||||
public class ConSessionHistory : Panel
|
public class ConSessionHistory : Panel
|
||||||
{
|
{
|
||||||
|
private FlowLayoutPanel flowlayout;
|
||||||
|
|
||||||
public ConSessionHistory() : base()
|
public ConSessionHistory() : base()
|
||||||
{
|
{
|
||||||
//
|
labelSessionHistory = new Label();
|
||||||
// ConSessionLibrary
|
|
||||||
//
|
|
||||||
this.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.Location = new System.Drawing.Point(0, 0);
|
this.Location = new System.Drawing.Point(0, 0);
|
||||||
this.Name = "ConSessionHistory";
|
this.Name = "ConSessionHistory";
|
||||||
this.Size = new System.Drawing.Size(584, 459);
|
this.Size = new System.Drawing.Size(584, 459);
|
||||||
this.TabIndex = 0;
|
this.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// labelSessionHistory
|
||||||
|
//
|
||||||
|
this.labelSessionHistory.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||||
|
this.labelSessionHistory.AutoSize = true;
|
||||||
|
this.labelSessionHistory.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.labelSessionHistory.Location = new System.Drawing.Point(0, 50);
|
||||||
|
this.labelSessionHistory.Name = "labelSessionHistory";
|
||||||
|
this.labelSessionHistory.Size = new System.Drawing.Size(103, 21);
|
||||||
|
this.labelSessionHistory.TabIndex = 3;
|
||||||
|
this.labelSessionHistory.Text = "Er zijn geen oude sessies.";
|
||||||
|
|
||||||
this.BackColor = System.Drawing.Color.Yellow;
|
flowlayout = new FlowLayoutPanel();
|
||||||
|
|
||||||
|
flowlayout.Dock = DockStyle.Fill;
|
||||||
|
flowlayout.BackColor = System.Drawing.Color.DarkGray;
|
||||||
|
flowlayout.Location = new System.Drawing.Point(0, 0);
|
||||||
|
flowlayout.Name = "flowlayout";
|
||||||
|
flowlayout.Padding = new Padding(15);
|
||||||
|
flowlayout.AutoScroll = true;
|
||||||
|
|
||||||
|
this.Controls.Add(labelSessionHistory);
|
||||||
|
this.Controls.Add(flowlayout);
|
||||||
|
|
||||||
|
//this.Controls.Add(data);
|
||||||
|
|
||||||
|
updateHistory(MainClient.oldSessionsData);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public System.Windows.Forms.Label labelSessionHistory;
|
||||||
|
|
||||||
|
public void updateHistory(List<Tuple<string, double, int>> actives)
|
||||||
|
{
|
||||||
|
flowlayout.Controls.Clear();
|
||||||
|
|
||||||
|
foreach (Tuple<string,double,int> sessiondata in actives)
|
||||||
|
{
|
||||||
|
flowlayout.Controls.Add(new SessionPanel(sessiondata.Item3, sessiondata.Item1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="ErgometerLibrary, Version=1.0.2.8, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="ErgometerLibrary, Version=1.0.3.1, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\ErgometerLibrary\ErgometerLibrary\ErgometerLibrary\bin\Debug\ErgometerLibrary.dll</HintPath>
|
<HintPath>..\..\ErgometerLibrary\ErgometerLibrary\bin\Debug\ErgometerLibrary.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace ErgometerDoctorApplication
|
|||||||
//Server information
|
//Server information
|
||||||
public static List<ClientThread> clients;
|
public static List<ClientThread> clients;
|
||||||
public static Dictionary<string, string> users;
|
public static Dictionary<string, string> users;
|
||||||
public static List<int> oldsessions;
|
public static List<Tuple<string, double, int>> oldSessionsData;
|
||||||
|
|
||||||
public static void RemoveActiveClient(ClientThread clientThread)
|
public static void RemoveActiveClient(ClientThread clientThread)
|
||||||
{
|
{
|
||||||
@@ -45,8 +45,8 @@ namespace ErgometerDoctorApplication
|
|||||||
|
|
||||||
clients = new List<ClientThread>();
|
clients = new List<ClientThread>();
|
||||||
users = new Dictionary<string, string>();
|
users = new Dictionary<string, string>();
|
||||||
oldsessions = new List<int>();
|
|
||||||
activesessions = new Dictionary<int, string>();
|
activesessions = new Dictionary<int, string>();
|
||||||
|
oldSessionsData = new List<Tuple<string, double, int>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool Connect(string password, out string error)
|
public static bool Connect(string password, out string error)
|
||||||
@@ -96,7 +96,7 @@ namespace ErgometerDoctorApplication
|
|||||||
loggedin = true;
|
loggedin = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SendNetCommand(new NetCommand(NetCommand.RequestType.USERS, Session));
|
//SendNetCommand(new NetCommand(NetCommand.RequestType.USERS, Session));
|
||||||
SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, Session));
|
SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, Session));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -157,7 +157,7 @@ namespace ErgometerDoctorApplication
|
|||||||
UsersLength = command.LengthValue;
|
UsersLength = command.LengthValue;
|
||||||
break;
|
break;
|
||||||
case NetCommand.LengthType.SESSIONS:
|
case NetCommand.LengthType.SESSIONS:
|
||||||
oldsessions.Clear();
|
oldSessionsData.Clear();
|
||||||
SessionsBeingSent = true;
|
SessionsBeingSent = true;
|
||||||
SessionsSent = 0;
|
SessionsSent = 0;
|
||||||
SessionsLength = command.LengthValue;
|
SessionsLength = command.LengthValue;
|
||||||
@@ -184,15 +184,6 @@ namespace ErgometerDoctorApplication
|
|||||||
UsersBeingSent = false;
|
UsersBeingSent = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NetCommand.CommandType.SESSION:
|
|
||||||
if (SessionsBeingSent)
|
|
||||||
{
|
|
||||||
oldsessions.Add(command.Session);
|
|
||||||
SessionsSent++;
|
|
||||||
if (SessionsSent >= SessionsLength)
|
|
||||||
SessionsBeingSent = false;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case NetCommand.CommandType.SESSIONDATA:
|
case NetCommand.CommandType.SESSIONDATA:
|
||||||
if (ActiveSessionsBeingSent)
|
if (ActiveSessionsBeingSent)
|
||||||
{
|
{
|
||||||
@@ -201,6 +192,13 @@ namespace ErgometerDoctorApplication
|
|||||||
if (ActiveSessionsSent >= ActiveSessionsLength)
|
if (ActiveSessionsSent >= ActiveSessionsLength)
|
||||||
ActiveSessionsBeingSent = false;
|
ActiveSessionsBeingSent = false;
|
||||||
}
|
}
|
||||||
|
if (SessionsBeingSent)
|
||||||
|
{
|
||||||
|
oldSessionsData.Add(new Tuple<string, double, int>(command.DisplayName, command.Timestamp, command.Session));
|
||||||
|
SessionsSent++;
|
||||||
|
if (SessionsSent >= SessionsLength)
|
||||||
|
SessionsBeingSent = false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
HandToClient(command);
|
HandToClient(command);
|
||||||
@@ -256,6 +254,7 @@ namespace ErgometerDoctorApplication
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
SendNetCommand(new NetCommand(NetCommand.RequestType.OLDDATA, session));
|
SendNetCommand(new NetCommand(NetCommand.RequestType.OLDDATA, session));
|
||||||
|
SendNetCommand(new NetCommand(NetCommand.RequestType.CHAT, session));
|
||||||
|
|
||||||
//Start new client
|
//Start new client
|
||||||
ClientThread cl = new ClientThread(name, session, true);
|
ClientThread cl = new ClientThread(name, session, true);
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ namespace ErgometerDoctorApplication
|
|||||||
{
|
{
|
||||||
public partial class MainWindow : Form
|
public partial class MainWindow : Form
|
||||||
{
|
{
|
||||||
private bool request;
|
private int request;
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
conPanelLogin.BringToFront();
|
conPanelLogin.BringToFront();
|
||||||
request = false;
|
request = 0;
|
||||||
updateTimer.Start();
|
updateTimer.Start();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,18 @@ namespace ErgometerDoctorApplication
|
|||||||
this.HeaderLabel.Text = "Sessie geschiedenis";
|
this.HeaderLabel.Text = "Sessie geschiedenis";
|
||||||
conSessionHistory.BringToFront();
|
conSessionHistory.BringToFront();
|
||||||
|
|
||||||
MainClient.StartOldCLient("Test", 1148735907);
|
//MainClient.StartOldCLient("Test", 1148735907);
|
||||||
|
|
||||||
|
if (MainClient.oldSessionsData.Count > 0)
|
||||||
|
{
|
||||||
|
conSessionHistory.labelSessionHistory.Text = "";
|
||||||
|
conSessionHistory.updateHistory(MainClient.oldSessionsData);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
conSessionHistory.updateHistory(MainClient.oldSessionsData);
|
||||||
|
conSessionHistory.labelSessionHistory.Text = "Er zijn geen oude sessies.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public void validateLogin()
|
public void validateLogin()
|
||||||
{
|
{
|
||||||
@@ -114,12 +125,18 @@ namespace ErgometerDoctorApplication
|
|||||||
|
|
||||||
private void updateTimer_tick(object sender, EventArgs e)
|
private void updateTimer_tick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (request)
|
if (request == 0)
|
||||||
MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.USERS, MainClient.Session));
|
MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.USERS, MainClient.Session));
|
||||||
else
|
else if (request == 1)
|
||||||
MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, MainClient.Session));
|
MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, MainClient.Session));
|
||||||
|
else if(request == 2)
|
||||||
|
MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.ALLSESSIONS, MainClient.Session));
|
||||||
|
|
||||||
request = !request;
|
request ++;
|
||||||
|
if (request > 2)
|
||||||
|
{
|
||||||
|
request = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user