Commit e24025ae authored by Moses Swai's avatar Moses Swai
Browse files

Clean up FlightEngine and add more documentation

parent 98030847
package engine;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import model.FlightModel;
......@@ -74,30 +72,72 @@ public abstract class FlightEngine implements FlightPlaylist {
/***** PUBLIC FUNCTIONS *****/
/**
* Returns the FlightModel used to create the LXModel
*
* @return The FlightModel
*/
public FlightModel getModel() {
return model;
}
/**
* Returns an array with all the flyer configurations
* This array can be used to save the current flyer states
* to a .json file using the IO class
*
* @return A FlyerConfig array
*/
public FlyerConfig[] getFlyerConfigs() {
return model.getFlyerConfigs();
}
/**
* Returns the number of patterns in each channel.
* This assumes that every channel has the same patterns
*
* @return The number of patterns
*/
public int numPatterns() {
return this.patterns.size();
}
/**
* Returns the number of channels in the LXMixerEngine
* NOTE: This does not count the master channel
*
* @return The number of channels
*/
public int numChannels() {
return this.lx.engine.mixer.channels.size();
}
/**
* Returns the LXMixerEngine object in the LXEngine
*
* @return A list of LXAbstractChannel
*/
public LXMixerEngine getMixerEngine() {
return lx.engine.mixer;
}
/**
* Returns the loaded channels in the LX engine.
* NOTE: This does not include the master channel
*
* @return A list of LXAbstractChannel
*/
List<LXAbstractChannel> getChannels() {
return lx.engine.mixer.channels;
}
/**
* Returns the IO class object for saving and loading
* flyer configurations and playlist
*
* @return The IO class object
*/
public IO getIO(){
return io;
}
......@@ -214,11 +254,13 @@ public abstract class FlightEngine implements FlightPlaylist {
}
}
/* Adds patterns to the pattern list passed as parameter.
* This pattern is useful because each channel has its own
* list of patterns, since each instance of a pattern might
* have different settings.
*/
// PRIVATE FUNCTIONS
/* Adds patterns to the pattern list passed as parameter.
* This pattern is useful because each channel has its own
* list of patterns, since each instance of a pattern might
* have different settings.
*/
private void addPatterns(ArrayList<LXPattern> patterns) {
patterns.add(new ColorWheel(lx));
patterns.add(new ColorWave(lx));
......
......@@ -192,7 +192,7 @@ class ColorSweep extends FlightPattern {
float max_distance = (float)Math.sqrt((max_x * max_x) + (max_z * max_z));
final BoundedParameter period = new BoundedParameter("PERIOD", 10000, 1000, 50000);
final BoundedParameter range = new BoundedParameter("RANGE", 5, 0, 10);
final BoundedParameter range = new BoundedParameter("RANGE", 5, 0, 100);
final BoundedParameter hue = new BoundedParameter("HUE", 100, 0, 360);
final TriangleLFO position = new TriangleLFO(0, max_distance, period);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment