wip
This commit is contained in:
parent
c6a769c1b8
commit
01ccf6d968
5 changed files with 26 additions and 3 deletions
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="11.0.3" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="11.0.5" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -11,7 +11,7 @@ import javax.persistence.OneToMany;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
public class ButtonDimmer extends Dimmer {
|
public class ButtonDimmer extends Dimmer {
|
||||||
@OneToMany(mappedBy = "")
|
@OneToMany(mappedBy = "button_dimmer")
|
||||||
private Set<DimmableLight> lights = new HashSet<DimmableLight>();
|
private Set<DimmableLight> lights = new HashSet<DimmableLight>();
|
||||||
|
|
||||||
public ButtonDimmer() {
|
public ButtonDimmer() {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import javax.persistence.OneToMany;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
public class KnobDimmer extends Dimmer {
|
public class KnobDimmer extends Dimmer {
|
||||||
@OneToMany(mappedBy = "")
|
@OneToMany(mappedBy = "knob_dimmer")
|
||||||
private Set<DimmableLight> lights = new HashSet<DimmableLight>();
|
private Set<DimmableLight> lights = new HashSet<DimmableLight>();
|
||||||
|
|
||||||
public KnobDimmer() {
|
public KnobDimmer() {
|
||||||
|
|
|
@ -1,11 +1,29 @@
|
||||||
package ch.usi.inf.sa4.sanmarinoes.smarthut.models;
|
package ch.usi.inf.sa4.sanmarinoes.smarthut.models;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/** A switch input device TODO: define switch behaviour (push button vs on/off state) */
|
/** A switch input device TODO: define switch behaviour (push button vs on/off state) */
|
||||||
@Entity
|
@Entity
|
||||||
public class Switch extends InputDevice {
|
public class Switch extends InputDevice {
|
||||||
|
|
||||||
|
/** The state of this switch */
|
||||||
|
@Column private boolean switchState = false;
|
||||||
|
|
||||||
public Switch() {
|
public Switch() {
|
||||||
super("switch");
|
super("switch");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setter method for Switch
|
||||||
|
*
|
||||||
|
* @param state The state to be set
|
||||||
|
*/
|
||||||
|
void setState(boolean state) {
|
||||||
|
switchState = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean getState() {
|
||||||
|
return switchState;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue