From f14011c038ae36f5a459d06b823776faa490808a Mon Sep 17 00:00:00 2001 From: Benji Arrigo Date: Sat, 16 Oct 2021 15:58:39 -0500 Subject: [PATCH] Data Model Deployment 10/16/2021 Data models complete! Also adjusted some old ones to make getIndex() standard --- .../strikete/photon/objects/BeamPalette.java | 4 +- .../strikete/photon/objects/ColorPalette.java | 4 +- .../com/strikete/photon/objects/Curve.java | 47 ++++++++ .../com/strikete/photon/objects/Effect.java | 66 +++++++---- .../strikete/photon/objects/FocusPalette.java | 4 +- .../com/strikete/photon/objects/Group.java | 2 +- .../photon/objects/IntensityPalette.java | 4 +- .../strikete/photon/objects/MagicSheet.java | 47 ++++++++ .../com/strikete/photon/objects/Palette.java | 108 +++++++++++++----- .../com/strikete/photon/objects/Pixelmap.java | 101 ++++++++++++++++ .../com/strikete/photon/objects/Preset.java | 7 +- .../com/strikete/photon/objects/Snapshot.java | 47 ++++++++ .../java/com/strikete/photon/objects/Sub.java | 2 +- 13 files changed, 379 insertions(+), 64 deletions(-) create mode 100644 photon/src/main/java/com/strikete/photon/objects/Curve.java create mode 100644 photon/src/main/java/com/strikete/photon/objects/MagicSheet.java create mode 100644 photon/src/main/java/com/strikete/photon/objects/Pixelmap.java create mode 100644 photon/src/main/java/com/strikete/photon/objects/Snapshot.java diff --git a/photon/src/main/java/com/strikete/photon/objects/BeamPalette.java b/photon/src/main/java/com/strikete/photon/objects/BeamPalette.java index b5fc370..4c578ad 100644 --- a/photon/src/main/java/com/strikete/photon/objects/BeamPalette.java +++ b/photon/src/main/java/com/strikete/photon/objects/BeamPalette.java @@ -3,7 +3,7 @@ public class BeamPalette extends Palette { //Only need the constructor - public BeamPalette(float bpNumIn, String UIDin, String nameIn, boolean absoluteIn, boolean lockedIn) { - super(bpNumIn, UIDin, nameIn, absoluteIn, lockedIn); + public BeamPalette(float bpNumIn, int indexIn, String uidIn) { + super(bpNumIn, indexIn, uidIn); } } diff --git a/photon/src/main/java/com/strikete/photon/objects/ColorPalette.java b/photon/src/main/java/com/strikete/photon/objects/ColorPalette.java index 87932a4..ce93d1b 100644 --- a/photon/src/main/java/com/strikete/photon/objects/ColorPalette.java +++ b/photon/src/main/java/com/strikete/photon/objects/ColorPalette.java @@ -3,7 +3,7 @@ public class ColorPalette extends Palette { //Only need the constructor - public ColorPalette(float cpNumIn, String UIDin, String nameIn, boolean absoluteIn, boolean lockedIn) { - super(cpNumIn, UIDin, nameIn, absoluteIn, lockedIn); + public ColorPalette(float cpNumIn, int indexIn, String uidIn) { + super(cpNumIn, indexIn, uidIn); } } diff --git a/photon/src/main/java/com/strikete/photon/objects/Curve.java b/photon/src/main/java/com/strikete/photon/objects/Curve.java new file mode 100644 index 0000000..f416762 --- /dev/null +++ b/photon/src/main/java/com/strikete/photon/objects/Curve.java @@ -0,0 +1,47 @@ +package com.strikete.photon.objects; + +public class Curve { + + /* + * VARIABLES + */ + private int curveNum; + private int index; + private String uid; + private String label; + + + /* + * METHODS - GETTERS + */ + public int getCurveNumber() { + return curveNum; + } + public int getIndex() { + return index; + } + public String getUid() { + return uid; + } + public String getLabel() { + return label; + } + + + /* + * METHODS - SETTER + */ + public void setLabel(String labelIn) { + this.label = labelIn; + } + + + /* + * CONSTRUCTOR + */ + public Curve(int curveNumIn, int indexIn, String uidIn) { + this.curveNum = curveNumIn; + this.index = indexIn; + this.uid = uidIn; + } +} \ No newline at end of file diff --git a/photon/src/main/java/com/strikete/photon/objects/Effect.java b/photon/src/main/java/com/strikete/photon/objects/Effect.java index 3165cb7..cf2d56a 100644 --- a/photon/src/main/java/com/strikete/photon/objects/Effect.java +++ b/photon/src/main/java/com/strikete/photon/objects/Effect.java @@ -5,56 +5,78 @@ public class Effect { /* * VARIABLES */ - private float fxNum; - private String UID; - private String name; - private String effectType; //TODO: Make enumeration of types + private float effectNum; + private int index; + private String uid; + private String label; + private String effectType; private String entry; private String exit; private String duration; private String scale; + /* - * METHODS + * METHODS - GETTERS */ - public float getEffectNum() { - return this.fxNum; + public float getEffectNumber() { + return effectNum; + } + public int getIndex() { + return index; } - public String getUID() { - return this.UID; + public String getUid() { + return uid; } - public String getName() { - return this.name; + public String getLabel() { + return label; } public String getEffectType() { - return this.effectType; + return effectType; } public String getEntry() { - return this.entry; + return entry; } public String getExit() { - return this.exit; + return exit; } public String getDuration() { - return this.duration; + return duration; } public String getScale() { - return this.scale; + return scale; } + /* - * CONSTRUCTOR + * METHODS - SETTERS */ - public Effect(float fxNumIn, String UIDin, String nameIn, String effectTypeIn, String entryIn, String exitIn, String durationIn, String scaleIn) { - this.fxNum = fxNumIn; - this.UID = UIDin; - this.name = nameIn; + public void setLabel(String labelIn) { + this.label = labelIn; + } + public void setEffectType(String effectTypeIn) { this.effectType = effectTypeIn; + } + public void setEntry(String entryIn) { this.entry = entryIn; + } + public void setExit(String exitIn) { this.exit = exitIn; + } + public void setDuration(String durationIn) { this.duration = durationIn; + } + public void setScale(String scaleIn) { this.scale = scaleIn; } -} + /* + * CONSTRUCTOR + */ + public Effect(float effectNumIn, int indexIn, String uidIn) { + this.effectNum = effectNumIn; + this.index = indexIn; + this.uid = uidIn; + } +} \ No newline at end of file diff --git a/photon/src/main/java/com/strikete/photon/objects/FocusPalette.java b/photon/src/main/java/com/strikete/photon/objects/FocusPalette.java index 9d448db..1728544 100644 --- a/photon/src/main/java/com/strikete/photon/objects/FocusPalette.java +++ b/photon/src/main/java/com/strikete/photon/objects/FocusPalette.java @@ -3,7 +3,7 @@ public class FocusPalette extends Palette { //Only need the constructor - public FocusPalette(float fpNumIn, String UIDin, String nameIn, boolean absoluteIn, boolean lockedIn) { - super(fpNumIn, UIDin, nameIn, absoluteIn, lockedIn); + public FocusPalette(float fpNumIn, int indexIn, String uidIn) { + super(fpNumIn, indexIn, uidIn); } } diff --git a/photon/src/main/java/com/strikete/photon/objects/Group.java b/photon/src/main/java/com/strikete/photon/objects/Group.java index 9283a4c..133900b 100644 --- a/photon/src/main/java/com/strikete/photon/objects/Group.java +++ b/photon/src/main/java/com/strikete/photon/objects/Group.java @@ -20,7 +20,7 @@ public class Group { public float getGroupNumber() { return groupNum; } - public float getIndexNumber() { + public float getIndex() { return index; } public String getUid() { diff --git a/photon/src/main/java/com/strikete/photon/objects/IntensityPalette.java b/photon/src/main/java/com/strikete/photon/objects/IntensityPalette.java index 409bc6d..c059ce7 100644 --- a/photon/src/main/java/com/strikete/photon/objects/IntensityPalette.java +++ b/photon/src/main/java/com/strikete/photon/objects/IntensityPalette.java @@ -3,7 +3,7 @@ public class IntensityPalette extends Palette { //Only need the constructor - public IntensityPalette(float ipNumIn, String UIDin, String nameIn, boolean absoluteIn, boolean lockedIn) { - super(ipNumIn, UIDin, nameIn, absoluteIn, lockedIn); + public IntensityPalette(float ipNumIn, int indexIn, String uidIn) { + super(ipNumIn, indexIn, uidIn); } } diff --git a/photon/src/main/java/com/strikete/photon/objects/MagicSheet.java b/photon/src/main/java/com/strikete/photon/objects/MagicSheet.java new file mode 100644 index 0000000..fcfa544 --- /dev/null +++ b/photon/src/main/java/com/strikete/photon/objects/MagicSheet.java @@ -0,0 +1,47 @@ +package com.strikete.photon.objects; + +public class MagicSheet { + + /* + * VARIABLES + */ + private int magicSheetNum; + private int index; + private String uid; + private String label; + + + /* + * METHODS - GETTERS + */ + public int getMagicSheetNumber() { + return magicSheetNum; + } + public int getIndex() { + return index; + } + public String getUid() { + return uid; + } + public String getLabel() { + return label; + } + + + /* + * METHODS - SETTER + */ + public void setLabel(String labelIn) { + this.label = labelIn; + } + + + /* + * CONSTRUCTOR + */ + public MagicSheet(int magicSheetNumIn, int indexIn, String uidIn) { + this.magicSheetNum = magicSheetNumIn; + this.index = indexIn; + this.uid = uidIn; + } +} \ No newline at end of file diff --git a/photon/src/main/java/com/strikete/photon/objects/Palette.java b/photon/src/main/java/com/strikete/photon/objects/Palette.java index 8cdcc22..47d7b54 100644 --- a/photon/src/main/java/com/strikete/photon/objects/Palette.java +++ b/photon/src/main/java/com/strikete/photon/objects/Palette.java @@ -2,62 +2,108 @@ import java.util.ArrayList; -public class Palette { +public class Palette implements CsvLevelDataSetter { /* * VARIABLES */ private float paletteNum; - private String UID; - private String name; + private int index; + private String uid; + private String label; private boolean absolute; private boolean locked; - private ArrayList channels = new ArrayList(); - private ArrayList effects = new ArrayList(); + private ArrayList channelList = new ArrayList(); + private ArrayList byTypeChannelList = new ArrayList(); + private ArrayList channels = new ArrayList(); + private ArrayList parameters = new ArrayList(); + private ArrayList levels = new ArrayList(); + /* - * METHODS + * METHODS - GETTERS */ - - public float getPaletteNum() { - return this.paletteNum; + public float getPaletteNumber() { + return paletteNum; } - public String getUID() { - return this.UID; + public int getIndex() { + return index; } - public String getName() { - return this.name; + public String getUid() { + return uid; + } + public String getLabel() { + return label; } public boolean getAbsolute() { - return this.absolute; + return absolute; } public boolean getLocked() { - return this.locked; + return locked; } - public Channel getChannel(int indexNum) { - return channels.get(indexNum); + public ArrayList getChannelList() { + return channelList; } - public int getChannelCount() { - return channels.size(); + public ArrayList getByTypeChannelList() { + return byTypeChannelList; } - public int getEffectCount() { - return effects.size(); + public ArrayList getChannels() { + return channels; } - public void addChannel(Channel channelIn) { - channels.add(channelIn); + public ArrayList getParameters() { + return parameters; } - public void addEffect(Effect effectIn) { - effects.add(effectIn); + public ArrayList getLevels() { + return levels; } + /* - * CONSTRUCTOR + * METHODS - SETTERS */ - public Palette(float paletteNumIn, String UIDin, String nameIn, boolean absoluteIn, boolean lockedIn) { - this.paletteNum = paletteNumIn; - this.UID = UIDin; - this.name = nameIn; + public void setLabel(String labelIn) { + this.label = labelIn; + } + public void setAbsolute(boolean absoluteIn) { this.absolute = absoluteIn; + } + public void setLocked(boolean lockedIn) { this.locked = lockedIn; } -} + public void setChannelList(ArrayList channelListIn) { + this.channelList = channelListIn; + } + public void setByTypeChannelList(ArrayList byTypeChannelListIn) { + this.byTypeChannelList = byTypeChannelListIn; + } + public void setChannels(ArrayList channelsIn) { + this.channels = channelsIn; + } + public void setParamters(ArrayList parametersIn) { + this.parameters = parametersIn; + } + public void setLevels(ArrayList levelsIn) { + this.levels = levelsIn; + } + + + /* + * METHODS - INTERFACES + */ + @Override + public void addCsvLevelData(int channelIn, String parameterIn, float levelIn) { + this.channels.add(channelIn); + this.parameters.add(parameterIn); + this.levels.add(levelIn); + } + + + /* + * CONSTRUCTOR + */ + public Palette(float paletteNumIn, int indexIn, String uidIn) { + this.paletteNum = paletteNumIn; + this.index = indexIn; + this.uid = uidIn; + } +} \ No newline at end of file diff --git a/photon/src/main/java/com/strikete/photon/objects/Pixelmap.java b/photon/src/main/java/com/strikete/photon/objects/Pixelmap.java new file mode 100644 index 0000000..c06894d --- /dev/null +++ b/photon/src/main/java/com/strikete/photon/objects/Pixelmap.java @@ -0,0 +1,101 @@ +package com.strikete.photon.objects; + +import java.util.ArrayList; + +public class Pixelmap { + + /* + * VARIABLES + */ + private int pixelmapNum; + private int index; + private String uid; + private String label; + private int serverChannel; + private String interfaceVar; + private int width; + private int height; + private int pixelCount; + private int fixtureCount; + private ArrayList layerChannelList = new ArrayList(); + + + /* + * METHODS - GETTERS + */ + public int getPixelmapNumber() { + return pixelmapNum; + } + public int getIndex() { + return index; + } + public String getUid() { + return uid; + } + public String getLabel() { + return label; + } + public int getServerChannel() { + return serverChannel; + } + public String getInterface() { + return interfaceVar; + } + public int getWidth() { + return width; + } + public int getHeight() { + return height; + } + public int getPixelCount() { + return pixelCount; + } + public int getFixtureCount() { + return fixtureCount; + } + public ArrayList getLayerChannelList() { + return layerChannelList; + } + + + /* + * METHODS - SETTERS + */ + public void setLabel(String labelIn) { + this.label = labelIn; + } + public void setServerChannel(int serverChannelIn) { + this.serverChannel = serverChannelIn; + } + public void setInterface(String interfaceIn) { + this.interfaceVar = interfaceIn; + } + public void setWidth(int widthIn) { + this.width = widthIn; + } + public void setHeight(int heightIn) { + this.height = heightIn; + } + public void setPixelCount(int pixelCountIn) { + this.pixelCount = pixelCountIn; + } + public void setFixtureCount(int fixtureCountIn) { + this.fixtureCount = fixtureCountIn; + } + public void setLayerChannelList(ArrayList layerChannelListIn) { + this.layerChannelList = layerChannelListIn; + } + public void addLayerChannel(int layerChannelIn) { + this.layerChannelList.add(layerChannelIn); + } + + + /* + * CONSTRUCTOR + */ + public Pixelmap(int pixelmapNumIn, int indexIn, String uidIn) { + this.pixelmapNum = pixelmapNumIn; + this.index = indexIn; + this.uid = uidIn; + } +} \ No newline at end of file diff --git a/photon/src/main/java/com/strikete/photon/objects/Preset.java b/photon/src/main/java/com/strikete/photon/objects/Preset.java index bc6bf07..79eac34 100644 --- a/photon/src/main/java/com/strikete/photon/objects/Preset.java +++ b/photon/src/main/java/com/strikete/photon/objects/Preset.java @@ -27,7 +27,7 @@ public class Preset implements CsvLevelDataSetter { public float getPresetNumber() { return presetNum; } - public int getIndexNumber() { + public int getIndex() { return index; } public String getUid() { @@ -111,5 +111,10 @@ public void addCsvLevelData(int channelIn, String parameterIn, float levelIn) { /* * CONSTRUCTOR */ + public Preset(float presetNumIn, int indexIn, String uidIn) { + this.presetNum = presetNumIn; + this.index = indexIn; + this.uid = uidIn; + } } \ No newline at end of file diff --git a/photon/src/main/java/com/strikete/photon/objects/Snapshot.java b/photon/src/main/java/com/strikete/photon/objects/Snapshot.java new file mode 100644 index 0000000..4cf93a4 --- /dev/null +++ b/photon/src/main/java/com/strikete/photon/objects/Snapshot.java @@ -0,0 +1,47 @@ +package com.strikete.photon.objects; + +public class Snapshot { + + /* + * VARIABLES + */ + private int snapshotNum; + private int index; + private String uid; + private String label; + + + /* + * METHODS - GETTERS + */ + public int getSnapshotNumber() { + return snapshotNum; + } + public int getIndex() { + return index; + } + public String getUid() { + return uid; + } + public String getLabel() { + return label; + } + + + /* + * METHODS - SETTER + */ + public void setLabel(String labelIn) { + this.label = labelIn; + } + + + /* + * CONSTRUCTOR + */ + public Snapshot(int snapshotNumIn, int indexIn, String uidIn) { + this.snapshotNum = snapshotNumIn; + this.index = indexIn; + this.uid = uidIn; + } +} \ No newline at end of file diff --git a/photon/src/main/java/com/strikete/photon/objects/Sub.java b/photon/src/main/java/com/strikete/photon/objects/Sub.java index 7609409..4853f0e 100644 --- a/photon/src/main/java/com/strikete/photon/objects/Sub.java +++ b/photon/src/main/java/com/strikete/photon/objects/Sub.java @@ -33,7 +33,7 @@ public class Sub implements CsvLevelDataSetter { public int getSubNumber() { return subNum; } - public int getIndexNumber() { + public int getIndex() { return index; } public String getUid() {