Skip to content

Commit

Permalink
Merge pull request #199 from BBekker/dev
Browse files Browse the repository at this point in the history
Master release
  • Loading branch information
BBekker authored Jun 2, 2017
2 parents 34fbfb4 + 9fa0553 commit beade12
Show file tree
Hide file tree
Showing 122 changed files with 10,729 additions and 1,974 deletions.
2 changes: 1 addition & 1 deletion CryostatControl.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26403.7
VisualStudioVersion = 15.0.26430.6
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CryostatControlClient", "CryostatControlClient\CryostatControlClient.csproj", "{F38C304B-B06B-46CA-A267-7C27328C9033}"
EndProject
Expand Down
24 changes: 13 additions & 11 deletions CryostatControlClient/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,26 @@
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IDataGet">
<security mode="Message">
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="WSDualHttpBinding_IDataGet" />
</wsDualHttpBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_ICommandService" />
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8000/SRON" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_ICommandService" contract="ServiceReference1.ICommandService"
name="WSHttpBinding_ICommandService">
<endpoint address="http://localhost:18080/Command" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_ICommandService" contract="ServiceReference1.ICommandService"
name="WSHttpBinding_ICommandService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="http://localhost:8001/SRON" binding="wsDualHttpBinding"
bindingConfiguration="WSDualHttpBinding_IDataGet" contract="ServiceReference1.IDataGet"
name="WSDualHttpBinding_IDataGet">
<endpoint address="http://localhost:18080/Data" binding="wsDualHttpBinding"
bindingConfiguration="WSDualHttpBinding_IDataGet" contract="ServiceReference1.IDataGet"
name="WSDualHttpBinding_IDataGet">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
Expand Down
31 changes: 27 additions & 4 deletions CryostatControlClient/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace CryostatControlClient
using System.Threading.Tasks;
using System.Windows;

using CryostatControlClient.Communication;
using CryostatControlClient.ServiceReference1;

/// <summary>
Expand All @@ -27,6 +28,11 @@ public partial class App
/// </summary>
private CommandServiceClient commandServiceClient;

/// <summary>
/// The server check
/// </summary>
private ServerCheck serverCheck;

#endregion Fields

#region Propertis
Expand All @@ -50,6 +56,20 @@ public CommandServiceClient CommandServiceClient
}
}

/// <summary>
/// Gets the server check.
/// </summary>
/// <value>
/// The server check.
/// </value>
public ServerCheck ServerCheck
{
get
{
return this.serverCheck;
}
}

#endregion Propertis

#region Methods
Expand Down Expand Up @@ -89,19 +109,22 @@ protected override void OnStartup(StartupEventArgs e)
DataClientCallback callback = new DataClientCallback(this);
InstanceContext instanceContext = new InstanceContext(callback);
DataGetClient dataClient = new DataGetClient(instanceContext);
this.serverCheck = new ServerCheck(this, this.commandServiceClient, dataClient);

try
{
Console.WriteLine("Server is alive: {0}", this.commandServiceClient.IsAlive());
Console.WriteLine("Subscribed for data");
dataClient.SubscribeForData(1000);

////Execute(this.Unsubscribe, 5000, dataClient);
dataClient.SubscribeForData(1000);
dataClient.SubscribeForUpdates();
}
catch (System.ServiceModel.EndpointNotFoundException)
catch
{
Console.WriteLine("Server is alive: {0}", false);
Console.WriteLine("No connection with server");
}

////Execute(this.Unsubscribe, 5000, dataClient);
}

#endregion Methods
Expand Down
43 changes: 32 additions & 11 deletions CryostatControlClient/Communication/DataReceiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace CryostatControlClient.Communication

using CryostatControlClient.ViewModels;

using CryostatControlServer.HostService.Enumerators;
using CryostatControlServer.Data;

/// <summary>
/// Handles the received data
Expand All @@ -35,6 +35,36 @@ public void SetState(int modus, ViewModelContainer dataContext)
}
}

/// <summary>
/// Sets the is logging.
/// </summary>
/// <param name="state">if set to <c>true</c> [state].</param>
/// <param name="dataContext">The data context.</param>
public void SetIsLogging(bool state, ViewModelContainer dataContext)
{
if (dataContext != null)
{
dataContext.LoggingViewModel.LoggingInProgress = state;
}
}

