Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 59 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
{
"cSpell.words": ["Cascadia", "Lucida"]
"cSpell.words": ["Cascadia", "Lucida"],
"js/ts.suggest.completeFunctionCalls": false,
"autoalign.moveableItems": ["=", ":", "+=", "-=", "//"],
"autoalign.moveableItemsAdditional": [

],
"autoalign.nonMoveableItems": [

"==",
"!=",
"/",
"*",
"#",
"<=",
">=",
"=>",
"=<",
"for(",
"for (",
"if(",
"if (",
"-(",
"- (",
"(\"",
"('",
"(`",
"=~",
"&:",
">:",
"*:",
"::",
":active",
":checked",
":disabled",
":empty",
":enabled",
":first-",
":focus",
":hover",
":in-range",
":invalid",
":lang",
":last-",
":link",
":not",
":nth-",
":only-",
":optional",
":out-of-range",
":read-",
":required",
":root",
":target",
":valid",
":visited",
"`",
"http:",
"https:"
]
}
4 changes: 4 additions & 0 deletions mainCode/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"tabWidth": 2,
"useTabs": true
}
Binary file added mainCode/code/jfoenix-9.0.10.jar
Binary file not shown.
32 changes: 32 additions & 0 deletions mainCode/lib.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*======IMPORT WINDOW LIBRARIES======*/
import javafx.stage.Stage; //import JavaFX Stage library
import javafx.scene.canvas.Canvas; //import Canvas library
import javafx.scene.layout.Pane; //import Pane layout library
import javafx.scene.layout.StackPane; //import StackPane layout library

//END

/*======IMPORT UI CONTROLS LIBRARIES======*/
import javafx.scene.control.Button; //import Button control library
import javafx.scene.control.TextField; //import TextField control library

// TODO: Replace with FX textArea JFeonix textArea
import javafx.scene.control.TextArea; //import TextArea control library
import javafx.scene.control.Label; //import Label control library
import javafx.scene.control.ComboBox; //import ComboBox control library
import javafx.scene.control.CheckBox; //import CheckBox control library
import javafx.scene.paint.Color; //import Color library
import javafx.scene.text.Text; //import JavaFX text library
import javafx.scene.text.TextFlow; //import JavaFX text flow library
import javafx.scene.text.Font; //import JavaFX font library
import javafx.scene.layout.VBox; //import VBox layout library
import javafx.scene.layout.HBox; //import HBox layout library
import javafx.geometry.Insets; //import Dimension library
/*======IMPORT UTILITY LIBRARIES======*/
import java.io.File; //import File library
import java.io.FileInputStream; //import FileInputStream library
import java.io.IOException; //import IOException library
import java.awt.image.BufferedImage; //import awt buffered image library
import java.util.Collection;
import java.util.Collections;
//END
99 changes: 49 additions & 50 deletions mainCode/logData.pde
Original file line number Diff line number Diff line change
@@ -1,53 +1,52 @@
// initialize data logging file
public void initLogFile() {
fileNameInput = textFieldFileName.getText();
textFieldFileDirInput = textFieldFileDir.getText() + OsDirChar;
fileDirectory = textFieldFileDirInput + fileNameInput + ".log";
fileDirectoryReplaced = fileDirectory.replace("\\", "/");
// // initialize data logging file
// public void initLogFile() {
// fileNameInput = textFieldFileName.getText();
// textFieldFileDirInput = textFieldFileDir.getText() + OsDirChar;
// fileDirectory = textFieldFileDirInput + fileNameInput + ".log";
// fileDirectoryReplaced = fileDirectory.replace("\\", "/");

try {
File logFile = new File(fileDirectoryReplaced);
// Creating File
if (logFile.createNewFile()) {
logFileExists = false;
textAreaMainMsg("\n", "File created: " + textFieldFileDirInput + logFile.getName(), "");
systemPrintln("File created: " + textFieldFileDirInput + logFile.getName());
} else if (logFile.exists()) {
logFileExists = true;
textAreaMainMsg("\n", "File already exists: " + textFieldFileDirInput + logFile.getName(), "");
systemPrintln("File already exists: " + textFieldFileDirInput + logFile.getName());
}
}
catch (IOException e) {
textAreaMainMsg("\n", "Failed to create log file. " + e, "");
systemPrintln("Failed to create log file. " + e);
initLogFileOk = false;
}
// try {
// File logFile = new File(fileDirectoryReplaced);
// // Creating File
// if (logFile.createNewFile()) {
// logFileExists = false;
// textAreaMainMsg("\n", "File created: " + textFieldFileDirInput + logFile.getName(), "");
// systemPrintln("File created: " + textFieldFileDirInput + logFile.getName());
// } else if (logFile.exists()) {
// logFileExists = true;
// textAreaMainMsg("\n", "File already exists: " + textFieldFileDirInput + logFile.getName(), "");
// systemPrintln("File already exists: " + textFieldFileDirInput + logFile.getName());
// }
// }
// catch (IOException e) {
// textAreaMainMsg("\n", "Failed to create log file. " + e, "");
// systemPrintln("Failed to create log file. " + e);
// initLogFileOk = false;
// }

try {
Writer = new FileWriter(fileDirectoryReplaced, true);
initLogFileOk = true;
logData = true;
textAreaMainMsg("\n", "Logging data to. " + fileDirectory, "");
}
catch(Exception e) {
textAreaMainMsg("\n", "Failed to init writer." + e, "");
initLogFileOk = false;
}
}

// write data to log file
public void writeToFile(String data) {
if (logData == true && dataLogPause == false) {
try {
Writer.append(data);
//Writer.write(data);
Writer.flush();
loggingData = true;
}
catch(Exception e) {
textAreaMainMsg("\n", "Failed to log data." + e, "");
}
}
}
// try {
// Writer = new FileWriter(fileDirectoryReplaced, true);
// initLogFileOk = true;
// logData = true;
// textAreaMainMsg("\n", "Logging data to. " + fileDirectory, "");
// }
// catch(Exception e) {
// textAreaMainMsg("\n", "Failed to init writer." + e, "");
// initLogFileOk = false;
// }
// }

// // write data to log file
// public void writeToFile(String data) {
// if (logData == true && dataLogPause == false) {
// try {
// Writer.append(data);
// //Writer.write(data);
// Writer.flush();
// loggingData = true;
// }
// catch(Exception e) {
// textAreaMainMsg("\n", "Failed to log data." + e, "");
// }
// }
// }
Loading