├── .classpath ├── .gitignore ├── .project ├── .settings ├── org.eclipse.jdt.core.prefs └── org.eclipse.jdt.ui.prefs ├── LICENSE ├── README.md ├── doc ├── allclasses-frame.html ├── allclasses-noframe.html ├── com │ └── heroicrobot │ │ ├── controlsynthesis │ │ ├── ConstantGenerator.html │ │ ├── Parameterized.html │ │ ├── RampGenerator.html │ │ ├── Receiver.html │ │ ├── SineFunction.html │ │ ├── SynthesisModule.html │ │ ├── Transmitter.html │ │ ├── class-use │ │ │ ├── ConstantGenerator.html │ │ │ ├── Parameterized.html │ │ │ ├── RampGenerator.html │ │ │ ├── Receiver.html │ │ │ ├── SineFunction.html │ │ │ ├── SynthesisModule.html │ │ │ └── Transmitter.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ └── package-use.html │ │ └── dropbit │ │ ├── common │ │ ├── ByteUtils.html │ │ ├── class-use │ │ │ └── ByteUtils.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ └── package-use.html │ │ ├── devices │ │ ├── Device.html │ │ ├── DeviceImpl.html │ │ ├── class-use │ │ │ ├── Device.html │ │ │ └── DeviceImpl.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ ├── package-use.html │ │ └── pixelpusher │ │ │ ├── CardThread.html │ │ │ ├── Pixel.html │ │ │ ├── PixelPusher.html │ │ │ ├── PusherCommand.html │ │ │ ├── PusherGroup.html │ │ │ ├── PusherTask.html │ │ │ ├── SceneThread.html │ │ │ ├── Strip.html │ │ │ ├── class-use │ │ │ ├── CardThread.html │ │ │ ├── Pixel.html │ │ │ ├── PixelPusher.html │ │ │ ├── PusherCommand.html │ │ │ ├── PusherGroup.html │ │ │ ├── PusherTask.html │ │ │ ├── SceneThread.html │ │ │ └── Strip.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── package-use.html │ │ ├── discovery │ │ ├── DeviceHeader.html │ │ ├── DeviceHeaderTest.html │ │ ├── DeviceType.html │ │ ├── class-use │ │ │ ├── DeviceHeader.html │ │ │ ├── DeviceHeaderTest.html │ │ │ └── DeviceType.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ └── package-use.html │ │ └── registry │ │ ├── DeviceRegistry.html │ │ ├── DeviceRegistryTest.html │ │ ├── class-use │ │ ├── DeviceRegistry.html │ │ └── DeviceRegistryTest.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ └── package-use.html ├── constant-values.html ├── deprecated-list.html ├── help-doc.html ├── index-files │ ├── index-1.html │ ├── index-10.html │ ├── index-11.html │ ├── index-12.html │ ├── index-13.html │ ├── index-14.html │ ├── index-15.html │ ├── index-16.html │ ├── index-17.html │ ├── index-18.html │ ├── index-19.html │ ├── index-2.html │ ├── index-3.html │ ├── index-4.html │ ├── index-5.html │ ├── index-6.html │ ├── index-7.html │ ├── index-8.html │ └── index-9.html ├── index.html ├── overview-frame.html ├── overview-summary.html ├── overview-tree.html ├── package-list ├── resources │ ├── background.gif │ ├── inherit.gif │ ├── tab.gif │ ├── titlebar.gif │ └── titlebar_end.gif └── stylesheet.css ├── lib └── core.jar └── src └── com └── heroicrobot ├── controlsynthesis ├── ConstantGenerator.java ├── Parameterized.java ├── RampGenerator.java ├── Receiver.java ├── SineFunction.java ├── SynthesisModule.java ├── Transmitter.java └── package-info.java └── dropbit ├── common └── ByteUtils.java ├── devices ├── Device.java ├── DeviceImpl.java └── pixelpusher │ ├── CardThread.java │ ├── Pixel.java │ ├── PixelPusher.java │ ├── PusherCommand.java │ ├── PusherGroup.java │ ├── SceneThread.java │ └── Strip.java ├── discovery ├── DeviceHeader.java ├── DeviceHeaderTest.java └── DeviceType.java └── registry ├── DeviceRegistry.java └── DeviceRegistryTest.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Package Files # 4 | *.jar 5 | *.war 6 | *.ear 7 | 8 | .DS_Store 9 | 10 | compiled/PixelPusher.jar 11 | /bin 12 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | PixelPusher-java 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | formatter_profile=_Dropbit style2 3 | formatter_settings_version=12 4 | org.eclipse.jdt.ui.exception.name=e 5 | org.eclipse.jdt.ui.gettersetter.use.is=true 6 | org.eclipse.jdt.ui.keywordthis=false 7 | org.eclipse.jdt.ui.overrideannotation=true 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PixelPusher-processing 2 | ====================== 3 | 4 | Java processing library to interact with PixelPushers -------------------------------------------------------------------------------- /doc/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | All Classes 20 |
21 | 22 | 23 | 24 | 69 | 70 |
ByteUtils 25 |
26 | CardThread 27 |
28 | ConstantGenerator 29 |
30 | Device 31 |
32 | DeviceHeader 33 |
34 | DeviceHeaderTest 35 |
36 | DeviceImpl 37 |
38 | DeviceRegistry 39 |
40 | DeviceRegistryTest 41 |
42 | DeviceType 43 |
44 | Parameterized 45 |
46 | Pixel 47 |
48 | PixelPusher 49 |
50 | PusherCommand 51 |
52 | PusherGroup 53 |
54 | RampGenerator 55 |
56 | Receiver 57 |
58 | SceneThread 59 |
60 | SineFunction 61 |
62 | Strip 63 |
64 | SynthesisModule 65 |
66 | Transmitter 67 |
68 |
71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /doc/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | All Classes 20 |
21 | 22 | 23 | 24 | 69 | 70 |
ByteUtils 25 |
26 | CardThread 27 |
28 | ConstantGenerator 29 |
30 | Device 31 |
32 | DeviceHeader 33 |
34 | DeviceHeaderTest 35 |
36 | DeviceImpl 37 |
38 | DeviceRegistry 39 |
40 | DeviceRegistryTest 41 |
42 | DeviceType 43 |
44 | Parameterized 45 |
46 | Pixel 47 |
48 | PixelPusher 49 |
50 | PusherCommand 51 |
52 | PusherGroup 53 |
54 | RampGenerator 55 |
56 | Receiver 57 |
58 | SceneThread 59 |
60 | SineFunction 61 |
62 | Strip 63 |
64 | SynthesisModule 65 |
66 | Transmitter 67 |
68 |
71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/controlsynthesis/class-use/ConstantGenerator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.heroicrobot.controlsynthesis.ConstantGenerator 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Uses of Class
com.heroicrobot.controlsynthesis.ConstantGenerator

