-
Notifications
You must be signed in to change notification settings - Fork 0
/
MemoryModule.cs
50 lines (42 loc) · 1.63 KB
/
MemoryModule.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Collections.Generic;
namespace powerLabel
{
public class MemoryModule
{
public int id { get; set; }
public ulong capacity { get; set; }
public uint maxClockspeed { get; set; }
public uint formFactor { get; set; } // 8 -> DIMM 12 -> SODIMM https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/cim-chip
public uint memoryType { get; set; } // https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.2.0.pdf Table 76
public static Dictionary<uint, string> memoryTypeLookup = new Dictionary<uint, string>()
{
[18] = "DDR",
[19] = "DDR2",
[20] = "DDR2 FB-DIMM",
[24] = "DDR3",
[26] = "DDR4",
[27] = "LPDDR",
[28] = "LPDDR2",
[29] = "LPDDR3",
[30] = "LPDDR4"
};
public string partNubmer { get; set; }
public string serialNubmer { get; set; }
public override bool Equals(object obj)
{
if (obj == null || GetType() != obj.GetType()) return false;
MemoryModule memory = (MemoryModule)obj;
if (this.capacity == memory.capacity &&
this.maxClockspeed == memory.maxClockspeed &&
this.formFactor == memory.formFactor &&
this.memoryType == memory.memoryType &&
this.partNubmer.Trim() == memory.partNubmer.Trim() &&
this.serialNubmer.Trim() == memory.serialNubmer.Trim()
)
{
return true;
}
return false;
}
}
}