Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rusettsten committed Feb 19, 2021
0 parents commit fe4937d
Show file tree
Hide file tree
Showing 60 changed files with 4,473 additions and 0 deletions.
38 changes: 38 additions & 0 deletions photon/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
1 change: 1 addition & 0 deletions photon/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
23 changes: 23 additions & 0 deletions photon/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>photon</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
16 changes: 16 additions & 0 deletions photon/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.5
4 changes: 4 additions & 0 deletions photon/.settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
39 changes: 39 additions & 0 deletions photon/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.strikete</groupId>
<artifactId>photon</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Photon LX Console Plugin Manager</name>
<description>A plugin interface for Light Boards</description>
<dependencies>
<dependency>
<groupId>com.illposed.osc</groupId>
<artifactId>javaosc-core</artifactId>
<version>0.6</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.14.0</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.27</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>30.0-jre</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
</plugin>
</plugins>
</build>
</project>
92 changes: 92 additions & 0 deletions photon/src/main/java/com/strikete/photon/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
package com.strikete.photon;

import java.io.IOException;
import java.net.InetAddress;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;

import com.google.common.eventbus.Subscribe;
import com.strikete.photon.events.ChannelCountUpdateEvent;
import com.strikete.photon.events.ChannelUpdateEvent;
import com.strikete.photon.objects.Channel;
import com.strikete.photon.objects.DmxAddress;
import com.strikete.photon.osc.OscInstance;
import com.strikete.photon.osc.OscInstance.OscFormat;

public class Main {

/*
* VARIABLES
*/

public static final String version = "SNAPSHOT 0.0.1";
public static Logger log;

/*
* NON-MAIN METHODS
*/

private static void printWelcomeMessage() { //Only to be called after the logger object has been configured
log.info("Welcome to Photon " + version + " .");
log.info("Photon is authored by Benji Arrigo in conjunction with Strike Theatre Electronics.");
}

@Subscribe
public void onChannelUpdateEvent(ChannelUpdateEvent e) {
Channel temp = e.getChannel();
if(temp.getChannelNum() == 3000) {
System.out.println("Channel: " + temp.getChannelNum());
DmxAddress tempAddr = temp.getAddress();
System.out.println("Universe: " + tempAddr.getUniverse().getUniverseNum());
System.out.println("Address: " + tempAddr.getAddressNumber());
System.out.println("Label: " + temp.getName());
System.out.println("Manufactuer: " + temp.getManufacturer());
System.out.println("Fixture Type: " + temp.getType());
System.out.println("UID: " + temp.getUID());
System.out.println("Level: " + temp.getLevel());
}
}



/*
* MAIN METHOD
*/

public static void main(String[] args) throws IOException {

//Create Logger
log = Logger.getLogger(Main.class);
BasicConfigurator.configure();

//Print welcome message
printWelcomeMessage();

OscInstance osc = new OscInstance(OscFormat.ETC_EOS,"192.168.10.109",6300,6301);
Main main = new Main();
System.out.println(InetAddress.getLocalHost());

osc.init();
//osc.getEventHandler().register(main);
osc.getObjectUpdater().doBasicUpdate();


try {
Thread.sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

osc.getOscSender().sendOscMessage("/eos/out/active/chan");
System.out.println("message sent");
//osc.getOscSender().sendOscMessage(osc.getOscMap().KEY_BLIND);
//osc.getOscSender().selectChannel(1);
while(true) {
//osc.getOscSender().sendOscMessage(osc.getOscMap().GET_PATCH_COUNT);

}
}

}
43 changes: 43 additions & 0 deletions photon/src/main/java/com/strikete/photon/Table.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.strikete.photon;

public class Table {

/*
* VARIABLES
*/
private int numOfLegs;
private String material;

/*
* METHODS
*/
public int getNumberOfLegs() {
return this.numOfLegs;
}
public String getMaterial() {
return this.material;
}

public void setNumberOfLegs(int numOfLegsIn) {
this.numOfLegs = numOfLegsIn;
}
public void setMaterial(String materialIn) {
this.material = materialIn;
}

/*
* CONSTRUCTORS
*/
public Table() {
this.numOfLegs = 0;
this.material = "wood";
}
public Table(int numOfLegsIn) {
this.numOfLegs = numOfLegsIn;
this.material = "wood";
}
public Table(int numOfLegsIn, String materialIn) {
this.numOfLegs = numOfLegsIn;
this.material = materialIn;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.strikete.photon.events;

import com.strikete.photon.Main;
import com.strikete.photon.osc.OscInstance;

public class BeamPaletteCountUpdateEvent extends GenericUpdateEvent {

/*
* VARIABLE
*/
private int beamPaletteNum;

/*
* METHOD
*/
public int getNumberOfBeamPalettes() {
return this.beamPaletteNum;
}

/*
* CONSTRUCTOR
*/
public BeamPaletteCountUpdateEvent(OscInstance oscInstanceIn, int beamPaletteNumIn) {
super(oscInstanceIn);
this.beamPaletteNum = beamPaletteNumIn;
Main.log.debug("EVENT TRIGGERED: BeamPaletteCountUpdateEvent at " + this.getTime());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.strikete.photon.events;

import com.strikete.photon.Main;
import com.strikete.photon.objects.BeamPalette;
import com.strikete.photon.osc.OscInstance;

public class BeamPaletteUpdateEvent extends GenericUpdateEvent {

/*
* VARIABLES
*/
private BeamPalette bp;
private int indexNum;

/*
* METHODS
*/
public int getIndexNum() {
return this.indexNum;
}
public BeamPalette getBeamPalette() {
return this.bp;
}

/*
* CONSTRUCTOR
*/
public BeamPaletteUpdateEvent(OscInstance oscInstanceIn, BeamPalette bpIn, int indexNumIn) {
super(oscInstanceIn);
this.bp = bpIn;
this.indexNum = indexNumIn;
Main.log.debug("EVENT TRIGGERED: BeamPaletteUpdateEvent with Beam Palette " + bpIn.getPaletteNum() + " at " + this.getTime());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.strikete.photon.events;

import com.strikete.photon.Main;
import com.strikete.photon.osc.OscInstance;

public class ChannelCountUpdateEvent extends GenericUpdateEvent {

/*
* VARIABLE
*/
private int channelNum;

/*
* METHOD
*/
public int getNumberOfChannels() {
return this.channelNum;
}

/*
* CONSTRUCTOR
*/
public ChannelCountUpdateEvent(OscInstance oscInstanceIn, int channelNumIn) {
super(oscInstanceIn);
this.channelNum = channelNumIn;
Main.log.debug("EVENT TRIGGERED: ChannelCountUpdateEvent at " + this.getTime());
}
}
Loading

0 comments on commit fe4937d

Please sign in to comment.