85 |
86 | No usage of com.heroicrobot.controlsynthesis.ConstantGenerator 87 |

88 |


89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/controlsynthesis/class-use/RampGenerator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.heroicrobot.controlsynthesis.RampGenerator 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Uses of Class
com.heroicrobot.controlsynthesis.RampGenerator

85 |
86 | No usage of com.heroicrobot.controlsynthesis.RampGenerator 87 |

88 |


89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/controlsynthesis/class-use/SineFunction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.heroicrobot.controlsynthesis.SineFunction 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Uses of Class
com.heroicrobot.controlsynthesis.SineFunction

85 |
86 | No usage of com.heroicrobot.controlsynthesis.SineFunction 87 |

88 |


89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/controlsynthesis/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.controlsynthesis 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | com.heroicrobot.controlsynthesis 20 | 21 | 22 | 33 | 34 |
23 | Interfaces  24 | 25 |
26 | Parameterized 27 |
28 | Receiver 29 |
30 | SynthesisModule 31 |
32 | Transmitter
35 | 36 | 37 | 38 | 39 | 48 | 49 |
40 | Classes  41 | 42 |
43 | ConstantGenerator 44 |
45 | RampGenerator 46 |
47 | SineFunction
50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/common/class-use/ByteUtils.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.heroicrobot.dropbit.common.ByteUtils 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Uses of Class
com.heroicrobot.dropbit.common.ByteUtils

85 |
86 | No usage of com.heroicrobot.dropbit.common.ByteUtils 87 |

88 |


89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/common/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.dropbit.common 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | com.heroicrobot.dropbit.common 20 | 21 | 22 | 27 | 28 |
23 | Classes  24 | 25 |
26 | ByteUtils
29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/common/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.dropbit.common 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |

83 | Package com.heroicrobot.dropbit.common 84 |

85 | 86 | 87 | 88 | 90 | 91 | 92 | 93 | 94 | 95 |
89 | Class Summary
ByteUtils 
96 |   97 | 98 |

99 |

100 |
101 |
102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 124 | 127 | 128 | 129 | 130 | 133 | 149 | 150 |
125 | 126 |
151 | 152 | 153 | 154 |
155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/common/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.dropbit.common Class Hierarchy 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Hierarchy For Package com.heroicrobot.dropbit.common 85 |

86 |
87 |
88 |
Package Hierarchies:
All Packages
89 |
90 |

91 | Class Hierarchy 92 |

93 | 97 |
98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 120 | 123 | 124 | 125 | 126 | 129 | 145 | 146 |
121 | 122 |
147 | 148 | 149 | 150 |
151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/common/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.heroicrobot.dropbit.common 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Uses of Package
com.heroicrobot.dropbit.common

85 |
86 | No usage of com.heroicrobot.dropbit.common 87 |

88 |


89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/devices/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.dropbit.devices 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | com.heroicrobot.dropbit.devices 20 | 21 | 22 | 27 | 28 |
23 | Interfaces  24 | 25 |
26 | Device
29 | 30 | 31 | 32 | 33 | 38 | 39 |
34 | Classes  35 | 36 |
37 | DeviceImpl
40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/devices/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.dropbit.devices 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |

83 | Package com.heroicrobot.dropbit.devices 84 |

85 | 86 | 87 | 88 | 90 | 91 | 92 | 93 | 94 | 95 |
89 | Interface Summary
Device 
96 |   97 | 98 |

99 | 100 | 101 | 102 | 104 | 105 | 106 | 107 | 108 | 109 |
103 | Class Summary
DeviceImpl 
110 |   111 | 112 |

113 |

114 |
115 |
116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 138 | 141 | 142 | 143 | 144 | 147 | 163 | 164 |
139 | 140 |
165 | 166 | 167 | 168 |
169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/devices/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.dropbit.devices Class Hierarchy 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Hierarchy For Package com.heroicrobot.dropbit.devices 85 |

86 |
87 |
88 |
Package Hierarchies:
All Packages
89 |
90 |

91 | Class Hierarchy 92 |

93 | 98 |

99 | Interface Hierarchy 100 |

101 | 103 |
104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 126 | 129 | 130 | 131 | 132 | 135 | 151 | 152 |
127 | 128 |
153 | 154 | 155 | 156 |
157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/devices/pixelpusher/class-use/CardThread.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.heroicrobot.dropbit.devices.pixelpusher.CardThread 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Uses of Class
com.heroicrobot.dropbit.devices.pixelpusher.CardThread

85 |
86 | No usage of com.heroicrobot.dropbit.devices.pixelpusher.CardThread 87 |

88 |


89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/devices/pixelpusher/class-use/PusherGroup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.heroicrobot.dropbit.devices.pixelpusher.PusherGroup 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Uses of Class
com.heroicrobot.dropbit.devices.pixelpusher.PusherGroup

85 |
86 | No usage of com.heroicrobot.dropbit.devices.pixelpusher.PusherGroup 87 |

88 |


89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/devices/pixelpusher/class-use/PusherTask.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class com.heroicrobot.dropbit.devices.pixelpusher.PusherTask 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 36 |
37 | 64 | 65 |
66 |

Uses of Class
com.heroicrobot.dropbit.devices.pixelpusher.PusherTask

67 |
68 |
No usage of com.heroicrobot.dropbit.devices.pixelpusher.PusherTask
69 | 70 |
71 | 72 | 73 | 74 | 75 | 85 |
86 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/devices/pixelpusher/class-use/SceneThread.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.heroicrobot.dropbit.devices.pixelpusher.SceneThread 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Uses of Class
com.heroicrobot.dropbit.devices.pixelpusher.SceneThread

85 |
86 | No usage of com.heroicrobot.dropbit.devices.pixelpusher.SceneThread 87 |

88 |


89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/devices/pixelpusher/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.dropbit.devices.pixelpusher 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | com.heroicrobot.dropbit.devices.pixelpusher 20 | 21 | 22 | 39 | 40 |
23 | Classes  24 | 25 |
26 | CardThread 27 |
28 | Pixel 29 |
30 | PixelPusher 31 |
32 | PusherCommand 33 |
34 | PusherGroup 35 |
36 | SceneThread 37 |
38 | Strip
41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/discovery/class-use/DeviceHeaderTest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.heroicrobot.dropbit.discovery.DeviceHeaderTest 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Uses of Class
com.heroicrobot.dropbit.discovery.DeviceHeaderTest

85 |
86 | No usage of com.heroicrobot.dropbit.discovery.DeviceHeaderTest 87 |

88 |


