Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

initial release

  • Loading branch information...
commit 2839efcec22be4a43d07d4413a7da7d8e898de9f 0 parents
@RenZ0 authored
Showing with 7,374 additions and 0 deletions.
  1. +339 −0 LICENCE
  2. +2 −0  NEWS
  3. +157 −0 README
  4. +4 −0 TODO
  5. +61 −0 engine/com_sql.py
  6. +12 −0 engine/config.py
  7. +298 −0 engine/delta.py
  8. +130 −0 engine/server.py
  9. +46 −0 engine/test.py
  10. +14 −0 psc/config.php
  11. +1,005 −0 psc/dmx/chart.php
  12. +309 −0 psc/dmx/chgall.php
  13. +297 −0 psc/dmx/colors.php
  14. +67 −0 psc/dmx/control.php
  15. +60 −0 psc/dmx/controlseq.php
  16. +144 −0 psc/dmx/fixtmod.php
  17. +163 −0 psc/dmx/fixtures.php
  18. +86 −0 psc/dmx/funct.php
  19. +57 −0 psc/dmx/head.php
  20. +36 −0 psc/dmx/index.php
  21. BIN  psc/dmx/jscolor/arrow.gif
  22. BIN  psc/dmx/jscolor/cross.gif
  23. BIN  psc/dmx/jscolor/hs.png
  24. BIN  psc/dmx/jscolor/hv.png
  25. +928 −0 psc/dmx/jscolor/jscolor.js
  26. +19 −0 psc/dmx/lxmath/LICENSE
  27. +14 −0 psc/dmx/lxmath/README.rst
  28. +12 −0 psc/dmx/lxmath/css/lxmath.css
  29. +38 −0 psc/dmx/lxmath/index.html
  30. +177 −0 psc/dmx/lxmath/js/lxmath.js
  31. +35 −0 psc/dmx/menu.php
  32. +55 −0 psc/dmx/overscript/overscript.css
  33. +96 −0 psc/dmx/overscript/overscript.js
  34. +145 −0 psc/dmx/panel.php
  35. +7 −0 psc/dmx/phpinfo.php
  36. +97 −0 psc/dmx/prefs.php
  37. +909 −0 psc/dmx/scenari.php
  38. +238 −0 psc/dmx/scenmod.php
  39. +203 −0 psc/dmx/scenseq.php
  40. +145 −0 psc/dmx/scensum.php
  41. +213 −0 psc/dmx/schema.php
  42. +131 −0 psc/dmx/schmod.php
  43. +75 −0 psc/dmx/schsum.php
  44. +169 −0 psc/dmx/style.css
  45. +11 −0 psc/index.php
  46. +185 −0 psc/lang/en.lang.php
  47. +185 −0 psc/lang/fr.lang.php
  48. BIN  sql/psc_base.sql.gz
