123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- package model;
- import java.nio.file.Path;
- /**
- * This class saves the current settings. Those are needed for creating the STLs.
- * @author Martin Herbers
- *
- */
- public class Settings {
- public enum Temp {
- UNDER0, OVER0
- }
-
- public enum Tilt {
- TILT, FLIP
- }
- //The 5 interactions that can currently be detected.
- private boolean weight = false;
- private boolean acceleration = false;
- private boolean squeeze = false;
- private boolean tilt = false;
- private boolean temperature = false;
- //ADD CODE HERE FOR ADDITIONAL INTERACTION
- //New boolean for each interaction, allows combining them later
-
- //Some more settings to create more interaction possibilities
- private int weightSetting = 54;
- private double accelerationSetting = 5;
- private Temp temperatureSetting = Temp.OVER0;
- private Tilt tiltSetting = Tilt.TILT;
- //ADD CODE HERE FOR ADDITIONAL INTERACTION
- //Only if additional data is necessary
-
- //Settings from the settings window that can be used for multiple objects
- private boolean fill = false;
- private float sizeScreen = 4.0f;
- private float sizeFinger = 4.0f;
- private Path openScadPath = null;
-
- private static Settings settings = new Settings();
-
- public static Settings getSettings() {
- return settings;
- }
-
- public void addWeight() {
- weight = true;
- }
-
- public void removeWeight() {
- weight = false;
- }
-
- public boolean isWeight() {
- return weight;
- }
-
- public void addAcceleration() {
- acceleration = true;
- }
-
- public void removeAcceleration() {
- acceleration = false;
- }
-
- public boolean isAcceleration() {
- return acceleration;
- }
-
- public void addSqueeze() {
- squeeze = true;
- }
-
- public void removeSqueeze() {
- squeeze = false;
- }
-
- public boolean isSqueeze() {
- return squeeze;
- }
-
- public void addTilt() {
- tilt = true;
- }
-
- public void removeTilt() {
- tilt = false;
- }
-
- public boolean isTilt() {
- return tilt;
- }
-
- public void addTemperature() {
- temperature = true;
- }
-
- public void removeTemperature() {
- temperature = false;
- }
-
- public boolean isTemperature() {
- return temperature;
- }
-
- public void setWeight(int w) {
- weightSetting = w;
- }
-
- public int getWeight() {
- return weightSetting;
- }
-
- public void setAcceleration(double a) {
- accelerationSetting = a;
- }
-
- public double getAcceleration() {
- return accelerationSetting;
- }
-
- public void setTemperature(Temp t) {
- temperatureSetting = t;
- }
-
- public Temp getTemperature() {
- return temperatureSetting;
- }
-
- public void setTilting (Tilt t) {
- tiltSetting = t;
- }
-
- public Tilt getTilting() {
- return tiltSetting;
- }
-
- public void setFill(boolean b) {
- fill = b;
- }
-
- public boolean getFill() {
- return fill;
- }
-
- public void setSizeScreen(float f) {
- sizeScreen = f;
- }
-
- public float getSizeScreen() {
- return sizeScreen;
- }
-
- public void setSizeFinger(float f) {
- sizeFinger = f;
- }
-
- public float getSizeFinger() {
- return sizeFinger;
- }
-
- public void setOpenSCADPath(Path p) {
- openScadPath = p;
- }
-
- public Path getOpenSCADPath() {
- return openScadPath;
- }
-
- //ADD CODE HERE FOR ADDITIONAL INTERACTION
- //At least get/set for the boolean, possibly also for additional data like size
-
- }
|