Simple single-color 8x8x8 LED Cube with AVRs
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

cubeWorker.java 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * cubeWorker.java
  3. *
  4. * Copyright 2011 Thomas Buck <xythobuz@me.com>
  5. * Copyright 2011 Max Nuding <max.nuding@gmail.com>
  6. * Copyright 2011 Felix Bäder <baeder.felix@gmail.com>
  7. *
  8. * This file is part of LED-Cube.
  9. *
  10. * LED-Cube is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation, either version 3 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * LED-Cube is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with LED-Cube. If not, see <http://www.gnu.org/licenses/>.
  22. */
  23. public class cubeWorker {
  24. cubeWorker() {
  25. }
  26. // Adds a new Animation
  27. // Returns id if ok, -1 if error or not enough space for
  28. // another animation
  29. public int addAnimation() {
  30. return -1;
  31. }
  32. // Removes an animation
  33. public void removeAnimation(int index) {
  34. }
  35. // Returns how many animations are defined
  36. public int numOfAnimations() {
  37. return 3;
  38. }
  39. // Selects an animation, on which the frame specific functions operate
  40. // Returns -1 if it does not exist
  41. public int selectAnimation(int index) {
  42. return -1;
  43. }
  44. public String getAnimationName(int index) {
  45. return "TestAnim";
  46. }
  47. public void setAnimationName(int index, String s) {
  48. }
  49. // Returns how many frames are in the current animation
  50. public int numOfFrames() {
  51. return 3;
  52. }
  53. public String getFrameName(int index) {
  54. return "Test";
  55. }
  56. public void setFrameName(int index, String s) {
  57. }
  58. // Adds a Frame to the current animation.
  59. // Returns id if okay, -1 if error
  60. public int addFrame() {
  61. return -1;
  62. }
  63. // Remove a frame
  64. public void removeFrame(int index) {
  65. }
  66. // Returns array with 64 bytes with led values
  67. public byte[] getFrame(int index) {
  68. return null;
  69. }
  70. public void setFrame(int index, byte[] data) {
  71. }
  72. // Loads an animation file into this object
  73. public int loadState(String path) {
  74. return 0;
  75. }
  76. // Saves the state of this object in an animation file
  77. public int saveState(String path) {
  78. System.out.println("Saving to " + path);
  79. return 0;
  80. }
  81. // sends state of object to led cube
  82. public int uploadState(String port) {
  83. return 0;
  84. }
  85. // loads all state from the cube into this object
  86. public int downloadState(String port) {
  87. return 0;
  88. }
  89. // Tells how many Frames you can add until you reached 1 Mbit...
  90. public int framesRemaining() {
  91. return 0;
  92. }
  93. public String[] getSerialPorts() {
  94. String[] sPorts = {"Select serial port..."};
  95. return sPorts;
  96. }
  97. // Returns true if last saved state != current state
  98. public boolean changedStateSinceSave() {
  99. return true;
  100. }
  101. }