Skip to content

Commit

Permalink
eingelesene Geraete werden dargestellt, refs #2, #5, #8
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowballThrower committed Feb 12, 2016
1 parent a3dba3b commit d48110e
Show file tree
Hide file tree
Showing 14 changed files with 272 additions and 51 deletions.
134 changes: 130 additions & 4 deletions DMXSoftware/Data/DeviceTypes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Name>"AmericanDJ"</Name>
<Type>"Par"</Type>
<Power>"36"</Power>
<Symbol>"./Pictures/ADJ.png"</Symbol>
<Symbol>"http://static.americandj.eu/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/3/0/304155_2.jpg"</Symbol>

<Channels No="7">

Expand Down Expand Up @@ -108,7 +108,7 @@
<Name>"Renkforce RDM Par_10"</Name>
<Type>"Par"</Type>
<Power>"60"</Power>
<Symbol>"./Pictures/RenkforceRDM_10.png"</Symbol>
<Symbol>"https://www.conrad.de/medias/global/ce/6000_6999/6400/6440/6448/1301624_LB_00_FB.EPS_1000.jpg"</Symbol>

<Channels No="10">
<Channel Nr="1" F="Red">
Expand All @@ -132,7 +132,7 @@
<Name>"Renkforce RDM Par_5"</Name>
<Type>"Par"</Type>
<Power>"60"</Power>
<Symbol>"./Pictures/RenkforceRDM_5.png"</Symbol>
<Symbol>"Data/Pictures/RenkforceRDM_5.png"</Symbol>

<Channels No="5">

Expand Down Expand Up @@ -185,7 +185,7 @@
<Name>"Stairville LED Bar 24"</Name>
<Type>"Bar"</Type>
<Power>"36"</Power>
<Symbol>"./Pictures/Bar24.png"</Symbol>
<Symbol>"https://www.thomann.de/pics/bdb/294835/6519071_800.jpg"</Symbol>

