Simple single-color 8x8x8 LED Cube with AVRs
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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. System.out.println("Animation " + index + " selected");
  43. return -1;
  44. }
  45. public String getAnimationName(int index) {
  46. return "TestAnim";
  47. }
  48. public void setAnimationName(int index, String s) {
  49. }
  50. // Returns how many frames are in the current animation
  51. public int numOfFrames() {
  52. return 3;
  53. }
  54. public String getFrameName(int index) {
  55. return "Test";
  56. }
  57. public void setFrameName(int index, String s) {
  58. }
  59. // Adds a Frame to the current animation.
  60. // Returns id if okay, -1 if error
  61. public int addFrame() {
  62. return -1;
  63. }
  64. // Remove a frame
  65. public void removeFrame(int index) {
  66. }
  67. // Returns array with 64 bytes with led values
  68. public byte[] getFrame(int index) {
  69. return null;
  70. }
  71. public void setFrame(int index, byte[] data) {
  72. }
  73. // Loads an animation file into this object
  74. public int loadState(String path) {
  75. return 0;
  76. }
  77. // Saves the state of this object in an animation file
  78. public int saveState(String path) {
  79. System.out.println("Saving to " + path);
  80. return 0;
  81. }
  82. // sends state of object to led cube
  83. public int uploadState(String port) {
  84. return 0;
  85. }
  86. // loads all state from the cube into this object
  87. public int downloadState(String port) {
  88. return 0;
  89. }
  90. // Tells how many Frames you can add until you reached 1 Mbit...
  91. public int framesRemaining() {
  92. return 0;
  93. }
  94. public String[] getSerialPorts() {
  95. String[] sPorts = {"Select serial port..."};
  96. return sPorts;
  97. }
  98. // Returns true if last saved state != current state
  99. public boolean changedStateSinceSave() {
  100. return true;
  101. }
  102. }