339 LICENCE
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
2  NEWS
@@ -0,0 +1,2 @@
+31/12/2011 php-show-controller 1.0.0
+ * Initial release
157 README
@@ -0,0 +1,157 @@
+PSC - Php-Show-Controller
+-------------------------
+
+PSC provides an interface to create DMX shows, and play those thanks to OLA.
+
+Project Page: http://imaginux.com/lighting
+Licence: GNU General Public Licence 2 (See LICENCE)
+
+
+Requirements
+------------
+
+This software requires:
+
+ - webserver like apache with php/mysql support
+ - python 2.7 (earlier versions may also work)
+ - ola >= 0.8.14 (must be built with --enable-python-libs)
+
+
+Installation
+------------
+
+First, you need to set up your webserver, for example on debian/ubuntu :
+sudo apt-get install apache2 mysql-server php5-mysql phpmyadmin
+
+Configure php with register_globals = On :
+sudo gedit /etc/php5/apache2/php.ini
+sudo /etc/init.d/apache2 restart
+
+Create a new database, for example : psc
+(you can use phpmyadmin to do this).
+Import the sql file psc_base.sql.gz into the new database.
+
+According to your webserver access, fill these files :
+engine/config.py
+psc/config.php
+
+Move the psc folder into the webserver root :
+sudo cp -r psc/ /var/www/
+
+PSC is ready !
+
+
+Getting Started
+---------------
+
+You need to have OLA working :
+http://www.opendmx.net/index.php/OLA
+
+You can get deb packages on my website :
+http://imaginux.com/lighting/
+
+Start OLA, for example :
+olad -f (background)
+or
+olad -l3 (with log)
+
+Configure OLA universes from :
+http://127.0.0.1:9090
+
+From the engine folder, simply run 'python server.py'.
+Python will tell you if modules missing, like python-mysqldb.
+
+Go to your webserver url (with your web browser), for example :
+http://127.0.0.1/psc
+
+
+How to use PSC ?
+----------------
+
+0) Set language in Preferences : en = english, fr = french.
+RGB and CMY checkboxes are for display in scenario creation.
+Engine Rate is set into database.
+
+1) Add your fixtures infos in Profiles page :
+Add each channel, default value and describe its function.
+You can group some channels if you want, adding a dot between values.
+
+RGB and CMY are special and names need to start with 'rgb' and 'cmy'.
+You can make virtual fixtures using the 'Multi' feature.
+Take care to not modify your profiles after scenario creation.
+
+2) Set universes and addresses in Fixtures page.
+
+3) Scenarios : add one and click on its name :
+You will be able to define each step.
+
+On the right of channel name, the o letter will display dmx info
+(defined in your profile).
+
+Color changes, included random and gradient are made on 'rgb'
+channels by default.
+Save the colors or values you want into the bank (Colors page).
+
+Use the checkboxes to make partial changes.
+Try the filter to show channels you want, and make fast changes
+(with filter, 'ALL' button applies value on every channel seen).
+
+You can disable, duplicate a step with X or # symbol.
+
+D,w and R,w letters are used to generate many steps from original step :
+D : first rgb color moves over rgb channels, going to last one.
+R : first rgb color recover rgb channels, until all changed.
+w is the same but rewind, it uses the last color instead of first one.
+(these features only work with channels named like rgb1 to rgbX)
+
+Use buttons (list, start...) to play the scenario
+and see the result while you create.
+Go to Steps page to change hold and fade times.
+
+4) Play the scenarios you've created from Control page.
+Control can be done with python too :
+
+python test.py start.1 (where 1 is scenario's id)
+python test.py stop.1
+python test.py status.1
+python test.py list
+python test.py stopall
+python test.py bo
+
+
+Troubleshooting
+---------------
+
+Sometimes things don't always work as expected.
+Often it's just a setting, please double check everything.
+
+Keep in mind :
+With php interface you change sql data.
+Python engine reads sql data, and send it to OLA.
+OLA use your hardware to send DMX signal.
+
+
+Known Issues
+------------
+
+Currently it's better to play only one scenario at once.
+One scenario can control more than one fixture (creating Multi),
+but it's limited because of synchronization.
+If you want to play many scenarios, you could set universe in HTP merge mode,
+and it could work but there will be too much frames.
+OLA port limiter will do its job according to your device and your settings.
+
+It could be good to have a merge function, it's in todo list :)
+
+
+Bugs
+----
+
+If you find a bug or want to submit new ideas, please send me an email :
+renzo@imaginux.com
+
+
+Copyright
+---------
+
+PSC is Copyright 2011 by Laurent Pierru <renzo@imaginux.com>
4 TODO
@@ -0,0 +1,4 @@
+*Add a merge function to allow playing multiple scenarios at once
+*With ajax requests we can have better scenario editor
+*Blackout should be done on every universe
+*Declare all variables to allow register_globals = Off
61 engine/com_sql.py
@@ -0,0 +1,61 @@
+#!/usr/bin/python
+# -*- coding:utf-8 -*-
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Copyright (C) 2011 Laurent Pierru <renzo@imaginux.com>
+
+"""Php-Show-Controller. SQL Class"""
+
+import sys
+import MySQLdb
+from config import DB_HOST,DB_USER,DB_PASS,DB_BASE
+
+class ComSql(object):
+ def __init__(self):
+ '''Initialisation, connexion sur la base'''
+
+ #@ _CONNECT_
+ try:
+ self.conn = MySQLdb.connect (host = DB_HOST,
+ user = DB_USER,
+ passwd = DB_PASS,
+ db = DB_BASE)
+ except MySQLdb.Error, e:
+ print "Error %d: %s" % (e.args[0], e.args[1])
+ sys.exit (1)
+ #@ _CONNECT_
+ self.cursor = self.conn.cursor (MySQLdb.cursors.DictCursor)
+
+ def requete_sql(self, req, *arg):
+ '''Renvoi le resultat de la requete SQL donné en argument'''
+ try:
+ #@ _RETRIEVE_1_
+ ret = self.cursor.execute(req, arg)
+ return self.cursor.fetchall()
+
+ #@ _CURSOR_CLOSE_
+ self.cursor.close()
+ #@ _CURSOR_CLOSE_
+
+ except MySQLdb.Error, e:
+ print "Error %d: %s" % (e.args[0], e.args[1])
+ sys.exit (1)
+
+# #@ _TERMINATE_
+# conn.commit ()
+# conn.close ()
+# #@ _TERMINATE_
+
12 engine/config.py
@@ -0,0 +1,12 @@
+#!/usr/bin/python
+# -*- coding:utf-8 -*-
+
+# TCP
+HOST="localhost"
+PORT=9999
+
+# SQL
+DB_HOST="localhost"
+DB_USER="root"
+DB_PASS=""
+DB_BASE="psc"
298 engine/delta.py
@@ -0,0 +1,298 @@
+#!/usr/bin/python
+# -*- coding:utf-8 -*-
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Copyright (C) 2011 Laurent Pierru <renzo@imaginux.com>
+# Thanks to Stéphane Bonhomme <stephane@exselt.com>
+# Thanks to Simon Newton <nomis52@gmail.com>
+
+"""Php-Show-Controller. Generates values and sends data to OLA."""
+
+import sys
+import time
+import array
+import com_sql
+from threading import Thread
+from ola.ClientWrapper import ClientWrapper
+
+###
+
+class DmxSender:
+ def __init__(self, wrapper, universe):
+ self._wrapper = wrapper
+ self._universe = universe
+ self._activesender = True
+
+ def Run(self, start, end, tick_interval, fade_interval):
+ self._counter = 0
+ self._tick_interval = tick_interval
+ self._frame = start
+ self._ticks = float(fade_interval) / tick_interval
+ #print self._ticks
+ self._delta = [float(b - a) / self._ticks for a, b in zip(start, end)]
+
+ # send the first one
+ self.SendDmx()
+ self._wrapper.Run()
+
+ def ComputeNextFrame(self):
+ self._counter += 1
+ self._frame = map(sum, zip(self._frame, self._delta))
+
+ def SendDmx(self):
+ if self._counter != self._ticks:
+ self._wrapper.AddEvent(self._tick_interval, self.SendDmx)
+
+ new_frame = [int(round(x)) for x in self._frame]
+ #print "sending %s" % new_frame
+ data = array.array('B', new_frame)
+ self._wrapper.Client().SendDmx(self._universe, data, self.DmxComplete)
+
+ if self._activesender:
+ # continue
+ self.ComputeNextFrame()
+ else:
+ self._wrapper.Stop()
+
+ def DmxComplete(self, state):
+ if not state.Succeeded() or self._counter > self._ticks:
+ #sleep 25ms to avoid rising between steps
+ norise = (float(self._tick_interval)/1000)
+ #print "sleep"
+ #print norise
+ time.sleep(norise)
+ self._wrapper.Stop()
+ #print "stop sender"
+
+ def StopDmxSender(self):
+ self._activesender = False
+
+###
+
+class ExcStopDmx(Exception):
+ pass
+
+class ThreadDmx(Thread):
+ def __init__(self, term):
+ Thread.__init__(self)
+ self.Terminated = False
+ self.term=term
+
+ def run(self):
+ pass
+
+ ## Stop the thread if called
+ def stop(self):
+ self.Terminated = True
+
+ def _checkpoint(self):
+ if self.Terminated:
+ raise ExcStopDmx
+
+class DeltaDmx(ThreadDmx):
+
+ def __init__(self, scenari, term):
+ self.scenari = scenari
+ super(DeltaDmx,self).__init__(term)
+ self.base = com_sql.ComSql()
+
+ engine = self.base.requete_sql("SELECT * FROM dmx_engine WHERE id=1") #setting
+ for e in range(len(engine)):
+ freq_ms = engine[e]['freq_ms']
+
+ self.TICK_INTERVAL = int(freq_ms) # in milliseconds
+ print "freq_ms"
+ print self.TICK_INTERVAL
+
+ def run(self):
+ print self.getName(),"Started"
+ try:
+ if self.scenari != 0:
+ self.gen_dmx()
+ else:
+ self.blackout()
+ except ExcStopDmx:
+ print self.getName(),"Stopped"
+ return
+ finally:
+ self.term()
+ print self.getName(),"Finished"
+
+ def state(self):
+ return self.getName()+" running "
+
+ def stop(self):
+ super(DeltaDmx,self).stop()
+ if hasattr(self, 'sender') and self.sender:
+ #print "sender will stop now"
+ self.sender.StopDmxSender()
+
+ def getdmxtrame(self, poffset, pafter, step_id):
+ alldmx=poffset
+ tramedmx = self.base.requete_sql("SELECT * FROM dmx_scenari WHERE id_scenari=%s AND step=%s ORDER BY id", str(self.scenari), str(step_id)) #step2
+ for k in range(len(tramedmx)):
+ #print(tramedmx[k]['ch_value'])
+ alldmx+=tramedmx[k]['ch_value']
+ alldmx+="."
+ alldmx+=pafter
+ alldmx=alldmx[:-1]
+ print alldmx
+ return [int(k) for k in alldmx.split(".")]
+
+ def blackout(self):
+ print "blackout"
+
+ wrapper = ClientWrapper()
+ universe = 1
+ self.sender = DmxSender(wrapper, universe)
+
+ trame=""
+ for i in range(512):
+ trame+="0."
+ trame=trame[:-1]
+ print trame
+
+ ei=[int(k) for k in trame.split(".")]
+
+ ### send dmx ###
+
+ #boucle hold
+ h = 3
+ h_ms = int(float(h)*1000)
+ print h_ms
+ self.sender.Run(ei, ei, self.TICK_INTERVAL, h_ms)
+
+ def gen_dmx(self):
+
+ ##################
+
+ scendet = self.base.requete_sql("SELECT * FROM dmx_scensum WHERE id=%s", str(self.scenari)) #scen
+ for i in range(len(scendet)):
+ reverse = scendet[i]['reverse']
+ fixtdet = self.base.requete_sql("SELECT * FROM dmx_fixture WHERE id=%s", str(scendet[i]['id_fixture'])) #fixt
+ for j in range(len(fixtdet)):
+ patch = fixtdet[j]['patch']
+ patch_after = fixtdet[j]['patch_after']
+ universe = fixtdet[j]['univ']
+ print "patch, patch_after, univ"
+ print patch, patch_after, universe
+
+ poffset=""
+ for i in range(patch):
+ poffset+="0."
+ #print poffset
+
+ pafter=""
+ for i in range(patch_after):
+ pafter+="0."
+ #print pafter
+
+ ##################
+
+ wrapper = ClientWrapper()
+ self.sender = DmxSender(wrapper, universe)
+
+ ##################
+
+ if reverse==0:
+ way="ASC"
+ else:
+ way="DESC"
+
+ print way
+
+ # define first step
+ si = ""
+
+ while True:
+
+ #sequence
+ if reverse==0:
+ sequence = self.base.requete_sql("SELECT * FROM dmx_scenseq WHERE disabled!=1 AND id_scenari=%s ORDER BY position ASC,id ASC", str(self.scenari)) #seq
+ else:
+ sequence = self.base.requete_sql("SELECT * FROM dmx_scenseq WHERE disabled!=1 AND id_scenari=%s ORDER BY position DESC,id DESC", str(self.scenari)) #seq
+
+ # t = sequence[0]['fade']
+ # h = sequence[0]['hold']
+
+ for i in range(len(sequence)):
+ # print (sequence[i]['step'])
+ # print "len"
+ # print (len(sequence))
+
+ print "start"
+ print i
+ # init
+ if si == "":
+ start_step = sequence[i]['id']
+ si = self.getdmxtrame(poffset, pafter, start_step)
+
+ # print (len(sequence))
+ if (i+1)==(len(sequence)):
+ i=-1
+ print "reloop"
+
+ print "end"
+ print i+1
+ end_step = sequence[i+1]['id']
+ ei = self.getdmxtrame(poffset, pafter, end_step)
+
+ ##################
+
+ ##################
+
+ t = sequence[i]['fade']
+ self._checkpoint()
+ print "fade"
+ print (t)
+
+ ### send dmx ###
+
+ if float(t) > 0:
+ #boucle fade
+ t_ms = int(float(t)*1000)
+ print t_ms
+ self.sender.Run(si, ei, self.TICK_INTERVAL, t_ms)
+ else:
+ pass
+
+ ### ###
+
+ ### ###
+
+ h = sequence[i+1]['hold']
+ self._checkpoint()
+ print "hold"
+ print (h)
+
+ ### send dmx ###
+
+ if float(h) > 0:
+ #boucle hold
+ h_ms = int(float(h)*1000)
+ print h_ms
+ self.sender.Run(ei, ei, self.TICK_INTERVAL, h_ms)
+ else:
+ pass
+
+ # next step start from end
+ si = ei
+
+ ###
+ #wrapper.Stop()
+
+
+
130 engine/server.py
@@ -0,0 +1,130 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Copyright (C) 2011 Laurent Pierru <renzo@imaginux.com>
+# Thanks to Stéphane Bonhomme <stephane@exselt.com>
+
+"""Php-Show-Controller. TCP Server to control scenarios."""
+
+import SocketServer
+from delta import DeltaDmx
+from config import HOST, PORT
+from threading import Lock
+import time
+
+# tcp server commands :
+# start.n : starts a thread playing sequence n one time
+# stop.n : stops a sequence
+# status.n : gives the status of a sequence
+# list : list of sequences currently playing
+# stopall : stops all sequences currently playing
+
+class MyTCPServer(SocketServer.TCPServer):
+ allow_reuse_address=True
+
+class MyTCPHandler(SocketServer.BaseRequestHandler):
+ """
+ The RequestHandler class for our server.
+
+ It is instantiated once per connection to the server, and must
+ override the handle() method to implement communication to the
+ client.
+ """
+ my_threads = {}
+ lock=Lock()
+
+ def handle(self):
+ # self.request is the TCP socket connected to the client
+
+ self.data = self.request.recv(1024).strip()
+ status=0
+ data=None
+ try:
+ command, scenarid = self.data.split('.')
+ except:
+ command=self.data
+
+ if command=="start":
+ if not self.my_threads.has_key(scenarid):
+ t= DeltaDmx(scenarid, lambda:self.terminate(scenarid))
+ self.my_threads[scenarid]=t
+ t.start()
+ status=1
+
+ if command=="stop":
+ try:
+ t=self.my_threads[scenarid]
+ t.stop()
+ t.join()
+ if not t.is_alive():
+ status=1
+ except:
+ #import traceback
+ #print traceback.format_exc()
+ pass
+
+ if command=="status":
+ try:
+ data=self.my_threads[scenarid].state()
+ status=1
+ except:
+ pass
+
+ if command=="list":
+ try:
+ print self.my_threads.keys()
+ data=reduce(lambda x,y : y+'.'+x, self.my_threads.keys())
+ except:
+ pass
+
+ if command=="stopall":
+ for t in self.my_threads.itervalues():
+ t.stop()
+ status=1
+
+ if command=="bo":
+ for t in self.my_threads.itervalues():
+ t.stop()
+ #status=1
+ time.sleep(0.25)
+ if not self.my_threads.has_key(0):
+ t= DeltaDmx(0, lambda:self.terminate(0))
+ self.my_threads[0]=t
+ t.start()
+ status=1
+
+ response=str(status)
+ if data is not None:
+ response=response+":"+data
+
+ self.request.send(response)
+
+ def terminate(self,scenarid):
+ if self.lock.acquire():
+ self.my_threads.pop(scenarid)
+ self.lock.release()
+
+if __name__=="__main__":
+
+ # Create the server, binding to localhost on port 9999
+ server = MyTCPServer((HOST, PORT), MyTCPHandler)
+
+ # Activate the server; this will keep running until you
+ # interrupt the program with Ctrl-C
+ server.serve_forever()
+
+
46 engine/test.py
@@ -0,0 +1,46 @@
+#! /usr/bin/python
+# -*- coding:utf-8 -*-
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Copyright (C) 2011 Laurent Pierru <renzo@imaginux.com>
+
+"""Php-Show-Controller. Test for tcp server."""
+
+import socket
+import sys
+import cgi
+import time
+from config import HOST, PORT
+
+arguments=sys.argv
+data=arguments[1]
+
+try:
+ # Create a socket (SOCK_STREAM means a TCP socket)
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+
+ # Connect to server and send data
+ sock.connect((HOST, PORT))
+ sock.send(data)
+
+ # Receive data from the server and shut down
+ received = sock.recv(1024)
+ sock.close()
+
+ print "Sent: %s" % data
+ print "Received: %s" % received
+except:
+ print "Server not ready"
14 psc/config.php
@@ -0,0 +1,14 @@
+<?
+//tcp
+$tcp_host="localhost";
+$tcp_port=9999;
+
+//sql
+$host="localhost";
+$user="root";
+$pass="";
+$base="psc";
+
+$c=@mysql_connect("$host","$user","$pass") or die('Database connection failed');
+mysql_select_db("$base") or die('Could not open database : '.$base.'');
+?>
1,005 psc/dmx/chart.php
@@ -0,0 +1,1005 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+
+ <title>RGB Color Chart</title>
+ </head><body leftmargin="50" marginwidth="50" bgcolor="white">
+ <div align="left">
+ <table width="640" border="0" cellpadding="0" cellspacing="2">
+ <tbody><tr>
+ <td>
+ <div align="center">
+ <h1>RGB Color Chart</h1>
+ <p><a href="#PA">Whites/Pastels</a> . <a href="#GR">Grays</a> <br> <a href="#BL">Blues</a> . <a href="#GRE">Greens</a> . <a href="#YE">Yellows</a> <br> <a href="#BR">Browns</a> . <a href="#OR">Oranges</a> . <a href="#PI">Pinks/Violets</a></p>
+ <h3>Whites/Pastels </h3>
+ <table width="417" border="1" cellpadding="0" cellspacing="2">
+ <tbody><tr>
+ <td>Color Name</td>
+ <td>RGB CODE</td>
+ <td>HEX #</td>
+ <td>Sample</td>
+ </tr>
+ <tr>
+ <td>Snow</td>
+ <td>255.250.250</td>
+ <td>fffafa</td>
+ <td bgcolor="#fffafa">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Snow 2</td>
+ <td>238.233.233</td>
+ <td>eee9e9</td>
+ <td bgcolor="#eee9e9">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Snow 3</td>
+ <td>205<a name="PA"></a>.201.201</td>
+ <td>cdc9c9</td>
+ <td bgcolor="#cdc9c9">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Snow 4</td>
+ <td>139.137.137</td>
+ <td>8b8989</td>
+ <td bgcolor="#8b8989">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Ghost White</td>
+ <td>248.248.255</td>
+ <td>f8f8ff</td>
+ <td bgcolor="#f8f8ff">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>White Smoke</td>
+ <td>245.245.245</td>
+ <td>f5f5f5</td>
+ <td bgcolor="#f5f5f5">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Gainsboro</td>
+ <td>220.220.220</td>
+ <td>dccdc</td>
+ <td bgcolor="#dcdcdc">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Floral White</td>
+ <td>255.250.240</td>
+ <td>fffaf0</td>
+ <td bgcolor="#fffaf0">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Old Lace</td>
+ <td>253.245.230</td>
+ <td>fdf5e6</td>
+ <td bgcolor="#fdf5e6">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Linen</td>
+ <td>240.240.230</td>
+ <td>faf0e6</td>
+ <td bgcolor="#faf0e6">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Antique White</td>
+ <td>250.235.215</td>
+ <td>faebd7</td>
+ <td bgcolor="#faebd7">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Antique White 2</td>
+ <td>238.223.204</td>
+ <td>eedfcc</td>
+ <td bgcolor="#eedfcc">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Antique White 3</td>
+ <td>205.192.176</td>
+ <td>cdc0b0</td>
+ <td bgcolor="#cdc0b0">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Antique White 4</td>
+ <td>139.131.120</td>
+ <td>8b8378</td>
+ <td bgcolor="#8b8378">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Papaya Whip</td>
+ <td>255.239.213</td>
+ <td>ffefd5</td>
+ <td bgcolor="#ffefd5">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Blanched Almond</td>
+ <td>255.235.205</td>
+ <td>ffebcd</td>
+ <td bgcolor="#ffebcd">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Bisque</td>
+ <td>255.228.196</td>
+ <td>ffe4c4</td>
+ <td bgcolor="#ffe4c4">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Bisque 2</td>
+ <td>238.213.183</td>
+ <td>eed5b7</td>
+ <td bgcolor="#eed5b7">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Bisque 3</td>
+ <td>205.183.158</td>
+ <td>cdb79e</td>
+ <td bgcolor="#cdb79e">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Bisque 4</td>
+ <td>139.125.107</td>
+ <td>8b7d6b</td>
+ <td bgcolor="#8b7d6b">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Peach Puff</td>
+ <td>255.218.185</td>
+ <td>ffdab9</td>
+ <td bgcolor="#ffdab9">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Peach Puff 2</td>
+ <td>238.203.173</td>
+ <td>eecbad</td>
+ <td bgcolor="#eecbad">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Peach Puff 3</td>
+ <td>205.175.149</td>
+ <td>cdaf95</td>
+ <td bgcolor="#cdaf95">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Peach Puff 4</td>
+ <td>139.119.101</td>
+ <td>8b7765</td>
+ <td bgcolor="#8b7765">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Navajo White</td>
+ <td>255.222.173</td>
+ <td>ffdead</td>
+ <td bgcolor="#ffdead">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Moccasin</td>
+ <td>255.228.181</td>
+ <td>ffe4b5</td>
+ <td bgcolor="#ffe4b5">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Cornsilk</td>
+ <td>255.248.220</td>
+ <td>fff8dc</td>
+ <td bgcolor="#fff8dc">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Cornsilk 2</td>
+ <td>238.232.205</td>
+ <td>eee8dc</td>
+ <td bgcolor="#eee8dc">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Cornsilk 3</td>
+ <td>205.200.177</td>
+ <td>cdc8b1</td>
+ <td bgcolor="#cdc8b1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Cornsilk 4</td>
+ <td>139.136.120</td>
+ <td>8b8878</td>
+ <td bgcolor="#8b8878">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Ivory</td>
+ <td>255.255.240</td>
+ <td>fffff0</td>
+ <td bgcolor="#fffff0">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Ivory 2</td>
+ <td>238.238.224</td>
+ <td>eeeee0</td>
+ <td bgcolor="#eeeee0">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Ivory 3</td>
+ <td>205.205.193</td>
+ <td>cdcdc1</td>
+ <td bgcolor="#cdcdc1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Ivory 4</td>
+ <td>139.139.131</td>
+ <td>8b8b83</td>
+ <td bgcolor="#8b8b83">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Lemon Chiffon</td>
+ <td>255.250.205</td>
+ <td>fffacd</td>
+ <td bgcolor="#fffacd">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Seashell</td>
+ <td>255.245.238</td>
+ <td>fff5ee</td>
+ <td bgcolor="#fff5ee">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Seashell 2</td>
+ <td>238.229.222</td>
+ <td>eee5de</td>
+ <td bgcolor="#eee5de">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Seashell 3</td>
+ <td>205.197.191</td>
+ <td>cdc5bf</td>
+ <td bgcolor="#cdc5bf">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Seashell 4</td>
+ <td>139.134.130</td>
+ <td>8b8682</td>
+ <td bgcolor="#8b8682">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Honeydew</td>
+ <td>240.255.240</td>
+ <td>f0fff0</td>
+ <td bgcolor="#f0fff0">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Honeydew 2</td>
+ <td>244.238.224</td>
+ <td>e0eee0</td>
+ <td bgcolor="#e0eee0">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Honeydew 3</td>
+ <td>193.205.193</td>
+ <td>c1cdc1</td>
+ <td bgcolor="#c1cdc1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Honeydew 4</td>
+ <td>131.139.131</td>
+ <td>838b83</td>
+ <td bgcolor="#838b83">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Mint Cream</td>
+ <td>245.255.250</td>
+ <td>f5fffa</td>
+ <td bgcolor="#f5fffa">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Azure</td>
+ <td>240.255.255</td>
+ <td>f0ffff</td>
+ <td bgcolor="#f0ffff">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Alice Blue</td>
+ <td>240.248.255</td>
+ <td>f0f8ff</td>
+ <td bgcolor="#f0f8ff">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Lavender</td>
+ <td>230.230.250</td>
+ <td>e6e6fa</td>
+ <td bgcolor="#e6e6fa">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Lavender Blush</td>
+ <td>255.240.245</td>
+ <td>fff0f5</td>
+ <td bgcolor="#fff0f5">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Misty Rose</td>
+ <td>255.228.225</td>
+ <td>ffe4e1</td>
+ <td bgcolor="#ffe4e1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>White</td>
+ <td>255.255.255</td>
+ <td>ffffff</td>
+ <td bgcolor="#ffffff">&nbsp;</td>
+ </tr>
+ </tbody></table>
+ <h3>Grays</h3>
+ <table width="417" border="1" cellpadding="0" cellspacing="2">
+ <tbody><tr>
+ <td>Color Name</td>
+ <td>RGB COD<a name="GR"></a>E</td>
+ <td>HEX #</td>
+ <td>Sample</td>
+ </tr>
+ <tr>
+ <td>Black</td>
+ <td>0.0.0</td>
+ <td>000000</td>
+ <td bgcolor="#000000">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dark Slate Gray</td>
+ <td>49.79.79</td>
+ <td>2f4f4f</td>
+ <td bgcolor="#2f4f4f">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dim Gray</td>
+ <td>105.105.105</td>
+ <td>696969</td>
+ <td bgcolor="#696969">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Slate Gray</td>
+ <td>112.138.144</td>
+ <td>708090</td>
+ <td bgcolor="#708090">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Slate Gray</td>
+ <td>119.136.153</td>
+ <td>778899</td>
+ <td bgcolor="#778899">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Gray</td>
+ <td>190.190.190</td>
+ <td>bebebe</td>
+ <td bgcolor="#bebebe">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Gray</td>
+ <td>211.211.211</td>
+ <td>d3d3d3</td>
+ <td bgcolor="#d3d3d3">&nbsp;</td>
+ </tr>
+ </tbody></table>
+ <h3>Blues</h3>
+ <table width="417" border="1" cellpadding="0" cellspacing="2">
+ <tbody><tr>
+ <td>Color Name</td>
+ <td>RGB <a name="BL"></a>CODE</td>
+ <td>HEX #</td>
+ <td>Sample</td>
+ </tr>
+ <tr>
+ <td>Midnight Blue</td>
+ <td>25.25.112</td>
+ <td>191970</td>
+ <td bgcolor="#191970">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Navy</td>
+ <td>0.0.128</td>
+ <td>000080</td>
+ <td bgcolor="#000080">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Cornflower Blue</td>
+ <td>100.149.237</td>
+ <td>6495ed</td>
+ <td bgcolor="#6495ed">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dark Slate Blue</td>
+ <td>72.61.139</td>
+ <td>483d8b</td>
+ <td bgcolor="#483d8b">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Slate Blue</td>
+ <td>106.90.205</td>
+ <td>6a5acd</td>
+ <td bgcolor="#6a5acd">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Medium Slate Blue</td>
+ <td>123.104.238</td>
+ <td>7b68ee</td>
+ <td bgcolor="#7b68ee">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Slate Blue</td>
+ <td>132.112.255</td>
+ <td>8470ff</td>
+ <td bgcolor="#8470ff">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Medium Blue</td>
+ <td>0.0.205</td>
+ <td>0000cd</td>
+ <td bgcolor="#0000cd">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Royal Blue</td>
+ <td>65.105.225</td>
+ <td>4169e1</td>
+ <td bgcolor="#4169e1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Blue</td>
+ <td>0.0.255</td>
+ <td>0000ff</td>
+ <td bgcolor="#0000ff">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dodger Blue</td>
+ <td>30.144.255</td>
+ <td>1e90ff</td>
+ <td bgcolor="#1e90ff">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Deep Sky Blue</td>
+ <td>0.191.255</td>
+ <td>00bfff</td>
+ <td bgcolor="#00bfff">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Sky Blue</td>
+ <td>135.206.250</td>
+ <td>87ceeb</td>
+ <td bgcolor="#87ceeb">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Sky Blue</td>
+ <td>135.206.250</td>
+ <td>87cefa</td>
+ <td bgcolor="#87cefa">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Steel Blue</td>
+ <td>70.130.180</td>
+ <td>4682b4</td>
+ <td bgcolor="#4682b4">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Steel Blue</td>
+ <td>176.196.222</td>
+ <td>b0c4de</td>
+ <td bgcolor="#b0c4de">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Blue</td>
+ <td>173.216.230</td>
+ <td>add8e6</td>
+ <td bgcolor="#add8e6">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Powder Blue</td>
+ <td>176.224.230</td>
+ <td>b0e0e6</td>
+ <td bgcolor="#b0e0e6">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Pale Turquoise</td>
+ <td>175.238.238</td>
+ <td>afeeee</td>
+ <td bgcolor="#afeeee">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dark Turquoise</td>
+ <td>0.206.209</td>
+ <td>00ced1</td>
+ <td bgcolor="#00ced1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Medium Turquoise</td>
+ <td>72.209.204</td>
+ <td>48d1cc</td>
+ <td bgcolor="#48d1cc">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Turquoise</td>
+ <td>64.224.208</td>
+ <td>40e0d0</td>
+ <td bgcolor="#40e0d0">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Cyan</td>
+ <td>0.255.255</td>
+ <td>00ffff</td>
+ <td bgcolor="#00ffff">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Cyan</td>
+ <td>224.255.255</td>
+ <td>e0ffff</td>
+ <td bgcolor="#e0ffff">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Cadet Blue</td>
+ <td>95.158.160</td>
+ <td>5f9ea0</td>
+ <td bgcolor="#5f9ea0">&nbsp;</td>
+ </tr>
+ </tbody></table>
+ <h3>Greens</h3>
+ <table width="417" border="1" cellpadding="0" cellspacing="2">
+ <tbody><tr>
+ <td><b>Color Name</b></td>
+ <td><b>RGB<a name="GRE"></a> CODE</b></td>
+ <td><b>HEX #</b></td>
+ <td><b>Sample</b></td>
+ </tr>
+ <tr>
+ <td>Medium Aquamarine</td>
+ <td>102.205.170</td>
+ <td>66cdaa</td>
+ <td bgcolor="#66cdaa">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Aquamarine</td>
+ <td>127.255.212</td>
+ <td>7fffd4</td>
+ <td bgcolor="#7fffd4">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dark Green</td>
+ <td>0.100.0</td>
+ <td>006400</td>
+ <td bgcolor="#006400">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dark Olive Green</td>
+ <td>85.107.47</td>
+ <td>556b2f</td>
+ <td bgcolor="#556b2f">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dark Sea Green</td>
+ <td>143.188.143</td>
+ <td>8fbc8f</td>
+ <td bgcolor="#8fbc8f">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Sea Green</td>
+ <td>46.139.87</td>
+ <td>2e8b57</td>
+ <td bgcolor="#2e8b57">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Medium Sea Green</td>
+ <td>60.179.113</td>
+ <td>3cb371</td>
+ <td bgcolor="#3cb371">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Sea Green</td>
+ <td>32.178.170</td>
+ <td>20b2aa</td>
+ <td bgcolor="#20b2aa">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Pale Green</td>
+ <td>152.251.152</td>
+ <td>98fb98</td>
+ <td bgcolor="#98fb98">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Spring Green</td>
+ <td>0.255.127</td>
+ <td>00ff7f</td>
+ <td bgcolor="#00ff7f">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Lawn Green</td>
+ <td>124.252.0</td>
+ <td>7cfc00</td>
+ <td bgcolor="#7cfc00">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Chartreuse</td>
+ <td>127.255.0</td>
+ <td>7fff00</td>
+ <td bgcolor="#7fff00">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Medium Spring Green</td>
+ <td>0.250.154</td>
+ <td>00fa9a</td>
+ <td bgcolor="#00fa9a">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Green Yellow</td>
+ <td>173.255.47</td>
+ <td>adff2f</td>
+ <td bgcolor="#adff2f">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Lime Green</td>
+ <td>50.205.50</td>
+ <td>32cd32</td>
+ <td bgcolor="#32cd32">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Yellow Green</td>
+ <td>154.205.50</td>
+ <td>9acd32</td>
+ <td bgcolor="#9acd32">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Forest Green</td>
+ <td>34.139.34</td>
+ <td>228b22</td>
+ <td bgcolor="#228b22">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Olive Drab</td>
+ <td>107.142.35</td>
+ <td>6b8e23</td>
+ <td bgcolor="#6b8e23">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dark Khaki</td>
+ <td>189.183.107</td>
+ <td>bdb76b</td>
+ <td bgcolor="#bdb76b">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Khaki</td>
+ <td>240.230.140</td>
+ <td>f0e68c</td>
+ <td bgcolor="#f0e68c">&nbsp;</td>
+ </tr>
+ </tbody></table>
+ <h3>Yellow</h3>
+ <table width="417" border="1" cellpadding="0" cellspacing="2">
+ <tbody><tr>
+ <td><b>Color Name</b></td>
+ <td><b>RGB <a name="YE"></a>CODE</b></td>
+ <td><b>HEX #</b></td>
+ <td><b>Sample</b></td>
+ </tr>
+ <tr>
+ <td>Pale Goldenrod</td>
+ <td>238.232.170</td>
+ <td>eee8aa</td>
+ <td bgcolor="#eee8aa">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Goldenrod Yellow</td>
+ <td>250.250.210</td>
+ <td>fafad2</td>
+ <td bgcolor="#fafad2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Yellow</td>
+ <td>255.255.224</td>
+ <td>ffffe0</td>
+ <td bgcolor="#ffffe0">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Yellow</td>
+ <td>255.255.0</td>
+ <td>ffff00</td>
+ <td bgcolor="#ffff00">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Gold</td>
+ <td>255.215.0</td>
+ <td>ffd700</td>
+ <td bgcolor="#ffd700">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Goldenrod</td>
+ <td>238.221.130</td>
+ <td>eedd82</td>
+ <td bgcolor="#eedd82">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Goldenrod</td>
+ <td>218.165.32</td>
+ <td>daa520</td>
+ <td bgcolor="#daa520">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dark Goldenrod</td>
+ <td>184.134.11</td>
+ <td>b8860b</td>
+ <td bgcolor="#b8860b">&nbsp;</td>
+ </tr>
+ </tbody></table>
+ <h3>Browns</h3>
+ <table width="417" border="1" cellpadding="0" cellspacing="2">
+ <tbody><tr>
+ <td><b>Color Name</b></td>
+ <td><b>RGB<a name="BR"></a> CODE</b></td>
+ <td><b>HEX #</b></td>
+ <td><b>Sample</b></td>
+ </tr>
+ <tr>
+ <td>Rosy Brown</td>
+ <td>188.143.143</td>
+ <td>bc8f8f</td>
+ <td bgcolor="#bc8f8f">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Indian Red</td>
+ <td>205.92.92</td>
+ <td>cd5c5c</td>
+ <td bgcolor="#cd5c5c">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Saddle Brown</td>
+ <td>139.69.19</td>
+ <td>8b4513</td>
+ <td bgcolor="#8b4513">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Sienna</td>
+ <td>160.82.45</td>
+ <td>a0522d</td>
+ <td bgcolor="#a0522d">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Peru</td>
+ <td>205.133.63</td>
+ <td>cd853f</td>
+ <td bgcolor="#cd853f">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Burlywood</td>
+ <td>222.184.135</td>
+ <td>deb887</td>
+ <td bgcolor="#deb887">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Beige</td>
+ <td>245.245.220</td>
+ <td>f5f5dc</td>
+ <td bgcolor="#f5f5dc">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Wheat</td>
+ <td>245.222.179</td>
+ <td>f5deb3</td>
+ <td bgcolor="#f5deb3">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Sandy Brown</td>
+ <td>244.164.96</td>
+ <td>f4a460</td>
+ <td bgcolor="#f4a460">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Tan</td>
+ <td>210.180.140</td>
+ <td>d2b48c</td>
+ <td bgcolor="#d2b48c">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Chocolate</td>
+ <td>210.105.30</td>
+ <td>d2691e</td>
+ <td bgcolor="#d2691e">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Firebrick</td>
+ <td>178.34.34</td>
+ <td>b22222</td>
+ <td bgcolor="#b22222">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Brown</td>
+ <td>165.42.42</td>
+ <td>a52a2a</td>
+ <td bgcolor="#a52a2a">&nbsp;</td>
+ </tr>
+ </tbody></table>
+ <h3>Oranges</h3>
+ <table width="417" border="1" cellpadding="0" cellspacing="2">
+ <tbody><tr>
+ <td><b>Color Name</b></td>
+ <td><b>RGB C<a name="OR"></a>ODE</b></td>
+ <td><b>HEX #</b></td>
+ <td><b>Sample</b></td>
+ </tr>
+ <tr>
+ <td>Dark Salmon</td>
+ <td>233.150.122</td>
+ <td>e9967a</td>
+ <td bgcolor="#e9967a">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Salmon</td>
+ <td>250.128.114</td>
+ <td>fa8072</td>
+ <td bgcolor="#fa8072">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Salmon</td>
+ <td>255.160.122</td>
+ <td>ffa07a</td>
+ <td bgcolor="#ffa07a">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Orange</td>
+ <td>255.165.0</td>
+ <td>ffa500</td>
+ <td bgcolor="#ffa500">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dark Orange</td>
+ <td>255.140.0</td>
+ <td>ff8c00</td>
+ <td bgcolor="#ff8c00">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Coral</td>
+ <td>255.127.80</td>
+ <td>ff7f50</td>
+ <td bgcolor="#ff7f50">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Coral</td>
+ <td>240.128.128</td>
+ <td>f08080</td>
+ <td bgcolor="#f08080">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Tomato</td>
+ <td>255.99.71</td>
+ <td>ff6347</td>
+ <td bgcolor="#ff6347">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Orange Red</td>
+ <td>255.69.0</td>
+ <td>ff4500</td>
+ <td bgcolor="#ff4500">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Red</td>
+ <td>255.0.0</td>
+ <td>ff0000</td>
+ <td bgcolor="#ff0000">&nbsp;</td>
+ </tr>
+ </tbody></table>
+ <h3>Pinks/Violets</h3>
+ <table width="416" border="1" cellpadding="0" cellspacing="2">
+ <tbody><tr>
+ <td><b>Color Name</b></td>
+ <td><b>RGB<a name="PI"></a> CODE</b></td>
+ <td><b>HEX #</b></td>
+ <td><b>Sample</b></td>
+ </tr>
+ <tr>
+ <td>Hot Pink</td>
+ <td>255.105.180</td>
+ <td>ff69b4</td>
+ <td bgcolor="#ff69b4">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Deep Pink</td>
+ <td>255.20.147</td>
+ <td>ff1493</td>
+ <td bgcolor="#ff1493">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Pink</td>
+ <td>255.192.203</td>
+ <td>ffc0cb</td>
+ <td bgcolor="#ffc0cb">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Light Pink</td>
+ <td>255.182.193</td>
+ <td>ffb6c1</td>
+ <td bgcolor="#ffb6c1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Pale Violet Red</td>
+ <td>219.112.147</td>
+ <td>db7093</td>
+ <td bgcolor="#db7093">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Maroon</td>
+ <td>176.48.96</td>
+ <td>b03060</td>
+ <td bgcolor="#b03060">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Medium Violet Red</td>
+ <td>199.21.133</td>
+ <td>c71585</td>
+ <td bgcolor="#c71585">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Violet Red</td>
+ <td>208.32.144</td>
+ <td>d02090</td>
+ <td bgcolor="#d02090">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Violet</td>
+ <td>238.130.238</td>
+ <td>ee82ee</td>
+ <td bgcolor="#ee82ee">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Plum</td>
+ <td>221.160.221</td>
+ <td>dda0dd</td>
+ <td bgcolor="#dda0dd">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Orchid</td>
+ <td>218.112.214</td>
+ <td>da70d6</td>
+ <td bgcolor="#da70d6">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Medium Orchid</td>
+ <td>186.85.211</td>
+ <td>ba55d3</td>
+ <td bgcolor="#ba55d3">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dark Orchid</td>
+ <td>153.50.204</td>
+ <td>9932cc</td>
+ <td bgcolor="#9932cc">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Dark Violet</td>
+ <td>148.0.211</td>
+ <td>9400d3</td>
+ <td bgcolor="#9400d3">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Blue Violet</td>
+ <td>138.43.226</td>
+ <td>8a2be2</td>
+ <td bgcolor="#8a2be2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Purple</td>
+ <td>160.32.240</td>
+ <td>a020f0</td>
+ <td bgcolor="#a020f0">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Medium Purple</td>
+ <td>147.112.219</td>
+ <td>9370db</td>
+ <td bgcolor="#9370db">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>Thistle</td>
+ <td>216.191.216</td>
+ <td>d8bfd8</td>
+ <td bgcolor="#d8bfd8">&nbsp;</td>
+ </tr>
+ </tbody></table>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div align="center">
+ <p><a href="#PA">Whites/Pastels</a> . <a href="#GR">Grays</a> <br> <a href="#BL">Blues</a> . <a href="#GRE">Greens</a> . <a href="#YE">Yellows</a> <br> <a href="#BR">Browns</a> . <a href="#OR">Oranges</a> . <a href="#PI">Pinks/Violets</a></p>
+ </div>
+ </td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ </body></html>
309 psc/dmx/chgall.php
@@ -0,0 +1,309 @@
+<?
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * chgall.php
+ * requests to change values
+ * Copyright (C) 2011 Laurent Pierru <renzo@imaginux.com>
+ */
+
+ //chg all rgb values
+ if ( isset($_POST['chgallval']) || isset($_POST['chgallvaljs_rgb']) || isset($_POST['chgallvaljs_cmy']) || isset($_POST['chgallvalmy']) )
+ {
+
+ if ( isset($_POST['chgallval']) )
+ {
+ $new_allch_value=$allch_value;
+ }
+ elseif ( isset($_POST['chgallvaljs_rgb']) )
+ {
+ $new_allch_value=$allch_valuejs_rgb;
+ }
+ elseif ( isset($_POST['chgallvaljs_cmy']) )
+ {
+ $new_allch_value=$allch_valuejs_cmy;
+ }
+ elseif ( isset($_POST['chgallvalmy']) )
+ {
+ $new_allch_value=$allch_valuemy;
+ }
+
+ //que les cases cochees
+ if ( isset($_POST['chkbox']) ){
+
+ //this array values
+ foreach($_POST['chkbox'] as $val)
+ {
+ //echo $val,'<br />';
+ $sqlg="UPDATE $table_dmx1 SET ch_value='".$new_allch_value."' WHERE id='".$val."'";
+ $sqlg=mysql_query($sqlg) or die(mysql_error());
+ //echo'ok_';
+ }
+
+ //sinon toutes les rgb
+ }elseif ( ( isset($_POST['chgallvaljs_rgb']) || isset($_POST['chgallvalmy']) ) AND (!isset($_POST['colorstab'])) ){
+ //array values
+ for ($j = 0; $j < $testf; $j++) {
+ $match=substr($ch_name[$j], 0, 3);
+ //echo"".$ch_name[$j]." $match<br>";
+ if ($match=='rgb'){
+ $sqlg="UPDATE $table_dmx1 SET ch_value='".$new_allch_value."' WHERE id='".$ch_id[$j]."'";
+ $sqlg=mysql_query($sqlg) or die(mysql_error());
+ //echo'ok_';
+ }
+ }
+
+ //sinon toutes les cmy
+ }elseif ( (isset($_POST['chgallvaljs_cmy'])) AND (!isset($_POST['colorstab'])) ){
+ //array values
+ for ($j = 0; $j < $testf; $j++) {
+ $match=substr($ch_name[$j], 0, 3);
+ //echo"".$ch_name[$j]." $match<br>";
+ if ($match=='cmy'){
+ $sqlg="UPDATE $table_dmx1 SET ch_value='".$new_allch_value."' WHERE id='".$ch_id[$j]."'";
+ $sqlg=mysql_query($sqlg) or die(mysql_error());
+ //echo'ok_';
+ }
+ }
+
+ //sinon toutes les rgb when no filter
+ }elseif ( (isset($_POST['chgallval'])) AND (!isset($_POST['colorstab'])) AND $new_allch_value!="" AND (!isset($_SESSION['filter_exp'])) ){
+ //array values
+ for ($j = 0; $j < $testf; $j++) {
+ $match=substr($ch_name[$j], 0, 3);
+ //echo"".$ch_name[$j]." $match<br>";
+ if ($match=='rgb'){
+ $sqlg="UPDATE $table_dmx1 SET ch_value='".$new_allch_value."' WHERE id='".$ch_id[$j]."'";
+ $sqlg=mysql_query($sqlg) or die(mysql_error());
+ //echo'ok_';
+ }
+ }
+
+ //sinon toutes
+ }elseif ( (isset($_POST['chgallval'])) AND (!isset($_POST['colorstab'])) AND $new_allch_value!="" ){
+ //array values
+ for ($j = 0; $j < $testf; $j++) {
+ //$match=substr($ch_name[$j], 0, 3);
+ //echo"".$ch_name[$j]." $match<br>";
+ //if ($match==''){
+ $sqlg="UPDATE $table_dmx1 SET ch_value='".$new_allch_value."' WHERE id='".$ch_id[$j]."'";
+ $sqlg=mysql_query($sqlg) or die(mysql_error());
+ //echo'ok_';
+ //}
+ }
+ }
+ }
+
+ //chg all rgb values random
+ if ( isset($_POST['chgallrand']) )
+ {
+ //que les cases cochees
+ if ( isset($_POST['chkbox']) ){
+
+ //this array values
+ foreach($_POST['chkbox'] as $val)
+ {
+ $rand1=rand(0,255);
+ $rand2=rand(0,255);
+ $rand3=rand(0,255);
+ $random_value="$rand1.$rand2.$rand3";
+ //echo $val,'<br />';
+ $sqlg="UPDATE $table_dmx1 SET ch_value='".$random_value."' WHERE id='".$val."'";
+ $sqlg=mysql_query($sqlg) or die(mysql_error());
+ //echo'ok_';
+ }
+
+ //sinon toutes les rgb
+ }elseif(!isset($_POST['colorstab'])){
+ //array values
+ for ($j = 0; $j < $testf; $j++) {
+ $rand1=rand(0,255);
+ $rand2=rand(0,255);
+ $rand3=rand(0,255);
+ $random_value="$rand1.$rand2.$rand3";
+ $match=substr($ch_name[$j], 0, 3);
+ //echo"".$ch_name[$j]." $match<br>";
+ if ($match=='rgb'){
+ $sqlg="UPDATE $table_dmx1 SET ch_value='".$random_value."' WHERE id='".$ch_id[$j]."'";
+ $sqlg=mysql_query($sqlg) or die(mysql_error());
+ //echo'ok_';
+ }
+ }
+ }
+ }
+
+ //chg all rgb values with fade
+ if ( isset($_POST['chgallvalfade']) )
+ {
+ if ( isset($_POST['chkbox']) ){
+ //this array values
+ $p=0;
+ foreach($_POST['chkbox'] as $val)
+ {
+ $p++;
+ }
+ $nb_rgb=$p;
+ }
+
+ //echo"_$nb_rgb";
+
+ //get array to increment each channel
+ $src_color=explode('.',$ch_value_src);
+ $dst_color=explode('.',$ch_value_dst);
+
+ //define variation (delta / nb)
+ for($k=0; $k<3; $k++){
+ $color_color[$k] = (( abs($dst_color[$k]-$src_color[$k]) ) / ($nb_rgb-1));
+ }
+
+ //que les cases cochees
+ if ( isset($_POST['chkbox']) ){
+
+ //this array values
+ $n=-1;
+ foreach($_POST['chkbox'] as $val)
+ {
+ //echo $val,'<br />';
+ //if ($match=='rgb'){
+ $n++; //echo"$n";
+
+ for($k=0; $k<3; $k++){
+
+ if ($offset!=""){
+ if ($n>$offset){
+ //echo"normal<br>";
+ //normal
+ if (($src_color[$k]-$dst_color[$k]) < 0){
+ $src_color_new[$k] = $src_color[$k]+ ( ($n-$offset)*$color_color[$k] );
+ }else{
+ $src_color_new[$k] = $src_color[$k]- ( ($n-$offset)*$color_color[$k] );
+ }
+ }else{
+ //echo"reverse<br>";
+ //reverse
+ if (($src_color[$k]-$dst_color[$k]) < 0){
+ $src_color_new[$k] = $src_color[$k]+ ( ($offset-$n)*$color_color[$k] );
+ }else{
+ $src_color_new[$k] = $src_color[$k]- ( ($offset-$n)*$color_color[$k] );
+ }
+ }
+ //echo"n=$n,offset=$offset<br>";
+ }else{
+ //define if increase or decrease
+ if (($src_color[$k]-$dst_color[$k]) < 0){
+ $src_color_new[$k] = $src_color[$k]+ ( ($n)*$color_color[$k] );
+ }else{
+ $src_color_new[$k] = $src_color[$k]- ( ($n)*$color_color[$k] );
+ }
+ }
+
+ //not decimal
+ $src_color_new[$k] = round($src_color_new[$k],0);
+ //echo"$src_color[$k]";
+
+ //get legal values
+ if ($src_color_new[$k] > 255){
+ $src_color_new[$k] = 255;
+ }
+ if ($src_color_new[$k] < 0){
+ $src_color_new[$k] = 0;
+ }
+ }
+
+ //concat
+ $ch_value_new=$src_color_new[0];
+ $ch_value_new.=".";
+ $ch_value_new.=$src_color_new[1];
+ $ch_value_new.=".";