89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/discovery/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.dropbit.discovery 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | com.heroicrobot.dropbit.discovery 20 | 21 | 22 | 29 | 30 |
23 | Classes  24 | 25 |
26 | DeviceHeader 27 |
28 | DeviceHeaderTest
31 | 32 | 33 | 34 | 35 | 40 | 41 |
36 | Enums  37 | 38 |
39 | DeviceType
42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/discovery/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.dropbit.discovery Class Hierarchy 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Hierarchy For Package com.heroicrobot.dropbit.discovery 85 |

86 |
87 |
88 |
Package Hierarchies:
All Packages
89 |
90 |

91 | Class Hierarchy 92 |

93 | 97 |

98 | Enum Hierarchy 99 |

100 | 107 |
108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 130 | 133 | 134 | 135 | 136 | 139 | 155 | 156 |
131 | 132 |
157 | 158 | 159 | 160 |
161 | 162 | 163 | 164 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/registry/class-use/DeviceRegistry.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.heroicrobot.dropbit.registry.DeviceRegistry 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Uses of Class
com.heroicrobot.dropbit.registry.DeviceRegistry

85 |
86 | No usage of com.heroicrobot.dropbit.registry.DeviceRegistry 87 |

88 |


89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/registry/class-use/DeviceRegistryTest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.heroicrobot.dropbit.registry.DeviceRegistryTest 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Uses of Class
com.heroicrobot.dropbit.registry.DeviceRegistryTest

85 |
86 | No usage of com.heroicrobot.dropbit.registry.DeviceRegistryTest 87 |

88 |


89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/registry/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.dropbit.registry 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | com.heroicrobot.dropbit.registry 20 | 21 | 22 | 29 | 30 |
23 | Classes  24 | 25 |
26 | DeviceRegistry 27 |
28 | DeviceRegistryTest
31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/registry/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.dropbit.registry 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |

83 | Package com.heroicrobot.dropbit.registry 84 |

85 | 86 | 87 | 88 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 |
89 | Class Summary
DeviceRegistry 
DeviceRegistryTest 
100 |   101 | 102 |

103 |

104 |
105 |
106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 128 | 131 | 132 | 133 | 134 | 137 | 153 | 154 |
129 | 130 |
155 | 156 | 157 | 158 |
159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/registry/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.heroicrobot.dropbit.registry Class Hierarchy 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Hierarchy For Package com.heroicrobot.dropbit.registry 85 |

86 |
87 |
88 |
Package Hierarchies:
All Packages
89 |
90 |

91 | Class Hierarchy 92 |

93 | 99 |
100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 122 | 125 | 126 | 127 | 128 | 131 | 147 | 148 |
123 | 124 |
149 | 150 | 151 | 152 |
153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /doc/com/heroicrobot/dropbit/registry/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.heroicrobot.dropbit.registry 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Uses of Package
com.heroicrobot.dropbit.registry

85 |
86 | No usage of com.heroicrobot.dropbit.registry 87 |

88 |


89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Deprecated List 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Deprecated API

85 |
86 |
87 | Contents 89 | 90 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 113 | 116 | 117 | 118 | 119 | 122 | 138 | 139 |
114 | 115 |
140 | 141 | 142 | 143 |
144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /doc/index-files/index-1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | A-Index 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 | A B C D E F G H I L M O P R S T U V W
82 |

83 | A

84 |
85 |
addPusher(PixelPusher) - 86 | Method in class com.heroicrobot.dropbit.devices.pixelpusher.PusherGroup 87 |
  88 |
89 |
90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 112 | 115 | 116 | 117 | 118 | 121 | 137 | 138 |
113 | 114 |
139 | 140 | 141 | 142 | A B C D E F G H I L M O P R S T U V W
143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /doc/index-files/index-19.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | W-Index 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 | A B C D E F G H I L M O P R S T U V W
82 |

83 | W

84 |
85 |
white - 86 | Variable in class com.heroicrobot.dropbit.devices.pixelpusher.Pixel 87 |
  88 |
WIFI_CONFIGURE - 89 | Static variable in class com.heroicrobot.dropbit.devices.pixelpusher.PusherCommand 90 |
  91 |
92 |
93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 115 | 118 | 119 | 120 | 121 | 124 | 140 | 141 |
116 | 117 |
142 | 143 | 144 | 145 | A B C D E F G H I L M O P R S T U V W
146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /doc/index-files/index-6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | F-Index 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 | A B C D E F G H I L M O P R S T U V W
82 |

83 | F

84 |
85 |
fromInteger(int) - 86 | Static method in enum com.heroicrobot.dropbit.discovery.DeviceType 87 |
  88 |
89 |
90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 112 | 115 | 116 | 117 | 118 | 121 | 137 | 138 |
113 | 114 |
139 | 140 | 141 | 142 | A B C D E F G H I L M O P R S T U V W
143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Generated Documentation (Untitled) 8 | 9 | 54 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | <H2> 65 | Frame Alert</H2> 66 | 67 | <P> 68 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 69 | <BR> 70 | Link to<A HREF="overview-summary.html">Non-frame version.</A> 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /doc/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Overview List 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 |
22 |
25 | 26 | 27 | 28 | 46 | 47 |
All Classes 29 |

30 | 31 | Packages 32 |
33 | com.heroicrobot.controlsynthesis 34 |
35 | com.heroicrobot.dropbit.common 36 |
37 | com.heroicrobot.dropbit.devices 38 |
39 | com.heroicrobot.dropbit.devices.pixelpusher 40 |
41 | com.heroicrobot.dropbit.discovery 42 |
43 | com.heroicrobot.dropbit.registry 44 |
45 |

48 | 49 |

50 |   51 | 52 | 53 | -------------------------------------------------------------------------------- /doc/overview-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Overview 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |


29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 | 83 | 84 | 85 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 |
86 | Packages
com.heroicrobot.controlsynthesis 
com.heroicrobot.dropbit.common 
com.heroicrobot.dropbit.devices 
com.heroicrobot.dropbit.devices.pixelpusher 
com.heroicrobot.dropbit.discovery 
com.heroicrobot.dropbit.registry 
113 | 114 |

115 |  


