diff --git a/README.md b/README.md index c5c4090..e6f40dc 100644 --- a/README.md +++ b/README.md @@ -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) + + diff --git a/src/PCHWRMClient/dash.java b/src/PCHWRMClient/dash.java index 5699507..93b6416 100644 --- a/src/PCHWRMClient/dash.java +++ b/src/PCHWRMClient/dash.java @@ -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; @@ -247,7 +246,7 @@ public void applyConfigReadingsToFields() Socket client; - DataOutputStream osx; + BufferedWriter osx; public void initGPUCPURAM() throws Exception { @@ -266,6 +265,7 @@ protected Void call() if(isConnected) { writeToOS("QUIT"); + osx.close(); client.close(); isConnected=false; Platform.runLater(()->{ @@ -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+"::"); @@ -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 = "";