Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
Updated README.md, logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rnayabed committed Apr 17, 2020
1 parent ef895b8 commit 5a1f99a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# PCHWRM_Client

# PCHWRM Server
PC Hardware Resource Monitor For [Raspberry Pi](https://www.raspberrypi.org/), Built with JavaFX

[Screenshots](https://imgur.com/a/4H3YjMH)

Built with JavaFX, Java

**Only Windows Supported for now.**

**This program uses [Open Hardware Monitor](https://openhardwaremonitor.org/) to access PC Data. Please make sure its running before you begin using it.**

## How to Run?

**MAKE SURE YOU HAVE [Open Hardware Monitor](https://openhardwaremonitor.org/). Make sure you have it running while using this.**

1. Download the latest zip from [releases](https://github.com/dubbadhar/PCHWRM_Client/releases).
2. Run `unzip windows64.zip`
e. Run `start.vbs` in the extracted Folder.

## Libraries Used
* [JNA](https://github.com/java-native-access/jna) - Access to WMI

## License

[GNU GPL v3](https://github.com/dubbadhar/PCHWRM_Client/blob/master/LICENSE)


14 changes: 4 additions & 10 deletions src/PCHWRMClient/dash.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.io.*;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;

Expand Down Expand Up @@ -247,7 +246,7 @@ public void applyConfigReadingsToFields()

Socket client;

DataOutputStream osx;
BufferedWriter osx;

public void initGPUCPURAM() throws Exception
{
Expand All @@ -266,6 +265,7 @@ protected Void call()
if(isConnected)
{
writeToOS("QUIT");
osx.close();
client.close();
isConnected=false;
Platform.runLater(()->{
Expand Down Expand Up @@ -299,7 +299,7 @@ protected Void call()
client = new Socket();
client.connect(new InetSocketAddress(serverIPAddressTextField.getText(), Integer.parseInt(serverPortTextField.getText())), 2500);

osx = new DataOutputStream(client.getOutputStream());
osx = new BufferedWriter(new OutputStreamWriter(client.getOutputStream()));

writeToOS("CPU_GPU_MODELS!!"+cpuModel+"::"+gpuModel+"::");

Expand Down Expand Up @@ -396,17 +396,11 @@ else if(each[0].equals(AvailableRAMNameTextField.getText()) && each[1].equals("D

public void writeToOS(String txt) throws Exception
{
byte[] by = txt.getBytes(StandardCharsets.UTF_8);
osx.writeUTF("buff_length::"+by.length+"::");
osx.write(txt+"\n");
osx.flush();

osx.write(by);
osx.flush();
io.pln("SENT @ "+by.length);
}



public String doFormValidation()
{
String toReturn = "";
Expand Down

0 comments on commit 5a1f99a

Please sign in to comment.