/// <summary>
/// The update notification.
/// </summary>
/// <param name="notification">
/// The notification.
/// </param>
/// <param name="dataContext">
/// The data context.
/// </param>
public void UpdateNotification(string[] notification, ViewModelContainer dataContext)
{
if (dataContext != null)
{
dataContext.MessageBoxViewModel.Message = notification;
}
}

/// <summary>
/// Updates the compressor viewmodel.
/// </summary>
Expand All @@ -59,27 +89,17 @@ private void UpdateHe7ViewModel(double[] data, ViewModelContainer viewModelConta
{
viewModelContainer.He7ViewModel.ConnectionState = data[(int)DataEnumerator.HeConnectionState];
viewModelContainer.He7ViewModel.He3HeadTemp = data[(int)DataEnumerator.He3Head];
viewModelContainer.He7ViewModel.He3HeadMax = data[(int)DataEnumerator.He3HeadMax];
viewModelContainer.He7ViewModel.He3PumpTemp = data[(int)DataEnumerator.He3Pump];
viewModelContainer.He7ViewModel.He3PumpMax = data[(int)DataEnumerator.He3PumpMax];
viewModelContainer.He7ViewModel.He4HeadTemp = data[(int)DataEnumerator.He4Head];
viewModelContainer.He7ViewModel.He4HeadMax = data[(int)DataEnumerator.He4HeadMax];
viewModelContainer.He7ViewModel.He4PumpTemp = data[(int)DataEnumerator.He4Pump];
viewModelContainer.He7ViewModel.He4PumpMax = data[(int)DataEnumerator.He4PumpMax];
viewModelContainer.He7ViewModel.He3PumpActualVolt = data[(int)DataEnumerator.He3VoltActual];
viewModelContainer.He7ViewModel.He4PumpActualVolt = data[(int)DataEnumerator.He4VoltActual];
viewModelContainer.He7ViewModel.He3SwitchTemp = data[(int)DataEnumerator.He3SwitchTemp];
viewModelContainer.He7ViewModel.He3SwitchActualVolt = data[(int)DataEnumerator.He3SwitchVoltActual];
viewModelContainer.He7ViewModel.He3SwitchMax1 = data[(int)DataEnumerator.He3SwitchMax1];
viewModelContainer.He7ViewModel.He3SwitchMax2 = data[(int)DataEnumerator.He3SwitchMax2];
viewModelContainer.He7ViewModel.He4SwitchTemp = data[(int)DataEnumerator.He4SwitchTemp];
viewModelContainer.He7ViewModel.He4SwitchActualVolt = data[(int)DataEnumerator.He4SwitchVoltActual];
viewModelContainer.He7ViewModel.He4SwitchMax1 = data[(int)DataEnumerator.He4SwitchMax1];
viewModelContainer.He7ViewModel.He4SwitchMax2 = data[(int)DataEnumerator.He4SwitchMax2];
viewModelContainer.He7ViewModel.TwoKPlateTemp = data[(int)DataEnumerator.HePlate2K];
viewModelContainer.He7ViewModel.FourKPlateTemp = data[(int)DataEnumerator.HePlate4K];
viewModelContainer.He7ViewModel.FourKPlateMax1 = data[(int)DataEnumerator.HePlate4Kmax1];
viewModelContainer.He7ViewModel.FourKPlateMax2 = data[(int)DataEnumerator.HePlate4Kmax2];
}

/// <summary>
Expand All @@ -102,6 +122,7 @@ private void UpdateCompressorViewModel(double[] data, ViewModelContainer viewMod
viewModelContainer.CompressorViewModel.ErrorState = data[(int)DataEnumerator.ComError];
viewModelContainer.CompressorViewModel.WarningState = data[(int)DataEnumerator.ComWarning];
viewModelContainer.CompressorViewModel.HoursOfOperation = data[(int)DataEnumerator.ComHoursOfOperation];
viewModelContainer.CompressorViewModel.OperatingState = data[(int)DataEnumerator.ComOperationState];
}

/// <summary>
Expand Down
Loading

0 comments on commit beade12

Please sign in to comment.