Skip to content

Commit

Permalink
Merge pull request #12 from nmzaheer/main
Browse files Browse the repository at this point in the history
Linebreak set to LF as per SerialPlotterProtocol
  • Loading branch information
per1234 authored Sep 5, 2022
2 parents 2264606 + 4d866b7 commit eac6d39
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export default function App() {
monitorUISettings: {
lineEnding: isEOL(urlParams.get("lineEnding"))
? (urlParams.get("lineEnding") as EOL)
: "\r\n",
: "\n",
darkTheme: urlParams.get("darkTheme") === "true",
wsPort: parseInt(urlParams.get("wsPort") || "3030"),
interpolate: urlParams.get("interpolate") === "true",
Expand Down
7 changes: 4 additions & 3 deletions src/fakeMessagsGenerators.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const separator = "\n";
// format1: <value1> <value2> <value3>
export const generateRandomMessages = () => {
const messages: string[] = [];
Expand All @@ -10,7 +11,7 @@ export const generateRandomMessages = () => {
}
let line = variables.join(" ");

messages.push(line + "\r\n");
messages.push(line + separator);
}

return messages;
Expand All @@ -30,7 +31,7 @@ export const namedVariables = () => {
let pair = genNamedVarValPair(i);
messages.push(pair);
}
return [messages.join(",") + "\r\n"];
return [messages.join(",") + separator];
};

export const namedVariablesMulti = () => {
Expand Down Expand Up @@ -67,5 +68,5 @@ export const jumpyNamedVariables = () => {
let pair = genNamedVarValPair(i);
messages.push(pair);
}
return [messages.join(",") + "\r\n"];
return [messages.join(",") + separator];
};
2 changes: 1 addition & 1 deletion src/msgAggregatorWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ctx.addEventListener("message", (event) => {

let buffer = "";
let discardFirstLine = true;
const separator = "\r\n";
const separator = "\n";
var re = new RegExp(`(${separator})`, "g");

export const parseSerialMessages = (
Expand Down

0 comments on commit eac6d39

Please sign in to comment.