116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 138 | 141 | 142 | 143 | 144 | 147 | 163 | 164 |
139 | 140 |
165 | 166 | 167 | 168 |
169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /doc/package-list: -------------------------------------------------------------------------------- 1 | com.heroicrobot.controlsynthesis 2 | com.heroicrobot.dropbit.common 3 | com.heroicrobot.dropbit.devices 4 | com.heroicrobot.dropbit.devices.pixelpusher 5 | com.heroicrobot.dropbit.discovery 6 | com.heroicrobot.dropbit.registry 7 | -------------------------------------------------------------------------------- /doc/resources/background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robot-head/PixelPusher-java/dc8603fc5a600d209dd5187023fc36aab40aca75/doc/resources/background.gif -------------------------------------------------------------------------------- /doc/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robot-head/PixelPusher-java/dc8603fc5a600d209dd5187023fc36aab40aca75/doc/resources/inherit.gif -------------------------------------------------------------------------------- /doc/resources/tab.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robot-head/PixelPusher-java/dc8603fc5a600d209dd5187023fc36aab40aca75/doc/resources/tab.gif -------------------------------------------------------------------------------- /doc/resources/titlebar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robot-head/PixelPusher-java/dc8603fc5a600d209dd5187023fc36aab40aca75/doc/resources/titlebar.gif -------------------------------------------------------------------------------- /doc/resources/titlebar_end.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robot-head/PixelPusher-java/dc8603fc5a600d209dd5187023fc36aab40aca75/doc/resources/titlebar_end.gif -------------------------------------------------------------------------------- /doc/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /lib/core.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robot-head/PixelPusher-java/dc8603fc5a600d209dd5187023fc36aab40aca75/lib/core.jar -------------------------------------------------------------------------------- /src/com/heroicrobot/controlsynthesis/ConstantGenerator.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.controlsynthesis; 2 | 3 | public class ConstantGenerator implements SynthesisModule, Transmitter, Parameterized { 4 | 5 | float myValue = 0.0f; 6 | 7 | @Override 8 | public int getNumberOfOutputs() { 9 | return 1; 10 | } 11 | 12 | @Override 13 | public float getOutput(int outputNumber) { 14 | // TODO Auto-generated method stub 15 | return myValue; 16 | } 17 | 18 | @Override 19 | public String getOutputName(int outputNumber) { 20 | return "Constant output"; 21 | } 22 | 23 | @Override 24 | public String getName() { 25 | return "Constant generator"; 26 | } 27 | 28 | @Override 29 | public int getChainDepth() { 30 | return 0; // always zero for ConstantGenerator 31 | } 32 | 33 | @Override 34 | public boolean hasInputs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean hasOutputs() { 40 | return true; 41 | } 42 | 43 | @Override 44 | public void tick() { 45 | // This is a null op for ConstantGenerator. 46 | } 47 | 48 | @Override 49 | public int getNumberOfParameters() { 50 | return 1; 51 | } 52 | 53 | @Override 54 | public float getParameter(int paramNum) { 55 | return myValue; 56 | } 57 | 58 | @Override 59 | public void setParameter(int paramNum, float value) { 60 | myValue = value; 61 | } 62 | 63 | @Override 64 | public String getParameterName(int paramNum) { 65 | return "Constant value"; 66 | } 67 | 68 | @Override 69 | public boolean hasLimits(int paramNum) { 70 | return false; // this module can generate any float 71 | } 72 | 73 | @Override 74 | public float getLowerLimit(int paramNum) { 75 | return 0; // meaningless because no limits 76 | } 77 | 78 | @Override 79 | public float getUpperLimit(int paramNum) { 80 | return 0; // meaningless because no limits 81 | } 82 | 83 | @Override 84 | public void setChainDepth(int depth) { 85 | // It's always zero for a constant generator 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/com/heroicrobot/controlsynthesis/Parameterized.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.controlsynthesis; 2 | 3 | /* 4 | * Interface used by UI software to enable the user to configure synthesis blocks' internal state. 5 | */ 6 | 7 | public interface Parameterized { 8 | int getNumberOfParameters(); // how many parameters this module has 9 | float getParameter(int paramNum); // get the value of a parameter 10 | void setParameter(int paramNum, float value); // set the value of a parameter 11 | String getParameterName(int paramNum); // get the name of a parameter 12 | boolean hasLimits(int paramNum); // true if the value has bounds 13 | float getLowerLimit(int paramNum); 14 | float getUpperLimit(int paramNum); 15 | } 16 | -------------------------------------------------------------------------------- /src/com/heroicrobot/controlsynthesis/RampGenerator.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.controlsynthesis; 2 | 3 | public class RampGenerator implements Transmitter, SynthesisModule, 4 | Parameterized { 5 | 6 | float currentState = 0.0f; 7 | float initState = 0.0f; 8 | float increment = 1.0f; 9 | float maxValue = 255.0f; 10 | float resetValue = 0.0f; 11 | 12 | @Override 13 | public int getNumberOfParameters() { 14 | // TODO Auto-generated method stub 15 | return 4; 16 | } 17 | 18 | @Override 19 | public float getParameter(int paramNum) { 20 | // TODO Auto-generated method stub 21 | switch (paramNum) { 22 | case 0: return initState; 23 | case 1: return increment; 24 | case 2: return maxValue; 25 | case 3: return resetValue; 26 | default: return 0.0f; 27 | } 28 | } 29 | 30 | @Override 31 | public void setParameter(int paramNum, float value) { 32 | switch (paramNum) { 33 | case 0: initState = value; break; 34 | case 1: increment = value; break; 35 | case 2: maxValue = value; break; 36 | case 3: resetValue = value; break; 37 | default: return; 38 | } 39 | } 40 | 41 | @Override 42 | public String getParameterName(int paramNum) { 43 | switch (paramNum) { 44 | case 0: return "Initial value"; 45 | case 1: return "Increment"; 46 | case 2: return "Maximum value"; 47 | case 3: return "Reset value"; 48 | default: return "Unknown parameter"; 49 | } 50 | } 51 | 52 | @Override 53 | public boolean hasLimits(int paramNum) { 54 | return false; // None of our params have limits 55 | } 56 | 57 | @Override 58 | public float getLowerLimit(int paramNum) { 59 | return 0; 60 | } 61 | 62 | @Override 63 | public float getUpperLimit(int paramNum) { 64 | return 0; 65 | } 66 | 67 | @Override 68 | public String getName() { 69 | // TODO Auto-generated method stub 70 | return "Ramp generator"; 71 | } 72 | 73 | @Override 74 | public int getChainDepth() { 75 | return 0; 76 | } 77 | 78 | 79 | @Override 80 | public boolean hasOutputs() { 81 | return true; 82 | } 83 | 84 | @Override 85 | public void tick() { 86 | currentState+=increment; 87 | if (currentState > maxValue) 88 | currentState = resetValue; 89 | } 90 | 91 | @Override 92 | public int getNumberOfOutputs() { 93 | // TODO Auto-generated method stub 94 | return 1; 95 | } 96 | 97 | @Override 98 | public float getOutput(int outputNumber) { 99 | return currentState; 100 | } 101 | 102 | @Override 103 | public String getOutputName(int outputNumber) { 104 | return "Ramp output"; 105 | } 106 | 107 | @Override 108 | public boolean hasInputs() { 109 | // TODO Auto-generated method stub 110 | return false; 111 | } 112 | 113 | @Override 114 | public void setChainDepth(int depth) { 115 | // We have no inputs (we are not a Receiver) so it's always zero. 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/com/heroicrobot/controlsynthesis/Receiver.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.controlsynthesis; 2 | 3 | /* 4 | * Pluggable synthesis module with inputs (ie., receives data). 5 | */ 6 | 7 | public interface Receiver extends SynthesisModule { 8 | int getNumberOfInputs(); // How many inputs do we have? 9 | void setInput(int inputNumber, float value); // Set internal state based on this input 10 | String getInputName(int inputNumber); // Get the name of this input. 11 | } 12 | -------------------------------------------------------------------------------- /src/com/heroicrobot/controlsynthesis/SineFunction.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.controlsynthesis; 2 | 3 | public class SineFunction implements Receiver, SynthesisModule, 4 | Transmitter { 5 | 6 | float myInput = 0; 7 | float myOutput = 0; 8 | int myChainDepth = 0; 9 | 10 | @Override 11 | public int getNumberOfOutputs() { 12 | // TODO Auto-generated method stub 13 | return 1; 14 | } 15 | 16 | @Override 17 | public float getOutput(int outputNumber) { 18 | // TODO Auto-generated method stub 19 | return myOutput; 20 | } 21 | 22 | @Override 23 | public String getOutputName(int outputNumber) { 24 | return "Sine of x"; 25 | } 26 | 27 | @Override 28 | public String getName() { 29 | return "Sine"; 30 | } 31 | 32 | @Override 33 | public int getChainDepth() { 34 | return myChainDepth; 35 | } 36 | 37 | @Override 38 | public boolean hasInputs() { 39 | return true; 40 | } 41 | 42 | @Override 43 | public boolean hasOutputs() { 44 | return true; 45 | } 46 | 47 | @Override 48 | public void tick() { 49 | myOutput = (float) Math.sin(myInput); 50 | } 51 | 52 | @Override 53 | public int getNumberOfInputs() { 54 | return 1; 55 | } 56 | 57 | @Override 58 | public void setInput(int inputNumber, float value) { 59 | myInput = value; 60 | } 61 | 62 | @Override 63 | public String getInputName(int inputNumber) { 64 | return "x"; 65 | } 66 | 67 | @Override 68 | public void setChainDepth(int depth) { 69 | myChainDepth = depth+1; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/com/heroicrobot/controlsynthesis/SynthesisModule.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.controlsynthesis; 2 | 3 | /* 4 | * Pluggable synthesizer module interface. 5 | */ 6 | 7 | public interface SynthesisModule { 8 | String getName(); // Get the name of this module. 9 | void setChainDepth(int depth); // Tell me my chain depth 10 | int getChainDepth(); // How far into the synthesis chain is this module? 11 | boolean hasInputs(); // Does this module have inputs? 12 | boolean hasOutputs(); // Does this module have outputs? 13 | void tick(); // Cause this module to update its outputs based on current inputs. 14 | } 15 | -------------------------------------------------------------------------------- /src/com/heroicrobot/controlsynthesis/Transmitter.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.controlsynthesis; 2 | 3 | /* 4 | * Pluggable synthesis module with outputs (ie, generates data). 5 | */ 6 | 7 | public interface Transmitter extends SynthesisModule { 8 | int getNumberOfOutputs(); // How many outputs do we have? 9 | float getOutput(int outputNumber); // Get the value of an output 10 | String getOutputName(int outputNumber); // Get the name of an output 11 | } 12 | -------------------------------------------------------------------------------- /src/com/heroicrobot/controlsynthesis/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | /** 5 | * @author jasmine 6 | * 7 | */ 8 | package com.heroicrobot.controlsynthesis; -------------------------------------------------------------------------------- /src/com/heroicrobot/dropbit/common/ByteUtils.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.dropbit.common; 2 | 3 | public class ByteUtils { 4 | public static final long unsignedIntToLong(byte[] b) { 5 | if (b.length != 4) { 6 | throw new IllegalArgumentException(); 7 | } 8 | long l = 0; 9 | l |= b[3] & 0xff; 10 | l <<= 8; 11 | l |= b[2] & 0xff; 12 | l <<= 8; 13 | l |= b[1] & 0xff; 14 | l <<= 8; 15 | l |= b[0] & 0xff; 16 | return l; 17 | } 18 | 19 | public static final int signedIntToInt(byte[] b) { 20 | if (b.length != 4) { 21 | throw new IllegalArgumentException("The number of the counting shall be 4!"); 22 | } 23 | int i = 0; 24 | i |= b[3] & 0xff; 25 | i <<= 8; 26 | i |= b[2] & 0xff; 27 | i <<= 8; 28 | i |= b[1] * 0xff; 29 | i <<= 8; 30 | i |= b[0] * 0xff; 31 | return i; 32 | } 33 | 34 | public static final int unsignedShortToInt(byte[] b) { 35 | if (b.length != 2) { 36 | throw new IllegalArgumentException(); 37 | } 38 | int i = 0; 39 | i |= b[1] & 0xff; 40 | i <<= 8; 41 | i |= b[0] & 0xff; 42 | return i; 43 | } 44 | 45 | public static final int unsignedCharToInt(byte[] b) { 46 | if (b.length != 1) { 47 | throw new IllegalArgumentException(); 48 | } 49 | int i = 0; 50 | i |= b[0] & 0xff; 51 | return i; 52 | } 53 | 54 | public static final long byteArrayToLong(byte[] b, boolean bigEndian) { 55 | if (b.length > 8) { 56 | throw new IllegalArgumentException( 57 | "The largest byte array that can fit in a long is 8"); 58 | } 59 | long value = 0; 60 | if (bigEndian) { 61 | for (int i = 0; i < b.length; i++) { 62 | value = (value << 8) | b[i]; 63 | } 64 | } else { 65 | for (int i = 0; i < b.length; i++) { 66 | value |= (long) b[i] << (8 * i); 67 | } 68 | } 69 | return value; 70 | } 71 | 72 | public static final byte[] longToByteArray(long l, boolean bigEndian) { 73 | return extractBytes(l, bigEndian, 8); 74 | } 75 | 76 | private static byte[] extractBytes(long l, boolean bigEndian, int numBytes) { 77 | byte[] bytes = new byte[numBytes]; 78 | if (bigEndian) { 79 | for (int i = 0; i < numBytes; i++) { 80 | bytes[i] = (byte) ((l >> i * 8) & 0xffL); 81 | } 82 | } else { 83 | for (int i = 0; i < numBytes; i++) { 84 | bytes[i] = (byte) ((l >> (8 - i) * 8) & 0xffL); 85 | } 86 | } 87 | return bytes; 88 | } 89 | 90 | public static final byte[] unsignedIntToByteArray(long l, boolean bigEndian) { 91 | return extractBytes(l, bigEndian, 4); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/com/heroicrobot/dropbit/devices/Device.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.dropbit.devices; 2 | 3 | import java.net.InetAddress; 4 | 5 | import com.heroicrobot.dropbit.discovery.DeviceType; 6 | 7 | public interface Device { 8 | String getMacAddress(); 9 | 10 | InetAddress getIp(); 11 | 12 | DeviceType getDeviceType(); 13 | 14 | int getProtocolVersion(); 15 | 16 | int getVendorId(); 17 | 18 | int getProductId(); 19 | 20 | int getHardwareRevision(); 21 | 22 | int getSoftwareRevision(); 23 | 24 | long getLinkSpeed(); 25 | 26 | } -------------------------------------------------------------------------------- /src/com/heroicrobot/dropbit/devices/DeviceImpl.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.dropbit.devices; 2 | 3 | import java.net.InetAddress; 4 | 5 | import com.heroicrobot.dropbit.discovery.DeviceHeader; 6 | import com.heroicrobot.dropbit.discovery.DeviceType; 7 | 8 | public abstract class DeviceImpl implements Device { 9 | 10 | private DeviceHeader header; 11 | 12 | public DeviceImpl(DeviceHeader header) { 13 | this.header = header; 14 | } 15 | 16 | /* 17 | * (non-Javadoc) 18 | * 19 | * @see com.heroicrobot.dropbit.devices.Device#getMacAddress() 20 | */ 21 | @Override 22 | public String getMacAddress() { 23 | // TODO Auto-generated method stub 24 | return header.GetMacAddressString(); 25 | } 26 | 27 | /* 28 | * (non-Javadoc) 29 | * 30 | * @see com.heroicrobot.dropbit.devices.Device#getIp() 31 | */ 32 | @Override 33 | public InetAddress getIp() { 34 | // TODO Auto-generated method stub 35 | return header.IpAddress; 36 | } 37 | 38 | /* 39 | * (non-Javadoc) 40 | * 41 | * @see com.heroicrobot.dropbit.devices.Device#getDeviceType() 42 | */ 43 | @Override 44 | public DeviceType getDeviceType() { 45 | // TODO Auto-generated method stub 46 | return header.DeviceType; 47 | } 48 | 49 | /* 50 | * (non-Javadoc) 51 | * 52 | * @see com.heroicrobot.dropbit.devices.Device#getProtocolVersion() 53 | */ 54 | @Override 55 | public int getProtocolVersion() { 56 | // TODO Auto-generated method stub 57 | return header.ProtocolVersion; 58 | } 59 | 60 | /* 61 | * (non-Javadoc) 62 | * 63 | * @see com.heroicrobot.dropbit.devices.Device#getVendorId() 64 | */ 65 | @Override 66 | public int getVendorId() { 67 | // TODO Auto-generated method stub 68 | return header.VendorId; 69 | } 70 | 71 | /* 72 | * (non-Javadoc) 73 | * 74 | * @see com.heroicrobot.dropbit.devices.Device#getProductId() 75 | */ 76 | @Override 77 | public int getProductId() { 78 | // TODO Auto-generated method stub 79 | return header.ProductId; 80 | } 81 | 82 | /* 83 | * (non-Javadoc) 84 | * 85 | * @see com.heroicrobot.dropbit.devices.Device#getHardwareRevision() 86 | */ 87 | @Override 88 | public int getHardwareRevision() { 89 | // TODO Auto-generated method stub 90 | return header.HardwareRevision; 91 | } 92 | 93 | /* 94 | * (non-Javadoc) 95 | * 96 | * @see com.heroicrobot.dropbit.devices.Device#getSoftwareRevision() 97 | */ 98 | @Override 99 | public int getSoftwareRevision() { 100 | // TODO Auto-generated method stub 101 | return header.SoftwareRevision; 102 | } 103 | 104 | /* 105 | * (non-Javadoc) 106 | * 107 | * @see com.heroicrobot.dropbit.devices.Device#getLinkSpeed() 108 | */ 109 | @Override 110 | public long getLinkSpeed() { 111 | // TODO Auto-generated method stub 112 | return header.LinkSpeed; 113 | } 114 | 115 | /* 116 | * (non-Javadoc) 117 | * 118 | * @see java.lang.Object#toString() 119 | */ 120 | @Override 121 | public String toString() { 122 | return "Mac: " + header.GetMacAddressString() + ", IP: " 123 | + header.IpAddress.getHostAddress() + " Firmware revision: "+getSoftwareRevision(); 124 | } 125 | 126 | } -------------------------------------------------------------------------------- /src/com/heroicrobot/dropbit/devices/pixelpusher/Pixel.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.dropbit.devices.pixelpusher; 2 | 3 | //import java.util.Objects; 4 | 5 | public class Pixel { 6 | 7 | static final byte sLinearExp[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9 | 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 10 | 13, 13, 13, 14, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 19, 19, 20, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 11 | 27, 28, 29, 29, 30, 31, 31, 32, 33, 34, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 12 | 59, 60, 61, 63, 64, 65, 67, 68, 70, 72, 73, 75, 76, 78, 80, 82, 83, 85, 87, 89, 91, 93, 95, 97, 99, 102, 104, 106, 109, 111, 114, 116, 13 | 119, 121, 124, 127, (byte)129, (byte)132, (byte)135, (byte)138, (byte)141, (byte)144, (byte)148, (byte)151, (byte)154, (byte)158, 14 | (byte)161, (byte)165, (byte)168, (byte)172, (byte)176, (byte)180, (byte)184, (byte)188, (byte)192, (byte)196, (byte)201, (byte)205, 15 | (byte)209, (byte)214, (byte)219, (byte)224, (byte)229, (byte)234, (byte)239, (byte)244, (byte)249, (byte)255 }; 16 | 17 | public byte red; 18 | public byte green; 19 | public byte blue; 20 | public byte orange; 21 | public byte white; 22 | 23 | public Pixel() { 24 | red = 0; 25 | green = 0; 26 | blue = 0; 27 | orange = 0; 28 | white = 0; 29 | } 30 | 31 | 32 | // Processing "color" objects only support the axes of red, green and blue. 33 | public void setColor(int color) { 34 | this.blue = (byte)(color & 0xff); 35 | this.green = (byte) ((color >> 8) & 0xff); 36 | this.red = (byte) ((color >> 16) & 0xff); 37 | this.orange = (byte) 0; 38 | this.white = (byte) 0; 39 | } 40 | 41 | 42 | public void setColorAntilog(int color) { 43 | this.blue = sLinearExp[(int)(color & 0xff)]; 44 | this.green = sLinearExp[(int)((color >> 8) & 0xff)]; 45 | this.red = sLinearExp[((int)(color >> 16) & 0xff)]; 46 | this.orange = (byte) 0; 47 | this.white = (byte) 0; 48 | } 49 | 50 | public Pixel(int color) { 51 | this.setColor(color); 52 | } 53 | 54 | public Pixel(int color, boolean useAntilog) { 55 | if (useAntilog) 56 | this.setColorAntilog(color); 57 | else 58 | this.setColor(color); 59 | } 60 | 61 | public void setColor(Pixel pixel) { 62 | this.red = pixel.red; 63 | this.blue = pixel.blue; 64 | this.green = pixel.green; 65 | this.orange = pixel.orange; 66 | this.white = pixel.white; 67 | } 68 | 69 | public void setColor(Pixel pixel, boolean useAntiLog) { 70 | if (useAntiLog) { 71 | this.red = sLinearExp[pixel.red & 0xff]; 72 | this.blue = sLinearExp[pixel.blue & 0xff]; 73 | this.green = sLinearExp[pixel.green & 0xff]; 74 | this.orange = sLinearExp[pixel.orange & 0xff]; 75 | this.white = sLinearExp[pixel.white & 0xff]; 76 | } else { 77 | this.red = pixel.red; 78 | this.blue = pixel.blue; 79 | this.green = pixel.green; 80 | this.orange = pixel.orange; 81 | this.white = pixel.white; 82 | } 83 | } 84 | 85 | public Pixel(Pixel pixel) { 86 | this.setColor(pixel); 87 | } 88 | 89 | public Pixel(byte red, byte green, byte blue) { 90 | this.red = red; 91 | this.green = green; 92 | this.blue = blue; 93 | this.orange = 0; 94 | this.white = 0; 95 | } 96 | 97 | public Pixel(byte red, byte green, byte blue, byte orange, byte white) { 98 | this.red = red; 99 | this.green = green; 100 | this.blue = blue; 101 | this.orange = orange; 102 | this.white = white; 103 | } 104 | 105 | 106 | @Override 107 | public int hashCode() { 108 | return (red ^ green ^ blue ^ orange ^ white); 109 | } 110 | 111 | 112 | @Override 113 | public boolean equals(Object obj) { 114 | if (this == obj) 115 | return true; 116 | 117 | if (!(obj instanceof Pixel)) 118 | return false; 119 | 120 | Pixel that = (Pixel) obj; 121 | return this.red == that.red 122 | && this.green == that.green 123 | && this.blue == that.blue 124 | && this.orange == that.orange 125 | && this.white == that.white; 126 | } 127 | 128 | 129 | 130 | } 131 | -------------------------------------------------------------------------------- /src/com/heroicrobot/dropbit/devices/pixelpusher/PusherGroup.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.dropbit.devices.pixelpusher; 2 | 3 | import java.util.Collections; 4 | import java.util.List; 5 | import java.util.Set; 6 | import java.util.TreeSet; 7 | import java.util.concurrent.CopyOnWriteArrayList; 8 | 9 | public class PusherGroup { 10 | 11 | private Set pushers; 12 | 13 | PusherGroup(Set pushers) { 14 | this.pushers = pushers; 15 | } 16 | 17 | public PusherGroup() { 18 | pushers = Collections.synchronizedSortedSet(new TreeSet()); 19 | } 20 | 21 | public Set getPushers() { 22 | return this.pushers; 23 | } 24 | 25 | public int size() { 26 | return pushers.size(); 27 | } 28 | 29 | public List getStrips() { 30 | List strips = new CopyOnWriteArrayList(); 31 | for (PixelPusher p : this.pushers) { 32 | strips.addAll(p.getStrips()); 33 | } 34 | return strips; 35 | } 36 | 37 | public void removePusher(PixelPusher pusher) { 38 | this.pushers.remove(pusher); 39 | } 40 | 41 | public void addPusher(PixelPusher pusher) { 42 | this.pushers.add(pusher); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/com/heroicrobot/dropbit/discovery/DeviceHeader.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.dropbit.discovery; 2 | 3 | import java.net.InetAddress; 4 | import java.net.UnknownHostException; 5 | import java.util.Arrays; 6 | import java.util.Formatter; 7 | import java.util.Locale; 8 | 9 | import com.heroicrobot.dropbit.common.ByteUtils; 10 | 11 | public class DeviceHeader { 12 | /** 13 | * Device Header format: 14 | * uint8_t mac_address[6]; 15 | * uint8_t ip_address[4]; 16 | * uint8_t device_type; 17 | * uint8_t protocol_version; // for the device, not the discovery 18 | * uint16_t vendor_id; 19 | * uint16_t product_id; 20 | * uint16_t hw_revision; 21 | * uint16_t sw_revision; 22 | * uint32_t link_speed; // in bits per second 23 | */ 24 | public byte[] MacAddress; 25 | public InetAddress IpAddress; 26 | public DeviceType DeviceType; 27 | public int ProtocolVersion; 28 | public int VendorId; 29 | public int ProductId; 30 | public int HardwareRevision; 31 | public int SoftwareRevision; 32 | public long LinkSpeed; 33 | public byte[] PacketRemainder; 34 | 35 | private static final int headerLength = 24; 36 | 37 | @Override 38 | public String toString() { 39 | StringBuffer outBuf = new StringBuffer(); 40 | outBuf.append(this.DeviceType.name()); 41 | outBuf.append(": MAC(" + this.GetMacAddressString() + "), "); 42 | outBuf.append("IP(" + this.IpAddress.toString() + "), "); 43 | outBuf.append("Protocol Ver(" + this.ProtocolVersion + "), "); 44 | outBuf.append("Vendor ID(" + this.VendorId + "), "); 45 | outBuf.append("Product ID(" + this.ProductId + "), "); 46 | outBuf.append("HW Rev(" + this.HardwareRevision + "), "); 47 | outBuf.append("SW Rev(" + this.SoftwareRevision + "), "); 48 | outBuf.append("Link Spd(" + this.LinkSpeed + "), "); 49 | return outBuf.toString(); 50 | } 51 | 52 | public String GetMacAddressString() { 53 | StringBuffer buffer = new StringBuffer(); 54 | Formatter formatter = new Formatter(buffer, Locale.US); 55 | formatter.format("%02x:%02x:%02x:%02x:%02x:%02x", this.MacAddress[0], 56 | this.MacAddress[1], this.MacAddress[2], this.MacAddress[3], 57 | this.MacAddress[4], this.MacAddress[5]); 58 | String macAddrString = formatter.toString(); 59 | formatter.close(); 60 | return macAddrString; 61 | } 62 | 63 | public DeviceHeader(byte[] packet) { 64 | if (packet.length < headerLength) { 65 | throw new IllegalArgumentException(); 66 | } 67 | byte[] headerPkt = Arrays.copyOfRange(packet, 0, headerLength); 68 | 69 | this.MacAddress = Arrays.copyOfRange(headerPkt, 0, 6); 70 | try { 71 | this.IpAddress = InetAddress.getByAddress(Arrays.copyOfRange(headerPkt, 72 | 6, 10)); 73 | } catch (UnknownHostException e) { 74 | throw new IllegalArgumentException(); 75 | } 76 | this.DeviceType = com.heroicrobot.dropbit.discovery.DeviceType 77 | .fromInteger(ByteUtils.unsignedCharToInt(new byte[] { headerPkt[10] })); 78 | this.ProtocolVersion = ByteUtils 79 | .unsignedCharToInt(new byte[] { headerPkt[11] }); 80 | this.VendorId = ByteUtils.unsignedShortToInt(Arrays.copyOfRange(headerPkt, 81 | 12, 14)); 82 | this.ProductId = ByteUtils.unsignedShortToInt(Arrays.copyOfRange(headerPkt, 83 | 14, 16)); 84 | this.HardwareRevision = ByteUtils.unsignedShortToInt(Arrays.copyOfRange( 85 | headerPkt, 16, 18)); 86 | this.SoftwareRevision = ByteUtils.unsignedShortToInt(Arrays.copyOfRange( 87 | headerPkt, 18, 20)); 88 | this.LinkSpeed = ByteUtils.unsignedIntToLong(Arrays.copyOfRange(headerPkt, 89 | 20, 24)); 90 | this.PacketRemainder = Arrays.copyOfRange(packet, headerLength, 91 | packet.length); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/com/heroicrobot/dropbit/discovery/DeviceHeaderTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.heroicrobot.dropbit.discovery; 5 | 6 | import static org.junit.Assert.assertEquals; 7 | 8 | import java.util.Arrays; 9 | 10 | import org.junit.After; 11 | import org.junit.Before; 12 | import org.junit.Test; 13 | 14 | /** 15 | * @author mattstone 16 | * 17 | */ 18 | public class DeviceHeaderTest { 19 | 20 | /** 21 | * @throws java.lang.Exception 22 | */ 23 | @Before 24 | public void setUp() throws Exception { 25 | } 26 | 27 | /** 28 | * @throws java.lang.Exception 29 | */ 30 | @After 31 | public void tearDown() throws Exception { 32 | } 33 | 34 | /** 35 | * 00 02 f7 f0 c0 99 0a 49 26 a6 02 01 02 00 01 00 36 | * 02 00 03 00 00 e1 f5 05 08 01 32 00 ff ff ff ff 37 | * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 | * 00 00 00 00 39 | */ 40 | @Test 41 | public void test() { 42 | byte[] headerPacket = { (byte) 0x00, (byte) 0x02, (byte) 0xf7, (byte) 0xf0, 43 | (byte) 0xc0, (byte) 0x99, (byte) 0x0a, (byte) 0x49, (byte) 0x26, 44 | (byte) 0xa6, (byte) 0x02, (byte) 0x01, (byte) 0x02, (byte) 0x00, 45 | (byte) 0x01, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0x03, 46 | (byte) 0x00, (byte) 0x00, (byte) 0xe1, (byte) 0xf5, (byte) 0x05, 47 | (byte) 0x08, (byte) 0x01, (byte) 0x32, (byte) 0x00, (byte) 0xff, 48 | (byte) 0xff, (byte) 0xff, (byte) 0xff }; 49 | DeviceHeader deviceHeader = new DeviceHeader(Arrays.copyOfRange( 50 | headerPacket, 0, 24)); 51 | assertEquals("PIXELPUSHER: MAC(00:02:f7:f0:c0:99), IP(/10.73.38.166), " 52 | + "Protocol Ver(1), Vendor ID(2), Product ID(1), " 53 | + "HW Rev(2), SW Rev(3), Link Spd(100000000), ", 54 | deviceHeader.toString()); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/com/heroicrobot/dropbit/discovery/DeviceType.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.dropbit.discovery; 2 | 3 | public enum DeviceType { 4 | ETHERDREAM, LUMIABRIDGE, PIXELPUSHER; 5 | 6 | public static DeviceType fromInteger(int x) { 7 | switch (x) { 8 | case 0: 9 | return ETHERDREAM; 10 | case 1: 11 | return LUMIABRIDGE; 12 | case 2: 13 | return PIXELPUSHER; 14 | } 15 | return null; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/com/heroicrobot/dropbit/registry/DeviceRegistryTest.java: -------------------------------------------------------------------------------- 1 | package com.heroicrobot.dropbit.registry; 2 | 3 | import java.util.Observable; 4 | import java.util.Observer; 5 | import java.util.Random; 6 | import java.util.logging.Level; 7 | import java.util.logging.Logger; 8 | 9 | import org.junit.Test; 10 | 11 | import com.heroicrobot.dropbit.devices.pixelpusher.Pixel; 12 | import com.heroicrobot.dropbit.devices.pixelpusher.Strip; 13 | 14 | public class DeviceRegistryTest { 15 | 16 | private final static Logger LOGGER = Logger 17 | .getLogger(DeviceRegistryTest.class.getName()); 18 | 19 | private Random random = new Random(); 20 | 21 | int[][] colors = { { 127, 0, 0 }, { 0, 127, 0 }, { 0, 0, 127 } }; 22 | 23 | public Pixel generateRandomPixel() { 24 | // return new 25 | // Pixel((byte)(random.nextInt(scaling)),(byte)(random.nextInt(scaling)),(byte)(random.nextInt(scaling))); 26 | // return new Pixel((byte)(15), (byte)0, (byte)0); 27 | int[] color = colors[random.nextInt(colors.length)]; 28 | return new Pixel((byte) color[0], (byte) color[1], (byte) color[2]); 29 | } 30 | 31 | @Test 32 | public void testDiscovery() throws InterruptedException { 33 | LOGGER.setLevel(Level.FINEST); 34 | LOGGER.info("Beginning discovery"); 35 | DeviceRegistry registry = new DeviceRegistry(); 36 | class TestObserver implements Observer { 37 | 38 | public boolean hasStrips = false; 39 | 40 | @Override 41 | public void update(Observable registry, Object updatedDevice) { 42 | LOGGER.info("Registry changed!"); 43 | if (updatedDevice != null) { 44 | LOGGER.info("Device change: " + updatedDevice); 45 | } 46 | this.hasStrips = true; 47 | } 48 | 49 | } 50 | TestObserver testObserver = new TestObserver(); 51 | registry.addObserver(testObserver); 52 | while (true) { 53 | Thread.yield(); 54 | if (testObserver.hasStrips) { 55 | registry.startPushing(); 56 | for (Strip strip : registry.getStrips()) { 57 | for (int i = 0; i < strip.getLength(); i++) 58 | strip.setPixel(generateRandomPixel(), i); 59 | } 60 | } 61 | } 62 | } 63 | 64 | } 65 | --------------------------------------------------------------------------------