Skip to content

Commit

Permalink
first implementation of serial write
Browse files Browse the repository at this point in the history
  • Loading branch information
samuderaahr committed Sep 29, 2017
1 parent c2e45f4 commit 1169039
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions ohm-server/ohm-server/MainGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private void intervalTimer_Tick(object sender, EventArgs e)
if (totalVRAM == "000000")
totalVRAM = ReadSensor("GPU Memory Total", OpenHardwareMonitor.Hardware.SensorType.SmallData);

sendString();
sendRoutine();

updateGUILabels();
}
Expand Down Expand Up @@ -141,9 +141,22 @@ private string ReadSensor(string sensorName, OpenHardwareMonitor.Hardware.Sensor
return "N/A";
}

private void sendString()
private void sendRoutine()
{
string temp = String.Empty;

temp = '#' + cpuTemp + '.' + gpuTemp + '.' + hddTemp + '.' + cpuLabel + '.' + gpuLoad + '.' + dramFree + '.' + vramFree;

serialPort.WriteLine(temp);
}

private void sendOnce()
{
string temp = String.Empty;

temp = '$' + CPUName + '.' + GPUName + '.' + HDDName + '.' + totalDRAM + '.' + totalVRAM;

serialPort.WriteLine(temp);
}

private void updateGUILabels()
Expand Down

0 comments on commit 1169039

Please sign in to comment.