Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed bug

  • Loading branch information...
commit 4b3594f9cd3b25d56f06b06471b8c88d98b15814 1 parent d0b0dc1
Steven Houben authored
View
12 NooSphere/ActivityBar/Properties/Settings.Designer.cs
@@ -130,5 +130,17 @@ internal sealed partial class Settings : global::System.Configuration.Applicatio
this["DISCOVERY_TYPE"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("0")]
+ public int DEVICE_TAG {
+ get {
+ return ((int)(this["DEVICE_TAG"]));
+ }
+ set {
+ this["DEVICE_TAG"] = value;
+ }
+ }
}
}
View
3  NooSphere/ActivityBar/Properties/Settings.settings
@@ -29,5 +29,8 @@
<Setting Name="DISCOVERY_TYPE" Type="NooSphere.ActivitySystem.Discovery.DiscoveryType" Scope="User">
<Value Profile="(Default)">WSDiscovery</Value>
</Setting>
+ <Setting Name="DEVICE_TAG" Type="System.Int32" Scope="User">
+ <Value Profile="(Default)">0</Value>
+ </Setting>
</Settings>
</SettingsFile>
View
2  NooSphere/ActivityBar/Xaml/ActivityBar.xaml.cs
@@ -210,7 +210,7 @@ public void StartActivityManager()
_host = new GenericHost(7891);
_host.HostLaunched += HostHostLaunched;
_host.Open(new ActivityManager(_owner, "c:/files/"), typeof (IActivityManager), _device.Name);
- _host.StartBroadcast(Settings.Default.DISCOVERY_TYPE, _device.Name, "205", _device.Location);
+ _host.StartBroadcast(Settings.Default.DISCOVERY_TYPE, _device.Name, _device.Code.ToString(), _device.Location);
});
}
View
6 NooSphere/ActivityBar/Xaml/Login/LoginWindow.xaml
@@ -57,7 +57,11 @@
<RadioButton Content="I don't know" GroupName="startup" Height="16" HorizontalAlignment="Left" Margin="270,248,0,0" Name="radioButton1" VerticalAlignment="Top" />
<Image Height="47" x:Name="imgLogo" Stretch="None" VerticalAlignment="Top" Source="/ActivityUI;component/Images/logo.PNG" Margin="107,35,0,0" />
<Label Content="Device type" Height="28" HorizontalAlignment="Left" Margin="8,211,0,0" Name="label2" VerticalAlignment="Top" Width="83" />
+ <Label Content="Device tag" Height="28" HorizontalAlignment="Left" Margin="220,211,0,0" Name="label4" VerticalAlignment="Top" Width="83" />
<Label Content="Connection" Height="28" HorizontalAlignment="Left" Margin="8,243,0,0" Name="label3" VerticalAlignment="Top" Width="83" />
- <ComboBox Height="23" HorizontalAlignment="Left" Margin="95,211,0,0" Name="cbType" VerticalAlignment="Top" Width="281" ItemsSource="{Binding}" Tag="Unknown" />
+
+ <ComboBox Height="23" HorizontalAlignment="Left" Margin="95,211,0,0" Name="cbType" VerticalAlignment="Top" Width="127" ItemsSource="{Binding}" Tag="Unknown" />
+ <ComboBox Height="23" HorizontalAlignment="Left" Margin="285,211,0,0" Name="cbTag" VerticalAlignment="Top" Width="91" ItemsSource="{Binding}" Tag="Unknown" />
+
</Grid>
</Window>
View
10 NooSphere/ActivityBar/Xaml/Login/LoginWindow.xaml.cs
@@ -54,6 +54,10 @@ public LoginWindow()
{
SourceInitialized += new EventHandler(LoginWindow_SourceInitialized);
InitializeComponent();
+
+ for (int i = 0; i < 223; i++)
+ cbTag.Items.Add(i);
+
LoadSettings();
ToolTipService.SetIsEnabled(btnInfo, false);
@@ -61,6 +65,9 @@ public LoginWindow()
ToolTipService.SetIsEnabled(btnGo, false);
this.cbType.ItemsSource = Enum.GetValues(typeof(DeviceType)).Cast<DeviceType>();
+
+
+
}
#endregion
@@ -71,6 +78,7 @@ private void LoadSettings()
txtEmail.Text = Settings.Default.USER_EMAIL;
txtDevicename.Text = Settings.Default.DEVICE_NAME;
cbType.SelectedValue = Settings.Default.DEVICE_TYPE;
+ cbTag.SelectedValue = Settings.Default.DEVICE_TAG;
}
private void SaveSettings()
{
@@ -78,6 +86,7 @@ private void SaveSettings()
Settings.Default.USER_EMAIL = txtEmail.Text;
Settings.Default.DEVICE_NAME = txtDevicename.Text;
Settings.Default.DEVICE_TYPE = (DeviceType)cbType.SelectedValue;
+ Settings.Default.DEVICE_TAG = (int)cbTag.SelectedValue;
Settings.Default.Save();
}
private void CreateUser(string baseUrl)
@@ -107,6 +116,7 @@ private void LogIn()
this.Device = new Device();
this.Device.Name = txtDevicename.Text;
this.Device.DeviceType = (DeviceType)cbType.SelectedValue;
+ Device.Code = (int)cbTag.SelectedValue;
if (rbClient.IsChecked == true)
this.Mode = StartUpMode.Client;
View
3  NooSphere/ActivityBar/app.config
@@ -75,6 +75,9 @@
<setting name="DISCOVERY_TYPE" serializeAs="String">
<value>WSDiscovery</value>
</setting>
+ <setting name="DEVICE_TAG" serializeAs="String">
+ <value>0</value>
+ </setting>
</ActivityUI.Properties.Settings>
</userSettings>
</configuration>
View
4 NooSphere/NooSphere.ActivitySystem/Base/Client/ActivityClient.cs
@@ -294,8 +294,8 @@ public void AddResource(FileInfo fileInfo,Guid activityId)
var resource = new Resource((int)fileInfo.Length, fileInfo.Name)
{
ActivityId = activityId,
- CreationTime = DateTime.Now.ToString(),
- LastWriteTime = DateTime.Now.ToString()
+ CreationTime = DateTime.Now.ToString("u"),
+ LastWriteTime = DateTime.Now.ToString("u")
};
var req = new FileRequest
{
View
94 NooSphere/NooSphere.Core/ActivityModel/Resource.cs
@@ -1,47 +1,47 @@
-
-/****************************************************************************
- (c) 2012 Steven Houben(shou@itu.dk) and Søren Nielsen(snielsen@itu.dk)
-
- Pervasive Interaction Technology Laboratory (pIT lab)
- IT University of Copenhagen
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU GENERAL PUBLIC LICENSE V3 or later,
- as published by the Free Software Foundation. Check
- http://www.gnu.org/licenses/gpl.html for details.
-****************************************************************************/
-
-using System;
-using System.Globalization;
-using NooSphere.Core.Primitives;
-
-namespace NooSphere.Core.ActivityModel
-{
- public class Resource : Base
- {
- public Resource()
- {
- InitializeTimeStamps();
- }
- public Resource(int size,string name)
- {
- InitializeTimeStamps();
- Name = name;
- Size = size;
- }
-
- private void InitializeTimeStamps()
- {
- CreationTime = DateTime.Now.ToString();
- LastWriteTime = DateTime.Now.ToString();
- }
-
- public Guid ActivityId { get; set; }
- public int Size { get; set; }
- public string CreationTime { get; set; }
- public string LastWriteTime { get; set; }
- public string RelativePath { get {return ActivityId +"/"+ Name; }}
- public string CloudPath { get { return "Activities/" + ActivityId + "/Resources/" + Id; } }
- public Service Service { get; set; }
- }
-}
+
+/****************************************************************************
+ (c) 2012 Steven Houben(shou@itu.dk) and Søren Nielsen(snielsen@itu.dk)
+
+ Pervasive Interaction Technology Laboratory (pIT lab)
+ IT University of Copenhagen
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU GENERAL PUBLIC LICENSE V3 or later,
+ as published by the Free Software Foundation. Check
+ http://www.gnu.org/licenses/gpl.html for details.
+****************************************************************************/
+
+using System;
+using System.Globalization;
+using NooSphere.Core.Primitives;
+
+namespace NooSphere.Core.ActivityModel
+{
+ public class Resource : Base
+ {
+ public Resource()
+ {
+ InitializeTimeStamps();
+ }
+ public Resource(int size,string name)
+ {
+ InitializeTimeStamps();
+ Name = name;
+ Size = size;
+ }
+
+ private void InitializeTimeStamps()
+ {
+ CreationTime = DateTime.Now.ToString("u");
+ LastWriteTime = DateTime.Now.ToString("u");
+ }
+
+ public Guid ActivityId { get; set; }
+ public int Size { get; set; }
+ public string CreationTime { get; set; }
+ public string LastWriteTime { get; set; }
+ public string RelativePath { get {return ActivityId +"/"+ Name; }}
+ public string CloudPath { get { return "Activities/" + ActivityId + "/Resources/" + Id; } }
+ public Service Service { get; set; }
+ }
+}
View
1  NooSphere/NooSphere.Core/Devices/Device.cs
@@ -19,6 +19,7 @@ public class Device : Base
public DeviceType DeviceType { get; set; }
public DeviceRole DeviceRole { get; set; }
public DevicePortability DevicePortability { get; set; }
+ public int Code { get; set; }
public string Location { get; set; }
public string BaseAddress { get; set; }
Please sign in to comment.
Something went wrong with that request. Please try again.