Skip to content
This repository was archived by the owner on Nov 9, 2020. It is now read-only.

Commit

Permalink
Added some real values in HUD
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrenouf committed Apr 8, 2018
1 parent 7634a1a commit e95aa14
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Assets/VR-DC-Exp/Scripts/InstantiateEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,18 @@ void Start()
vmInfo.resources.Add(new HUD.Resource("MEM", 4, 0.75f));

vmInfo.statistics = new List<HUD.Statistic>();
vmInfo.statistics.Add(new HUD.Statistic("OS", "Win"));
vmInfo.statistics.Add(new HUD.Statistic("Network", "VM Net"));
vmInfo.statistics.Add(new HUD.Statistic("Power", "On"));

string CPU = n.GetNumCPUStr(details);
vmInfo.statistics.Add(new HUD.Statistic(CPU, "CPU:"));

string MEM = n.GetMEMStr(details);
vmInfo.statistics.Add(new HUD.Statistic(MEM, "Memory:"));

string GuestOS = n.GetOSStr(details);
vmInfo.statistics.Add(new HUD.Statistic(GuestOS, "OS:"));

string Power = n.GetPowerStr(details);
vmInfo.statistics.Add(new HUD.Statistic(Power, "Power:"));

//CloneVM.GetComponents();

Expand Down
24 changes: 24 additions & 0 deletions Assets/VR-DC-Exp/Scripts/RESTConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,30 @@ public String GetVmDetailsStr(VmDetails details) {
return result;
}

public String GetNumCPUStr(VmDetails details) {
string result = String.Format ("{0}", details.value.cpu.count);

return result;
}

public String GetMEMStr(VmDetails details) {
string result = String.Format ("{0} GB", details.value.memory.size_MiB/1024);

return result;
}

public String GetOSStr(VmDetails details) {
string result = String.Format ("{0}", details.value.guest_OS);

return result;
}

public String GetPowerStr(VmDetails details) {
string result = String.Format ("{0}", details.value.power_state);

return result;
}

// Use this for initialization
public void Start()
{
Expand Down

0 comments on commit e95aa14

Please sign in to comment.