Skip to content

Commit

Permalink
Nightly commit 10-27-2021
Browse files Browse the repository at this point in the history
Working prototype! It can get the version and successfully parse an exact match.
  • Loading branch information
Rusettsten committed Oct 27, 2021
1 parent 03a8227 commit 46591fd
Show file tree
Hide file tree
Showing 50 changed files with 2,287 additions and 2,865 deletions.
50 changes: 17 additions & 33 deletions photon/src/main/java/com/strikete/photon/Main.java
Original file line number Diff line number Diff line change
@@ -1,49 +1,33 @@
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.csv.CsvCueLevelParser;
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;
import com.strikete.photon.wtsahtsi.Wtsahtsi;
import java.util.Scanner;

public class Main {

/*
* NON-MAIN METHODS
*/



/*
* MAIN METHOD
*/

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

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

//Print welcome message
printWelcomeMessage();
Photon photon = new Photon();
Scanner scanner = new Scanner(System.in);

OscInstance osc = new OscInstance(OscFormat.ETC_EOS,"192.168.0.86",6300,6301);
Main main = new Main();
System.out.println(InetAddress.getLocalHost());
String targetIp = "192.168.10.111";
int targetPort = 3032;
int listeningPort = 3033;

osc.init();
osc.getEventHandler().register(main);
photon.initializeOsc(targetIp, targetPort, listeningPort);


while(true) {
photon.updateOscObjects();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
45 changes: 42 additions & 3 deletions photon/src/main/java/com/strikete/photon/Photon.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.strikete.photon;

import java.io.IOException;
import java.util.ArrayList;

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

import com.strikete.photon.objects.BeamPalette;
Expand All @@ -21,6 +23,10 @@
import com.strikete.photon.objects.Preset;
import com.strikete.photon.objects.Snapshot;
import com.strikete.photon.objects.Sub;
import com.strikete.photon.osc.OscInterpreter;
import com.strikete.photon.osc.OscOutgoing;
import com.strikete.photon.osc.OscSender;
import com.strikete.photon.photonosc.PhotonOscRoutines;

public class Photon {

Expand All @@ -29,6 +35,15 @@ public class Photon {
*/
public static Logger log;
public static final String version = "SNAPSHOT 0.9.0";
public OscSender sender;
public OscInterpreter interpreter;


/*
* VARIABLES - EOS SPECIFIC
*/
private String eosVersion;


/*
* VARIABLES - OBJECTS
Expand All @@ -55,13 +70,18 @@ public class Photon {
/*
* METHODS - GETTERS
*/

public String getEosVersion() {
return eosVersion;
}


/*
* METHODS - SETTERS
*/

public void setEosVersion(String versionIn) {
this.eosVersion = versionIn;
System.out.println(eosVersion);
}


/*
Expand All @@ -73,6 +93,16 @@ private static void printWelcomeMessage() { //Only to be called after the logger
}


/*
* METHODS - CORE FUNCTIONS
*/

public void updateOscObjects() {
log.debug("PHOTON: Updating OSC Objects.");
sender.sendOscMessage(OscOutgoing.GET_VERSION);
}


/*
* METHODS - INITIALIZATION
*/
Expand All @@ -96,15 +126,24 @@ private void initializeVariables() {
subs = new ArrayList<Sub>();
}

public void initializeOsc() {
public void initializeOsc(String targetIp,int oscClientPort, int oscIncomingPort) {
this.sender = new OscSender(targetIp,oscClientPort);
try {
this.interpreter = new OscInterpreter(this, oscIncomingPort);
} catch (IOException e) {
log.error("PHOTON ERROR: COULD NOT ESTABLISH LISTENER AT PORT: " + oscIncomingPort);
}

PhotonOscRoutines photonOscRoutines = new PhotonOscRoutines(this, 100);
}


/*
* CONSTRUCTOR
*/
public Photon() {
log = Logger.getLogger(Photon.class);
BasicConfigurator.configure();
initializeVariables();

}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 46591fd

Please sign in to comment.