Skip to content

Commit

Permalink
Heatmaps & Graphs - complete (I hope). So so many changes, more than …
Browse files Browse the repository at this point in the history
…I can remember.
  • Loading branch information
andymanic committed Apr 26, 2022
1 parent a7dbd0a commit 7c6f4d8
Show file tree
Hide file tree
Showing 35 changed files with 9,165 additions and 5,550 deletions.
9 changes: 3 additions & 6 deletions Hardware/OSRTT_Full_Code/OSRTT_Full_Code.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SPISettings settingsA(10000000, MSBFIRST, SPI_MODE0);

//Serial connection values
bool connected = false;
String firmware = "2.2";
String firmware = "2.3";
int testRuns = 4;
bool vsync = true;
bool extendedGamma = true;
Expand Down Expand Up @@ -219,7 +219,7 @@ void digitalPotWrite(int value)
int checkUSBVoltage() // Check USB voltage is between 4.8V and 5.2V
{
int counter = 0;
while (counter < 1000)
while (counter < 2000)
{
ADC1->SWTRIG.bit.START = 1; //Start ADC1
while(!ADC1->INTFLAG.bit.RESRDY); //wait for ADC to have a new value
Expand Down Expand Up @@ -558,10 +558,7 @@ void loop() {
{
Serial.setTimeout(300);
Keyboard.print(fpsLimit);
if (vsync == false)
{
Keyboard.print('V');
}
Keyboard.print(fpsLimit);
// Check USB voltage level
//int voltageTest = checkUSBVoltage();
//if (voltageTest == 0)
Expand Down
65 changes: 39 additions & 26 deletions OSRTT Launcher/OSRTT Launcher/App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="OSRTT_Launcher.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
Expand All @@ -11,6 +11,10 @@
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib" />
<dependentAssembly>
<assemblyIdentity name="Syncfusion.Licensing" publicKeyToken="632609b4d040f6b4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-20.1460.0.47" newVersion="20.1460.0.47" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<userSettings>
Expand All @@ -24,21 +28,6 @@
<setting name="Verbose" serializeAs="String">
<value>False</value>
</setting>
<setting name="threePercentSetting" serializeAs="String">
<value>False</value>
</setting>
<setting name="tenPercentSetting" serializeAs="String">
<value>False</value>
</setting>
<setting name="gammaCorrectedSetting" serializeAs="String">
<value>True</value>
</setting>
<setting name="gammaPercentSetting" serializeAs="String">
<value>False</value>
</setting>
<setting name="gammaCorrRT" serializeAs="String">
<value>True</value>
</setting>
<setting name="saveGammaTable" serializeAs="String">
<value>False</value>
</setting>
Expand All @@ -48,20 +37,14 @@
<setting name="USBOutput" serializeAs="String">
<value>False</value>
</setting>
<setting name="RGB10Offset" serializeAs="String">
<value>False</value>
</setting>
<setting name="RGB5Offset" serializeAs="String">
<value>True</value>
</setting>
<setting name="MinToTray" serializeAs="String">
<value>False</value>
</setting>
<setting name="SuppressDiagBox" serializeAs="String">
<value>False</value>
</setting>
<setting name="saveXLSX" serializeAs="String">
<value>True</value>
<value>False</value>
</setting>
<setting name="advancedSettings" serializeAs="String">
<value>False</value>
Expand Down Expand Up @@ -91,7 +74,7 @@
<value>True</value>
</setting>
<setting name="VSyncState" serializeAs="String">
<value>0</value>
<value>True</value>
</setting>
<setting name="extendedGammaTest" serializeAs="String">
<value>True</value>
Expand All @@ -103,7 +86,37 @@
<value>5,15,20</value>
</setting>
<setting name="vrrKey" serializeAs="String">
<value>95, 85, 75</value>
<value>75, 85, 95</value>
</setting>
<setting name="rtName" serializeAs="String">
<value>RGB 5 Tolerance</value>
</setting>
<setting name="rtTolerance" serializeAs="String">
<value>5</value>
</setting>
<setting name="rtGammaCorrected" serializeAs="String">
<value>True</value>
</setting>
<setting name="rtPercentage" serializeAs="String">
<value>False</value>
</setting>
<setting name="osName" serializeAs="String">
<value>RGB Values</value>
</setting>
<setting name="osEndPercent" serializeAs="String">
<value>False</value>
</setting>
<setting name="osRangePercent" serializeAs="String">
<value>False</value>
</setting>
<setting name="osGammaCorrected" serializeAs="String">
<value>True</value>
</setting>
<setting name="shareResults" serializeAs="String">
<value>True</value>
</setting>
<setting name="serialNumber" serializeAs="String">
<value />
</setting>
</OSRTT_Launcher.Properties.Settings>
</userSettings>
Expand Down
49 changes: 49 additions & 0 deletions OSRTT Launcher/OSRTT Launcher/CFuncs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OSRTT_Launcher
{
class CFuncs
{
public DialogResult showMessageBox(string title, string message, MessageBoxButtons buttons, MessageBoxIcon icon)
{
if (!Properties.Settings.Default.SuppressDiagBox)
{
DialogResult d = MessageBox.Show(title, message, buttons, icon);
return d;
}
else
{
return DialogResult.None;
}
}

public string createFileName(string resultsFolderPath, string searchParams)
{
decimal fileNumber = 001;
// search /Results folder for existing file names, pick new name
string[] existingFiles = Directory.GetFiles(resultsFolderPath, "*" + searchParams);
// Search \Results folder for existing results to not overwrite existing or have save conflict errors
foreach (var s in existingFiles)
{
decimal num = 0;
try
{ num = decimal.Parse(Path.GetFileNameWithoutExtension(s).Remove(3)); }
catch
{ Console.WriteLine("Non-standard file name found"); }
if (num >= fileNumber)
{
fileNumber = num + 1;
}
}
return fileNumber.ToString("000") + searchParams;
}

}
}
140 changes: 140 additions & 0 deletions OSRTT Launcher/OSRTT Launcher/DataUpload.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Management;

namespace OSRTT_Launcher
{
class DataUpload
{
public class SystemInfo
{
public string boardSerial { get; set; }
public CPU cpu { get; set; }
public GPU gpu { get; set; }
public RAM ram { get; set; }
public string MACAddress { get; set; }
}
public class CPU
{
public string CPUName { get; set; }
public int Cores { get; set; }
public int LogicalProcessors { get; set; }
}
public class GPU
{
public string GPUName { get; set; }
public Int64 VRAM { get; set; }
public string GPUDriver { get; set; }
}
public class RAM
{
public Int64 totalCapcity { get; set; }
public int sticks { get; set; }
public int FormFactor { get; set; }
public string PartNumber { get; set; }
public int RamSpeed { get; set; }
public int RamVolts { get; set; }
}
Thread uploadThread;
public async void UploadData(object data, string url)
{
string json = JsonConvert.SerializeObject(data);
var httpContent = new StringContent(json, Encoding.UTF8, "application/json");
var httpClient = new HttpClient();
var httpResponse = await httpClient.PostAsync(url, httpContent);
}

public void systemInfo()
{
SystemInfo si = new SystemInfo
{
boardSerial = Properties.Settings.Default.serialNumber,
cpu = new CPU(),
gpu = new GPU(),
ram = new RAM()
};
ManagementObjectSearcher cpu = new ManagementObjectSearcher("select * from Win32_Processor");
foreach (ManagementObject cpuObj in cpu.Get())
{
si.cpu.CPUName = cpuObj["Name"].ToString();
si.cpu.Cores = Convert.ToInt32(cpuObj["NumberOfCores"]);
si.cpu.LogicalProcessors = Convert.ToInt32(cpuObj["NumberOfLogicalProcessors"]);
}
ManagementObjectSearcher gpu = new ManagementObjectSearcher("select * from Win32_VideoController");
foreach (ManagementObject gpuObj in gpu.Get())
{
si.gpu.GPUName = gpuObj["Name"].ToString();
si.gpu.VRAM = Convert.ToInt64(gpuObj["AdapterRAM"]);
si.gpu.GPUDriver = gpuObj["DriverVersion"].ToString();
}
ManagementObjectSearcher ram = new ManagementObjectSearcher("select * from Win32_PhysicalMemory ");
Int64 capacity = 0;
int sticks = 0;
foreach (ManagementObject ramObj in ram.Get())
{
capacity += Convert.ToInt64(ramObj["Capacity"]);
sticks += 1;
si.ram.FormFactor = Convert.ToInt32(ramObj["FormFactor"]);
si.ram.PartNumber = ramObj["PartNumber"].ToString();
si.ram.RamSpeed = Convert.ToInt32(ramObj["ConfiguredClockSpeed"]);
si.ram.RamVolts = Convert.ToInt32(ramObj["ConfiguredVoltage"]);
}
si.ram.totalCapcity = capacity;
si.ram.sticks = sticks;
ManagementObjectSearcher nac = new ManagementObjectSearcher("select * from Win32_NetworkAdapterConfiguration");
foreach (ManagementObject nacObj in nac.Get())
{
bool enabled = (bool)nacObj["IPEnabled"];
if (enabled)
{
si.MACAddress = nacObj["MACAddress"].ToString();
}
}
//UploadData(si, "https://api.osrtt.com/systemInfo");
}
public void UploadRawData(List<List<ProcessData.rawResultData>> rawData)
{
// thread this
string url = "https://api.osrtt.com/rawData";
UploadData(rawData, url);
}
public void UploadGammaData(List<ProcessData.gammaResult> gamma)
{
string url = "https://api.osrtt.com/gammaData";
UploadData(gamma, url);
}
public void UploadTestLatency(List<int> testLatency)
{
string url = "https://api.osrtt.com/testLatency";
UploadData(testLatency, url);
}
public void UploadRunSettings(ProcessData.runSettings testLatency)
{
string url = "https://api.osrtt.com/runSetting";
UploadData(testLatency, url);
}

// PC config...

public void ShareResults(
List<List<ProcessData.rawResultData>> rawData,
List<ProcessData.gammaResult> gamma,
List<int> testLatency,
ProcessData.runSettings runSetting
// PC config
)
{
Guid g = Guid.NewGuid();
// put guid in request _somewhere_
UploadRawData(rawData);
UploadGammaData(gamma);
UploadTestLatency(testLatency);
UploadRunSettings(runSetting);
}
}
}
Loading

0 comments on commit 7c6f4d8

Please sign in to comment.