<Channels No="24">
<Channel Nr="1" F="Red">
Expand Down Expand Up @@ -230,6 +230,132 @@
</conditions>
</Values>
</Channel>
<Channel Nr="7" F="Red">
<ChName>"Red2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="8" F="Green">
<ChName>"Green2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="9" F="Blue">
<ChName>"Blue2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="10" F="Red">
<ChName>"Red2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="11" F="Green">
<ChName>"Green2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="12" F="Blue">
<ChName>"Blue2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="13" F="Red">
<ChName>"Red2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="14" F="Green">
<ChName>"Green2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="15" F="Blue">
<ChName>"Blue2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="16" F="Red">
<ChName>"Red2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="17" F="Green">
<ChName>"Green2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="18" F="Blue">
<ChName>"Blue2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="19" F="Red">
<ChName>"Red2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="20" F="Green">
<ChName>"Green2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="21" F="Blue">
<ChName>"Blue2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="22" F="Red">
<ChName>"Red2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="23" F="Green">
<ChName>"Green2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
<Channel Nr="24" F="Blue">
<ChName>"Blue2"</ChName>
<Values case="0">
<conditions>
</conditions>
</Values>
</Channel>
</Channels>
</Device>
</ExampleDevices>
15 changes: 15 additions & 0 deletions DMXSoftware/Data/Devices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,19 @@
<Name>"BAR 1"</Name>
<Additional>"Kuhstall Tor-Seite Mistfall"</Additional>
</Device>
<Device Id="5" Channel="125">
<Type Id="4"></Type>
<Name>"BAR 2"</Name>
<Additional>"Kuhstall Tor-Seite Deele"</Additional>
</Device>
<Device Id="6" Channel="150">
<Type Id="4"></Type>
<Name>"BAR 3"</Name>
<Additional>"Kuhstall Haus-Seite Mistfall"</Additional>
</Device>
<Device Id="7" Channel="175">
<Type Id="4"></Type>
<Name>"BAR 4"</Name>
<Additional>"Kuhstall Haus-Seite Deele"</Additional>
</Device>
</Devices>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMXSoftware/Data/Pictures/ADJ_Par.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMXSoftware/Data/Pictures/ADJ_Par.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,25 @@
*
* @author Sven
*/
class Channel {
public class Channel {

String name;
int number;
Function funcion;
Function function;
List<Meaning> meanings;
String getMeaning(int value, int[] values){

String getMeaning(int value, int[] values) {
int i;
for(i=0;i<meanings.size();i++){
if(meanings.get(i).met(values)){
for (i = 0; i < meanings.size(); i++) {
if (meanings.get(i).met(values)) {
return meanings.get(i).getMeaning(value);
}
}
return value+"";
return value + "";
}

public Function getFunction() {
return function;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ public String getName() {
public DeviceType getType() {
return this.type;
}

public String getImagePath() {
return type.picturePath;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public String getChannelNames() {
if (channels != null) {
for (Channel channel : channels) {
if (channel != null) {
string = string + " " + channel.name + " " + channel.funcion;
string = string + " " + channel.name + " " + channel.function;
}
}
} else {
Expand All @@ -67,4 +67,8 @@ public String getChannelName(int x) {
return "no Channel";
}

public Channel[] getChannels() {
return channels;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public List<DeviceType> getTypes() {

Element channelElement = (Element) channelNode;
channel.number = Integer.parseInt(rem(channelElement.getAttribute("Nr")));
channel.funcion = Function.toFunction(rem(channelElement.getAttribute("F")));
channel.function = Function.toFunction(rem(channelElement.getAttribute("F")));
channel.name = rem(channelElement.getElementsByTagName("ChName")
.item(0).getTextContent());
System.out.println(channel.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import SnowballThrower.dmxsoftware.Database.Function;
import SnowballThrower.dmxsoftware.Processing.Devices;
import SnowballThrower.dmxsoftware.Database.XMLReader;
import SnowballThrower.dmxsoftware.Surface.ControlSurface;
import SnowballThrower.dmxsoftware.Surface.Fader;
import SnowballThrower.dmxsoftware.Surface.FaderListener;
import javafx.application.Application;
Expand Down Expand Up @@ -35,33 +36,13 @@ public void start(Stage primaryStage) {
public void handle(ActionEvent event) {
System.out.println("Hello World!");
Devices devices = new Devices();
new ControlSurface(devices.getDevices());
}
});

StackPane root = new StackPane();
Fader fader1 = new Fader(Function.Red, 50, 50, 100, 500);
Fader fader2 = new Fader(Function.Green, 150, 50, 100, 500);
Fader fader3 = new Fader(Function.Blue, 250, 50, 100, 500);
Fader fader4 = new Fader(Function.White, 350, 50, 100, 500);
Fader fader5 = new Fader(Function.Amber, 450, 50, 100, 500);
Fader fader6 = new Fader(Function.UV, 550, 50, 100, 500);
Fader fader7 = new Fader(Function.Dimmer, 650, 50, 100, 500);
FaderListener fl = new FaderListener();
fl.addFader(fader1);
fl.addFader(fader2);
fl.addFader(fader3);
fl.addFader(fader4);
fl.addFader(fader5);
fl.addFader(fader6);
fl.addFader(fader7);
root.getChildren().add(btn);
Group group = new Group(root, fader1.getFader(), fader2.getFader(),
fader3.getFader(), fader4.getFader(), fader5.getFader(),
fader6.getFader(), fader7.getFader());
Scene scene = new Scene(group, 300, 250);
scene.setOnMouseClicked(fl);
scene.setOnMousePressed(fl);
scene.setOnMouseDragged(fl);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Devices() {
}
}
System.out.println("have merged.");
showDevs();
//showDevs();
}

private void showDevs() {
Expand All @@ -43,12 +43,16 @@ private void showDevs() {
System.out.println(device.getType().getChannelNames());
int[] values = new int[device.getType().getChannelNumber()];
for (int v = 0; v < 256; v++) {
for (int x = 0; x<device.getType().getChannelNumber();x++) {
values[x]=v;
System.out.println(device.getType().getMeaning(x, values)+device.getType().getChannelName(x));
for (int x = 0; x < device.getType().getChannelNumber(); x++) {
values[x] = v;
System.out.println(device.getType().getMeaning(x, values) + device.getType().getChannelName(x));
}

}
}
}

public List<Device> getDevices() {
return this.devices;
}
}
Loading

0 comments on commit d48110e

Please sign in to comment.