diff --git a/.gitignore b/.gitignore index 56364c34ca..91fcea346b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.out *~ +*.swp *.pyc @@ -16,15 +17,35 @@ *.aux +# Debian related files +*.deb +*.dsc +*.changes +*.substvars +*.debhelper.log +*-stamp +/debian/control +/debian/changelog +/debian/files +/debian/paparazzi-arm7 +/debian/paparazzi-avr +/debian/paparazzi-dev +/debian/paparazzi-bin +/sw/lib/ocaml/ivy/debian/changelog +/sw/lib/ocaml/ivy/debian/files +/sw/lib/ocaml/ivy/debian/ivy-ocaml + /var /dox +/paparazzi # /conf/ /conf/conf.xml /conf/conf.xml.20* /conf/control_panel.xml /conf/%gconf.xml +/conf/srtm_data/* # /doc/pprz_algebra/ /doc/pprz_algebra/headfile.log @@ -77,6 +98,7 @@ # /sw/simulator/ /sw/simulator/gaia /sw/simulator/simhitl +/sw/simulator/launchsitl # /sw/supervision/ /sw/supervision/gtk_process.ml @@ -86,3 +108,17 @@ # /sw/tools/ /sw/tools/fp_parser.ml /sw/tools/wiki_gen/wiki_gen + +# /sw/ground_segment/joystick +/sw/ground_segment/joystick/test_stick + +# /sw/airborne/arch/lpc21/test/bootloader +/sw/airborne/arch/lpc21/test/bootloader/bl.dmp +/sw/airborne/arch/lpc21/test/bootloader/bl.hex +/sw/airborne/arch/lpc21/test/bootloader/bl.map +/sw/airborne/arch/lpc21/test/bootloader/bl.elf +/sw/airborne/arch/lpc21/test/bootloader/bl_ram.dmp +/sw/airborne/arch/lpc21/test/bootloader/bl_ram.hex +/sw/airborne/arch/lpc21/test/bootloader/bl_ram.map +/sw/airborne/arch/lpc21/test/bootloader/bl_ram.elf +/sw/airborne/arch/lpc21/test/bootloader/crt.lst diff --git a/Doxyfile b/Doxyfile index fb6c91fc1e..934897d58e 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.4.2 +# Doxyfile 1.6.3 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project @@ -14,524 +14,669 @@ # Project related configuration options #--------------------------------------------------------------------------- -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. -PROJECT_NAME = Paparazzi3 +PROJECT_NAME = Paparazzi -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 3 +PROJECT_NUMBER = 4 -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = dox -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, -# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, -# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, -# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, -# Swedish, and Ukrainian. +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the # path to strip. -STRIP_FROM_PATH = +STRIP_FROM_PATH = -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = YES - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO -# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 2 -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. -ALIASES = +ALIASES = -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES -# If the EXTRACT_STATIC tag is set to YES all static members of a file +# If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the +# Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES -# The ENABLED_SECTIONS tag can be used to enable conditional +# The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. -ENABLED_SECTIONS = +ENABLED_SECTIONS = -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. SHOW_DIRECTORIES = YES -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the progam writes to standard output +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- -# The QUIET tag can be used to turn on/off the messages that are generated +# The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written # to stderr. -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = sw/airborne/booz_priv sw/airborne/booz_priv/ sw/airborne/booz_priv/arm7 sw/airborne/ sw/airborne/arm7 +INPUT = sw/airborne sw/airborne/math -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. -FILE_PATTERNS = +INPUT_ENCODING = UTF-8 -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. -EXCLUDE = +EXCLUDE = var -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see # the \include command). -EXAMPLE_PATH = +EXAMPLE_PATH = -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left # blank all files are included. -EXAMPLE_PATTERNS = +EXAMPLE_PATTERNS = -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see # the \image command). -IMAGE_PATH = +IMAGE_PATH = -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be # ignored. -INPUT_FILTER = +INPUT_FILTER = -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. -FILTER_PATTERNS = +FILTER_PATTERNS = -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO @@ -540,38 +685,54 @@ FILTER_SOURCE_FILES = NO # configuration options related to source browsing #--------------------------------------------------------------------------- -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES -# Setting the INLINE_SOURCES tag to YES will include the body +# Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES @@ -580,279 +741,424 @@ VERBATIM_HEADERS = YES # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a # standard header. -HTML_HEADER = +HTML_HEADER = -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a # standard footer. -HTML_FOOTER = +HTML_FOOTER = -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! -HTML_STYLESHEET = +HTML_STYLESHEET = -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = YES + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be # written to the html output directory. -CHM_FILE = +CHM_FILE = -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. -HHC_LOCATION = +HHC_LOCATION = -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO -# The TOC_EXPAND flag can be set to YES to add extra items for group members +# The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. +# For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's +# filter section matches. +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO -# This tag can be used to set the number of enum values (range [1..20]) +# This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = NO -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. -GENERATE_LATEX = YES +GENERATE_LATEX = NO -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. LATEX_CMD_NAME = latex -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. -EXTRA_PACKAGES = +EXTRA_PACKAGES = -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! -LATEX_HEADER = +LATEX_HEADER = -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO +# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = -# Set optional variables used in the generation of an rtf document. +# Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man -# The MAN_EXTENSION tag determines the extension that is added to +# The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO @@ -861,33 +1167,33 @@ MAN_LINKS = NO # configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the # syntax of the XML files. -XML_SCHEMA = +XML_SCHEMA = -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the # syntax of the XML files. -XML_DTD = +XML_DTD = -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES @@ -896,10 +1202,10 @@ XML_PROGRAMLISTING = YES # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO @@ -908,311 +1214,341 @@ GENERATE_AUTOGEN_DEF = NO # configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- -# Configuration options related to the preprocessor +# Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_PREDEFINED tags. +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by # the preprocessor. -INCLUDE_PATH = var/BOOZ2_flixr var/include sw/include sw/airborne/booz_priv sw/airborne/booz_priv/ sw/airborne/booz_priv/arm7 sw/airborne/ sw/airborne/arm7 var/BOOZ2_flixr +INCLUDE_PATH = sw/include \ + sw/airborne -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator # instead of the = operator. -PREDEFINED = KILL_SWITCH USE_BUSS_TWI_BLMC USE_AMI601 +PREDEFINED = KILL_SWITCH \ + USE_BUSS_TWI_BLMC \ + USE_AMI601 -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration::additions related to external references #--------------------------------------------------------------------------- -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen +# If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = -# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. -GENERATE_TAGFILE = +GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES -# The PERL_PATH should be the absolute path and name of the perl script +# The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = YES -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO -# If set to YES, the inheritance and collaboration graphs will show the +# If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. -CALL_GRAPH = NO +CALL_GRAPH = YES -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = YES + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. -DOT_IMAGE_FORMAT = png +DOT_IMAGE_FORMAT = gif -# The tag DOT_PATH can be used to specify the path where the dot tool can be +# The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. -DOT_PATH = +DOT_PATH = -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the # \dotfile command). -DOTFILE_DIRS = +DOTFILE_DIRS = -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. -MAX_DOT_GRAPH_WIDTH = 1024 +DOT_GRAPH_MAX_NODES = 50 -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that a graph may be further truncated if the graph's -# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH -# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), -# the graph is not depth-constrained. +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, which results in a white background. -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/Makefile b/Makefile index d1f4c2f58e..516f73a2ec 100644 --- a/Makefile +++ b/Makefile @@ -60,14 +60,14 @@ XSENS_XML = $(CONF)/xsens_MTi-G.xml TOOLS=$(PAPARAZZI_SRC)/sw/tools HAVE_ARM_NONE_EABI_GCC := $(shell which arm-none-eabi-gcc) ifeq ($(strip $(HAVE_ARM_NONE_EABI_GCC)),) -#ARMGCC=/opt/paparazzi/bin/arm-elf-gcc -ARMGCC=/usr/bin/arm-elf-gcc +ARMGCC=$(shell which arm-elf-gcc) else ARMGCC=$(HAVE_ARM_NONE_EABI_GCC) endif +OCAML=$(shell which ocaml) +OCAMLRUN=$(shell which ocamlrun) - -all: static conf +all: commands static conf static : lib center tools cockpit multimon tmtc logalizer lpc21iap sim_static static_h usb_lib @@ -211,6 +211,7 @@ clean: rm -f $(MESSAGES_H) $(MESSAGES2_H) $(UBX_PROTOCOL_H) $(DL_PROTOCOL_H) find . -mindepth 2 -name Makefile -exec sh -c '$(MAKE) -C `dirname {}` $@' \; find . -name '*~' -exec rm -f {} \; + rm -f paparazzi sw/simulator/launchsitl cleanspaces: find ./sw/airborne -name '*.[ch]' -exec sed -i {} -e 's/[ \t]*$$//' \; @@ -219,16 +220,32 @@ cleanspaces: find ./sw -name '*.mli' -exec sed -i {} -e 's/[ \t]*$$//' ';' find ./conf -name '*.xml' -exec sed -i {} -e 's/[ \t]*$$//' ';' +distclean : dist_clean dist_clean : clean + rm -r conf/srtm_data ab_clean: find sw/airborne -name '*~' -exec rm -f {} \; test_all_example_airframes: - $(MAKE) AIRCRAFT=BOOZ2_A2 clean_ac ap - $(MAKE) AIRCRAFT=MJ5 clean_ac ap sim - $(MAKE) AIRCRAFT=TJ1 clean_ac ap sim - $(MAKE) AIRCRAFT=HITL clean_ac ap - $(MAKE) AIRCRAFT=DM clean_ac ap sim - $(MAKE) AIRCRAFT=CSC clean_ac ap + $(MAKE) AIRCRAFT=BOOZ2_A1 clean_ac ap sim + $(MAKE) AIRCRAFT=Microjet clean_ac ap sim + $(MAKE) AIRCRAFT=Tiny_IMU clean_ac ap + $(MAKE) AIRCRAFT=EasyStar_ETS clean_ac ap sim + +commands: paparazzi sw/simulator/launchsitl + +paparazzi: + cat src/paparazzi | sed s#OCAMLRUN#$(OCAMLRUN)# | sed s#OCAML#$(OCAML)# > $@ + chmod a+x $@ + +sw/simulator/launchsitl: + cat src/$(@F) | sed s#OCAMLRUN#$(OCAMLRUN)# | sed s#OCAML#$(OCAML)# > $@ + chmod a+x $@ + +#.SUFFIXES: .hgt.zip + +%.hgt.zip: + cd data/srtm; $(MAKE) $(@) + diff --git a/Makefile.ac b/Makefile.ac index 93e3c50fc1..3e8d6c7ec1 100644 --- a/Makefile.ac +++ b/Makefile.ac @@ -53,14 +53,13 @@ TUNING_H=$(AC_GENERATED)/tuning.h SUPERVISION=./paparazzi MAKE=make PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) MODULES_H=$(AC_GENERATED)/modules.h -MODULES_DIR=$(PAPARAZZI_HOME)/conf/modules/ AIRCRAFT_MD5=$(AIRCRAFT_CONF_DIR)/aircraft.md5 # "make Q=''" to get full echo Q=@ init: - @[ -d $(PAPARAZZI_HOME) ] || (echo "Copying config example in your $(PAPARAZZI_HOME) directory"; mkdir -p $(PAPARAZZI_HOME); cp -a conf $(PAPARAZZI_HOME); cp -a data $(PAPARAZZI_HOME); mkdir -p $(PAPARAZZI_HOME)/var/maps; mv $(PAPARAZZI_HOME)/data/maps/trtqtttqtsrrt*.jpg $(PAPARAZZI_HOME)/var/maps; mkdir -p $(PAPARAZZI_HOME)/var/include) + @[ -d $(PAPARAZZI_HOME) ] || (echo "Copying config example in your $(PAPARAZZI_HOME) directory"; mkdir -p $(PAPARAZZI_HOME); cp -a conf $(PAPARAZZI_HOME); cp -a data $(PAPARAZZI_HOME); mkdir -p $(PAPARAZZI_HOME)/var/maps; mkdir -p $(PAPARAZZI_HOME)/var/include) demo: $(SUPERVISION) @@ -132,7 +131,7 @@ $(TUNING_H) : $(SETTINGS_XMLS) $(CONF_XML) $(TOOLS)/gen_tuning.out $(MODULES_H) : $(CONF)/$(AIRFRAME_XML) $(TOOLS)/gen_modules.out $(CONF)/modules/*.xml $(Q)test -d $(AC_GENERATED) || mkdir -p $(AC_GENERATED) @echo BUILD $@ - $(Q)$(TOOLS)/gen_modules.out $(MODULES_DIR) $(SETTINGS_MODULES) $< > $@ + $(Q)$(TOOLS)/gen_modules.out $(SETTINGS_MODULES) $< > $@ $(Q)chmod a+r $@ $(SETTINGS_MODULES) : $(MODULES_H) diff --git a/Makefile.install b/Makefile.install index 978a38ec64..1acf59704f 100644 --- a/Makefile.install +++ b/Makefile.install @@ -19,13 +19,11 @@ install_data: $(INSTALL) -d $(DESTDIR)/data/maps $(INSTALLDATA) data/maps/muret_UTM.xml data/maps/muret_UTM.gif $(DESTDIR)/data/maps $(INSTALL) -d $(DESTDIR)/data/pictures/gcs_icons - $(INSTALLDATA) var/maps/trtqtttqtsrrtstq*.jpg var/maps/trtqtttqtsrrttsr*.jpg $(DESTDIR)/data/maps $(INSTALLDATA) data/pictures/*.gif data/pictures/*.svg data/pictures/*.jpg data/pictures/*.png $(DESTDIR)/data/pictures $(INSTALLDATA) data/pictures/gcs_icons/*.png $(DESTDIR)/data/pictures/gcs_icons $(INSTALL) -d $(PREFIX)/usr/share/pixmaps $(INSTALLDATA) data/pictures/penguin_icon.png $(PREFIX)/usr/share/pixmaps/paparazzi.png $(INSTALL) -d $(DESTDIR)/data/srtm - $(INSTALLDATA) data/srtm/N43E001.hgt.bz2 $(DESTDIR)/data/srtm install_conf: @@ -37,17 +35,27 @@ install_conf: $(INSTALLDATA) conf/gui.xml $(DESTDIR)/conf/ $(INSTALL) -d $(DESTDIR)/conf/airframes $(INSTALLDATA) conf/airframes/airframe.dtd $(DESTDIR)/conf/airframes - $(INSTALLDATA) conf/airframes/microjet5.xml $(DESTDIR)/conf/airframes - $(INSTALLDATA) conf/airframes/twinstar1.xml $(DESTDIR)/conf/airframes - $(INSTALLDATA) conf/airframes/twinjet1.xml $(DESTDIR)/conf/airframes - $(INSTALLDATA) conf/airframes/tiny_hitl.xml $(DESTDIR)/conf/airframes - $(INSTALLDATA) conf/airframes/booz2_a2.xml $(DESTDIR)/conf/airframes + $(INSTALLDATA) conf/airframes/microjet_example.xml $(DESTDIR)/conf/airframes + $(INSTALLDATA) conf/airframes/twinstar_example.xml $(DESTDIR)/conf/airframes + $(INSTALLDATA) conf/airframes/twinjet_example.xml $(DESTDIR)/conf/airframes + $(INSTALLDATA) conf/airframes/example_twog_analogimu.xml $(DESTDIR)/conf/airframes $(INSTALL) -d $(DESTDIR)/conf/autopilot $(INSTALLDATA) conf/autopilot/*.makefile $(DESTDIR)/conf/autopilot $(INSTALLDATA) conf/autopilot/*.h $(DESTDIR)/conf/autopilot + $(INSTALL) -d $(DESTDIR)/conf/autopilot/subsystems + $(INSTALLDATA) conf/autopilot/subsystems/*.makefile $(DESTDIR)/conf/autopilot/subsystems + $(INSTALL) -d $(DESTDIR)/conf/autopilot/subsystems/fixedwing + $(INSTALLDATA) conf/autopilot/subsystems/fixedwing/*.makefile $(DESTDIR)/conf/autopilot/subsystems/fixedwing + $(INSTALL) -d $(DESTDIR)/conf/autopilot/subsystems/rotorcraft + $(INSTALLDATA) conf/autopilot/subsystems/rotorcraft/*.makefile $(DESTDIR)/conf/autopilot/subsystems/rotorcraft + $(INSTALL) -d $(DESTDIR)/conf/autopilot/subsystems/shared + $(INSTALLDATA) conf/autopilot/subsystems/shared/*.makefile $(DESTDIR)/conf/autopilot/subsystems/shared $(INSTALL) -d $(DESTDIR)/conf/flight_plans $(INSTALLDATA) conf/flight_plans/*.dtd $(DESTDIR)/conf/flight_plans $(INSTALLDATA) conf/flight_plans/*.xml $(DESTDIR)/conf/flight_plans + $(INSTALL) -d $(DESTDIR)/conf/modules + $(INSTALLDATA) conf/modules/*.dtd $(DESTDIR)/conf/modules + $(INSTALLDATA) conf/modules/*.xml $(DESTDIR)/conf/modules $(INSTALL) -d $(DESTDIR)/conf/gps $(INSTALLDATA) conf/gps/Makefile $(DESTDIR)/conf/gps $(INSTALLDATA) conf/gps/ublox_conf.c $(DESTDIR)/conf/gps @@ -111,16 +119,12 @@ install_libs: install_tools: $(INSTALLDATA) Makefile.ac $(DESTDIR) - $(INSTALL) -d $(DESTDIR)/sw/tools/ $(INSTALLDATA) conf/Makefile* $(DESTDIR)/conf + $(INSTALL) -d $(DESTDIR)/sw/tools/ $(INSTALL) sw/tools/*.out $(DESTDIR)/sw/tools/ rm -f $(DESTDIR)/sw/tools/gen_flight_plan.out - $(INSTALLDATA) sw/tools/fp_syntax.cmo $(DESTDIR)/sw/tools - $(INSTALLDATA) sw/tools/fp_parser.cmo $(DESTDIR)/sw/tools - $(INSTALLDATA) sw/tools/fp_lexer.cmo $(DESTDIR)/sw/tools $(INSTALLDATA) sw/tools/fp_proc.cmo $(DESTDIR)/sw/tools $(INSTALLDATA) sw/tools/gen_flight_plan.cmo $(DESTDIR)/sw/tools - $(INSTALLDATA) sw/tools/extract_makefile.ml $(DESTDIR)/sw/tools/ $(INSTALLDATA) sw/tools/gen_aircraft.ml $(DESTDIR)/sw/tools/ $(INSTALLDATA) sw/tools/gen_airframe.ml $(DESTDIR)/sw/tools/ $(INSTALLDATA) sw/tools/gen_messages.ml $(DESTDIR)/sw/tools/ @@ -130,6 +134,14 @@ install_tools: $(INSTALLDATA) sw/tools/gen_settings.ml $(DESTDIR)/sw/tools/ $(INSTALLDATA) sw/tools/gen_tuning.ml $(DESTDIR)/sw/tools/ $(INSTALLDATA) sw/tools/gen_ubx.ml $(DESTDIR)/sw/tools/ + $(INSTALLDATA) sw/tools/gen_xsens.ml $(DESTDIR)/sw/tools/ + $(INSTALLDATA) sw/tools/gen_modules.ml $(DESTDIR)/sw/tools/ + $(INSTALLDATA) sw/tools/gen_common.cmo $(DESTDIR)/sw/tools/ + $(INSTALL) -d $(DESTDIR)/sw/tools/calibration + $(INSTALLDATA) sw/tools/calibration/calibrate.py $(DESTDIR)/sw/tools/calibration + $(INSTALLDATA) sw/tools/calibration/calibrate_gyro.py $(DESTDIR)/sw/tools/calibration + $(INSTALLDATA) sw/tools/calibration/calibration_utils.py $(DESTDIR)/sw/tools/calibration + $(INSTALLDATA) sw/tools/calibration/README $(DESTDIR)/sw/tools/calibration $(INSTALL) -d $(DESTDIR)/sw/ground_segment/lpc21iap $(INSTALL) sw/ground_segment/lpc21iap/lpc21iap $(DESTDIR)/sw/ground_segment/lpc21iap/ $(INSTALL) -d $(DESTDIR)/sw/simulator @@ -142,7 +154,7 @@ install_tools: install_airborne_sources: $(INSTALL) -d $(DESTDIR)/sw/ - tar --exclude=CVS -cf - sw/airborne/ | tar -C $(DESTDIR) -xf - + tar -cf - sw/airborne/ | tar -C $(DESTDIR) -xf - $(INSTALL) -d $(DESTDIR)/sw/include $(INSTALLDATA) sw/include/std.h $(DESTDIR)/sw/include $(INSTALLDATA) var/include/*.h $(DESTDIR)/sw/include diff --git a/conf/Makefile.sim b/conf/Makefile.sim index fea3dd1379..8830edd81d 100644 --- a/conf/Makefile.sim +++ b/conf/Makefile.sim @@ -35,7 +35,7 @@ CC = g++ endif OCAMLC = ocamlc SIMDIR = $(PAPARAZZI_SRC)/sw/simulator -CAMLINCLUDES = -I +lablgtk2 -I $(PAPARAZZI_SRC)/sw/lib/ocaml -I $(SIMDIR) -I +xml-light +CAMLINCLUDES = $(shell ocamlfind query -r -i-format lablgtk2) -I $(PAPARAZZI_SRC)/sw/lib/ocaml -I $(SIMDIR) $(shell ocamlfind query -r -i-format xml-light) SIMSITLML = $(OBJDIR)/simsitl.ml MYGTKINITCMO = myGtkInit.cmo SITLCMA = $(SIMDIR)/sitl.cma diff --git a/conf/Makefile.stm32 b/conf/Makefile.stm32 index c361279f28..00f6b6caf8 100644 --- a/conf/Makefile.stm32 +++ b/conf/Makefile.stm32 @@ -53,6 +53,18 @@ SIZE = $(GCC_BIN_PREFIX)-size RM = rm OOCD = $(TOOLCHAIN_DIR)/bin/openocd +# If we can't find the toolchain then try picking up the compilers from the path +ifeq ($(TOOLCHAIN_DIR),) +CC = $(shell which arm-none-eabi-gcc) +LD = $(shell which arm-none-eabi-gcc) +CP = $(shell which arm-none-eabi-objcopy) +DMP = $(shell which arm-none-eabi-objdump) +NM = $(shell which arm-none-eabi-nm) +SIZE = $(shell which arm-none-eabi-size) +OOCD = $(shell which openocd) +GCC_LIB_DIR=$(shell dirname `which arm-none-eabi-gcc`)/../arm-none-eabi/lib +endif + LOADER=/home/poine/work/stm32/stm32loader-a3c51c26ad6c/stm32loader.py ifndef $(TARGET).OOCD_INTERFACE @@ -87,14 +99,20 @@ LDSCRIPT = $($(TARGET).LDSCRIPT) endif endif -CFLAGS = -I. -I./$(ARCH) $(INCLUDES) -D__thumb2__ -Wall -c -msoft-float -O$(OPT) +UNAME = $(shell uname -s) + +CFLAGS = -I. -I./$(ARCH) $(INCLUDES) -D__thumb2__ -Wall -msoft-float -O$(OPT) CFLAGS += -Wl,gc-sections CFLAGS += -mcpu=$(MCU) -mthumb -ansi +ifeq ("$(UNAME)","Darwin") +CFLAGS += -mfix-cortex-m3-ldrd +endif CFLAGS += -std=gnu99 #CFLAGS += -malignment-traps -CFLAGS += -fno-common -g$(DEBUG) +CFLAGS += -fno-common +CFLAGS += -g$(DEBUG) CFLAGS += -ffunction-sections -fdata-sections -CFLAGS += -Wall -Wimplicit +CFLAGS += -Wimplicit CFLAGS += -Wcast-align CFLAGS += -Wpointer-arith -Wswitch CFLAGS += -Wredundant-decls -Wreturn-type -Wshadow -Wunused @@ -108,9 +126,16 @@ CFLAGS += -Wswitch-default CFLAGS += $($(TARGET).CFLAGS) AFLAGS = -ahls -mapcs-32 +ifeq ("$(UNAME)","Darwin") +AFLAGS += -mcpu=$(MCU) -mthumb +endif AFLAGS += -x assembler-with-cpp -Wa,-adhlns=$(OBJDIR)/$(<:.S=.lst),--g$(DEBUG) +ifeq ("$(UNAME)","Darwin") +LDFLAGS = -T$(LDSCRIPT) -nostartfiles -O$(OPT) --gc-sections -mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float +else LDFLAGS = -D__thumb2__ -T$(LDSCRIPT) -nostartfiles -L$(GCC_LIB_DIR) -O$(OPT) --gc-sections +endif LDFLAGS += -Wl,-Map=$(OBJDIR)/$(TARGET).map,--cref,--gc-sections LDLIBS += -lc -lm -lgcc -lcmsis -lstm32 @@ -123,7 +148,17 @@ ODFLAGS = -S # Default target. -all: sizebefore build sizeafter +all: printcommands sizebefore build sizeafter + +printcommands: + @echo "Using CC = $(CC)" + @echo "Using LD = $(LD)" + @echo "Using CP = $(CP)" + @echo "Using DMP = $(DMP)" + @echo "Using NM = $(NM)" + @echo "Using SIZE = $(SIZE)" + @echo "Using RM = $(RM)" + @echo "Using OOCD = $(OOCD)" build: elf bin hex # lss sym @@ -188,15 +223,17 @@ ifeq ($(FLASH_MODE),SERIAL) upload: $(OBJDIR)/$(TARGET).bin $(LOADER) -p /dev/ttyUSB0 -b 115200 -e -w -v $^ else ifeq ($(FLASH_MODE),JTAG) -upload: $(OBJDIR)/$(TARGET).bin - @echo -e " OOCD\t$<" +upload: $(OBJDIR)/$(TARGET).elf + @echo " OOCD\t$<" $(Q)$(OOCD) -f interface/$(OOCD_INTERFACE).cfg \ - -f board/$(OOCD_BOARD).cfg \ - -c init \ - -c "reset halt" \ - -c "flash write_image erase $(OBJDIR)/$(TARGET).bin 0x08000000" \ - -c reset \ - -c shutdown + -f board/$(OOCD_BOARD).cfg \ + -c init \ + -c "reset halt" \ + -c "reset init" \ + -c "stm32x mass_erase 0" \ + -c "flash write_image $<" \ + -c reset \ + -c shutdown else upload: @echo unknown flash_mode $(FLASH_MODE) diff --git a/conf/airframes/AirborneCodeReorg/LisaFw.xml b/conf/airframes/AirborneCodeReorg/LisaFw.xml index ee5d66b914..15baa30976 100644 --- a/conf/airframes/AirborneCodeReorg/LisaFw.xml +++ b/conf/airframes/AirborneCodeReorg/LisaFw.xml @@ -166,10 +166,10 @@ - - - - + + + + @@ -185,8 +185,8 @@ - - + + @@ -194,14 +194,14 @@ - + diff --git a/conf/airframes/AirborneCodeReorg/TinyFw.xml b/conf/airframes/AirborneCodeReorg/TinyFw.xml index e67e97d6f3..160460fe9a 100644 --- a/conf/airframes/AirborneCodeReorg/TinyFw.xml +++ b/conf/airframes/AirborneCodeReorg/TinyFw.xml @@ -161,10 +161,10 @@ - - - - + + + + @@ -179,7 +179,7 @@ - + diff --git a/conf/airframes/ENAC/fixed-wing/drops.xml b/conf/airframes/ENAC/fixed-wing/drops.xml index cf7359cc92..289865ccae 100644 --- a/conf/airframes/ENAC/fixed-wing/drops.xml +++ b/conf/airframes/ENAC/fixed-wing/drops.xml @@ -221,7 +221,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -233,11 +233,11 @@ ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_AUTO1 ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c @@ -269,7 +269,7 @@ ap.srcs += subsystems/navigation/snav.c # include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile sim.ARCHDIR = $(ARCHI) sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED -DWIND_INFO sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c diff --git a/conf/airframes/ENAC/fixed-wing/firestorm.xml b/conf/airframes/ENAC/fixed-wing/firestorm.xml index fa11fa8574..124a14b520 100644 --- a/conf/airframes/ENAC/fixed-wing/firestorm.xml +++ b/conf/airframes/ENAC/fixed-wing/firestorm.xml @@ -213,7 +213,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -225,7 +225,7 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c @@ -262,7 +262,7 @@ ap.CFLAGS += -DUSE_MODULES # Config for SITL simulation #include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile sim.ARCHDIR = $(ARCHI) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN diff --git a/conf/airframes/ENAC/fixed-wing/funjet1.xml b/conf/airframes/ENAC/fixed-wing/funjet1.xml index 80580c7832..47d29560c7 100644 --- a/conf/airframes/ENAC/fixed-wing/funjet1.xml +++ b/conf/airframes/ENAC/fixed-wing/funjet1.xml @@ -232,7 +232,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -244,11 +244,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU @@ -298,7 +298,7 @@ ap.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=150 -DI2C0_SCLH=150 # Config for SITL simulation #include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile sim.ARCHDIR = $(ARCHI) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN @@ -317,8 +317,8 @@ sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_re # a test program to setup actuators setup_actuators.ARCHDIR = $(ARCHI) -setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART1 -DUART1_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart1 -setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4015_hw.c main.c +setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DUSE_LED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART1 -DUART1_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart1 +setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/mcu_periph/uart_arch.c $(SRC_ARCH)/servos_4015_hw.c main.c diff --git a/conf/airframes/ENAC/fixed-wing/funjet2.xml b/conf/airframes/ENAC/fixed-wing/funjet2.xml index 0d224a5e6c..a10debf64c 100644 --- a/conf/airframes/ENAC/fixed-wing/funjet2.xml +++ b/conf/airframes/ENAC/fixed-wing/funjet2.xml @@ -14,15 +14,15 @@ - - + + @@ -36,7 +36,7 @@ - + @@ -51,11 +51,11 @@ - + - + @@ -106,8 +106,8 @@
- - + + diff --git a/conf/airframes/ENAC/fixed-wing/funjet2_nc.xml b/conf/airframes/ENAC/fixed-wing/funjet2_nc.xml index 354a60858e..b02cd6ec66 100644 --- a/conf/airframes/ENAC/fixed-wing/funjet2_nc.xml +++ b/conf/airframes/ENAC/fixed-wing/funjet2_nc.xml @@ -14,8 +14,8 @@ - - + + @@ -23,20 +23,15 @@ - - - - - - - + + + + + + + - - - - - - + @@ -54,11 +49,11 @@ - + - + diff --git a/conf/airframes/ENAC/fixed-wing/funjet2_new.xml b/conf/airframes/ENAC/fixed-wing/funjet2_new.xml new file mode 100644 index 0000000000..83436e97ef --- /dev/null +++ b/conf/airframes/ENAC/fixed-wing/funjet2_new.xml @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + +
+ + +
+ +
+ + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ +
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +
+ + + + + +
+ +
+ + +
+ +
diff --git a/conf/airframes/ENAC/fixed-wing/merlin.xml b/conf/airframes/ENAC/fixed-wing/merlin.xml index 51ce75f968..2ab3b975ac 100644 --- a/conf/airframes/ENAC/fixed-wing/merlin.xml +++ b/conf/airframes/ENAC/fixed-wing/merlin.xml @@ -10,20 +10,16 @@ - - - - + + - - - - + + - - + + @@ -33,6 +29,10 @@
+ + + + @@ -169,6 +169,7 @@ +
diff --git a/conf/airframes/ENAC/fixed-wing/minimag1.xml b/conf/airframes/ENAC/fixed-wing/minimag1.xml index 959e0eabdc..714f48dc14 100644 --- a/conf/airframes/ENAC/fixed-wing/minimag1.xml +++ b/conf/airframes/ENAC/fixed-wing/minimag1.xml @@ -1,19 +1,54 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + @@ -51,11 +86,9 @@
-
- - - - +
+ +
@@ -98,7 +131,6 @@
- @@ -123,7 +155,6 @@ -
@@ -138,7 +169,6 @@ -
@@ -155,64 +185,14 @@ -
- +
-
- -
- -
- - -include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile - -FLASH_MODE=IAP - -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_0_99.h\" -DLED -DTIME_LED=1 -ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c - -ap.srcs += commands.c - -ap.CFLAGS += -DACTUATORS=\"servos_4015_MAT_hw.h\" -DSERVOS_4015_MAT -ap.srcs += $(SRC_ARCH)/servos_4015_MAT_hw.c actuators.c - -ap.CFLAGS += -DRADIO_CONTROL -ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c - -ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c - -#TRANSPARENT ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -#TRANSPARENT ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c - - -ap.CFLAGS += -DINTER_MCU -ap.srcs += inter_mcu.c - -ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_4 -ap.srcs += $(SRC_ARCH)/adc_hw.c - -ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 - -ap.srcs += gps_ubx.c gps.c latlong.c - -ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -ap.srcs += infrared.c estimator.c - -ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c - -# Config for SITL simulation -include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c - - + + diff --git a/conf/airframes/ENAC/fixed-wing/slayer2.xml b/conf/airframes/ENAC/fixed-wing/slayer2.xml index 4a74c62cd5..5be6b30153 100644 --- a/conf/airframes/ENAC/fixed-wing/slayer2.xml +++ b/conf/airframes/ENAC/fixed-wing/slayer2.xml @@ -201,7 +201,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_0_99.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_0_99.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -213,7 +213,7 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c # AEROCOMM # ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600 @@ -221,7 +221,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # RADIOTRONIX ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU @@ -241,7 +241,7 @@ ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/traffic_info.c subsystems/navigation/nav_line.c # Camera power switch on ADC_7 pin -ap.CFLAGS += -DLED_3_BANK=0 -DLED_3_PIN=10 -DPOWER_SWITCH_LED=3 +ap.CFLAGS += -DUSE_LED_3_BANK=0 -DUSE_LED_3_PIN=10 -DPOWER_SWITCH_LED=3 ap.CFLAGS += -DUSE_GYRO -DADXRS150 @@ -271,7 +271,7 @@ ap.CFLAGS += -D BARO_MS5534A_W1=0xAC20 -D BARO_MS5534A_W2=0x87D9 -D BARO_MS5534A # Config for SITL simulation #include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile sim.ARCHDIR = $(ARCHI) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DUSE_BARO_MS5534A diff --git a/conf/airframes/ENAC/fixed-wing/soarzi.xml b/conf/airframes/ENAC/fixed-wing/soarzi.xml index 03f799119b..e0cf78c35f 100644 --- a/conf/airframes/ENAC/fixed-wing/soarzi.xml +++ b/conf/airframes/ENAC/fixed-wing/soarzi.xml @@ -179,7 +179,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_0_99.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_0_99.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -191,10 +191,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #XBEE ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -#XBEE ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#XBEE ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/ENAC/fixed-wing/solarstorm.xml b/conf/airframes/ENAC/fixed-wing/solarstorm.xml index 7c1cf6a949..ec953714e9 100644 --- a/conf/airframes/ENAC/fixed-wing/solarstorm.xml +++ b/conf/airframes/ENAC/fixed-wing/solarstorm.xml @@ -206,7 +206,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -218,7 +218,7 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c @@ -253,7 +253,7 @@ ap.CFLAGS += -DUSE_MODULES # Config for SITL simulation #include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile sim.ARCHDIR = $(ARCHI) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN diff --git a/conf/airframes/ENAC/fixed-wing/spocII.xml b/conf/airframes/ENAC/fixed-wing/spocII.xml index a0c71c742f..675df4be66 100644 --- a/conf/airframes/ENAC/fixed-wing/spocII.xml +++ b/conf/airframes/ENAC/fixed-wing/spocII.xml @@ -212,7 +212,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -225,7 +225,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #TRANSPARENT ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c @@ -253,7 +253,7 @@ ap.CFLAGS += -DUSE_ADC_3 -DADC_CHANNEL_CURRENT=ADC_3 # Config for SITL simulation #include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile sim.ARCHDIR = $(ARCHI) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN @@ -274,8 +274,8 @@ jsbsim.srcs += $(SIMDIR)/sim_ac_fw.c # a test program to setup actuators setup_actuators.ARCHDIR = $(ARCHI) -setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART1 -DUART1_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart1 -setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4015_hw.c main.c +setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DUSE_LED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART1 -DUART1_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart1 +setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/mcu_periph/uart_arch.c $(SRC_ARCH)/servos_4015_hw.c main.c diff --git a/conf/airframes/ENAC/fixed-wing/twinjet2.xml b/conf/airframes/ENAC/fixed-wing/twinjet2.xml index 4acf157a96..c118819f03 100644 --- a/conf/airframes/ENAC/fixed-wing/twinjet2.xml +++ b/conf/airframes/ENAC/fixed-wing/twinjet2.xml @@ -15,25 +15,20 @@ - - + +
- - - - - + + + - - - - - + + @@ -230,7 +225,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.CFLAGS += -DINTER_MCU @@ -247,11 +242,11 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ########## Modems ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ########## ADC ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 @@ -303,7 +298,7 @@ ap.CFLAGS += -DUSE_MODULES #include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile sim.ARCHDIR = $(ARCHI) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl_n.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DPITCH_TRIM -DALT_KALMAN diff --git a/conf/airframes/ENAC/quadrotor/blender.xml b/conf/airframes/ENAC/quadrotor/blender.xml index a419019daa..72313de308 100644 --- a/conf/airframes/ENAC/quadrotor/blender.xml +++ b/conf/airframes/ENAC/quadrotor/blender.xml @@ -1,20 +1,34 @@ + + + + + + + + + + + + + + @@ -218,7 +232,7 @@ - + @@ -228,22 +242,4 @@ - - -ap.CFLAGS += -DGUIDANCE_H_USE_REF - -ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 -DUSE_PWM1 -ap.CFLAGS += -DBOOZ_ACTUATORS_MAX_THRUST=160 -DBOOZ_THRUST_LOWPASS=17 - -ap.srcs += $(SRC_BOOZ_ARCH)/booz2_pwm_hw.c - -sim.CFLAGS += -DBSM_PARAMS=\"booz_sensors_model_params_booz2_a2.h\" -sim.CFLAGS += -DNPS_NO_SUPERVISION - -sim.CFLAGS += -DGUIDANCE_H_USE_REF -sim.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 -sim.srcs += $(SRC_BOOZ_SIM)/booz2_pwm_hw.c - - - diff --git a/conf/airframes/ENAC/quadrotor/booz2_g1.xml b/conf/airframes/ENAC/quadrotor/booz2_g1.xml index 625bf730dd..b1405b3931 100644 --- a/conf/airframes/ENAC/quadrotor/booz2_g1.xml +++ b/conf/airframes/ENAC/quadrotor/booz2_g1.xml @@ -1,6 +1,7 @@ + @@ -9,17 +10,28 @@ + + + + + - + + + + + - + + + @@ -220,21 +232,4 @@ - - - -ap.CFLAGS += -DGUIDANCE_H_USE_REF -ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 - -ap.srcs += $(SRC_BOOZ_ARCH)/booz2_pwm_hw.c - -sim.CFLAGS += -DBSM_PARAMS=\"booz_sensors_model_params_booz2_a2.h\" -sim.CFLAGS += -DNPS_NO_SUPERVISION -sim.CFLAGS += -DGUIDANCE_H_USE_REF -sim.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 - -sim.srcs += $(SRC_BOOZ_SIM)/booz2_pwm_hw.c - - - diff --git a/conf/airframes/ENAC/quadrotor/g1_vision.xml b/conf/airframes/ENAC/quadrotor/g1_vision.xml new file mode 100644 index 0000000000..0c630fdb66 --- /dev/null +++ b/conf/airframes/ENAC/quadrotor/g1_vision.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ +
+ +
+ + + +
+ +
+ + + +
+ + + +ARCH=lpc21 +ARCHI=arm7 +BOARD_CFG = \"boards/booz2_v1_0.h\" +FLASH_MODE=IAP + +# prevents motors from ever starting +#ap.CFLAGS += -DKILL_MOTORS + +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile +include $(CFG_BOOZ)/booz2_autopilot.makefile +include $(CFG_BOOZ)/booz2_test_progs.makefile +ap.CFLAGS += -DBOOZ_FAILSAFE_GROUND_DETECT + +sim.CFLAGS += -DBSM_PARAMS=\"booz_sensors_model_params_booz2_a2.h\" +sim.CFLAGS += -DNPS_NO_SUPERVISION +include $(CFG_BOOZ)/booz2_simulator_nps.makefile + +ap.CFLAGS += -DMODEM_BAUD=B57600 +include $(CFG_BOOZ)/subsystems/booz2_actuators_asctec.makefile +include $(CFG_BOOZ)/subsystems/booz2_radio_control_ppm.makefile +include $(CFG_BOOZ)/subsystems/booz2_imu_b2v1_1.makefile +#include $(CFG_BOOZ)/subsystems/booz2_gps.makefile +include $(CFG_BOOZ)/subsystems/booz2_analog_bat_baro.makefile +include $(CFG_BOOZ)/subsystems/booz2_fms_datalink.makefile + +include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile + +#include $(CFG_BOOZ)/subsystems/booz2_ins_hff.makefile +#ap.CFLAGS += -DR_POS=0.1 + +ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 +sim.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 + +ap.CFLAGS += -DUSE_MODULES + + + +
diff --git a/conf/airframes/ENAC/quadrotor/mkk1-vision.xml b/conf/airframes/ENAC/quadrotor/mkk1-vision.xml new file mode 100644 index 0000000000..ffd6dd9264 --- /dev/null +++ b/conf/airframes/ENAC/quadrotor/mkk1-vision.xml @@ -0,0 +1,278 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + +
+ +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + + + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ +
+ +
+ +
+ + +
+ + +
+ + + + + +ARCH=lpc21 +ARCHI=arm7 +BOARD_CFG = \"boards/booz2_v1_0.h\" +FLASH_MODE=IAP + +# prevents motors from ever starting +#ap.CFLAGS += -DKILL_MOTORS + +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile +include $(CFG_BOOZ)/booz2_autopilot.makefile +include $(CFG_BOOZ)/booz2_test_progs.makefile +ap.CFLAGS += -DBOOZ_FAILSAFE_GROUND_DETECT + +ap.CFLAGS += -DMODEM_BAUD=B57600 +include $(CFG_BOOZ)/subsystems/booz2_actuators_mkk.makefile +include $(CFG_BOOZ)/subsystems/booz2_radio_control_ppm.makefile +include $(CFG_BOOZ)/subsystems/booz2_imu_b2v1_1.makefile +#include $(CFG_BOOZ)/subsystems/booz2_gps.makefile +include $(CFG_BOOZ)/subsystems/booz2_analog_bat_baro.makefile +#ap.CFLAGS += -DBOOZ2_SONAR -DUSE_SONAR_1 +#include $(CFG_BOOZ)/subsystems/booz2_analog_bat_baro_sonar.makefile +include $(CFG_BOOZ)/subsystems/booz2_fms_datalink.makefile + +include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile + +#include $(CFG_BOOZ)/subsystems/booz2_ins_hff.makefile + +ap.CFLAGS += -DB2_GUIDANCE_H_USE_REF +ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT + +ap.CFLAGS += -DUSE_MODULES + +include $(CFG_BOOZ)/booz2_simulator_nps.makefile +#sim.CFLAGS += -DB2_GUIDANCE_H_USE_REF +sim.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT +sim.CFLAGS += -DUSE_MODULES + + + +
diff --git a/conf/airframes/ENAC/quadrotor/mkk1.xml b/conf/airframes/ENAC/quadrotor/mkk1.xml index 3a1ef13ea5..37229f6b1d 100644 --- a/conf/airframes/ENAC/quadrotor/mkk1.xml +++ b/conf/airframes/ENAC/quadrotor/mkk1.xml @@ -12,6 +12,7 @@
+ diff --git a/conf/airframes/ENAC/quadrotor/nova1.xml b/conf/airframes/ENAC/quadrotor/nova1.xml new file mode 100644 index 0000000000..e894ef65de --- /dev/null +++ b/conf/airframes/ENAC/quadrotor/nova1.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + +
+ +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + + + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ +
+ +
+ +
+ + +
+ + +
+ + + + + +# prevents motors from ever starting +#ap.CFLAGS += -DKILL_MOTORS + +#set GPS lag for horizontal filter +#ap.CFLAGS += -DUSE_GPS_ACC4R + +#ap.CFLAGS += -DGUIDANCE_H_USE_REF +ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT + +#sim.CFLAGS += -DGUIDANCE_H_USE_REF +sim.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT + + + +
diff --git a/conf/airframes/LAAS/mmlaas_N1.xml b/conf/airframes/LAAS/mmlaas_N1.xml index 45a9557b29..8c08511f7b 100644 --- a/conf/airframes/LAAS/mmlaas_N1.xml +++ b/conf/airframes/LAAS/mmlaas_N1.xml @@ -18,15 +18,15 @@ - + - - - + + + diff --git a/conf/airframes/LAAS/mmlaas_N2.xml b/conf/airframes/LAAS/mmlaas_N2.xml index ede0969eaf..018c4551cf 100644 --- a/conf/airframes/LAAS/mmlaas_N2.xml +++ b/conf/airframes/LAAS/mmlaas_N2.xml @@ -18,15 +18,15 @@ - + - - - + + + diff --git a/conf/airframes/LAAS/mmlaas_N3.xml b/conf/airframes/LAAS/mmlaas_N3.xml index 1b9d0c563d..5f75acae18 100644 --- a/conf/airframes/LAAS/mmlaas_N3.xml +++ b/conf/airframes/LAAS/mmlaas_N3.xml @@ -18,15 +18,15 @@ - + - - - + + + diff --git a/conf/airframes/PPZUAV/fixed-wing/kalscott_easystar.xml b/conf/airframes/PPZUAV/fixed-wing/kalscott_easystar.xml index 4cf13bf2b8..2fddd20c7e 100644 --- a/conf/airframes/PPZUAV/fixed-wing/kalscott_easystar.xml +++ b/conf/airframes/PPZUAV/fixed-wing/kalscott_easystar.xml @@ -156,7 +156,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 -DUSE_MODULES +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 -DUSE_MODULES ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -171,7 +171,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # Telemetry configuration ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/Paul/minimag1.xml b/conf/airframes/Paul/minimag1.xml index f16f2aca5f..cfe17c9d28 100644 --- a/conf/airframes/Paul/minimag1.xml +++ b/conf/airframes/Paul/minimag1.xml @@ -176,7 +176,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_2_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_2_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -188,7 +188,7 @@ ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/Poine/antenna.xml b/conf/airframes/Poine/antenna.xml index 19a339e347..98d24b8294 100644 --- a/conf/airframes/Poine/antenna.xml +++ b/conf/airframes/Poine/antenna.xml @@ -23,10 +23,10 @@ ant.LOCK_FUSE = ff ant.CFLAGS += -DBOARD_CONFIG=\"antenna.h\" ant.srcs = main_antenna.c sys_time.c $(SRC_ARCH)/sys_time_hw.c -ant.CFLAGS += -DLED +ant.CFLAGS += -DUSE_LED ant.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 -ant.srcs += $(SRC_ARCH)/uart_hw.c +ant.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c ant.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 ant.srcs += downlink.c pprz_transport.c diff --git a/conf/airframes/Poine/autoplato.xml b/conf/airframes/Poine/autoplato.xml index b509daabbf..48a5844d0e 100644 --- a/conf/airframes/Poine/autoplato.xml +++ b/conf/airframes/Poine/autoplato.xml @@ -16,17 +16,17 @@ test_usb.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) test_usb.srcs += $(SRC_BOOZ_TEST)/atpt_main.c test_usb.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' # -DTIME_LED=1 -test_usb.CFLAGS += -DLED +test_usb.CFLAGS += -DUSE_LED test_usb.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c #test_usb.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -#test_usb.srcs += $(SRC_ARCH)/uart_hw.c +#test_usb.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c #test_usb.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 #test_usb.srcs += downlink.c pprz_transport.c test_usb.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DUSE_USB_SERIAL test_usb.CFLAGS += -DDOWNLINK_DEVICE=UsbS -DPPRZ_UART=UsbS -DDATALINK=PPRZ -test_usb.srcs += downlink.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/usb_ser_hw.c pprz_transport.c +test_usb.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c $(SRC_ARCH)/usb_ser_hw.c pprz_transport.c # datalink.c test_usb.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbcontrol.c test_usb.srcs += $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c diff --git a/conf/airframes/Poine/beth.xml b/conf/airframes/Poine/beth.xml index ed7388ddb1..aaa4ec37d5 100644 --- a/conf/airframes/Poine/beth.xml +++ b/conf/airframes/Poine/beth.xml @@ -114,7 +114,7 @@ main_stm32.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' main_stm32.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c main_stm32.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -main_stm32.srcs += $(SRC_ARCH)/uart_hw.c +main_stm32.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c main_stm32.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 main_stm32.srcs += downlink.c pprz_transport.c @@ -126,12 +126,12 @@ main_stm32.srcs += lisa/lisa_overo_link.c lisa/arch/stm32/lisa_overo_link_arch.c #booz IMU #main_stm32.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" -#main_stm32.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 +#main_stm32.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2100 #main_stm32.srcs += $(SRC_FIRMWARE)/imu.c #main_stm32.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ #main_stm32.srcs += $(SRC_FIRMWARE)/imu/imu_b2.c $(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_b2_arch.c #main_stm32.srcs += peripherals/max1168.c $(SRC_ARCH)/peripherals/max1168_arch.c -#main_stm32.srcs += peripherals/ms2001.c $(SRC_ARCH)/peripherals/ms2001_arch.c +#main_stm32.srcs += peripherals/ms2100.c $(SRC_ARCH)/peripherals/ms2100_arch.c #main_stm32.srcs += math/pprz_trig_int.c #crista IMU @@ -186,7 +186,7 @@ main_coders.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' main_coders.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c main_coders.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -main_coders.srcs += $(SRC_ARCH)/uart_hw.c +main_coders.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c main_coders.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 main_coders.srcs += downlink.c pprz_transport.c diff --git a/conf/airframes/Poine/bl_mc.xml b/conf/airframes/Poine/bl_mc.xml index 51d00613d0..21d5e7adee 100644 --- a/conf/airframes/Poine/bl_mc.xml +++ b/conf/airframes/Poine/bl_mc.xml @@ -26,11 +26,11 @@ main.srcs = main_bl_mc.c main.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1e-2)' main.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -main.CFLAGS += -DLED +main.CFLAGS += -DUSE_LED #-DTIME_LED=1 main.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B38400 -main.srcs += $(SRC_ARCH)/uart_hw.c +main.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c main.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 main.srcs += downlink.c pprz_transport.c diff --git a/conf/airframes/Poine/booz2_a1.xml b/conf/airframes/Poine/booz2_a1.xml index 9b53f79224..395583d8e9 100644 --- a/conf/airframes/Poine/booz2_a1.xml +++ b/conf/airframes/Poine/booz2_a1.xml @@ -202,6 +202,7 @@
+ diff --git a/conf/airframes/Poine/booz2_a6.xml b/conf/airframes/Poine/booz2_a6.xml index aa4ceda472..478600ab30 100644 --- a/conf/airframes/Poine/booz2_a6.xml +++ b/conf/airframes/Poine/booz2_a6.xml @@ -181,7 +181,7 @@ - + diff --git a/conf/airframes/Poine/booz2_a7.xml b/conf/airframes/Poine/booz2_a7.xml index 1ec3206aaf..091401ebed 100644 --- a/conf/airframes/Poine/booz2_a7.xml +++ b/conf/airframes/Poine/booz2_a7.xml @@ -199,7 +199,7 @@ - + diff --git a/conf/airframes/Poine/easy_glider1.xml b/conf/airframes/Poine/easy_glider1.xml index 44394d52a2..ab1f292c39 100644 --- a/conf/airframes/Poine/easy_glider1.xml +++ b/conf/airframes/Poine/easy_glider1.xml @@ -163,7 +163,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -177,7 +177,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # transparent ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/Poine/motor_bench.xml b/conf/airframes/Poine/motor_bench.xml index 2cfb8b27a2..dca7fe4d33 100644 --- a/conf/airframes/Poine/motor_bench.xml +++ b/conf/airframes/Poine/motor_bench.xml @@ -17,12 +17,12 @@ main.CFLAGS += -DPERIODIC_TASK_FREQ='250.' main.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./PERIODIC_TASK_FREQ)' main.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -main.CFLAGS += -DLED +main.CFLAGS += -DUSE_LED main.srcs += $(SRC_ARCH)/armVIC.c main.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B115200 -main.srcs += $(SRC_ARCH)/uart_hw.c +main.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c main.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 main.srcs += downlink.c pprz_transport.c @@ -61,7 +61,7 @@ foo.CFLAGS += -DPERIODIC_TASK_FREQ='250.' foo.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./PERIODIC_TASK_FREQ)' foo.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -foo.CFLAGS += -DLED +foo.CFLAGS += -DUSE_LED foo.srcs += $(SRC_ARCH)/armVIC.c foo.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=150 -DI2C0_SCLH=150 -DI2C0_VIC_SLOT=9 @@ -80,7 +80,7 @@ bar.CFLAGS += -DPERIODIC_TASK_FREQ='250.' bar.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./PERIODIC_TASK_FREQ)' bar.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -bar.CFLAGS += -DLED +bar.CFLAGS += -DUSE_LED bar.srcs += $(SRC_ARCH)/armVIC.c bar.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=150 -DI2C0_SCLH=150 -DI2C0_VIC_SLOT=9 diff --git a/conf/airframes/Poine/pt_ant.xml b/conf/airframes/Poine/pt_ant.xml index 93ade9c70e..765384cf20 100644 --- a/conf/airframes/Poine/pt_ant.xml +++ b/conf/airframes/Poine/pt_ant.xml @@ -10,7 +10,7 @@ tunnel.ARCHDIR = $(ARCH) -tunnel.CFLAGS += -DFBW -DBOARD_CONFIG=\"conf_demo.h\" -DLED -DTIME_LED=1 +tunnel.CFLAGS += -DFBW -DBOARD_CONFIG=\"conf_demo.h\" -DUSE_LED -DTIME_LED=1 tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c ARCH=lpc21 @@ -26,12 +26,12 @@ main.srcs = $(PT_ANT)/pt_ant_main.c main.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1.66666667e-2)' main.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -main.CFLAGS += -DLED +main.CFLAGS += -DUSE_LED main.srcs += $(SRC_ARCH)/armVIC.c main.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 -main.srcs += $(SRC_ARCH)/uart_hw.c +main.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c main.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 main.srcs += downlink.c pprz_transport.c $(PT_ANT)/pt_ant_telemetry.c diff --git a/conf/airframes/Poine/turntable.xml b/conf/airframes/Poine/turntable.xml index 77c99e020c..dc97e08e98 100644 --- a/conf/airframes/Poine/turntable.xml +++ b/conf/airframes/Poine/turntable.xml @@ -25,7 +25,7 @@ main.srcs += sys_time.c $(MB)/turntable_systime.c #main.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=UsbS main.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B115200 -main.srcs += $(SRC_ARCH)/uart_hw.c +main.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c main.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 main.srcs += downlink.c pprz_transport.c diff --git a/conf/airframes/TU_Delft/MicrojetBR.xml b/conf/airframes/TU_Delft/MicrojetBR.xml index 0027581695..ee3384716b 100644 --- a/conf/airframes/TU_Delft/MicrojetBR.xml +++ b/conf/airframes/TU_Delft/MicrojetBR.xml @@ -229,8 +229,8 @@ - - + + @@ -253,12 +253,12 @@ - + diff --git a/conf/airframes/TU_Delft/MicrojetCDW.xml b/conf/airframes/TU_Delft/MicrojetCDW.xml index 32cbb91002..77b6fddac1 100644 --- a/conf/airframes/TU_Delft/MicrojetCDW.xml +++ b/conf/airframes/TU_Delft/MicrojetCDW.xml @@ -4,9 +4,9 @@ - - - + + + @@ -22,8 +22,8 @@
- - + +
@@ -52,37 +52,46 @@ - - - + + + - - - + + + + + + + + + + + - - + + - - - + + + - - - + + + + - + - + - - - + + + - - - + + + @@ -143,18 +152,18 @@ - - + + - - + + - + - - + +
@@ -181,7 +190,13 @@
- + + + + + + + @@ -192,7 +207,7 @@ - + @@ -212,8 +227,8 @@ - - + + diff --git a/conf/airframes/TU_Delft/Trip50A.xml b/conf/airframes/TU_Delft/Trip50A.xml index 0a681fbb23..36081877f7 100644 --- a/conf/airframes/TU_Delft/Trip50A.xml +++ b/conf/airframes/TU_Delft/Trip50A.xml @@ -249,7 +249,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=2 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=2 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -261,15 +261,15 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -#DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c # Maxstream API protocol ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/TU_Delft/Trip50B.xml b/conf/airframes/TU_Delft/Trip50B.xml index af557a6d57..1cbde06526 100644 --- a/conf/airframes/TU_Delft/Trip50B.xml +++ b/conf/airframes/TU_Delft/Trip50B.xml @@ -254,7 +254,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=2 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=2 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -266,15 +266,15 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -#DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c # Maxstream API protocol ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/TU_Delft/holiday50.xml b/conf/airframes/TU_Delft/holiday50.xml index 3a1745e964..d95a52bb30 100644 --- a/conf/airframes/TU_Delft/holiday50.xml +++ b/conf/airframes/TU_Delft/holiday50.xml @@ -248,7 +248,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP # main files (including the 60Hz timing) -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c # Command allocation and Radio Mixers @@ -264,7 +264,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # Paparazzi protocol on UART0 at 57600 ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c # communication from FBW and AP ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/TU_Delft/yapa_xsens.xml b/conf/airframes/TU_Delft/yapa_xsens.xml index 3534d3d41f..ae607c28b4 100644 --- a/conf/airframes/TU_Delft/yapa_xsens.xml +++ b/conf/airframes/TU_Delft/yapa_xsens.xml @@ -171,14 +171,14 @@ @@ -193,7 +193,7 @@ - + diff --git a/conf/airframes/UofAdelaide/A1000_BOOZ.xml b/conf/airframes/UofAdelaide/A1000_BOOZ.xml index 3bd37f4813..66b39fd1ed 100644 --- a/conf/airframes/UofAdelaide/A1000_BOOZ.xml +++ b/conf/airframes/UofAdelaide/A1000_BOOZ.xml @@ -289,6 +289,7 @@ second attempt + diff --git a/conf/airframes/UofAdelaide/A1000_LISA.xml b/conf/airframes/UofAdelaide/A1000_LISA.xml index e6f8ac8831..36dde5dd6d 100644 --- a/conf/airframes/UofAdelaide/A1000_LISA.xml +++ b/conf/airframes/UofAdelaide/A1000_LISA.xml @@ -198,6 +198,7 @@ --> + diff --git a/conf/airframes/UofAdelaide/A1000_NOVA.xml b/conf/airframes/UofAdelaide/A1000_NOVA.xml index fe7204faf8..9847fa9a0e 100644 --- a/conf/airframes/UofAdelaide/A1000_NOVA.xml +++ b/conf/airframes/UofAdelaide/A1000_NOVA.xml @@ -248,6 +248,7 @@ + diff --git a/conf/airframes/airframe.dtd b/conf/airframes/airframe.dtd index 9a741787b0..22808bfe3e 100644 --- a/conf/airframes/airframe.dtd +++ b/conf/airframes/airframe.dtd @@ -22,12 +22,11 @@ - - - - - - + + + + + @@ -100,11 +99,7 @@ value CDATA #IMPLIED unit CDATA #IMPLIED integer CDATA #IMPLIED> - - - @@ -120,7 +115,9 @@ target CDATA #IMPLIED location CDATA #IMPLIED> +main_freq CDATA #IMPLIED +target CDATA #IMPLIED> +name CDATA #REQUIRED +target CDATA #IMPLIED> diff --git a/conf/airframes/booz2_flixr.xml b/conf/airframes/booz2_flixr.xml index a5201efd9e..38255e1429 100644 --- a/conf/airframes/booz2_flixr.xml +++ b/conf/airframes/booz2_flixr.xml @@ -16,7 +16,10 @@ - + + + + @@ -25,26 +28,23 @@ - + + + + + - - - - - - - @@ -72,10 +72,6 @@
- - - - @@ -84,10 +80,6 @@ - - - - @@ -245,9 +237,4 @@
- - ap.srcs += $(SRC_BOOZ_ARCH)/booz2_pwm_hw.c - sim.srcs += $(SRC_BOOZ_SIM)/booz2_pwm_hw.c - - diff --git a/conf/airframes/booz2_ppzuav.xml b/conf/airframes/booz2_ppzuav.xml index 74e44ece8e..b0ec00deec 100644 --- a/conf/airframes/booz2_ppzuav.xml +++ b/conf/airframes/booz2_ppzuav.xml @@ -201,9 +201,10 @@ - + + diff --git a/conf/airframes/demo.xml b/conf/airframes/demo.xml index e70c819f25..8fd502eaca 100644 --- a/conf/airframes/demo.xml +++ b/conf/airframes/demo.xml @@ -26,7 +26,7 @@ demo2.srcs = main_demo2.c demo2.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-2)' demo2.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -demo2.CFLAGS += -DLED +demo2.CFLAGS += -DUSE_LED # # UART (interrupts) and formated ascii printing @@ -39,12 +39,12 @@ demo3.srcs = main_demo3.c demo3.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1e-1)' demo3.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -demo3.CFLAGS += -DLED +demo3.CFLAGS += -DUSE_LED demo3.srcs += $(SRC_ARCH)/armVIC.c demo3.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 -demo3.srcs += $(SRC_ARCH)/uart_hw.c +demo3.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c # # DOWNLINK : send formated messages according to messages.xml description @@ -58,12 +58,12 @@ demo4.srcs = main_demo4.c demo4.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-2)' demo4.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -demo4.CFLAGS += -DLED +demo4.CFLAGS += -DUSE_LED demo4.srcs += $(SRC_ARCH)/armVIC.c demo4.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 -demo4.srcs += $(SRC_ARCH)/uart_hw.c +demo4.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c demo4.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 demo4.srcs += downlink.c pprz_transport.c @@ -81,12 +81,12 @@ demo5.srcs = main_demo5.c demo5.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-2)' demo5.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -demo5.CFLAGS += -DLED +demo5.CFLAGS += -DUSE_LED demo5.srcs += $(SRC_ARCH)/armVIC.c demo5.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 -demo5.srcs += $(SRC_ARCH)/uart_hw.c +demo5.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c demo5.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 demo5.srcs += downlink.c pprz_transport.c @@ -105,7 +105,7 @@ demo6.srcs = main_demo6.c demo6.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-2)' demo6.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -demo6.CFLAGS += -DLED +demo6.CFLAGS += -DUSE_LED demo6.srcs += $(SRC_ARCH)/armVIC.c @@ -132,7 +132,7 @@ test_spk.srcs = main_test_spk.c test_spk.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_spk.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -test_spk.CFLAGS += -DLED +test_spk.CFLAGS += -DUSE_LED test_spk.srcs += $(SRC_ARCH)/armVIC.c @@ -143,7 +143,7 @@ test_spk.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbcontrol.c test_spk.srcs += $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c test_spk.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B115200 -test_spk.srcs += $(SRC_ARCH)/uart_hw.c +test_spk.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c diff --git a/conf/airframes/demo_module.xml b/conf/airframes/demo_module.xml index f8e4223226..fc3166cfd7 100644 --- a/conf/airframes/demo_module.xml +++ b/conf/airframes/demo_module.xml @@ -164,7 +164,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c $(SRC_FIRMWARE)/main.c ap.CFLAGS += -DINTER_MCU @@ -181,7 +181,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ########## Modem ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ########## ADC ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 diff --git a/conf/airframes/easy_glider_example.xml b/conf/airframes/easy_glider_example.xml index dd3f84f026..313e793a84 100644 --- a/conf/airframes/easy_glider_example.xml +++ b/conf/airframes/easy_glider_example.xml @@ -162,15 +162,12 @@ - + - - - @@ -181,4 +178,10 @@ + + + + + + diff --git a/conf/airframes/easystar_ets_example.xml b/conf/airframes/easystar_ets_example.xml index 3e6f1e5548..763be2683d 100644 --- a/conf/airframes/easystar_ets_example.xml +++ b/conf/airframes/easystar_ets_example.xml @@ -19,6 +19,7 @@ + diff --git a/conf/airframes/esden/lisa_asctec.xml b/conf/airframes/esden/lisa_asctec.xml index 09561d3c9a..a011e5177f 100644 --- a/conf/airframes/esden/lisa_asctec.xml +++ b/conf/airframes/esden/lisa_asctec.xml @@ -16,6 +16,12 @@
+ +
+ + +
+
@@ -32,42 +38,46 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - + +
@@ -114,27 +124,27 @@ - - + + - - - + + + - - + + - - - + + +
- +
@@ -164,49 +174,72 @@
+
+ + + +
- + + + + + + + + + + + + + + + + + + + + + + + + -USER = root -HOST = 192.168.1.3 -#HOST = overo -#HOST = beth -#HOST = asctec_lisa -TARGET_DIR = ~ + + + + + + + + + + + + + + + + + + + + -SRC_FMS=fms + + + + + + + + + + + + -ARCH=stm32 -BOARD_CFG=\"boards/lisa_0.99.h\" -FLASH_MODE = JTAG - -ap.CFLAGS += -DMODEM_BAUD=B57600 - -ap.CFLAGS += -DRADIO_CONTROL_SPEKTRUM_MODEL_H=\"subsystems/radio_control/spektrum_dx7se_joby.h\" - -include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile -include $(CFG_BOOZ)/booz2_autopilot.makefile - -include $(CFG_BOOZ)/subsystems/booz2_radio_control_spektrum.makefile -include $(CFG_BOOZ)/subsystems/booz2_actuators_asctec_v2.makefile -include $(CFG_BOOZ)/subsystems/booz2_imu_b2v1_1.makefile -#include $(CFG_BOOZ)/subsystems/booz2_gps.makefile -include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile - - -include $(PAPARAZZI_SRC)/conf/autopilot/lisa_test_progs.makefile - -CONFIG_PASSTHROUGH = $(PAPARAZZI_SRC)/conf/autopilot/subsystems/lisa_passthrough -SERVOS_REFRESH_FREQ=200 - -include $(PAPARAZZI_SRC)/conf/autopilot/lisa_passthrough.makefile - -RADIO_CONTROL_SPEKTRUM_MODEL=\"booz/radio_control/booz_radio_control_joby.h\" -include $(CONFIG_PASSTHROUGH)/radio_control_joby.makefile - - - diff --git a/conf/airframes/esden/lisa_asctec_aspirin.xml b/conf/airframes/esden/lisa_asctec_aspirin.xml new file mode 100644 index 0000000000..6aa143ec58 --- /dev/null +++ b/conf/airframes/esden/lisa_asctec_aspirin.xml @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + + +
+ + +
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + + + + + + + +
+ + +
+ + + +
+ +
+ +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/conf/airframes/esden/lisa_pwm_aspirin.xml b/conf/airframes/esden/lisa_pwm_aspirin.xml new file mode 100644 index 0000000000..a4641f0209 --- /dev/null +++ b/conf/airframes/esden/lisa_pwm_aspirin.xml @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + + +
+ + +
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + + + + + + + +
+ + +
+ + + +
+ +
+ +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/conf/airframes/example_twog_analogimu.xml b/conf/airframes/example_twog_analogimu.xml index a4cf652c0e..479feb9c1b 100644 --- a/conf/airframes/example_twog_analogimu.xml +++ b/conf/airframes/example_twog_analogimu.xml @@ -1,6 +1,6 @@ - @@ -57,11 +52,6 @@ - @@ -94,7 +84,6 @@
-
@@ -209,28 +198,23 @@ - + - - - - - - - + + + + + + + - +
- - - ap.CFLAGS += -DANALOGIMU_ROTATED - ap.CFLAGS += -DANALOGIMU_ZERO_AVERAGE - diff --git a/conf/airframes/funjet_cam_example.xml b/conf/airframes/funjet_cam_example.xml index 76de339590..839a8f761d 100644 --- a/conf/airframes/funjet_cam_example.xml +++ b/conf/airframes/funjet_cam_example.xml @@ -41,8 +41,8 @@ - - + + diff --git a/conf/airframes/jsbsim.xml b/conf/airframes/jsbsim.xml index 7b2f1d6d0b..67fe2f0a1a 100644 --- a/conf/airframes/jsbsim.xml +++ b/conf/airframes/jsbsim.xml @@ -34,7 +34,7 @@ - + @@ -52,7 +52,7 @@ - + @@ -80,13 +80,13 @@
- - + + - +
@@ -94,7 +94,7 @@
- +
@@ -107,7 +107,7 @@
- +
@@ -188,7 +188,7 @@
- +
@@ -199,7 +199,7 @@ #### Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DBOARD_CONFIG=\"tiny_sim.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +sim.CFLAGS += -DBOARD_CONFIG=\"boards/tiny_sim.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c @@ -207,7 +207,7 @@ sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_re SRC_FIRMWARE = firmwares/fixedwing include $(PAPARAZZI_SRC)/conf/autopilot/sitl_jsbsim.makefile -jsbsim.CFLAGS += -DBOARD_CONFIG=\"tiny_sim.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN +jsbsim.CFLAGS += -DBOARD_CONFIG=\"boards/tiny_sim.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN jsbsim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c jsbsim.srcs += $(SIMDIR)/sim_ac_fw.c diff --git a/conf/airframes/mentor_tum.xml b/conf/airframes/mentor_tum.xml index 361e2fa209..4d00f9c4fa 100644 --- a/conf/airframes/mentor_tum.xml +++ b/conf/airframes/mentor_tum.xml @@ -29,15 +29,16 @@ - - + + + - - - + + + diff --git a/conf/airframes/microjet_example.xml b/conf/airframes/microjet_example.xml index c757c95670..405a1356c0 100644 --- a/conf/airframes/microjet_example.xml +++ b/conf/airframes/microjet_example.xml @@ -158,9 +158,18 @@
+ + +
+ + + +
+ + @@ -171,7 +180,7 @@ - + diff --git a/conf/airframes/microjet_raw_makefile.xml b/conf/airframes/microjet_raw_makefile.xml index 050277440c..28b71fef98 100644 --- a/conf/airframes/microjet_raw_makefile.xml +++ b/conf/airframes/microjet_raw_makefile.xml @@ -181,7 +181,7 @@ CONFIG=\"tiny_2_11.h\" include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP - ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 + ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c ap.CFLAGS += -DACTUATORS=\"servos_4015_MAT_hw.h\" -DSERVOS_4015_MAT @@ -189,7 +189,7 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 - ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c + ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 diff --git a/conf/airframes/mm/extra/logger_sd_adc.xml b/conf/airframes/mm/extra/logger_sd_adc.xml index 390fac3e6e..e7d5417246 100644 --- a/conf/airframes/mm/extra/logger_sd_adc.xml +++ b/conf/airframes/mm/extra/logger_sd_adc.xml @@ -60,7 +60,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DLED -DLOGGER +ap.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DLOGGER ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_logger.c #choose one @@ -70,7 +70,7 @@ ap.CFLAGS += -DLOG_XBEE #set the speed ap.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B57600 -DUSE_UART0_RX_ONLY ap.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -DUSE_UART1_RX_ONLY -ap.srcs += $(SRC_ARCH)/uart_hw.c +ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c #set SPI interface for SD card (0 or 1) ap.CFLAGS += -DHW_ENDPOINT_LPC2000_SPINUM=0 diff --git a/conf/airframes/mm/extra/press_t.xml b/conf/airframes/mm/extra/press_t.xml index 38dfec588a..8263abb2a4 100644 --- a/conf/airframes/mm/extra/press_t.xml +++ b/conf/airframes/mm/extra/press_t.xml @@ -227,7 +227,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -239,11 +239,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/extra/quiet.xml b/conf/airframes/mm/extra/quiet.xml index 0fac57e481..0d3754173d 100644 --- a/conf/airframes/mm/extra/quiet.xml +++ b/conf/airframes/mm/extra/quiet.xml @@ -23,7 +23,7 @@ ap.CFLAGS += -DLOG_XBEE #set the speed ap.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B57600 -DUSE_UART0_RX_ONLY ap.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -DUSE_UART1_RX_ONLY -ap.srcs += $(SRC_ARCH)/uart_hw.c +ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c diff --git a/conf/airframes/mm/extra/rctx.xml b/conf/airframes/mm/extra/rctx.xml index 45f385c3c0..ec0c2d90d2 100644 --- a/conf/airframes/mm/extra/rctx.xml +++ b/conf/airframes/mm/extra/rctx.xml @@ -32,14 +32,14 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DLED +ap.CFLAGS += -DFBW -DAP -DCONFIG=$(CONFIG) -DUSE_LED ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_rctx.c ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c xbee.c ap.CFLAGS += -DUSE_DOWNLINK_BROADCAST diff --git a/conf/airframes/mm/fixed-wing/drops.xml b/conf/airframes/mm/fixed-wing/drops.xml index 69dc6e5362..d725fffcde 100644 --- a/conf/airframes/mm/fixed-wing/drops.xml +++ b/conf/airframes/mm/fixed-wing/drops.xml @@ -243,7 +243,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -255,11 +255,11 @@ ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_AUTO1 ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c @@ -293,7 +293,7 @@ sim.ARCHDIR = $(ARCHI) sim.ARCH = sitl sim.TARGET = autopilot sim.TARGETDIR = autopilot -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN diff --git a/conf/airframes/mm/fixed-wing/funjeteth1.xml b/conf/airframes/mm/fixed-wing/funjeteth1.xml index a0130847fa..b0e551ada1 100644 --- a/conf/airframes/mm/fixed-wing/funjeteth1.xml +++ b/conf/airframes/mm/fixed-wing/funjeteth1.xml @@ -204,7 +204,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -216,11 +216,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/mm/fixed-wing/funjeteth2.xml b/conf/airframes/mm/fixed-wing/funjeteth2.xml index 6c092bac67..1aee3db2a0 100644 --- a/conf/airframes/mm/fixed-wing/funjeteth2.xml +++ b/conf/airframes/mm/fixed-wing/funjeteth2.xml @@ -205,7 +205,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -217,11 +217,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/mm/fixed-wing/funjetfmi1.xml b/conf/airframes/mm/fixed-wing/funjetfmi1.xml index 190f934f62..183fe6112c 100644 --- a/conf/airframes/mm/fixed-wing/funjetfmi1.xml +++ b/conf/airframes/mm/fixed-wing/funjetfmi1.xml @@ -207,7 +207,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -219,11 +219,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/funjetfmi2.xml b/conf/airframes/mm/fixed-wing/funjetfmi2.xml index 4147a894e9..0e006dc4e1 100644 --- a/conf/airframes/mm/fixed-wing/funjetfmi2.xml +++ b/conf/airframes/mm/fixed-wing/funjetfmi2.xml @@ -206,7 +206,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -218,11 +218,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/funjetfmi3.xml b/conf/airframes/mm/fixed-wing/funjetfmi3.xml index 2f89ac7e7d..467eb62730 100644 --- a/conf/airframes/mm/fixed-wing/funjetfmi3.xml +++ b/conf/airframes/mm/fixed-wing/funjetfmi3.xml @@ -206,7 +206,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -218,11 +218,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/funjetgfi1.xml b/conf/airframes/mm/fixed-wing/funjetgfi1.xml index 8f0fdbb206..402d3614d4 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi1.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi1.xml @@ -184,7 +184,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -196,11 +196,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/funjetgfi3.xml b/conf/airframes/mm/fixed-wing/funjetgfi3.xml index f5d33639e7..3647cddfc0 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi3.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi3.xml @@ -196,7 +196,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -208,10 +208,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -#TRANSPARENT ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#TRANSPARENT ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/funjetgfi4.xml b/conf/airframes/mm/fixed-wing/funjetgfi4.xml index a4bbe25fa9..dd100932fc 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi4.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi4.xml @@ -185,7 +185,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -197,11 +197,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/funjetgfi5.xml b/conf/airframes/mm/fixed-wing/funjetgfi5.xml index a849c6653a..0731f33820 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi5.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi5.xml @@ -186,7 +186,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -198,11 +198,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/funjetgfi6.xml b/conf/airframes/mm/fixed-wing/funjetgfi6.xml index 233c49573c..e4f607d80b 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi6.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi6.xml @@ -186,7 +186,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -198,11 +198,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/funjetgfi7.xml b/conf/airframes/mm/fixed-wing/funjetgfi7.xml index 3e7abb3574..be48d15148 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi7.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi7.xml @@ -186,7 +186,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -198,11 +198,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/funjetgfi9.xml b/conf/airframes/mm/fixed-wing/funjetgfi9.xml index 2a4de16260..aaacc21284 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi9.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi9.xml @@ -186,7 +186,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -198,11 +198,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/funjetlisa.xml b/conf/airframes/mm/fixed-wing/funjetlisa.xml index d6e6556d1c..a92f5d8271 100644 --- a/conf/airframes/mm/fixed-wing/funjetlisa.xml +++ b/conf/airframes/mm/fixed-wing/funjetlisa.xml @@ -18,7 +18,7 @@ - + diff --git a/conf/airframes/mm/fixed-wing/funjetlisam.xml b/conf/airframes/mm/fixed-wing/funjetlisam.xml index 8173da67b3..33e68d8522 100644 --- a/conf/airframes/mm/fixed-wing/funjetlisam.xml +++ b/conf/airframes/mm/fixed-wing/funjetlisam.xml @@ -18,7 +18,7 @@ - +
diff --git a/conf/airframes/mm/fixed-wing/funjetmm2.xml b/conf/airframes/mm/fixed-wing/funjetmm2.xml index 4485d2195a..b9dd882225 100644 --- a/conf/airframes/mm/fixed-wing/funjetmm2.xml +++ b/conf/airframes/mm/fixed-wing/funjetmm2.xml @@ -212,7 +212,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -224,11 +224,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/miniwing.xml b/conf/airframes/mm/fixed-wing/miniwing.xml index 3e9f7d9597..68bee9865c 100644 --- a/conf/airframes/mm/fixed-wing/miniwing.xml +++ b/conf/airframes/mm/fixed-wing/miniwing.xml @@ -180,7 +180,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -192,7 +192,7 @@ ap.CFLAGS += -DRADIO_CONTROL -DUSE_RC_TELEMETRY ap.srcs += radio_control.c ppm_telemetry.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/mm/fixed-wing/slowfast.xml b/conf/airframes/mm/fixed-wing/slowfast.xml index ddf00fbd9a..13fca656e9 100644 --- a/conf/airframes/mm/fixed-wing/slowfast.xml +++ b/conf/airframes/mm/fixed-wing/slowfast.xml @@ -227,7 +227,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -239,11 +239,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/slowfast2.xml b/conf/airframes/mm/fixed-wing/slowfast2.xml index 708cf98ac2..13db40d0c9 100644 --- a/conf/airframes/mm/fixed-wing/slowfast2.xml +++ b/conf/airframes/mm/fixed-wing/slowfast2.xml @@ -241,7 +241,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -253,11 +253,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/fixed-wing/twinstarmm.xml b/conf/airframes/mm/fixed-wing/twinstarmm.xml index 92db7ebddb..870947b36c 100644 --- a/conf/airframes/mm/fixed-wing/twinstarmm.xml +++ b/conf/airframes/mm/fixed-wing/twinstarmm.xml @@ -203,7 +203,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -216,11 +216,11 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #XBEE #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c @@ -247,7 +247,7 @@ ap.srcs += subsystems/navigation/snav.c # Config for SITL simulation # include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile sim.ARCHDIR = $(ARCHI) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN diff --git a/conf/airframes/mm/hangar/black_one.xml b/conf/airframes/mm/hangar/black_one.xml index fcb1f0398f..be9796bf51 100644 --- a/conf/airframes/mm/hangar/black_one.xml +++ b/conf/airframes/mm/hangar/black_one.xml @@ -216,7 +216,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -228,10 +228,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/mm/hangar/glass_one1.xml b/conf/airframes/mm/hangar/glass_one1.xml index c87a0f442c..e8bf7ff754 100644 --- a/conf/airframes/mm/hangar/glass_one1.xml +++ b/conf/airframes/mm/hangar/glass_one1.xml @@ -206,7 +206,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -218,10 +218,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/mm/hangar/glass_one2.xml b/conf/airframes/mm/hangar/glass_one2.xml index d1b53ac34e..2aa4cd4511 100644 --- a/conf/airframes/mm/hangar/glass_one2.xml +++ b/conf/airframes/mm/hangar/glass_one2.xml @@ -180,7 +180,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -192,10 +192,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/mm/hangar/glass_one3.xml b/conf/airframes/mm/hangar/glass_one3.xml index 8eb4e8755e..64c7c610fb 100644 --- a/conf/airframes/mm/hangar/glass_one3.xml +++ b/conf/airframes/mm/hangar/glass_one3.xml @@ -207,7 +207,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -219,10 +219,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/mm/hangar/lila.xml b/conf/airframes/mm/hangar/lila.xml index c93cca0366..1dd11c946a 100644 --- a/conf/airframes/mm/hangar/lila.xml +++ b/conf/airframes/mm/hangar/lila.xml @@ -203,7 +203,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -215,11 +215,11 @@ ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT #ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c @@ -247,7 +247,7 @@ ap.srcs += subsystems/navigation/snav.c # Config for SITL simulation sim.ARCHDIR = $(ARCHI) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN diff --git a/conf/airframes/mm/hangar/mac06a.xml b/conf/airframes/mm/hangar/mac06a.xml index e7e2240692..932014cd75 100644 --- a/conf/airframes/mm/hangar/mac06a.xml +++ b/conf/airframes/mm/hangar/mac06a.xml @@ -200,7 +200,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -212,10 +212,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #XBEE ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -#XBEE ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#XBEE ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/mm/hangar/red_one.xml b/conf/airframes/mm/hangar/red_one.xml index e2aca5ec54..887601c421 100644 --- a/conf/airframes/mm/hangar/red_one.xml +++ b/conf/airframes/mm/hangar/red_one.xml @@ -227,7 +227,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -239,10 +239,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/mm/rotor/qmk1.xml b/conf/airframes/mm/rotor/qmk1.xml index 8935328ed0..409ec50983 100644 --- a/conf/airframes/mm/rotor/qmk1.xml +++ b/conf/airframes/mm/rotor/qmk1.xml @@ -189,7 +189,6 @@ - @@ -199,9 +198,11 @@ - + - + + + diff --git a/conf/airframes/booz2_Aron.xml b/conf/airframes/obsolete/booz2_Aron.xml similarity index 79% rename from conf/airframes/booz2_Aron.xml rename to conf/airframes/obsolete/booz2_Aron.xml index 3314d84eb2..ebd46bf904 100644 --- a/conf/airframes/booz2_Aron.xml +++ b/conf/airframes/obsolete/booz2_Aron.xml @@ -1,37 +1,37 @@ - - - - - - - - - - - - - - -
- - -
- -
- - - - - - - - - - - -
+ + + + + + + + + + + + + + +
+ + +
+ +
+ + + + + + + + + + + +
@@ -46,10 +46,10 @@ - + - + @@ -62,9 +62,9 @@ - + - + diff --git a/conf/airframes/booz2_NoVa.xml b/conf/airframes/obsolete/booz2_NoVa.xml similarity index 88% rename from conf/airframes/booz2_NoVa.xml rename to conf/airframes/obsolete/booz2_NoVa.xml index 5a050ecd98..86d5481083 100644 --- a/conf/airframes/booz2_NoVa.xml +++ b/conf/airframes/obsolete/booz2_NoVa.xml @@ -70,18 +70,18 @@
- - - + + + - - - + + + @@ -91,7 +91,7 @@ -
+
@@ -152,23 +152,23 @@
- - - - - - - - - - - -
+ + + + + + + + + + + +
- - -
+ + +
diff --git a/conf/airframes/booz2_NoVa_001.xml b/conf/airframes/obsolete/booz2_NoVa_001.xml similarity index 88% rename from conf/airframes/booz2_NoVa_001.xml rename to conf/airframes/obsolete/booz2_NoVa_001.xml index 3962ee5378..99f676ffc5 100644 --- a/conf/airframes/booz2_NoVa_001.xml +++ b/conf/airframes/obsolete/booz2_NoVa_001.xml @@ -70,18 +70,18 @@
- - - + + + - - - + + + @@ -91,7 +91,7 @@ -
+
@@ -152,23 +152,23 @@
- - - - - - - - - - - -
+ + + + + + + + + + + +
- - -
+ + +
diff --git a/conf/airframes/booz2_NoVa_002.xml b/conf/airframes/obsolete/booz2_NoVa_002.xml similarity index 88% rename from conf/airframes/booz2_NoVa_002.xml rename to conf/airframes/obsolete/booz2_NoVa_002.xml index 198745a46e..2b74d58c71 100644 --- a/conf/airframes/booz2_NoVa_002.xml +++ b/conf/airframes/obsolete/booz2_NoVa_002.xml @@ -70,18 +70,18 @@
- - - + + + - - - + + + @@ -91,7 +91,7 @@ -
+
@@ -152,23 +152,23 @@
- - - - - - - - - - - -
+ + + + + + + + + + + +
- - -
+ + +
diff --git a/conf/airframes/booz2_s1.xml b/conf/airframes/obsolete/booz2_s1.xml similarity index 98% rename from conf/airframes/booz2_s1.xml rename to conf/airframes/obsolete/booz2_s1.xml index bc0035c8cb..31084571f3 100644 --- a/conf/airframes/booz2_s1.xml +++ b/conf/airframes/obsolete/booz2_s1.xml @@ -39,10 +39,10 @@ - + - + @@ -55,7 +55,7 @@ - + @@ -160,7 +160,7 @@ - +
@@ -196,7 +196,7 @@ BOARD_CFG = \"boards/booz2_v1_0.h\" # Enables Canon Hack Development Kit features. -ap.CFLAGS += -DLED -DCANON_CHDK +ap.CFLAGS += -DUSE_LED -DCANON_CHDK ap.srcs += $(PAPARAZZI_SRC)/sw/airborne/chdk.c include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile diff --git a/conf/airframes/booz2_x1.xml b/conf/airframes/obsolete/booz2_x1.xml similarity index 100% rename from conf/airframes/booz2_x1.xml rename to conf/airframes/obsolete/booz2_x1.xml diff --git a/conf/airframes/csc.xml b/conf/airframes/obsolete/csc.xml similarity index 100% rename from conf/airframes/csc.xml rename to conf/airframes/obsolete/csc.xml diff --git a/conf/airframes/csc_ap.xml b/conf/airframes/obsolete/csc_ap.xml similarity index 100% rename from conf/airframes/csc_ap.xml rename to conf/airframes/obsolete/csc_ap.xml diff --git a/conf/airframes/obsolete/dc_mc.xml b/conf/airframes/obsolete/dc_mc.xml index fa94047805..76e6aff207 100644 --- a/conf/airframes/obsolete/dc_mc.xml +++ b/conf/airframes/obsolete/dc_mc.xml @@ -20,11 +20,11 @@ main.srcs = main_dc_mc.c main.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-2)' main.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -main.CFLAGS += -DLED +main.CFLAGS += -DUSE_LED #-DTIME_LED=1 main.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 -main.srcs += $(SRC_ARCH)/uart_hw.c +main.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c main.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 main.srcs += downlink.c pprz_transport.c diff --git a/conf/airframes/obsolete/easystar2.xml b/conf/airframes/obsolete/easystar2.xml index 2ebf40831f..bc44601368 100644 --- a/conf/airframes/obsolete/easystar2.xml +++ b/conf/airframes/obsolete/easystar2.xml @@ -178,7 +178,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 -DUSE_MODULES +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 -DUSE_MODULES ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -193,7 +193,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # Telemetry configuration ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/obsolete/example.xml b/conf/airframes/obsolete/example.xml index 81bd9b7c2b..e225a43a4d 100644 --- a/conf/airframes/obsolete/example.xml +++ b/conf/airframes/obsolete/example.xml @@ -20,12 +20,12 @@ example_gps.srcs = example/example_gps.c example_gps.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-2)' example_gps.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -example_gps.CFLAGS += -DLED +example_gps.CFLAGS += -DUSE_LED example_gps.srcs += $(SRC_ARCH)/armVIC.c example_gps.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 -example_gps.srcs += $(SRC_ARCH)/uart_hw.c +example_gps.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c example_gps.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 example_gps.srcs += downlink.c pprz_transport.c diff --git a/conf/airframes/hitl_usb.xml b/conf/airframes/obsolete/hitl_usb.xml similarity index 96% rename from conf/airframes/hitl_usb.xml rename to conf/airframes/obsolete/hitl_usb.xml index 7108d6acf2..653b66330c 100644 --- a/conf/airframes/hitl_usb.xml +++ b/conf/airframes/obsolete/hitl_usb.xml @@ -114,7 +114,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -129,7 +129,7 @@ ap.srcs += pprz_transport.c #XBEE ap.srcs += xbee.c -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/usb_ser_hw.c datalink.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c $(SRC_ARCH)/usb_ser_hw.c datalink.c ap.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbcontrol.c ap.srcs += $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c @@ -154,7 +154,7 @@ ap.CFLAGS += -DGPS_USE_LATLONG # simulating LEA 5H # Config for SITL simulation sim.ARCHDIR = $(ARCH) -sim.CFLAGS += -DSITL -DAP -DFBW -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED +sim.CFLAGS += -DSITL -DAP -DFBW -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED sim.srcs = latlong.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c subsystems/navigation/traffic_info.c diff --git a/conf/airframes/obsolete/kalscott_easystar.xml b/conf/airframes/obsolete/kalscott_easystar.xml index 6f5519ba87..b56de424ca 100644 --- a/conf/airframes/obsolete/kalscott_easystar.xml +++ b/conf/airframes/obsolete/kalscott_easystar.xml @@ -158,7 +158,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 -DUSE_MODULES +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 -DUSE_MODULES ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -173,7 +173,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # Telemetry configuration ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/logger_sd.xml b/conf/airframes/obsolete/logger_sd.xml similarity index 96% rename from conf/airframes/logger_sd.xml rename to conf/airframes/obsolete/logger_sd.xml index c310466dc7..0d6a3714b3 100644 --- a/conf/airframes/logger_sd.xml +++ b/conf/airframes/obsolete/logger_sd.xml @@ -43,7 +43,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DLED +ap.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DUSE_LED ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_logger.c #choose one @@ -53,7 +53,7 @@ ap.CFLAGS += -DLOG_XBEE #set the speed ap.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B9600 -DUSE_UART0_RX_ONLY ap.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B9600 -DUSE_UART1_RX_ONLY -ap.srcs += $(SRC_ARCH)/uart_hw.c +ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c #set SPI interface for SD card (0 or 1) ap.CFLAGS += -DHW_ENDPOINT_LPC2000_SPINUM=1 diff --git a/conf/airframes/obsolete/microjet5.xml b/conf/airframes/obsolete/microjet5.xml index 418d2ba25f..5a7971bc76 100644 --- a/conf/airframes/obsolete/microjet5.xml +++ b/conf/airframes/obsolete/microjet5.xml @@ -175,7 +175,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -187,7 +187,7 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/obsolete/microjet5_tp_auto.xml b/conf/airframes/obsolete/microjet5_tp_auto.xml index 2202e38386..5e2287cacd 100644 --- a/conf/airframes/obsolete/microjet5_tp_auto.xml +++ b/conf/airframes/obsolete/microjet5_tp_auto.xml @@ -177,10 +177,10 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c -ap.CFLAGS += -DLED_3_BANK=0 -DLED_3_PIN=17 -DLED_4_BANK=0 -DLED_4_PIN=18 -DLED_5_BANK=0 -DLED_5_PIN=19 -DLED_6_BANK=0 -DLED_6_PIN=20 +ap.CFLAGS += -DUSE_LED_3_BANK=0 -DUSE_LED_3_PIN=17 -DUSE_LED_4_BANK=0 -DUSE_LED_4_PIN=18 -DUSE_LED_5_BANK=0 -DUSE_LED_5_PIN=19 -DUSE_LED_6_BANK=0 -DUSE_LED_6_PIN=20 ap.srcs += commands.c @@ -192,10 +192,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c latlong.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c latlong.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/obsolete/microjet6.xml b/conf/airframes/obsolete/microjet6.xml index b253366e0c..71f9184796 100644 --- a/conf/airframes/obsolete/microjet6.xml +++ b/conf/airframes/obsolete/microjet6.xml @@ -200,7 +200,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -213,11 +213,11 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # API mode # ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B57600 -# ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +# ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c # transparent ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/obsolete/microjetI.xml b/conf/airframes/obsolete/microjetI.xml index ed08e55f50..1be67762ec 100644 --- a/conf/airframes/obsolete/microjetI.xml +++ b/conf/airframes/obsolete/microjetI.xml @@ -187,7 +187,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -200,11 +200,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B19200 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c # transparent # ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -# ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +# ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/obsolete/microjetII.xml b/conf/airframes/obsolete/microjetII.xml index 1948c1959d..913e68d99b 100644 --- a/conf/airframes/obsolete/microjetII.xml +++ b/conf/airframes/obsolete/microjetII.xml @@ -187,7 +187,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -200,11 +200,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B19200 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c # transparent #ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/obsolete/microjetIII.xml b/conf/airframes/obsolete/microjetIII.xml index 36df078b8c..4697f6e2cc 100644 --- a/conf/airframes/obsolete/microjetIII.xml +++ b/conf/airframes/obsolete/microjetIII.xml @@ -176,7 +176,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -189,11 +189,11 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c # transparent #ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/obsolete/minimag_fs.xml b/conf/airframes/obsolete/minimag_fs.xml index 4e5aa431e1..2f73162216 100644 --- a/conf/airframes/obsolete/minimag_fs.xml +++ b/conf/airframes/obsolete/minimag_fs.xml @@ -182,7 +182,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -195,7 +195,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/obsolete/nova.xml b/conf/airframes/obsolete/nova.xml index 365565a847..256c6ae89e 100644 --- a/conf/airframes/obsolete/nova.xml +++ b/conf/airframes/obsolete/nova.xml @@ -11,10 +11,10 @@ timu.ARCHDIR = $(ARCHI) timu.CFLAGS += -DBOARD_CONFIG=\"tiny_2_0.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1e-1)' timu.srcs = nova_test_imu.c sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c -timu.CFLAGS += -DLED -DLED -DTIME_LED=1 +timu.CFLAGS += -DUSE_LED -DUSE_LED -DTIME_LED=1 timu.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -timu.srcs += downlink.c $(SRC_ARCH)/uart_hw.c pprz_transport.c +timu.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c pprz_transport.c timu.srcs += $(SRC_ARCH)/ADS8344.c diff --git a/conf/airframes/obsolete/slayer1.xml b/conf/airframes/obsolete/slayer1.xml index 086cbd8421..d44389ac6e 100644 --- a/conf/airframes/obsolete/slayer1.xml +++ b/conf/airframes/obsolete/slayer1.xml @@ -192,7 +192,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -204,10 +204,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -DXBEE868 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c latlong.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c latlong.c xbee.c #transp ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -#transp ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#transp ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/obsolete/slayer3.xml b/conf/airframes/obsolete/slayer3.xml index 928b3c88d8..b6f57d2451 100644 --- a/conf/airframes/obsolete/slayer3.xml +++ b/conf/airframes/obsolete/slayer3.xml @@ -194,7 +194,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -206,10 +206,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -#TRANSPARENT ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#TRANSPARENT ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/obsolete/slayerJH.xml b/conf/airframes/obsolete/slayerJH.xml index 48b830b90b..2cec49a721 100644 --- a/conf/airframes/obsolete/slayerJH.xml +++ b/conf/airframes/obsolete/slayerJH.xml @@ -175,7 +175,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -188,11 +188,11 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #MAXSTREAM #ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c #TRANSPARENT ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/obsolete/slicer1.xml b/conf/airframes/obsolete/slicer1.xml index 3cd8b34397..784f96a463 100644 --- a/conf/airframes/obsolete/slicer1.xml +++ b/conf/airframes/obsolete/slicer1.xml @@ -186,7 +186,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -200,7 +200,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # Radiotronix ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/obsolete/slicer2.xml b/conf/airframes/obsolete/slicer2.xml index 0311507969..2705338724 100644 --- a/conf/airframes/obsolete/slicer2.xml +++ b/conf/airframes/obsolete/slicer2.xml @@ -168,7 +168,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -182,7 +182,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # Radiotronix ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/obsolete/spirit.xml b/conf/airframes/obsolete/spirit.xml index 53c1dc9c9e..ed3b0b5b42 100644 --- a/conf/airframes/obsolete/spirit.xml +++ b/conf/airframes/obsolete/spirit.xml @@ -185,7 +185,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -199,7 +199,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # transparent ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/obsolete/spirit_proto.xml b/conf/airframes/obsolete/spirit_proto.xml index 257a656625..108e8b940f 100644 --- a/conf/airframes/obsolete/spirit_proto.xml +++ b/conf/airframes/obsolete/spirit_proto.xml @@ -173,7 +173,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -187,7 +187,7 @@ ap.srcs += poradio_control.c $(SRC_ARCH)/ppm_hw.c # transparent ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/obsolete/storm1.xml b/conf/airframes/obsolete/storm1.xml index 99dc34336d..aa4eb82ea4 100644 --- a/conf/airframes/obsolete/storm1.xml +++ b/conf/airframes/obsolete/storm1.xml @@ -228,7 +228,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -241,17 +241,17 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -#DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B57600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DTELEMETRY_MODE_FBW=1 #TRANSPARENT ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -#TRANSPARENT ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#TRANSPARENT ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/obsolete/tiny2.xml b/conf/airframes/obsolete/tiny2.xml index 4220672e22..d18fb4a59b 100644 --- a/conf/airframes/obsolete/tiny2.xml +++ b/conf/airframes/obsolete/tiny2.xml @@ -199,7 +199,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -211,10 +211,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c #XBEE ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600 -#XBEE ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +#XBEE ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/tiny_hitl.xml b/conf/airframes/obsolete/tiny_hitl.xml similarity index 98% rename from conf/airframes/tiny_hitl.xml rename to conf/airframes/obsolete/tiny_hitl.xml index ac97fa1fc3..4638d90d03 100644 --- a/conf/airframes/tiny_hitl.xml +++ b/conf/airframes/obsolete/tiny_hitl.xml @@ -165,7 +165,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -179,7 +179,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # transparent ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c diff --git a/conf/airframes/obsolete/tl.xml b/conf/airframes/obsolete/tl.xml index 0787729120..9412650b8c 100644 --- a/conf/airframes/obsolete/tl.xml +++ b/conf/airframes/obsolete/tl.xml @@ -86,7 +86,7 @@ ap.ARCHDIR = $(ARCHI) ap.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(16.666e-3)' -I$(TL) ap.srcs = $(TL)/tl_main.c sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c -ap.CFLAGS += -DLED -DLED -DTIME_LED=1 +ap.CFLAGS += -DUSE_LED -DUSE_LED -DTIME_LED=1 ap.CFLAGS += -DADC ap.srcs += $(SRC_ARCH)/adc_hw.c $(TL)/tl_bat.c @@ -101,7 +101,7 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # transparent ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c pprz_transport.c $(TL)/tl_telemetry.c datalink.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c pprz_transport.c $(TL)/tl_telemetry.c datalink.c ap.CFLAGS += -DTL_AP_MODE_AUTO=TL_AP_MODE_NAV -DDT_VFILTER="(1./60.)" ap.srcs += $(TL)/tl_autopilot.c $(TL)/tl_control.c $(TL)/tl_estimator.c $(TL)/tl_vfilter.c @@ -133,9 +133,9 @@ tmm.ARCHDIR = $(ARCHI) tmm.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(16.666e-3)' tmm.srcs = $(TL)/tl_test_mm_main.c sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c -tmm.CFLAGS += -DLED -DLED -DTIME_LED=1 +tmm.CFLAGS += -DUSE_LED -DUSE_LED -DTIME_LED=1 tmm.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DUART0_BAUD=B57600 -tmm.srcs += downlink.c $(SRC_ARCH)/uart_hw.c pprz_transport.c +tmm.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c pprz_transport.c tmm.srcs += micromag.c $(SRC_ARCH)/micromag_hw.c @@ -148,9 +148,9 @@ timu.ARCHDIR = $(ARCHI) timu.CFLAGS += -DBOARD_CONFIG=\"tiny_1_1.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(16.666e-3)' timu.srcs = $(TL)/tl_test_imu_main.c sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c -timu.CFLAGS += -DLED -DLED -DTIME_LED=1 +timu.CFLAGS += -DUSE_LED -DUSE_LED -DTIME_LED=1 timu.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DUART0_BAUD=B57600 -timu.srcs += downlink.c $(SRC_ARCH)/uart_hw.c pprz_transport.c +timu.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c pprz_transport.c timu.srcs += $(TL)/tl_imu.c timu.CFLAGS += -DADC -DUSE_ADC_5 -DADC_CHANNEL_GR=ADC_5 -DUSE_ADC_6 -DADC_CHANNEL_RM=ADC_6 -DUSE_ADC_7 -DADC_CHANNEL_ACCEL=ADC_7 diff --git a/conf/airframes/obsolete/twinjet1.xml b/conf/airframes/obsolete/twinjet1.xml index 0721f67e8b..8c2450f8d4 100644 --- a/conf/airframes/obsolete/twinjet1.xml +++ b/conf/airframes/obsolete/twinjet1.xml @@ -172,7 +172,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/classix.makefile # FLASH_MODE=ISP FLASH_MODE=IAP -fbw.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=1 +fbw.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DUSE_LED -DTIME_LED=1 fbw.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main.c fbw.srcs += commands.c @@ -184,7 +184,7 @@ fbw.CFLAGS += -DRADIO_CONTROL fbw.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c fbw.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DUART0_BAUD=B9600 -fbw.srcs += downlink.c pprz_transport.c $(SRC_ARCH)/uart_hw.c +fbw.srcs += downlink.c pprz_transport.c $(SRC_ARCH)/mcu_periph/uart_arch.c fbw.CFLAGS += -DINTER_MCU -DMCU_SPI_LINK -DUSE_SPI -DSPI_SLAVE fbw.srcs += inter_mcu.c link_mcu.c spi.c $(SRC_ARCH)/spi_hw.c @@ -193,14 +193,14 @@ fbw.CFLAGS += -DADC -DUSE_AD0 fbw.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DAP -DRADIO_CONTROL_AUTO1 -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=2 +ap.CFLAGS += -DAP -DRADIO_CONTROL_AUTO1 -DBOARD_CONFIG=\"classix.h\" -DUSE_LED -DTIME_LED=2 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_ap.c main.c #ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c subsystems/navigation/traffic_info.c xbee.c +#ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c subsystems/navigation/traffic_info.c xbee.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU -DMCU_SPI_LINK -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 ap.srcs += inter_mcu.c link_mcu.c spi.c $(SRC_ARCH)/spi_hw.c @@ -237,8 +237,8 @@ ap.CFLAGS += -DUSE_LIGHT -test.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING -DUSE_UART0 -DDATALINK -DPPRZ_INPUT -DPPRZ_UART=Uart0 -DUART0_BAUD=B9600 -test.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4017_hw.c main.c +test.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DUSE_LED -DTIME_LED=1 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING -DUSE_UART0 -DDATALINK -DPPRZ_INPUT -DPPRZ_UART=Uart0 -DUART0_BAUD=B9600 +test.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/mcu_periph/uart_arch.c $(SRC_ARCH)/servos_4017_hw.c main.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile diff --git a/conf/airframes/obsolete/twinstar6.xml b/conf/airframes/obsolete/twinstar6.xml index a7a381a4eb..30aeb79607 100644 --- a/conf/airframes/obsolete/twinstar6.xml +++ b/conf/airframes/obsolete/twinstar6.xml @@ -180,7 +180,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/classix.makefile # FLASH_MODE=ISP FLASH_MODE=IAP -fbw.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=1 +fbw.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DUSE_LED -DTIME_LED=1 fbw.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main.c fbw.srcs += commands.c @@ -192,7 +192,7 @@ fbw.CFLAGS += -DRADIO_CONTROL fbw.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c fbw.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DUART0_BAUD=B9600 -fbw.srcs += downlink.c pprz_transport.c $(SRC_ARCH)/uart_hw.c +fbw.srcs += downlink.c pprz_transport.c $(SRC_ARCH)/mcu_periph/uart_arch.c fbw.CFLAGS += -DINTER_MCU -DMCU_SPI_LINK -DUSE_SPI -DSPI_SLAVE fbw.srcs += inter_mcu.c link_mcu.c spi.c $(SRC_ARCH)/spi_hw.c @@ -201,11 +201,11 @@ fbw.CFLAGS += -DADC -DUSE_AD0 fbw.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DAP -DRADIO_CONTROL_AUTO1 -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=2 +ap.CFLAGS += -DAP -DRADIO_CONTROL_AUTO1 -DBOARD_CONFIG=\"classix.h\" -DUSE_LED -DTIME_LED=2 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_ap.c main.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c subsystems/navigation/traffic_info.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c subsystems/navigation/traffic_info.c pprz_transport.c ap.CFLAGS += -DINTER_MCU -DMCU_SPI_LINK -DUSE_SPI -DSPI_MASTER ap.srcs += inter_mcu.c link_mcu.c spi.c $(SRC_ARCH)/spi_hw.c @@ -237,8 +237,8 @@ ap.CFLAGS += -DDIGITAL_CAM ap.srcs += dc.c -test.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING -DUSE_UART0 -DDATALINK -DPPRZ_INPUT -DPPRZ_UART=Uart0 -DUART0_BAUD=B9600 -test.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4017_hw.c main.c +test.CFLAGS += -DFBW -DBOARD_CONFIG=\"classix.h\" -DUSE_LED -DTIME_LED=1 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING -DUSE_UART0 -DDATALINK -DPPRZ_INPUT -DPPRZ_UART=Uart0 -DUART0_BAUD=B9600 +test.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/mcu_periph/uart_arch.c $(SRC_ARCH)/servos_4017_hw.c main.c # Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile diff --git a/conf/airframes/obsolete/twisted.xml b/conf/airframes/obsolete/twisted.xml index a9db415bc8..19ebf649b7 100644 --- a/conf/airframes/obsolete/twisted.xml +++ b/conf/airframes/obsolete/twisted.xml @@ -46,7 +46,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_1_1.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_coax.c main.c ap.CFLAGS += -DACTUATORS=\"servos_4015_MAT_hw.h\" -DSERVOS_4015_MAT @@ -56,7 +56,7 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B19200 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 -DUSE_BARO_MS5534A ap.srcs += spi.c $(SRC_ARCH)/spi_hw.c $(SRC_ARCH)/baro_MS5534A.c diff --git a/conf/airframes/obsolete/tyto1.xml b/conf/airframes/obsolete/tyto1.xml index 15feae9864..049cea6a4f 100644 --- a/conf/airframes/obsolete/tyto1.xml +++ b/conf/airframes/obsolete/tyto1.xml @@ -204,7 +204,7 @@ FLASH_MODE=IAP ap.CFLAGS += -DTELEMETRY_MODE_FBW=1 -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -216,10 +216,10 @@ ap.CFLAGS += -DRADIO_CONTROL ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -# ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c +# ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c xbee.c ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU diff --git a/conf/airframes/vor.xml b/conf/airframes/obsolete/vor.xml similarity index 89% rename from conf/airframes/vor.xml rename to conf/airframes/obsolete/vor.xml index ea7f66b737..ef449a636a 100644 --- a/conf/airframes/vor.xml +++ b/conf/airframes/obsolete/vor.xml @@ -14,14 +14,14 @@ main.srcs = firmwares/vor/lpc_vor_main.c main.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./29880.)' main.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -main.CFLAGS += -DLED +main.CFLAGS += -DUSE_LED main.srcs += $(SRC_ARCH)/armVIC.c main.srcs += firmwares/vor/lpc_vor_convertions.c main.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B9600 -main.srcs += $(SRC_ARCH)/uart_hw.c +main.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c main.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 main.srcs += downlink.c pprz_transport.c diff --git a/conf/airframes/whirly.xml b/conf/airframes/obsolete/whirly.xml similarity index 100% rename from conf/airframes/whirly.xml rename to conf/airframes/obsolete/whirly.xml diff --git a/conf/airframes/obsolete/xxx1.xml b/conf/airframes/obsolete/xxx1.xml index 7c967182fa..972d9e9809 100644 --- a/conf/airframes/obsolete/xxx1.xml +++ b/conf/airframes/obsolete/xxx1.xml @@ -209,7 +209,7 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile FLASH_MODE=IAP -ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_0_99.h\" -DLED -DTIME_LED=1 +ap.CFLAGS += -DFBW -DAP -DBOARD_CONFIG=\"tiny_0_99.h\" -DUSE_LED -DTIME_LED=1 ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c ap.srcs += commands.c @@ -222,10 +222,10 @@ ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c # ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600 -ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c #TRANSPARENT ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 -#TRANSPARENT ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +#TRANSPARENT ap.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU @@ -278,8 +278,8 @@ sim.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_re # a test program to setup actuators setup_actuators.ARCHDIR = $(ARCHI) -setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART0 -DUART0_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 -setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4015_hw.c main.c +setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DUSE_LED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART0 -DUART0_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 +setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/mcu_periph/uart_arch.c $(SRC_ARCH)/servos_4015_hw.c main.c diff --git a/conf/airframes/test_hb.xml b/conf/airframes/test_hb.xml new file mode 100644 index 0000000000..4d8b1c6795 --- /dev/null +++ b/conf/airframes/test_hb.xml @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+ +
+ + +
+ +
+ + + + + + + + +
+ +
+ + + + + +
+ +
+ +
+ +
diff --git a/conf/airframes/test_i2c.xml b/conf/airframes/test_i2c.xml index c575a5cd8e..8ddf557a10 100644 --- a/conf/airframes/test_i2c.xml +++ b/conf/airframes/test_i2c.xml @@ -19,10 +19,10 @@ FLASH_MODE = ISP mb.CFLAGS += -DBOARD_CONFIG=\"conf_motor_bench.h\" -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(10e-3)' mb.srcs = $(SRC_ARCH)/main_test_i2c.c sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c -mb.CFLAGS += -DLED +mb.CFLAGS += -DUSE_LED mb.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 -mb.srcs += $(SRC_ARCH)/uart_hw.c +mb.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c mb.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 mb.srcs += downlink.c pprz_transport.c diff --git a/conf/airframes/twinjet_example.xml b/conf/airframes/twinjet_example.xml index dbece1f26f..70fd68b0b7 100644 --- a/conf/airframes/twinjet_example.xml +++ b/conf/airframes/twinjet_example.xml @@ -34,6 +34,12 @@ + + + + + + diff --git a/conf/airframes/twinjet_overo.xml b/conf/airframes/twinjet_overo.xml old mode 100755 new mode 100644 diff --git a/conf/airframes/wind_tunnel.xml b/conf/airframes/wind_tunnel.xml index 2ae886c686..418362b110 100644 --- a/conf/airframes/wind_tunnel.xml +++ b/conf/airframes/wind_tunnel.xml @@ -17,12 +17,12 @@ ap.srcs = $(WIND_TUNNEL)/main.c ap.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1e-1)' ap.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -ap.CFLAGS += -DLED +ap.CFLAGS += -DUSE_LED ap.srcs += $(SRC_ARCH)/armVIC.c ap.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 -ap.srcs += $(SRC_ARCH)/uart_hw.c +ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c ap.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 ap.srcs += downlink.c pprz_transport.c @@ -47,12 +47,12 @@ mb.srcs = $(WIND_TUNNEL)/main_mb.c mb.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1e-2)' mb.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -mb.CFLAGS += -DLED +mb.CFLAGS += -DUSE_LED mb.srcs += $(SRC_ARCH)/armVIC.c mb.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 -mb.srcs += $(SRC_ARCH)/uart_hw.c +mb.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c mb.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 mb.srcs += downlink.c pprz_transport.c diff --git a/conf/autopilot/booz2_test_progs.makefile b/conf/autopilot/booz2_test_progs.makefile index aab10a795c..ec7cc603ac 100644 --- a/conf/autopilot/booz2_test_progs.makefile +++ b/conf/autopilot/booz2_test_progs.makefile @@ -22,6 +22,8 @@ # # +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile + # # test_led : blinks all leds # @@ -47,7 +49,7 @@ test_downlink.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./10.))' -DTIM test_downlink.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_downlink.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_downlink.srcs += $(SRC_ARCH)/uart_hw.c +test_downlink.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_downlink.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_downlink.srcs += downlink.c pprz_transport.c @@ -66,7 +68,7 @@ test_max1168.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIM test_max1168.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_max1168.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_max1168.srcs += $(SRC_ARCH)/uart_hw.c +test_max1168.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_max1168.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_max1168.srcs += downlink.c pprz_transport.c @@ -83,11 +85,11 @@ test_micromag.ARCHDIR = $(ARCH) test_micromag.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_micromag.srcs += $(SRC_BOOZ_TEST)/booz2_test_micromag.c test_micromag.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 -test_micromag.CFLAGS += -DLED +test_micromag.CFLAGS += -DUSE_LED test_micromag.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_micromag.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_micromag.srcs += $(SRC_ARCH)/uart_hw.c +test_micromag.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_micromag.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_micromag.srcs += downlink.c pprz_transport.c @@ -108,12 +110,13 @@ tunnel.ARCHDIR = $(ARCH) tunnel.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) tunnel.srcs += $(SRC_BOOZ_TEST)/booz2_tunnel.c tunnel.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 -tunnel.CFLAGS += -DLED +tunnel.CFLAGS += -DUSE_LED tunnel.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c +tunnel.srcs += mcu.c $(SRC_ARCH)/mcu_arch.c tunnel.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400 tunnel.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -tunnel.srcs += $(SRC_ARCH)/uart_hw.c +tunnel.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c # @@ -124,7 +127,7 @@ tunnel_bb.ARCHDIR = $(ARCH) tunnel_bb.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) tunnel_bb.srcs += $(SRC_BOOZ_TEST)/booz2_tunnel_bb.c tunnel_bb.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 -tunnel_bb.CFLAGS += -DLED +tunnel_bb.CFLAGS += -DUSE_LED tunnel_bb.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c @@ -137,11 +140,11 @@ test_gps.ARCHDIR = $(ARCH) test_gps.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_gps.srcs += $(SRC_BOOZ_TEST)/booz2_test_gps.c test_gps.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 -test_gps.CFLAGS += -DLED +test_gps.CFLAGS += -DUSE_LED test_gps.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_gps.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_gps.srcs += $(SRC_ARCH)/uart_hw.c +test_gps.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_gps.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_gps.srcs += downlink.c pprz_transport.c @@ -162,11 +165,11 @@ test_modem.ARCHDIR = $(ARCH) test_modem.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) test_modem.srcs += $(SRC_BOOZ_TEST)/booz2_test_modem.c test_modem.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 -test_modem.CFLAGS += -DLED +test_modem.CFLAGS += -DUSE_LED test_modem.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_modem.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_modem.srcs += $(SRC_ARCH)/uart_hw.c +test_modem.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_modem.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_modem.srcs += downlink.c pprz_transport.c @@ -184,18 +187,18 @@ test_usb.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) test_usb.srcs += $(SRC_BOOZ_TEST)/booz2_test_usb.c test_usb.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' # -DTIME_LED=1 -test_usb.CFLAGS += -DLED +test_usb.CFLAGS += -DUSE_LED test_usb.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c #test_usb.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -#test_usb.srcs += $(SRC_ARCH)/uart_hw.c +#test_usb.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c #test_usb.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 #test_usb.srcs += downlink.c pprz_transport.c test_usb.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DUSE_USB_SERIAL test_usb.CFLAGS += -DDOWNLINK_DEVICE=UsbS -DPPRZ_UART=UsbS -DDATALINK=PPRZ -test_usb.srcs += downlink.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/usb_ser_hw.c pprz_transport.c -# datalink.c +test_usb.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c $(SRC_ARCH)/usb_ser_hw.c pprz_transport.c +# $(SRC_FIRMWARE)/datalink.c test_usb.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbcontrol.c test_usb.srcs += $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c @@ -212,11 +215,11 @@ test_ami.ARCHDIR = $(ARCH) test_ami.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) $(BOOZ_CFLAGS) test_ami.srcs += $(SRC_BOOZ_TEST)/booz2_test_ami.c test_ami.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./50.))' -DTIME_LED=1 -test_ami.CFLAGS += -DLED +test_ami.CFLAGS += -DUSE_LED test_ami.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_ami.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_ami.srcs += $(SRC_ARCH)/uart_hw.c +test_ami.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_ami.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_ami.srcs += downlink.c pprz_transport.c @@ -235,11 +238,11 @@ test_crista.ARCHDIR = $(ARCH) test_crista.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_crista.srcs += $(SRC_BOOZ_TEST)/booz2_test_crista.c test_crista.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 -test_crista.CFLAGS += -DLED +test_crista.CFLAGS += -DUSE_LED test_crista.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_crista.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B57600 -test_crista.srcs += $(SRC_ARCH)/uart_hw.c +test_crista.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_crista.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0 test_crista.srcs += downlink.c pprz_transport.c @@ -261,11 +264,11 @@ test_micromag2.srcs += $(SRC_BOOZ_TEST)/booz2_test_micromag_2.c test_micromag2.CFLAGS += -DSSP_VIC_SLOT=9 test_micromag2.CFLAGS += -DMICROMAG_DRDY_VIC_SLOT=8 test_micromag2.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./50.))' -DTIME_LED=1 -test_micromag2.CFLAGS += -DLED +test_micromag2.CFLAGS += -DUSE_LED test_micromag2.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_micromag2.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_micromag2.srcs += $(SRC_ARCH)/uart_hw.c +test_micromag2.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_micromag2.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_micromag2.srcs += downlink.c pprz_transport.c @@ -283,11 +286,11 @@ test_imu_b2.ARCHDIR = $(ARCH) test_imu_b2.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_imu_b2.srcs += $(SRC_BOOZ_TEST)/booz2_test_imu_b2.c test_imu_b2.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 -test_imu_b2.CFLAGS += -DLED +test_imu_b2.CFLAGS += -DUSE_LED test_imu_b2.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_imu_b2.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_imu_b2.srcs += $(SRC_ARCH)/uart_hw.c +test_imu_b2.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_imu_b2.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_imu_b2.srcs += downlink.c pprz_transport.c @@ -313,11 +316,11 @@ test_rc_spektrum.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) $(BOOZ_CFLA test_rc_spektrum.CFLAGS += -DPERIPHERALS_AUTO_INIT test_rc_spektrum.srcs += $(SRC_BOOZ_TEST)/booz2_test_radio_control.c test_rc_spektrum.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 -test_rc_spektrum.CFLAGS += -DLED +test_rc_spektrum.CFLAGS += -DUSE_LED test_rc_spektrum.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c #test_rc_spektrum.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -#test_rc_spektrum.srcs += $(SRC_ARCH)/uart_hw.c +#test_rc_spektrum.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c #test_rc_spektrum.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 #test_rc_spektrum.srcs += downlink.c pprz_transport.c test_rc_spektrum.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DUSE_USB_SERIAL @@ -333,7 +336,7 @@ test_rc_spektrum.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B115200 test_rc_spektrum.CFLAGS += -DRADIO_CONTROL_LINK=Uart0 test_rc_spektrum.srcs += $(SRC_SUBSYSTEMS)/radio_control.c \ $(SRC_SUBSYSTEMS)/radio_control_spektrum.c \ - $(SRC_ARCH)/uart_hw.c + $(SRC_ARCH)/mcu_periph/uart_arch.c # # test rc ppm @@ -345,11 +348,11 @@ test_rc_ppm.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARC test_rc_ppm.CFLAGS += -DPERIPHERALS_AUTO_INIT test_rc_ppm.srcs += $(SRC_BOOZ_TEST)/booz2_test_radio_control.c test_rc_ppm.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 -test_rc_ppm.CFLAGS += -DLED +test_rc_ppm.CFLAGS += -DUSE_LED test_rc_ppm.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c #test_rc_ppm.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -#test_rc_ppm.srcs += $(SRC_ARCH)/uart_hw.c +#test_rc_ppm.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c #test_rc_ppm.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 #test_rc_ppm.srcs += downlink.c pprz_transport.c test_rc_ppm.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DUSE_USB_SERIAL @@ -374,11 +377,11 @@ test_mc.ARCHDIR = $(ARCH) test_mc.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_mc.srcs += $(SRC_BOOZ_TEST)/booz2_test_mc.c test_mc.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 -test_mc.CFLAGS += -DLED +test_mc.CFLAGS += -DUSE_LED test_mc.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_mc.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_mc.srcs += $(SRC_ARCH)/uart_hw.c +test_mc.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_mc.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_mc.srcs += downlink.c pprz_transport.c @@ -403,7 +406,7 @@ test_buss_bldc.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DT test_buss_bldc.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_buss_bldc.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_buss_bldc.srcs += $(SRC_ARCH)/uart_hw.c +test_buss_bldc.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_buss_bldc.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_buss_bldc.srcs += downlink.c pprz_transport.c @@ -421,16 +424,16 @@ test_amc.ARCHDIR = $(ARCH) test_amc.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_amc.srcs += $(SRC_BOOZ_TEST)/booz2_test_amc.c test_amc.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 -test_amc.CFLAGS += -DLED +test_amc.CFLAGS += -DUSE_LED test_amc.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_amc.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_amc.srcs += $(SRC_ARCH)/uart_hw.c +test_amc.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_amc.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_amc.srcs += downlink.c pprz_transport.c test_amc.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart1 -test_amc.srcs += $(SRC_BOOZ)/booz2_datalink.c +test_amc.srcs += $(SRC_FIRMWARE)/datalink.c test_amc.CFLAGS += -DACTUATORS=\"actuators_asctec_twi_blmc_hw.h\" test_amc.srcs += $(SRC_BOOZ_ARCH)/actuators_asctec_twi_blmc_hw.c actuators.c @@ -465,12 +468,12 @@ test_baro_24.ARCHDIR = $(ARCH) test_baro_24.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -I$(SRC_BOOZ) $(BOOZ_CFLAGS) test_baro_24.srcs += $(SRC_BOOZ_TEST)/booz2_test_baro_24.c test_baro_24.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./5.))' -DTIME_LED=1 -test_baro_24.CFLAGS += -DLED +test_baro_24.CFLAGS += -DUSE_LED test_baro_24.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_baro_24.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_baro_24.srcs += $(SRC_ARCH)/uart_hw.c +test_baro_24.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_baro_24.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_baro_24.srcs += downlink.c pprz_transport.c diff --git a/conf/autopilot/fixedwing.makefile b/conf/autopilot/fixedwing.makefile index 0ead7d26d4..d4e98b98c4 100644 --- a/conf/autopilot/fixedwing.makefile +++ b/conf/autopilot/fixedwing.makefile @@ -33,27 +33,13 @@ endif ifeq ($(TARGET),$(ACTUATOR_TARGET)) ifeq ($(ACTUATORS),) - ifeq ($(BOARD),tiny) - ifeq ($(BOARD_VERSION),1.1) - include $(CFG_SHARED)/actuators_4015.makefile - else - ifeq ($(BOARD_VERSION),0.99) - include $(CFG_SHARED)/actuators_4015.makefile - else - include $(CFG_SHARED)/actuators_4017.makefile - endif - endif - endif - ifeq ($(BOARD),twog) - include $(CFG_SHARED)/actuators_4017.makefile - endif ifeq ($(BOARD),lisa_l) include $(CFG_SHARED)/actuators_direct.makefile endif else - include $(CFG_FIXEDWING)/$(ACTUATORS).makefile + include $(CFG_SHARED)/$(ACTUATORS).makefile endif endif diff --git a/conf/autopilot/fixedwing.xml b/conf/autopilot/fixedwing.xml index 696bce4992..0899eb9b68 100644 --- a/conf/autopilot/fixedwing.xml +++ b/conf/autopilot/fixedwing.xml @@ -3,7 +3,7 @@ - + @@ -17,26 +17,26 @@ - + - - - + + + - - - - + + + + - - + + diff --git a/conf/autopilot/lisa_l_test_progs.makefile b/conf/autopilot/lisa_l_test_progs.makefile index ab9527b999..2a04cbbb14 100644 --- a/conf/autopilot/lisa_l_test_progs.makefile +++ b/conf/autopilot/lisa_l_test_progs.makefile @@ -53,6 +53,7 @@ SRC_BOARD=boards/$(BOARD) SRC_FIRMWARE=firmwares/rotorcraft SRC_SUBSYSTEMS=subsystems +SRC_AIRBORNE=. # # default configuration expected from the board files @@ -67,7 +68,9 @@ SRC_SUBSYSTEMS=subsystems test_led.ARCHDIR = $(ARCH) test_led.CFLAGS += -I$(SRC_LISA) -I$(ARCH) -DPERIPHERALS_AUTO_INIT test_led.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_led.srcs += $(SRC_LISA)/test_led.c \ +test_led.srcs += $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + $(SRC_LISA)/test_led.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c test_led.CFLAGS += -DUSE_LED @@ -79,10 +82,12 @@ test_led.srcs += $(SRC_ARCH)/led_hw.c test_uart.ARCHDIR = $(ARCH) test_uart.CFLAGS = -I$(SRC_LISA) -I$(ARCH) -DPERIPHERALS_AUTO_INIT test_uart.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_uart.srcs = $(SRC_LISA)/test_uart.c \ +test_uart.srcs = $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + $(SRC_LISA)/test_uart.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c -test_uart.CFLAGS += -DUSE_LED +test_uart.CFLAGS += -DUSE_LED -DUSE_UART test_uart.srcs += $(SRC_ARCH)/led_hw.c test_uart.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=$(SYS_TIME_LED) test_uart.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' @@ -90,7 +95,7 @@ test_uart.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_uart.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 test_uart.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 test_uart.CFLAGS += -DUSE_UART3 -DUART3_BAUD=B57600 -test_uart.srcs += $(SRC_ARCH)/uart_hw.c +test_uart.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c @@ -104,7 +109,9 @@ test_servos.ARCHDIR = $(ARCH) test_servos.CFLAGS = -I$(SRC_FIRMWARE)/actuators/arch/$(ARCH) -I$(SRC_LISA) -I$(ARCH) -DPERIPHERALS_AUTO_INIT test_servos.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_servos.LDFLAGS += -lm -test_servos.srcs += $(SRC_LISA)/test_servos.c \ +test_servos.srcs += $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + $(SRC_LISA)/test_servos.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c test_servos.CFLAGS += -DUSE_LED @@ -126,9 +133,11 @@ test_servos.srcs += $(SRC_FIRMWARE)/actuators/actuators_pwm.c $(SRC_FIRMWARE)/ac test_telemetry.ARCHDIR = $(ARCH) test_telemetry.CFLAGS += -I$(SRC_LISA) -I$(SRC_ARCH) -DPERIPHERALS_AUTO_INIT test_telemetry.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_telemetry.srcs = test/test_telemetry.c \ - $(SRC_ARCH)/stm32_exceptions.c \ - $(SRC_ARCH)/stm32_vector_table.c +test_telemetry.srcs = $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + test/test_telemetry.c \ + $(SRC_ARCH)/stm32_exceptions.c \ + $(SRC_ARCH)/stm32_vector_table.c test_telemetry.CFLAGS += -DUSE_LED test_telemetry.srcs += $(SRC_ARCH)/led_hw.c test_telemetry.CFLAGS += -DUSE_SYS_TIME @@ -139,7 +148,7 @@ test_telemetry.CFLAGS += -DUSE_$(MODEM_PORT) test_telemetry.CFLAGS += -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) test_telemetry.srcs += downlink.c pprz_transport.c test_telemetry.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) -test_telemetry.srcs += $(SRC_ARCH)/uart_hw.c +test_telemetry.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c # @@ -153,7 +162,9 @@ test_telemetry.srcs += $(SRC_ARCH)/uart_hw.c test_baro.ARCHDIR = $(ARCH) test_baro.CFLAGS = -I$(SRC_LISA) -I$(SRC_ARCH) -I$(SRC_BOARD) -DPERIPHERALS_AUTO_INIT test_baro.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_baro.srcs = $(SRC_BOARD)/test_baro.c \ +test_baro.srcs = $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + $(SRC_BOARD)/test_baro.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c test_baro.CFLAGS += -DUSE_LED @@ -165,10 +176,10 @@ test_baro.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_baro.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_baro.srcs += downlink.c pprz_transport.c test_baro.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_baro.srcs += $(SRC_ARCH)/uart_hw.c +test_baro.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_baro.srcs += $(SRC_BOARD)/baro_board.c test_baro.CFLAGS += -DUSE_I2C2 -test_baro.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +test_baro.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c # @@ -185,7 +196,9 @@ test_rc_spektrum.ARCHDIR = $(ARCH) test_rc_spektrum.CFLAGS += -I$(SRC_ARCH) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT test_rc_spektrum.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_rc_spektrum.srcs += $(SRC_BOOZ_TEST)/booz2_test_radio_control.c \ +test_rc_spektrum.srcs += $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + $(SRC_BOOZ_TEST)/booz2_test_radio_control.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c @@ -196,7 +209,7 @@ test_rc_spektrum.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_rc_spektrum.CFLAGS += -DSYS_TIME_LED=$(SYS_TIME_LED) test_rc_spektrum.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_rc_spektrum.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_rc_spektrum.srcs += $(SRC_ARCH)/uart_hw.c +test_rc_spektrum.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_rc_spektrum.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_rc_spektrum.srcs += downlink.c pprz_transport.c test_rc_spektrum.CFLAGS += -DRADIO_CONTROL @@ -226,7 +239,9 @@ test_rc_ppm.ARCHDIR = $(ARCH) test_rc_ppm.CFLAGS += -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -I$(SRC_BOARD) test_rc_ppm.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_rc_ppm.CFLAGS += -DPERIPHERALS_AUTO_INIT -test_rc_ppm.srcs += $(SRC_BOOZ)/test/booz2_test_radio_control.c \ +test_rc_ppm.srcs += $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + $(SRC_BOOZ)/test/booz2_test_radio_control.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c @@ -237,7 +252,7 @@ test_rc_ppm.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_rc_ppm.CFLAGS += -DSYS_TIME_LED=$(SYS_TIME_LED) test_rc_ppm.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_rc_ppm.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_rc_ppm.srcs += $(SRC_ARCH)/uart_hw.c +test_rc_ppm.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_rc_ppm.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_rc_ppm.srcs += downlink.c pprz_transport.c test_rc_ppm.CFLAGS += -DRADIO_CONTROL @@ -261,7 +276,9 @@ test_adc.ARCHDIR = $(ARCH) test_adc.CFLAGS = -I$(SRC_LISA) -I$(ARCH) -DPERIPHERALS_AUTO_INIT test_adc.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_adc.srcs = $(SRC_LISA)/test_adc.c \ +test_adc.srcs = $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + $(SRC_LISA)/test_adc.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c @@ -274,15 +291,14 @@ test_adc.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_adc.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_adc.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_adc.srcs += $(SRC_ARCH)/uart_hw.c +test_adc.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_adc.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=$(MODEM_PORT) test_adc.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_adc.srcs += downlink.c pprz_transport.c test_adc.srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c -test_adc.CFLAGS += -DUSE_AD1 -DUSE_AD1_1 -# -DUSE_AD1_2 -DUSE_AD1_3 -DUSE_AD1_4 +test_adc.CFLAGS += -DUSE_AD1 -DUSE_AD1_1 -DUSE_AD1_2 -DUSE_AD1_3 -DUSE_AD1_4 test_adc.CFLAGS += -DUSE_ADC1_2_IRQ_HANDLER # @@ -296,7 +312,9 @@ test_adc.CFLAGS += -DUSE_ADC1_2_IRQ_HANDLER test_imu_b2.ARCHDIR = $(ARCH) test_imu_b2.CFLAGS = -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT test_imu_b2.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_imu_b2.srcs += $(SRC_BOOZ_TEST)/booz_test_imu.c \ +test_imu_b2.srcs += $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + $(SRC_BOOZ_TEST)/booz_test_imu.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c @@ -309,7 +327,7 @@ test_imu_b2.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_imu_b2.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_imu_b2.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_imu_b2.srcs += $(SRC_ARCH)/uart_hw.c +test_imu_b2.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_imu_b2.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_imu_b2.srcs += downlink.c pprz_transport.c @@ -317,14 +335,14 @@ test_imu_b2.srcs += downlink.c pprz_transport.c test_imu_b2.srcs += math/pprz_trig_int.c test_imu_b2.CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_b2.h\" -test_imu_b2.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 -DIMU_B2_VERSION_1_1 +test_imu_b2.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2100 -DIMU_B2_VERSION_1_1 test_imu_b2.srcs += $(SRC_SUBSYSTEMS)/imu.c test_imu_b2.CFLAGS += -DMAX_1168_DRDY_PORT=$(MAX_1168_DRDY_PORT) test_imu_b2.CFLAGS += -DMAX_1168_DRDY_PORT_SOURCE=$(MAX_1168_DRDY_PORT_SOURCE) test_imu_b2.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ test_imu_b2.srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c $(SRC_ARCH)/subsystems/imu/imu_b2_arch.c test_imu_b2.srcs += peripherals/max1168.c $(SRC_ARCH)/peripherals/max1168_arch.c -test_imu_b2.srcs += peripherals/ms2001.c $(SRC_ARCH)/peripherals/ms2001_arch.c +test_imu_b2.srcs += peripherals/ms2100.c $(SRC_ARCH)/peripherals/ms2100_arch.c # # test IMU b2 1.2 @@ -337,7 +355,9 @@ test_imu_b2.srcs += peripherals/ms2001.c $(SRC_ARCH)/peripherals/ms2001_arch.c test_imu_b2_2.ARCHDIR = $(ARCH) test_imu_b2_2.CFLAGS = -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT test_imu_b2_2.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_imu_b2_2.srcs += $(SRC_BOOZ_TEST)/booz_test_imu.c \ +test_imu_b2_2.srcs += $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + $(SRC_BOOZ_TEST)/booz_test_imu.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c @@ -350,7 +370,7 @@ test_imu_b2_2.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_imu_b2_2.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_imu_b2_2.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_imu_b2_2.srcs += $(SRC_ARCH)/uart_hw.c +test_imu_b2_2.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_imu_b2_2.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_imu_b2_2.srcs += downlink.c pprz_transport.c @@ -366,8 +386,8 @@ test_imu_b2_2.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_ test_imu_b2_2.srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c $(SRC_ARCH)/subsystems/imu/imu_b2_arch.c test_imu_b2_2.srcs += peripherals/max1168.c $(SRC_ARCH)/peripherals/max1168_arch.c test_imu_b2_2.CFLAGS += -DUSE_I2C2 -test_imu_b2_2.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c -test_imu_b2_2.srcs += peripherals/hmc5843.c $(SRC_BOOZ_ARCH)/peripherals/hmc5843_arch.c +test_imu_b2_2.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c +test_imu_b2_2.srcs += peripherals/hmc5843.c $(SRC_ARCH)/peripherals/hmc5843_arch.c test_imu_b2_2.CFLAGS += -DUSE_EXTI9_5_IRQ # Mag Int on PB5 @@ -377,7 +397,9 @@ test_imu_b2_2.CFLAGS += -DUSE_EXTI9_5_IRQ # Mag Int on PB5 test_imu_aspirin.ARCHDIR = $(ARCH) test_imu_aspirin.CFLAGS = -I$(SRC_FIRMWARE) -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT test_imu_aspirin.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_imu_aspirin.srcs += $(SRC_BOOZ_TEST)/booz_test_imu.c \ +test_imu_aspirin.srcs += $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + $(SRC_BOOZ_TEST)/booz_test_imu.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c @@ -389,7 +411,7 @@ test_imu_aspirin.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_imu_aspirin.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_imu_aspirin.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_imu_aspirin.srcs += $(SRC_ARCH)/uart_hw.c +test_imu_aspirin.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_imu_aspirin.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_imu_aspirin.srcs += downlink.c pprz_transport.c @@ -400,9 +422,10 @@ test_imu_aspirin.CFLAGS += -DIMU_TYPE_H=\"imu/imu_aspirin.h\" -DIMU_OVERRIDE_CHA test_imu_aspirin.srcs += $(SRC_SUBSYSTEMS)/imu.c \ $(SRC_SUBSYSTEMS)/imu/imu_aspirin.c \ $(SRC_ARCH)/subsystems/imu/imu_aspirin_arch.c +test_imu_aspirin.srcs += peripherals/hmc5843.c $(SRC_ARCH)/peripherals/hmc5843_arch.c test_imu_aspirin.CFLAGS += -DUSE_I2C2 -test_imu_aspirin.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +test_imu_aspirin.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c test_imu_aspirin.CFLAGS += -DUSE_EXTI15_10_IRQ # Gyro Int on PC14 test_imu_aspirin.CFLAGS += -DUSE_EXTI9_5_IRQ # Mag Int on PB5 test_imu_aspirin.CFLAGS += -DUSE_EXTI2_IRQ # Accel Int on PD2 @@ -422,7 +445,9 @@ test_imu_aspirin.CFLAGS += -DUSE_DMA1_C4_IRQ # SPI2 Rx DMA test_hmc5843.ARCHDIR = $(ARCH) test_hmc5843.CFLAGS = -I$(SRC_FIRMWARE) -I$(SRC_LISA) -I$(ARCH) -Ibooz -DPERIPHERALS_AUTO_INIT test_hmc5843.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_hmc5843.srcs = lisa/test/lisa_test_hmc5843.c \ +test_hmc5843.srcs = $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + lisa/test/lisa_test_hmc5843.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c test_hmc5843.CFLAGS += -DUSE_LED @@ -432,13 +457,13 @@ test_hmc5843.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_hmc5843.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_hmc5843.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_hmc5843.srcs += $(SRC_ARCH)/uart_hw.c +test_hmc5843.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_hmc5843.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_hmc5843.srcs += downlink.c pprz_transport.c test_hmc5843.CFLAGS += -DUSE_I2C2 -test_hmc5843.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +test_hmc5843.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c test_hmc5843.CFLAGS += -DIMU_OVERRIDE_CHANNELS test_hmc5843.CFLAGS += -DUSE_EXTI9_5_IRQ # Mag Int on PB5 @@ -449,7 +474,9 @@ test_hmc5843.CFLAGS += -DUSE_EXTI9_5_IRQ # Mag Int on PB5 test_itg3200.ARCHDIR = $(ARCH) test_itg3200.CFLAGS = -I$(SRC_FIRMWARE) -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT test_itg3200.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_itg3200.srcs += lisa/test/lisa_test_itg3200.c \ +test_itg3200.srcs += $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + lisa/test/lisa_test_itg3200.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c @@ -461,13 +488,13 @@ test_itg3200.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_itg3200.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_itg3200.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_itg3200.srcs += $(SRC_ARCH)/uart_hw.c +test_itg3200.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_itg3200.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_itg3200.srcs += downlink.c pprz_transport.c test_itg3200.CFLAGS += -DUSE_I2C2 -test_itg3200.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +test_itg3200.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c test_itg3200.CFLAGS += -DUSE_EXTI15_10_IRQ # Gyro Int on PC14 @@ -477,7 +504,9 @@ test_itg3200.CFLAGS += -DUSE_EXTI15_10_IRQ # Gyro Int on PC14 test_adxl345.ARCHDIR = $(ARCH) test_adxl345.CFLAGS = -I$(SRC_FIRMWARE) -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT test_adxl345.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_adxl345.srcs += lisa/test/lisa_test_adxl345_dma.c \ +test_adxl345.srcs += $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + lisa/test/lisa_test_adxl345_dma.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c @@ -489,7 +518,7 @@ test_adxl345.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_adxl345.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_adxl345.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_adxl345.srcs += $(SRC_ARCH)/uart_hw.c +test_adxl345.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_adxl345.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_adxl345.srcs += downlink.c pprz_transport.c @@ -505,7 +534,9 @@ test_adxl345.CFLAGS += -DUSE_DMA1_C4_IRQ # SPI2 Rx DMA test_esc_mkk_simple.ARCHDIR = $(ARCH) test_esc_mkk_simple.CFLAGS = -I$(SRC_FIRMWARE) -I$(SRC_LISA) -I$(ARCH) -DPERIPHERALS_AUTO_INIT test_esc_mkk_simple.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_esc_mkk_simple.srcs = test/test_esc_mkk_simple.c \ +test_esc_mkk_simple.srcs = $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + test/test_esc_mkk_simple.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c test_esc_mkk_simple.CFLAGS += -DUSE_LED @@ -514,7 +545,7 @@ test_esc_mkk_simple.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=$(SYS_TIME_LED) test_esc_mkk_simple.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_esc_mkk_simple.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_esc_mkk_simple.CFLAGS += -DUSE_I2C2 -test_esc_mkk_simple.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +test_esc_mkk_simple.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c test_esc_mkk_simple.CFLAGS += -DACTUATORS_MKK_DEV=i2c2 @@ -524,7 +555,9 @@ test_esc_mkk_simple.CFLAGS += -DACTUATORS_MKK_DEV=i2c2 test_esc_asctecv1_simple.ARCHDIR = $(ARCH) test_esc_asctecv1_simple.CFLAGS = -I$(SRC_FIRMWARE) -I$(SRC_LISA) -I$(ARCH) -DPERIPHERALS_AUTO_INIT test_esc_asctecv1_simple.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_esc_asctecv1_simple.srcs = test/test_esc_asctecv1_simple.c \ +test_esc_asctecv1_simple.srcs = $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + test/test_esc_asctecv1_simple.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c test_esc_asctecv1_simple.CFLAGS += -DUSE_LED @@ -533,7 +566,7 @@ test_esc_asctecv1_simple.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 test_esc_asctecv1_simple.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_esc_asctecv1_simple.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_esc_asctecv1_simple.CFLAGS += -DUSE_I2C1 -test_esc_asctecv1_simple.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +test_esc_asctecv1_simple.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c # @@ -542,7 +575,9 @@ test_esc_asctecv1_simple.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c test_actuators_mkk.ARCHDIR = $(ARCH) test_actuators_mkk.CFLAGS = -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -DPERIPHERALS_AUTO_INIT test_actuators_mkk.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_actuators_mkk.srcs = test/test_actuators.c \ +test_actuators_mkk.srcs = $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + test/test_actuators.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c @@ -554,7 +589,7 @@ test_actuators_mkk.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_actuators_mkk.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_actuators_mkk.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_actuators_mkk.srcs += $(SRC_ARCH)/uart_hw.c +test_actuators_mkk.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_actuators_mkk.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_actuators_mkk.srcs += downlink.c pprz_transport.c @@ -564,7 +599,7 @@ test_actuators_mkk.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c test_actuators_mkk.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c1 test_actuators_mkk.srcs += $(SRC_FIRMWARE)/actuators/supervision.c test_actuators_mkk.CFLAGS += -DUSE_I2C1 -test_actuators_mkk.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +test_actuators_mkk.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c # # test actuators asctecv1 @@ -572,7 +607,9 @@ test_actuators_mkk.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c test_actuators_asctecv1.ARCHDIR = $(ARCH) test_actuators_asctecv1.CFLAGS = -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -DPERIPHERALS_AUTO_INIT test_actuators_asctecv1.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_actuators_asctecv1.srcs = test/test_actuators.c \ +test_actuators_asctecv1.srcs = $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + test/test_actuators.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c @@ -584,7 +621,7 @@ test_actuators_asctecv1.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512 test_actuators_asctecv1.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_actuators_asctecv1.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_actuators_asctecv1.srcs += $(SRC_ARCH)/uart_hw.c +test_actuators_asctecv1.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_actuators_asctecv1.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_actuators_asctecv1.srcs += downlink.c pprz_transport.c @@ -593,7 +630,7 @@ test_actuators_asctecv1.srcs += $(SRC_BOOZ)/booz2_commands.c test_actuators_asctecv1.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c1 test_actuators_asctecv1.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c test_actuators_asctecv1.CFLAGS += -DUSE_I2C1 -test_actuators_asctecv1.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +test_actuators_asctecv1.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c # @@ -602,7 +639,9 @@ test_actuators_asctecv1.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c test_bmp085.ARCHDIR = $(ARCH) test_bmp085.CFLAGS = -I$(SRC_FIRMWARE) -I$(SRC_LISA) -I$(ARCH) -DPERIPHERALS_AUTO_INIT test_bmp085.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_bmp085.srcs = lisa/test/lisa_test_bmp085.c \ +test_bmp085.srcs = $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + lisa/test/lisa_test_bmp085.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c test_bmp085.CFLAGS += -DUSE_LED @@ -612,13 +651,13 @@ test_bmp085.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_bmp085.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_bmp085.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_bmp085.srcs += $(SRC_ARCH)/uart_hw.c +test_bmp085.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_bmp085.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_bmp085.srcs += downlink.c pprz_transport.c test_bmp085.CFLAGS += -DUSE_I2C2 -test_bmp085.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +test_bmp085.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c #test_bmp085.CFLAGS += -DIMU_OVERRIDE_CHANNELS #test_bmp085.CFLAGS += -DUSE_EXTI9_5_IRQ # Mag Int on PB5 @@ -630,7 +669,9 @@ test_bmp085.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c test_manual.ARCHDIR = $(ARCH) test_manual.CFLAGS = -I$(SRC_FIRMWARE) -I$(ARCH) -DPERIPHERALS_AUTO_INIT test_manual.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_manual.srcs = test/test_manual.c \ +test_manual.srcs = $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + test/test_manual.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c test_manual.CFLAGS += -DUSE_LED @@ -640,7 +681,7 @@ test_manual.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_manual.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_manual.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_manual.srcs += $(SRC_ARCH)/uart_hw.c +test_manual.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_manual.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_manual.srcs += downlink.c pprz_transport.c @@ -674,7 +715,9 @@ test_manual.srcs += $(SRC_SUBSYSTEMS)/radio_control.c tunnel.ARCHDIR = $(ARCH) tunnel.CFLAGS += -I$(SRC_LISA) -I$(ARCH) -DPERIPHERALS_AUTO_INIT tunnel.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -tunnel.srcs += $(SRC_LISA)/tunnel_hw.c \ +tunnel.srcs += $(SRC_AIRBORNE)/mcu.c \ + $(SRC_ARCH)/mcu_arch.c \ + $(SRC_LISA)/tunnel_hw.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c tunnel.CFLAGS += -DUSE_LED diff --git a/conf/autopilot/lisa_passthrough.makefile b/conf/autopilot/lisa_passthrough.makefile index 2241a70455..a61cf4bfe1 100644 --- a/conf/autopilot/lisa_passthrough.makefile +++ b/conf/autopilot/lisa_passthrough.makefile @@ -42,7 +42,7 @@ stm_passthrough.CFLAGS += -DDOWNLINK stm_passthrough.CFLAGS += -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 stm_passthrough.srcs += downlink.c pprz_transport.c stm_passthrough.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -stm_passthrough.srcs += $(SRC_ARCH)/uart_hw.c +stm_passthrough.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c # Link Overo stm_passthrough.CFLAGS += -DUSE_OVERO_LINK @@ -75,7 +75,7 @@ stm_passthrough.srcs += $(SRC_BOOZ)/booz2_commands.c #stm_passthrough.srcs += $(SRC_FIRMWARE)/actuators/supervision.c #stm_passthrough.CFLAGS += -DACTUATORS_ASCTEC_V2_PROTOCOL #stm_passthrough.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c -#stm_passthrough.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +#stm_passthrough.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c # #stm_passthrough.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c1 #stm_passthrough.CFLAGS += -DUSE_I2C1 @@ -91,7 +91,7 @@ stm_passthrough.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arc # Baro stm_passthrough.srcs += $(SRC_BOARD)/baro_board.c stm_passthrough.CFLAGS += -DUSE_I2C2 -stm_passthrough.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +stm_passthrough.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c # Vanes stm_passthrough.CFLAGS += -I $(SRC_CSC) diff --git a/conf/autopilot/obsolete/booz_test_progs.makefile b/conf/autopilot/obsolete/booz_test_progs.makefile index 1374184582..00fa88a447 100644 --- a/conf/autopilot/obsolete/booz_test_progs.makefile +++ b/conf/autopilot/obsolete/booz_test_progs.makefile @@ -77,7 +77,7 @@ test_telemetry.CFLAGS += -DUSE_$(MODEM_PORT) test_telemetry.CFLAGS += -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) test_telemetry.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_telemetry.srcs += downlink.c pprz_transport.c -test_telemetry.srcs += $(SRC_ARCH)/uart_hw.c +test_telemetry.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c # @@ -102,7 +102,7 @@ test_baro.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_baro.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_baro.srcs += downlink.c pprz_transport.c test_baro.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_baro.srcs += $(SRC_ARCH)/uart_hw.c +test_baro.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_baro.srcs += $(SRC_BOARD)/baro_board.c test_baro.CFLAGS += -DBOOZ2_ANALOG_BARO_PERIOD='SYS_TICS_OF_SEC((1./100.))' test_baro.CFLAGS += -DADC0_VIC_SLOT=2 @@ -146,7 +146,7 @@ test_rc_ppm.CFLAGS += -DTIME_LED=$(SYS_TIME_LED) test_rc_ppm.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_rc_ppm.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_rc_ppm.srcs += $(SRC_ARCH)/uart_hw.c +test_rc_ppm.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_rc_ppm.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_rc_ppm.srcs += downlink.c pprz_transport.c test_rc_ppm.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_LED=$(RADIO_CONTROL_LED) @@ -192,7 +192,7 @@ test_actuators_mkk.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_actuators_mkk.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_actuators_mkk.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_actuators_mkk.srcs += $(SRC_ARCH)/uart_hw.c +test_actuators_mkk.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_actuators_mkk.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_actuators_mkk.srcs += downlink.c pprz_transport.c @@ -223,7 +223,7 @@ test_ami601.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_ami601.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_ami601.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -test_ami601.srcs += $(SRC_ARCH)/uart_hw.c +test_ami601.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_ami601.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=$(MODEM_PORT) test_ami601.srcs += downlink.c pprz_transport.c diff --git a/conf/autopilot/conf_dc_mc.h b/conf/autopilot/obsolete/conf_dc_mc.h similarity index 100% rename from conf/autopilot/conf_dc_mc.h rename to conf/autopilot/obsolete/conf_dc_mc.h diff --git a/conf/autopilot/conf_wt.h b/conf/autopilot/obsolete/conf_wt.h similarity index 100% rename from conf/autopilot/conf_wt.h rename to conf/autopilot/obsolete/conf_wt.h diff --git a/conf/autopilot/csc.makefile b/conf/autopilot/obsolete/csc.makefile similarity index 94% rename from conf/autopilot/csc.makefile rename to conf/autopilot/obsolete/csc.makefile index 2f83265bca..f30151ea99 100644 --- a/conf/autopilot/csc.makefile +++ b/conf/autopilot/obsolete/csc.makefile @@ -46,14 +46,14 @@ ap.ARCHDIR = $(ARCHI) ap.CFLAGS += -I$(SRC_CSC) ap.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) ap.srcs += $(SRC_CSC)/csc_main.c -ap.CFLAGS += -DLED -DTIME_LED=1 +ap.CFLAGS += -DUSE_LED -DTIME_LED=1 ap.CFLAGS += -DCSC_BOARD_ID=$(CSC_ID) ap.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIMER0_VIC_SLOT=1 ap.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c -ap.srcs += $(SRC_ARCH)/uart_hw.c +ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c ap.srcs += $(SRC_ARCH)/adc_hw.c ap.CFLAGS += -DADC -DUSE_AD0 -DUSE_AD0_0 -DUSE_AD0_1 @@ -99,13 +99,13 @@ test_uart.ARCHDIR = $(ARCHI) test_uart.CFLAGS += -I$(SRC_CSC) test_uart.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_uart.srcs += $(SRC_CSC)/csc_test_uart.c -test_uart.CFLAGS += -DLED +test_uart.CFLAGS += -DUSE_LED # -DTIME_LED=1 test_uart.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIMER0_VIC_SLOT=1 test_uart.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c -test_uart.srcs += $(SRC_ARCH)/uart_hw.c +test_uart.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_uart.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -DUART1_VIC_SLOT=6 test_uart.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport \ @@ -123,7 +123,7 @@ test_can1.ARCHDIR = $(ARCHI) test_can1.CFLAGS += -I$(SRC_CSC) test_can1.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_can1.srcs += $(SRC_CSC)/test_can1.c -test_can1.CFLAGS += -DLED +test_can1.CFLAGS += -DUSE_LED # -DTIME_LED=1 test_can1.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIMER0_VIC_SLOT=1 diff --git a/conf/autopilot/csc_ap.makefile b/conf/autopilot/obsolete/csc_ap.makefile similarity index 95% rename from conf/autopilot/csc_ap.makefile rename to conf/autopilot/obsolete/csc_ap.makefile index ee88e9d2c1..d1d6b55322 100644 --- a/conf/autopilot/csc_ap.makefile +++ b/conf/autopilot/obsolete/csc_ap.makefile @@ -46,14 +46,14 @@ ap.ARCHDIR = $(ARCHI) ap.CFLAGS += -I$(SRC_CSC) ap.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) ap.srcs += $(SRC_CSC)/csc_ap_main.c -ap.CFLAGS += -DLED -DTIME_LED=1 +ap.CFLAGS += -DUSE_LED -DTIME_LED=1 ap.CFLAGS += -DCSC_BOARD_ID=$(CSC_ID) ap.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./40.))' -DTIMER0_VIC_SLOT=1 ap.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c -ap.srcs += $(SRC_ARCH)/uart_hw.c +ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c ap.srcs += $(SRC_ARCH)/adc_hw.c ap.CFLAGS += -DADC -DUSE_AD0 -DUSE_AD0_0 -DUSE_AD0_1 @@ -102,13 +102,13 @@ test_uart.ARCHDIR = $(ARCHI) test_uart.CFLAGS += -I$(SRC_CSC) test_uart.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_uart.srcs += $(SRC_CSC)/csc_test_uart.c -test_uart.CFLAGS += -DLED +test_uart.CFLAGS += -DUSE_LED # -DTIME_LED=1 test_uart.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIMER0_VIC_SLOT=1 test_uart.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c -test_uart.srcs += $(SRC_ARCH)/uart_hw.c +test_uart.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_uart.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -DUART1_VIC_SLOT=6 test_uart.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport \ diff --git a/conf/autopilot/csc_baro.makefile b/conf/autopilot/obsolete/csc_baro.makefile similarity index 100% rename from conf/autopilot/csc_baro.makefile rename to conf/autopilot/obsolete/csc_baro.makefile diff --git a/conf/autopilot/csc_board_v1_0.h b/conf/autopilot/obsolete/csc_board_v1_0.h similarity index 100% rename from conf/autopilot/csc_board_v1_0.h rename to conf/autopilot/obsolete/csc_board_v1_0.h diff --git a/conf/autopilot/obsolete/lisa_test_progs.makefile b/conf/autopilot/obsolete/lisa_test_progs.makefile index 24bf199dbf..1a48c121c4 100644 --- a/conf/autopilot/obsolete/lisa_test_progs.makefile +++ b/conf/autopilot/obsolete/lisa_test_progs.makefile @@ -186,7 +186,7 @@ test_uart.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 test_uart.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_uart.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_uart.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_uart.srcs += $(SRC_ARCH)/uart_hw.c +test_uart.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c @@ -205,7 +205,7 @@ test_telemetry1.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 test_telemetry1.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_telemetry1.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_telemetry1.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_telemetry1.srcs += $(SRC_ARCH)/uart_hw.c +test_telemetry1.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_telemetry1.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_telemetry1.srcs += downlink.c pprz_transport.c @@ -225,7 +225,7 @@ test_telemetry2.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 test_telemetry2.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_telemetry2.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_telemetry2.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_telemetry2.srcs += $(SRC_ARCH)/uart_hw.c +test_telemetry2.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_telemetry2.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_telemetry2.srcs += downlink.c pprz_transport.c @@ -245,7 +245,7 @@ test_telemetry3.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 test_telemetry3.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_telemetry3.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_telemetry3.CFLAGS += -DUSE_UART3 -DUART3_BAUD=B57600 -test_telemetry3.srcs += $(SRC_ARCH)/uart_hw.c +test_telemetry3.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_telemetry3.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart3 test_telemetry3.srcs += downlink.c pprz_transport.c @@ -264,11 +264,11 @@ test_datalink.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 test_datalink.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_datalink.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_datalink.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_datalink.srcs += $(SRC_ARCH)/uart_hw.c +test_datalink.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_datalink.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_datalink.srcs += downlink.c pprz_transport.c test_datalink.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart2 -#test_datalink.srcs += $(SRC_BOOZ)/booz2_datalink.c +#test_datalink.srcs += $(SRC_FIRMWARE)/datalink.c # # tunnel @@ -296,7 +296,7 @@ tunnel.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 #tunnel.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B115200 #tunnel.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B115200 -tunnel.srcs += $(SRC_ARCH)/uart_hw.c +tunnel.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c @@ -315,7 +315,7 @@ test_float.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 test_float.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_float.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_float.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_float.srcs += $(SRC_ARCH)/uart_hw.c +test_float.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_float.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_float.srcs += downlink.c pprz_transport.c test_float.srcs += lisa/plug_sys.c @@ -352,7 +352,7 @@ test_rc_24.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_rc_24.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_rc_24.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_rc_24.srcs += $(SRC_ARCH)/uart_hw.c +test_rc_24.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_rc_24.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_rc_24.srcs += downlink.c pprz_transport.c @@ -363,7 +363,7 @@ test_rc_24.CFLAGS += -DUSE_UART3 -DUART3_BAUD=B115200 test_rc_24.CFLAGS += -DRADIO_CONTROL_LINK=Uart3 test_rc_24.srcs += $(SRC_SUBSYSTEMS)/radio_control.c \ $(SRC_BOOZ)/subsystems/radio_control/spektrum.c -# $(SRC_ARCH)/uart_hw.c +# $(SRC_ARCH)/mcu_periph/uart_arch.c # @@ -389,7 +389,7 @@ test_servos.srcs += $(SRC_FIRMWARE)/actuators/actuators_pwm.c $(SRC_FIRMWARE)/ac #test_servos.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -#test_servos.srcs += $(SRC_ARCH)/uart_hw.c +#test_servos.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c #test_servos.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 #test_servos.srcs += downlink.c pprz_transport.c @@ -416,7 +416,7 @@ test_imu_b2.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_imu_b2.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_imu_b2.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_imu_b2.srcs += $(SRC_ARCH)/uart_hw.c +test_imu_b2.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_imu_b2.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_imu_b2.srcs += downlink.c pprz_transport.c @@ -424,12 +424,12 @@ test_imu_b2.srcs += downlink.c pprz_transport.c test_imu_b2.srcs += math/pprz_trig_int.c test_imu_b2.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" -test_imu_b2.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 +test_imu_b2.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2100 test_imu_b2.srcs += $(SRC_SUBSYSTEMS)/imu.c test_imu_b2.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ test_imu_b2.srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c $(SRC_SUBSYSTEMS)/imu/arch/$(ARCH)/imu_b2_arch.c test_imu_b2.srcs += peripherals/max1168.c $(SRC_ARCH)/peripherals/max1168_arch.c -test_imu_b2.srcs += peripherals/ms2001.c $(SRC_ARCH)/peripherals/ms2001_arch.c +test_imu_b2.srcs += peripherals/ms2100.c $(SRC_ARCH)/peripherals/ms2100_arch.c # @@ -450,7 +450,7 @@ test_imu_crista.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_imu_crista.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_imu_crista.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_imu_crista.srcs += $(SRC_ARCH)/uart_hw.c +test_imu_crista.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_imu_crista.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_imu_crista.srcs += downlink.c pprz_transport.c @@ -482,7 +482,7 @@ test_imu_aspirin.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_imu_aspirin.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_imu_aspirin.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_imu_aspirin.srcs += $(SRC_ARCH)/uart_hw.c +test_imu_aspirin.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_imu_aspirin.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_imu_aspirin.srcs += downlink.c pprz_transport.c @@ -558,7 +558,7 @@ test_mc_asctec_v1_simple.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_mc_asctec_v1_simple.CFLAGS += -DUSE_I2C1 test_mc_asctec_v1_simple.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c test_mc_asctec_v1_simple.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_mc_asctec_v1_simple.srcs += $(SRC_ARCH)/uart_hw.c +test_mc_asctec_v1_simple.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_mc_asctec_v1_simple.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_mc_asctec_v1_simple.srcs += downlink.c pprz_transport.c @@ -602,7 +602,7 @@ test_actuators_mkk.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_actuators_mkk.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_actuators_mkk.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_actuators_mkk.srcs += $(SRC_ARCH)/uart_hw.c +test_actuators_mkk.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_actuators_mkk.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_actuators_mkk.srcs += downlink.c pprz_transport.c @@ -635,7 +635,7 @@ test_actuators_asctec.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.) test_actuators_asctec.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_actuators_asctec.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_actuators_asctec.srcs += $(SRC_ARCH)/uart_hw.c +test_actuators_asctec.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_actuators_asctec.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_actuators_asctec.srcs += downlink.c pprz_transport.c @@ -686,7 +686,7 @@ test_baro.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_baro.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_baro.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_baro.srcs += $(SRC_ARCH)/uart_hw.c +test_baro.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_baro.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_baro.srcs += downlink.c pprz_transport.c @@ -708,7 +708,7 @@ test_baro2.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_baro2.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_baro2.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_baro2.srcs += $(SRC_ARCH)/uart_hw.c +test_baro2.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_baro2.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_baro2.srcs += downlink.c pprz_transport.c @@ -734,7 +734,7 @@ test_baro3.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_baro3.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_baro3.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_baro3.srcs += $(SRC_ARCH)/uart_hw.c +test_baro3.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_baro3.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_baro3.srcs += downlink.c pprz_transport.c @@ -760,7 +760,7 @@ test_spi_slave.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_spi_slave.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_spi_slave.CFLAGS += -DUSE_SPI1_IRQ test_spi_slave.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_spi_slave.srcs += $(SRC_ARCH)/uart_hw.c +test_spi_slave.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_spi_slave.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_spi_slave.srcs += downlink.c pprz_transport.c @@ -780,7 +780,7 @@ test_spi_slave2.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 test_spi_slave2.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_spi_slave2.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_spi_slave2.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_spi_slave2.srcs += $(SRC_ARCH)/uart_hw.c +test_spi_slave2.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_spi_slave2.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_spi_slave2.srcs += downlink.c pprz_transport.c @@ -804,7 +804,7 @@ stm_test_spi_link.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' stm_test_spi_link.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c stm_test_spi_link.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -stm_test_spi_link.srcs += $(SRC_ARCH)/uart_hw.c +stm_test_spi_link.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c stm_test_spi_link.CFLAGS += -DUSE_OVERO_LINK -DOVERO_LINK_MSG_UP=AutopilotMessageFoo -DOVERO_LINK_MSG_DOWN=AutopilotMessageFoo stm_test_spi_link.CFLAGS += -DOVERO_LINK_LED_OK=3 -DOVERO_LINK_LED_KO=2 -DUSE_DMA1_C2_IRQ @@ -844,7 +844,7 @@ test_sc18is600.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./128.))' test_sc18is600.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_sc18is600.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_sc18is600.srcs += $(SRC_ARCH)/uart_hw.c +test_sc18is600.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_sc18is600.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_sc18is600.srcs += downlink.c pprz_transport.c @@ -878,39 +878,39 @@ test_max1168.srcs += peripherals/max1168.c \ $(SRC_ARCH)/peripherals/max1168_arch.c test_max1168.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_max1168.srcs += $(SRC_ARCH)/uart_hw.c +test_max1168.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_max1168.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 test_max1168.srcs += downlink.c pprz_transport.c # -# test ms2001 +# test ms2100 # -test_ms2001.ARCHDIR = $(ARCH) -test_ms2001.CFLAGS = -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT -test_ms2001.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -test_ms2001.srcs = $(SRC_LISA)/test/lisa_test_ms2001.c \ +test_ms2100.ARCHDIR = $(ARCH) +test_ms2100.CFLAGS = -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT +test_ms2100.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) +test_ms2100.srcs = $(SRC_LISA)/test/lisa_test_ms2100.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c -test_ms2001.CFLAGS += -DUSE_LED -test_ms2001.srcs += $(SRC_ARCH)/led_hw.c +test_ms2100.CFLAGS += -DUSE_LED +test_ms2100.srcs += $(SRC_ARCH)/led_hw.c -test_ms2001.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 -test_ms2001.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' -test_ms2001.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c +test_ms2100.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 +test_ms2100.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' +test_ms2100.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -test_ms2001.CFLAGS += -DUSE_SPI2 -test_ms2001.CFLAGS += -DUSE_DMA1_C4_IRQ -DMS2001_HANDLES_DMA_IRQ -test_ms2001.CFLAGS += -DUSE_SPI2_IRQ -DMS2001_HANDLES_SPI_IRQ -test_ms2001.srcs += peripherals/ms2001.c \ - $(SRC_ARCH)/peripherals/ms2001_arch.c +test_ms2100.CFLAGS += -DUSE_SPI2 +test_ms2100.CFLAGS += -DUSE_DMA1_C4_IRQ -DMS2100_HANDLES_DMA_IRQ +test_ms2100.CFLAGS += -DUSE_SPI2_IRQ -DMS2100_HANDLES_SPI_IRQ +test_ms2100.srcs += peripherals/ms2100.c \ + $(SRC_ARCH)/peripherals/ms2100_arch.c -test_ms2001.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -test_ms2001.srcs += $(SRC_ARCH)/uart_hw.c +test_ms2100.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 +test_ms2100.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c -test_ms2001.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 -test_ms2001.srcs += downlink.c pprz_transport.c +test_ms2100.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 +test_ms2100.srcs += downlink.c pprz_transport.c # # test adxl345 @@ -930,7 +930,7 @@ test_adxl345.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_adxl345.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_adxl345.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_adxl345.srcs += $(SRC_ARCH)/uart_hw.c +test_adxl345.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_adxl345.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_adxl345.srcs += downlink.c pprz_transport.c @@ -955,7 +955,7 @@ test_adxl345_dma.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_adxl345_dma.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_adxl345_dma.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_adxl345_dma.srcs += $(SRC_ARCH)/uart_hw.c +test_adxl345_dma.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_adxl345_dma.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_adxl345_dma.srcs += downlink.c pprz_transport.c @@ -984,7 +984,7 @@ test_itg3200.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_itg3200.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_itg3200.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_itg3200.srcs += $(SRC_ARCH)/uart_hw.c +test_itg3200.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_itg3200.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_itg3200.srcs += downlink.c pprz_transport.c @@ -1010,7 +1010,7 @@ test_hmc5843.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_hmc5843.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_hmc5843.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_hmc5843.srcs += $(SRC_ARCH)/uart_hw.c +test_hmc5843.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_hmc5843.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_hmc5843.srcs += downlink.c pprz_transport.c @@ -1042,7 +1042,7 @@ test_aspirin.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' test_aspirin.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_aspirin.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_aspirin.srcs += $(SRC_ARCH)/uart_hw.c +test_aspirin.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_aspirin.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_aspirin.srcs += downlink.c pprz_transport.c @@ -1086,18 +1086,18 @@ ptw.srcs += lisa/lisa_overo_link.c lisa/arch/stm32/lisa_overo_link_arch.c # Telemetry ptw.CFLAGS += -DUSE_OVERO_LINK_TELEMETRY #ptw.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -#ptw.srcs += $(SRC_ARCH)/uart_hw.c +#ptw.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c ptw.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=OveroLinkTelemetry ptw.srcs += downlink.c pprz_transport.c # IMU ptw.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" -ptw.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 +ptw.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2100 ptw.srcs += $(SRC_SUBSYSTEMS)/imu.c ptw.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ ptw.srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c $(SRC_SUBSYSTEMS)/imu/arch/$(ARCH)/imu_b2_arch.c ptw.srcs += peripherals/max1168.c $(SRC_ARCH)/peripherals/max1168_arch.c -ptw.srcs += peripherals/ms2001.c $(SRC_ARCH)/peripherals/ms2001_arch.c +ptw.srcs += peripherals/ms2100.c $(SRC_ARCH)/peripherals/ms2100_arch.c ptw.srcs += math/pprz_trig_int.c ptw.srcs += $(SRC_BOOZ)/booz2_commands.c @@ -1111,7 +1111,7 @@ ptw.srcs += $(SRC_SUBSYSTEMS)/radio_control.c \ ptw.CFLAGS += -DRADIO_CONTROL_LED=6 ptw.CFLAGS += -DUSE_UART3 -DUART3_BAUD=B115200 ptw.CFLAGS += -DRADIO_CONTROL_LINK=Uart3 -ptw.srcs += $(SRC_ARCH)/uart_hw.c +ptw.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c # Actuators ptw.srcs += $(SRC_FIRMWARE)/actuators/supervision.c @@ -1138,7 +1138,7 @@ test_csc_servo.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_csc_servo.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_csc_servo.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_csc_servo.srcs += $(SRC_ARCH)/uart_hw.c +test_csc_servo.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_csc_servo.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart2 test_csc_servo.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 @@ -1176,7 +1176,7 @@ test_gps.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LE test_gps.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_gps.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_gps.srcs += $(SRC_ARCH)/uart_hw.c +test_gps.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_gps.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 test_gps.srcs += downlink.c pprz_transport.c @@ -1207,7 +1207,7 @@ test_gps.srcs += $(SRC_BOOZ)/gps/booz_gps_skytraq.c # test_adc.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c # # test_adc.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -# test_adc.srcs += $(SRC_ARCH)/uart_hw.c +# test_adc.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c # # test_adc.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 # test_adc.srcs += downlink.c pprz_transport.c @@ -1231,7 +1231,7 @@ test_adc.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_adc.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_adc.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_adc.srcs += $(SRC_ARCH)/uart_hw.c +test_adc.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_adc.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart2 test_adc.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 @@ -1259,7 +1259,7 @@ test_board.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' test_board.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c test_board.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -test_board.srcs += $(SRC_ARCH)/uart_hw.c +test_board.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_board.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart2 test_board.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 @@ -1305,7 +1305,7 @@ hs_gyro_aspirin.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' hs_gyro_aspirin.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c hs_gyro_aspirin.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -hs_gyro_aspirin.srcs += $(SRC_ARCH)/uart_hw.c +hs_gyro_aspirin.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c hs_gyro_aspirin.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 hs_gyro_aspirin.srcs += downlink.c pprz_transport.c @@ -1343,7 +1343,7 @@ hs_gyro_b2.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' hs_gyro_b2.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c hs_gyro_b2.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -hs_gyro_b2.srcs += $(SRC_ARCH)/uart_hw.c +hs_gyro_b2.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c hs_gyro_b2.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 hs_gyro_b2.srcs += downlink.c pprz_transport.c @@ -1351,12 +1351,12 @@ hs_gyro_b2.srcs += downlink.c pprz_transport.c hs_gyro_b2.srcs += math/pprz_trig_int.c hs_gyro_b2.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" -hs_gyro_b2.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 +hs_gyro_b2.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2100 hs_gyro_b2.srcs += $(SRC_SUBSYSTEMS)/imu.c hs_gyro_b2.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ hs_gyro_b2.srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c $(SRC_SUBSYSTEMS)/imu/arch/$(ARCH)/imu_b2_arch.c hs_gyro_b2.srcs += peripherals/max1168.c $(SRC_ARCH)/peripherals/max1168_arch.c -hs_gyro_b2.srcs += peripherals/ms2001.c $(SRC_ARCH)/peripherals/ms2001_arch.c +hs_gyro_b2.srcs += peripherals/ms2100.c $(SRC_ARCH)/peripherals/ms2100_arch.c # # Spits every samples of one axis of gyro on IMU crista @@ -1376,7 +1376,7 @@ hs_gyro_crista.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' hs_gyro_crista.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c hs_gyro_crista.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 -hs_gyro_crista.srcs += $(SRC_ARCH)/uart_hw.c +hs_gyro_crista.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c hs_gyro_crista.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 hs_gyro_crista.srcs += downlink.c pprz_transport.c diff --git a/conf/autopilot/mercury.makefile b/conf/autopilot/obsolete/mercury.makefile similarity index 96% rename from conf/autopilot/mercury.makefile rename to conf/autopilot/obsolete/mercury.makefile index 1c2a5b1a9e..0bf68c81ef 100644 --- a/conf/autopilot/mercury.makefile +++ b/conf/autopilot/obsolete/mercury.makefile @@ -49,7 +49,7 @@ ap.ARCHDIR = $(ARCHI) ap.CFLAGS += -I$(SRC_CSC) -I$(SRC_BOOZ) -I$(SRC_CSC_ARCH) ap.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) ap.srcs += $(SRC_CSC)/mercury_main.c -ap.CFLAGS += -DLED -DTIME_LED=1 +ap.CFLAGS += -DUSE_LED -DTIME_LED=1 ap.CFLAGS += -DAHRS_ALIGNER_LED=2 ap.CFLAGS += -DCSC_BOARD_ID=$(CSC_ID) @@ -57,7 +57,7 @@ ap.CFLAGS += -DCSC_BOARD_ID=$(CSC_ID) ap.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIMER0_VIC_SLOT=1 ap.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c -ap.srcs += $(SRC_ARCH)/uart_hw.c +ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c ap.srcs += $(SRC_ARCH)/adc_hw.c ap.CFLAGS += -DADC -DUSE_AD0 -DUSE_AD0_0 -DUSE_AD0_1 @@ -128,13 +128,13 @@ test_uart.ARCHDIR = $(ARCHI) test_uart.CFLAGS += -I$(SRC_CSC) test_uart.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_uart.srcs += $(SRC_CSC)/csc_test_uart.c -test_uart.CFLAGS += -DLED +test_uart.CFLAGS += -DUSE_LED # -DTIME_LED=1 test_uart.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIMER0_VIC_SLOT=1 test_uart.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c -test_uart.srcs += $(SRC_ARCH)/uart_hw.c +test_uart.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_uart.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -DUART1_VIC_SLOT=6 test_uart.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport \ diff --git a/conf/autopilot/mercury_csc.makefile b/conf/autopilot/obsolete/mercury_csc.makefile similarity index 94% rename from conf/autopilot/mercury_csc.makefile rename to conf/autopilot/obsolete/mercury_csc.makefile index 1515defa7b..b8f5cd04e8 100644 --- a/conf/autopilot/mercury_csc.makefile +++ b/conf/autopilot/obsolete/mercury_csc.makefile @@ -47,7 +47,7 @@ ap.ARCHDIR = $(ARCH) ap.CFLAGS += -I$(SRC_CSC) -I$(SRC_CSC_ARCH) ap.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) ap.srcs += $(SRC_CSC)/mercury_csc_main.c -ap.CFLAGS += -DLED -DTIME_LED=1 +ap.CFLAGS += -DUSE_LED -DTIME_LED=1 ap.CFLAGS += -DCSC_BOARD_ID=$(CSC_ID) @@ -79,7 +79,7 @@ ap.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B57600 -DUART0_VIC_SLOT=5 ap.CFLAGS += -DACTUATORS=\"servos_direct_hw.h\" ap.srcs += actuators.c -ap.srcs += $(SRC_ARCH)/uart_hw.c +ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c ap.srcs += $(SRC_ARCH)/servos_direct_hw.c ap.srcs += $(SRC_CSC)/csc_servos.c ap.srcs += $(SRC_CSC)/csc_bat_monitor.c @@ -98,13 +98,13 @@ test_uart.ARCHDIR = $(ARCH) test_uart.CFLAGS += -I$(SRC_CSC) test_uart.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_uart.srcs += $(SRC_CSC)/csc_test_uart.c -test_uart.CFLAGS += -DLED +test_uart.CFLAGS += -DUSE_LED # -DTIME_LED=1 test_uart.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIMER0_VIC_SLOT=1 test_uart.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c -test_uart.srcs += $(SRC_ARCH)/uart_hw.c +test_uart.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c test_uart.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -DUART1_VIC_SLOT=6 test_uart.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport \ @@ -122,7 +122,7 @@ test_can1.ARCHDIR = $(ARCH) test_can1.CFLAGS += -I$(SRC_CSC) test_can1.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_can1.srcs += $(SRC_CSC)/test_can1.c -test_can1.CFLAGS += -DLED +test_can1.CFLAGS += -DUSE_LED # -DTIME_LED=1 test_can1.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIMER0_VIC_SLOT=1 diff --git a/conf/autopilot/pwm_input.makefile b/conf/autopilot/obsolete/pwm_input.makefile similarity index 100% rename from conf/autopilot/pwm_input.makefile rename to conf/autopilot/obsolete/pwm_input.makefile diff --git a/conf/autopilot/subsystems/fixedwing/testing.makefile b/conf/autopilot/obsolete/testing.makefile similarity index 73% rename from conf/autopilot/subsystems/fixedwing/testing.makefile rename to conf/autopilot/obsolete/testing.makefile index f1b539ccfc..f75a6c8ab0 100644 --- a/conf/autopilot/subsystems/fixedwing/testing.makefile +++ b/conf/autopilot/obsolete/testing.makefile @@ -3,23 +3,23 @@ # a test program to setup actuators setup_actuators.ARCHDIR = $(ARCH) -setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART0 -DUART0_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 -setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4015_hw.c main.c +setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DUSE_LED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART0 -DUART0_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 +setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/mcu_periph/uart_arch.c $(SRC_ARCH)/servos_4015_hw.c main.c # a test program to tunnel between both uart tunnel.ARCHDIR = $(ARCH) -tunnel.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DLED +tunnel.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DUSE_LED tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c # A test program to monitor the ADC values test_adcs.ARCHDIR = $(ARCH) -test_adcs.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 -DUSE_ADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_ADC_6 -DUSE_ADC_7 +test_adcs.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 -DUSE_ADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_ADC_6 -DUSE_ADC_7 test_adcs.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -test_adcs.srcs += downlink.c $(SRC_ARCH)/uart_hw.c xbee.c +test_adcs.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c xbee.c test_adcs.srcs += sys_time.c $(SRC_ARCH)/mcu_periph/adc_arch.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test/test_adcs.c # pprz_transport.c @@ -28,16 +28,16 @@ test_adcs.srcs += sys_time.c $(SRC_ARCH)/mcu_periph/adc_arch.c $(SRC_ARCH)/sys_t # a configuration program to access both uart through usb usb_tunnel_0.ARCHDIR = $(ARCH) usb_tunnel_0.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DUSE_UART0 -DUART0_BAUD=B115200 -usb_tunnel_0.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DLED -usb_tunnel_0.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/uart_hw.c +usb_tunnel_0.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DUSE_LED +usb_tunnel_0.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/mcu_periph/uart_arch.c usb_tunnel_0.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbinit.c usb_tunnel_0.srcs += $(SRC_ARCH)/lpcusb/usbcontrol.c $(SRC_ARCH)/lpcusb/usbstdreq.c usb_tunnel_0.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c usb_tunnel_1.ARCHDIR = $(ARCH) usb_tunnel_1.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DUSE_UART1 -DUART1_BAUD=B115200 -usb_tunnel_1.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DLED -usb_tunnel_1.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/uart_hw.c +usb_tunnel_1.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DUSE_LED +usb_tunnel_1.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/mcu_periph/uart_arch.c usb_tunnel_1.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbinit.c usb_tunnel_1.srcs += $(SRC_ARCH)/lpcusb/usbcontrol.c $(SRC_ARCH)/lpcusb/usbstdreq.c usb_tunnel_1.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c diff --git a/conf/autopilot/obsolete/tiny.makefile b/conf/autopilot/obsolete/tiny.makefile index b9ef9f08fc..71df9d2cea 100644 --- a/conf/autopilot/obsolete/tiny.makefile +++ b/conf/autopilot/obsolete/tiny.makefile @@ -32,23 +32,23 @@ ADC_GYRO_NB_SAMPLES = 16 # a test program to setup actuators setup_actuators.ARCHDIR = $(ARCHI) -setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART0 -DUART0_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 -setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4015_hw.c main.c +setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DUSE_LED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART0 -DUART0_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 +setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/mcu_periph/uart_arch.c $(SRC_ARCH)/servos_4015_hw.c main.c # a test program to tunnel between both uart tunnel.ARCHDIR = $(ARCHI) -tunnel.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DLED +tunnel.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DUSE_LED tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c # A test program to monitor the ADC values test_adcs.ARCHDIR = $(ARCHI) -test_adcs.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_ADC_6 -DUSE_ADC_7 +test_adcs.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DUSE_LED -DTIME_LED=1 -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_ADC_6 -DUSE_ADC_7 test_adcs.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 -test_adcs.srcs += downlink.c $(SRC_ARCH)/uart_hw.c xbee.c +test_adcs.srcs += downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c xbee.c test_adcs.srcs += sys_time.c $(SRC_ARCH)/adc_hw.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_adcs.c # pprz_transport.c @@ -57,16 +57,16 @@ test_adcs.srcs += sys_time.c $(SRC_ARCH)/adc_hw.c $(SRC_ARCH)/sys_time_hw.c $(SR # a configuration program to access both uart through usb usb_tunnel_0.ARCHDIR = $(ARCHI) usb_tunnel_0.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DUSE_UART0 -DUART0_BAUD=B115200 -usb_tunnel_0.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DLED -usb_tunnel_0.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/uart_hw.c +usb_tunnel_0.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DUSE_LED +usb_tunnel_0.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/mcu_periph/uart_arch.c usb_tunnel_0.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbinit.c usb_tunnel_0.srcs += $(SRC_ARCH)/lpcusb/usbcontrol.c $(SRC_ARCH)/lpcusb/usbstdreq.c usb_tunnel_0.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c usb_tunnel_1.ARCHDIR = $(ARCHI) usb_tunnel_1.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DUSE_UART1 -DUART1_BAUD=B115200 -usb_tunnel_1.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DLED -usb_tunnel_1.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/uart_hw.c +usb_tunnel_1.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DUSE_LED +usb_tunnel_1.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/mcu_periph/uart_arch.c usb_tunnel_1.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbinit.c usb_tunnel_1.srcs += $(SRC_ARCH)/lpcusb/usbcontrol.c $(SRC_ARCH)/lpcusb/usbstdreq.c usb_tunnel_1.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c diff --git a/conf/autopilot/obsolete/twin_mcu_avr.makefile b/conf/autopilot/obsolete/twin_mcu_avr.makefile index 49a4e0b050..04ef99b046 100644 --- a/conf/autopilot/obsolete/twin_mcu_avr.makefile +++ b/conf/autopilot/obsolete/twin_mcu_avr.makefile @@ -1,8 +1,8 @@ include $(PAPARAZZI_SRC)/conf/autopilot/twin_avr.makefile include $(PAPARAZZI_SRC)/conf/autopilot/twin_mcu.makefile -ap.srcs += $(SRC_ARCH)/adc_hw.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/spi_hw.c $(SRC_ARCH)/sys_time_hw.c +ap.srcs += $(SRC_ARCH)/adc_hw.c $(SRC_ARCH)/mcu_periph/uart_arch.c $(SRC_ARCH)/spi_hw.c $(SRC_ARCH)/sys_time_hw.c ap.CFLAGS += -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 fbw.CFLAGS += -DACTUATORS=\"servos_4017.h\" -DSERVOS_4017 -DADC -fbw.srcs += actuators.c $(SRC_ARCH)/adc_hw.c $(SRC_ARCH)/servos_4017.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/spi_hw.c $(SRC_ARCH)/sys_time_hw.c +fbw.srcs += actuators.c $(SRC_ARCH)/adc_hw.c $(SRC_ARCH)/servos_4017.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/mcu_periph/uart_arch.c $(SRC_ARCH)/spi_hw.c $(SRC_ARCH)/sys_time_hw.c diff --git a/conf/autopilot/vane_sensor.makefile b/conf/autopilot/obsolete/vane_sensor.makefile similarity index 100% rename from conf/autopilot/vane_sensor.makefile rename to conf/autopilot/obsolete/vane_sensor.makefile diff --git a/conf/autopilot/rotorcraft.makefile b/conf/autopilot/rotorcraft.makefile index 07274c0b94..8966f4bed8 100644 --- a/conf/autopilot/rotorcraft.makefile +++ b/conf/autopilot/rotorcraft.makefile @@ -23,13 +23,6 @@ # # -# -# Expected from board file or overriden as xml param : -# -# MODEM_PORT -# MODEM_BAUD -# - CFG_SHARED=$(PAPARAZZI_SRC)/conf/autopilot/subsystems/shared CFG_ROTORCRAFT=$(PAPARAZZI_SRC)/conf/autopilot/subsystems/rotorcraft @@ -79,12 +72,16 @@ ifeq ($(ARCH), stm32) ap.srcs += $(SRC_ARCH)/led_hw.c endif +# frequency of main periodic +ifndef PERIODIC_FREQUENCY +PERIODIC_FREQUENCY = 512 +endif +$(TARGET).CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./$(PERIODIC_FREQUENCY).))' -DPERIODIC_FREQUENCY=$(PERIODIC_FREQUENCY) # # Systime # ap.CFLAGS += -DUSE_SYS_TIME ap.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c -ap.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' ifeq ($(ARCH), stm32) ap.CFLAGS += -DSYS_TIME_LED=$(SYS_TIME_LED) endif @@ -92,21 +89,15 @@ endif # # Telemetry/Datalink # +# include subsystems/rotorcraft/telemetry_transparent.makefile +# or +# include subsystems/rotorcraft/telemetry_xbee_api.makefile +# ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c -ap.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -ap.CFLAGS += -DDOWNLINK_DEVICE=$(MODEM_PORT) -ap.srcs += $(SRC_FIRMWARE)/telemetry.c \ - downlink.c \ - pprz_transport.c -ap.CFLAGS += -DDATALINK=PPRZ -ap.CFLAGS += -DPPRZ_UART=$(MODEM_PORT) -ap.srcs += $(SRC_BOOZ)/booz2_datalink.c -ap.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) - -ifeq ($(ARCH), lpc21) -ap.CFLAGS += -D$(MODEM_PORT)_VIC_SLOT=6 -endif +# I2C is needed for speed controllers and barometers on lisa +ap.srcs += mcu_periph/i2c.c +ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c ap.srcs += $(SRC_BOOZ)/booz2_commands.c @@ -212,7 +203,7 @@ ap.srcs += math/pprz_geodetic_int.c math/pprz_geodetic_float.c math/pprz_geodeti # vertical filter float version ap.srcs += $(SRC_SUBSYSTEMS)/ins/vf_float.c -ap.CFLAGS += -DUSE_VFF -DDT_VFILTER='(1./512.)' +ap.CFLAGS += -DUSE_VFF -DDT_VFILTER='(1./$(PERIODIC_FREQUENCY).)' ap.srcs += $(SRC_FIRMWARE)/navigation.c diff --git a/conf/autopilot/rotorcraft.xml b/conf/autopilot/rotorcraft.xml index 2f6282417b..93467a93ff 100644 --- a/conf/autopilot/rotorcraft.xml +++ b/conf/autopilot/rotorcraft.xml @@ -2,10 +2,10 @@ description="autopilot and simulator for rotorcrafts"> - + - + @@ -13,13 +13,13 @@ - - + + - - + + diff --git a/conf/autopilot/setup.makefile b/conf/autopilot/setup.makefile index c889667725..b71b547167 100644 --- a/conf/autopilot/setup.makefile +++ b/conf/autopilot/setup.makefile @@ -12,72 +12,66 @@ SRC_FIRMWARE=firmwares/setup SETUP_INC = -I$(SRC_FIRMWARE) - -# for the usb_tunnel we need to set PCLK higher -# so we just use tiny_2_1_1_usb.h as board file for the usb tunnels -ifeq ($(TARGET), usb_tunnel_0) - usb_tunnel_0.CFLAGS += -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -else - ifeq ($(TARGET), usb_tunnel_1) - usb_tunnel_1.CFLAGS += -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" - else - $(TARGET).CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) - endif -endif - +$(TARGET).CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) # a test program to tunnel between both uart -tunnel.CFLAGS += -DFBW -DLED +tunnel.CFLAGS += -DUSE_LED tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c +tunnel.srcs += mcu.c $(SRC_ARCH)/mcu_arch.c +# for the usb_tunnel we need to set PCLK higher with the flag USE_USB_HIGH_PCLK + # a configuration program to access both uart through usb -usb_tunnel_0.CFLAGS += -DFBW -DUSE_UART0 -DUART0_BAUD=B115200 -usb_tunnel_0.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DLED -usb_tunnel_0.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/uart_hw.c +usb_tunnel_0.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B115200 -DPERIPHERALS_AUTO_INIT +usb_tunnel_0.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DUSE_LED -DUSE_USB_HIGH_PCLK +usb_tunnel_0.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/mcu_periph/uart_arch.c usb_tunnel_0.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbinit.c usb_tunnel_0.srcs += $(SRC_ARCH)/lpcusb/usbcontrol.c $(SRC_ARCH)/lpcusb/usbstdreq.c usb_tunnel_0.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c +usb_tunnel_0.srcs += mcu.c $(SRC_ARCH)/mcu_arch.c -usb_tunnel_1.CFLAGS += -DFBW -DUSE_UART1 -DUART1_BAUD=B115200 -usb_tunnel_1.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DLED -usb_tunnel_1.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/uart_hw.c +usb_tunnel_1.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B115200 -DPERIPHERALS_AUTO_INIT +usb_tunnel_1.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DUSE_LED -DUSE_USB_HIGH_PCLK +usb_tunnel_1.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/mcu_periph/uart_arch.c usb_tunnel_1.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbinit.c usb_tunnel_1.srcs += $(SRC_ARCH)/lpcusb/usbcontrol.c $(SRC_ARCH)/lpcusb/usbstdreq.c usb_tunnel_1.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c +usb_tunnel_1.srcs += mcu.c $(SRC_ARCH)/mcu_arch.c - -ifeq ($(ACTUATORS),) - ifeq ($(BOARD),tiny) - ifeq ($(BOARD_VERSION),1.1) - include $(CFG_SHARED)/actuators_4015.makefile - else - ifeq ($(BOARD_VERSION),0.99) +ifeq ($(TARGET), setup_actuators) + ifeq ($(ACTUATORS),) + ifeq ($(BOARD),tiny) + ifeq ($(BOARD_VERSION),1.1) include $(CFG_SHARED)/actuators_4015.makefile else - include $(CFG_SHARED)/actuators_4017.makefile + ifeq ($(BOARD_VERSION),0.99) + include $(CFG_SHARED)/actuators_4015.makefile + else + include $(CFG_SHARED)/actuators_4017.makefile + endif endif endif - endif - ifeq ($(BOARD),twog) - include $(CFG_SHARED)/actuators_4017.makefile - endif + ifeq ($(BOARD),twog) + include $(CFG_SHARED)/actuators_4017.makefile + endif - ifeq ($(BOARD),lisa_l) - include $(CFG_SHARED)/actuators_direct.makefile - endif + ifeq ($(BOARD),lisa_l) + include $(CFG_SHARED)/actuators_direct.makefile + endif -else - include $(CFG_SHARED)/$(ACTUATORS).makefile + else + include $(CFG_SHARED)/$(ACTUATORS).makefile + endif endif # a test program to setup actuators -setup_actuators.CFLAGS += -DFBW -DLED -DTIME_LED=1 +setup_actuators.CFLAGS += -DFBW -DUSE_LED -DTIME_LED=1 setup_actuators.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -DDOWNLINK_DEVICE=Uart1 -DPPRZ_UART=Uart1 setup_actuators.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ setup_actuators.CFLAGS += -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 setup_actuators.CFLAGS += $(SETUP_INC) -Ifirmwares/fixedwing -setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c downlink.c $(SRC_FIRMWARE)/setup_actuators.c $(SRC_ARCH)/uart_hw.c firmwares/fixedwing/main.c +setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c downlink.c $(SRC_FIRMWARE)/setup_actuators.c $(SRC_ARCH)/mcu_periph/uart_arch.c firmwares/fixedwing/main.c mcu.c $(SRC_ARCH)/mcu_arch.c diff --git a/conf/autopilot/sitl.makefile b/conf/autopilot/sitl.makefile index f3971eb938..b05421888e 100644 --- a/conf/autopilot/sitl.makefile +++ b/conf/autopilot/sitl.makefile @@ -1,5 +1,5 @@ sim.ARCHDIR = $(ARCH) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED -DWIND_INFO sim.srcs += latlong.c\ radio_control.c\ downlink.c\ @@ -14,7 +14,7 @@ sim.srcs += latlong.c\ sys_time.c\ $(SRC_FIRMWARE)/main_fbw.c \ $(SRC_FIRMWARE)/main_ap.c \ - datalink.c \ + $(SRC_FIRMWARE)/datalink.c \ $(SRC_ARCH)/ppm_hw.c \ $(SRC_ARCH)/sim_gps.c\ $(SRC_ARCH)/sim_ir.c \ diff --git a/conf/autopilot/sitl_jsbsim.makefile b/conf/autopilot/sitl_jsbsim.makefile index 06f62f724e..4b46e00a19 100644 --- a/conf/autopilot/sitl_jsbsim.makefile +++ b/conf/autopilot/sitl_jsbsim.makefile @@ -24,12 +24,12 @@ else jsbsim.LDFLAGS += -L$(JSBSIM_LIB) -lJSBSim endif -jsbsim.CFLAGS += -DSITL -DAP -DFBW -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO -Ifirmwares/fixedwing +jsbsim.CFLAGS += -DSITL -DAP -DFBW -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DUSE_LED -DWIND_INFO -Ifirmwares/fixedwing jsbsim.srcs = $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/jsbsim_ir.c $(SRC_ARCH)/jsbsim_transport.c $(SRC_ARCH)/ivy_transport.c jsbsim.srcs += latlong.c downlink.c commands.c gps.c inter_mcu.c subsystems/sensors/infrared.c \ $(SRC_FIXEDWING)/stabilization/stabilization_attitude.c \ $(SRC_FIXEDWING)/guidance/guidance_v.c\ - subsystems/nav.c estimator.c sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c datalink.c + subsystems/nav.c estimator.c sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c $(SRC_FIRMWARE)/datalink.c jsbsim.srcs += $(SIMDIR)/sim_ac_jsbsim.c # Choose in your airframe file type of airframe # jsbsim.srcs += $(SIMDIR)/sim_ac_fw.c diff --git a/conf/autopilot/sitl_link_pprz.makefile b/conf/autopilot/sitl_link_pprz.makefile index 2fcd2b8d91..313d5ee07f 100644 --- a/conf/autopilot/sitl_link_pprz.makefile +++ b/conf/autopilot/sitl_link_pprz.makefile @@ -1,3 +1,3 @@ sim.ARCHDIR = $(ARCH) sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DUSE_INFRARED -DRADIO_CONTROL_SETTINGS -DSIM_UART -DDOWNLINK_AP_DEVICE=SimUart -DDOWNLINK_FBW_DEVICE=SimUart -DDATALINK=PPRZ -sim.srcs = radio_control.c downlink.c pprz_transport.c commands.c gps.c inter_mcu.c subsystems/sensors/infrared.c $(SRC_FIRMWARE)/stabilization/stabilization_attitude.c $(SRC_FIRMWARE)/guidance/guidance_v.c nav.c estimator.c cam.c sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c rc_settings.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/sim_uart.c datalink.c +sim.srcs = radio_control.c downlink.c pprz_transport.c commands.c gps.c inter_mcu.c subsystems/sensors/infrared.c $(SRC_FIRMWARE)/stabilization/stabilization_attitude.c $(SRC_FIRMWARE)/guidance/guidance_v.c nav.c estimator.c cam.c sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c rc_settings.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/sim_uart.c $(SRC_FIRMWARE)/datalink.c diff --git a/conf/autopilot/subsystems/fixedwing/attitude_dcm.makefile b/conf/autopilot/subsystems/fixedwing/attitude_dcm.makefile index 03d340e877..91b1eb5ecd 100644 --- a/conf/autopilot/subsystems/fixedwing/attitude_dcm.makefile +++ b/conf/autopilot/subsystems/fixedwing/attitude_dcm.makefile @@ -5,11 +5,32 @@ $(TARGET).CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_float_dcm.h\" ifeq ($(ARCH), lpc21) -ap.CFLAGS += -DUSE_ANALOG_IMU +ap.CFLAGS += -DUSE_AHRS -ap.srcs += $(SRC_SUBSYSTEMS)/ahrs.c -ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c -ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_float_dcm.c +ap.srcs += $(SRC_SUBSYSTEMS)/ahrs.c +ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c +ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_float_dcm.c + +ifdef AHRS_ALIGNER_LED + ap.CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED) +endif + +ifdef CPU_LED + ap.CFLAGS += -DAHRS_CPU_LED=$(CPU_LED) +endif + +ifdef AHRS_PROPAGATE_FREQUENCY +else + AHRS_PROPAGATE_FREQUENCY = 60 +endif + +ifdef AHRS_CORRECT_FREQUENCY +else + AHRS_CORRECT_FREQUENCY = 60 +endif + +ap.CFLAGS += -DAHRS_PROPAGATE_FREQUENCY=$(AHRS_PROPAGATE_FREQUENCY) +ap.CFLAGS += -DAHRS_CORRECT_FREQUENCY=$(AHRS_CORRECT_FREQUENCY) endif diff --git a/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile b/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile index aa4509a479..7395522edb 100644 --- a/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile +++ b/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile @@ -33,6 +33,7 @@ ap.CFLAGS += -DADC_CHANNEL_IR_NB_SAMPLES=$(ADC_IR_NB_SAMPLES) $(TARGET).CFLAGS += -DUSE_INFRARED $(TARGET).srcs += subsystems/sensors/infrared.c +$(TARGET).srcs += subsystems/sensors/infrared_adc.c sim.srcs += $(SRC_ARCH)/sim_ir.c jsbsim.srcs += $(SRC_ARCH)/jsbsim_ir.c diff --git a/conf/autopilot/subsystems/fixedwing/attitude_infrared_i2c.makefile b/conf/autopilot/subsystems/fixedwing/attitude_infrared_i2c.makefile new file mode 100644 index 0000000000..b3f9355b11 --- /dev/null +++ b/conf/autopilot/subsystems/fixedwing/attitude_infrared_i2c.makefile @@ -0,0 +1,8 @@ +# attitude via IR I2C sensors + +$(TARGET).CFLAGS += -DUSE_INFRARED_I2C +$(TARGET).srcs += subsystems/sensors/infrared.c +$(TARGET).srcs += subsystems/sensors/infrared_i2c.c + +sim.srcs += $(SRC_ARCH)/sim_ir.c +jsbsim.srcs += $(SRC_ARCH)/jsbsim_ir.c diff --git a/conf/autopilot/subsystems/fixedwing/autopilot.makefile b/conf/autopilot/subsystems/fixedwing/autopilot.makefile index 6b3e601453..fe9ba0a275 100644 --- a/conf/autopilot/subsystems/fixedwing/autopilot.makefile +++ b/conf/autopilot/subsystems/fixedwing/autopilot.makefile @@ -68,8 +68,11 @@ endif # # Sys-time # - -$(TARGET).srcs += sys_time.c +ifndef PERIODIC_FREQUENCY +PERIODIC_FREQUENCY = 60 +endif +$(TARGET).CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./$(PERIODIC_FREQUENCY).))' -DPERIODIC_FREQUENCY=$(PERIODIC_FREQUENCY) +$(TARGET).srcs += sys_time.c # # InterMCU & Commands @@ -122,7 +125,6 @@ endif # ns_CFLAGS += -DUSE_SYS_TIME -ns_CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./60.))' ns_srcs += $(SRC_ARCH)/sys_time_hw.c @@ -168,6 +170,12 @@ ap_srcs += $(SRC_FIXEDWING)/estimator.c ## SIMULATOR THREAD SPECIFIC ## +UNAME = $(shell uname -s) +ifeq ("$(UNAME)","Darwin") + sim.CFLAGS += -I/opt/local/include/ +endif + +sim.CFLAGS += $(CPPFLAGS) sim.CFLAGS += $(fbw_CFLAGS) $(ap_CFLAGS) sim.srcs += $(fbw_srcs) $(ap_srcs) @@ -175,13 +183,14 @@ sim.CFLAGS += -DSITL sim.srcs += $(SRC_ARCH)/sim_ap.c sim.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -sim.srcs += downlink.c datalink.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c +sim.srcs += downlink.c $(SRC_FIRMWARE)/datalink.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c ###################################################################### ## ## JSBSIM THREAD SPECIFIC ## +OCAMLLIBDIR=$(shell ocamlc -where) JSBSIM_INC = /usr/include/JSBSim #JSBSIM_LIB = /usr/lib @@ -189,14 +198,14 @@ jsbsim.CFLAGS += $(fbw_CFLAGS) $(ap_CFLAGS) jsbsim.srcs += $(fbw_srcs) $(ap_srcs) jsbsim.CFLAGS += -DSITL -jsbsim.srcs += $(SIMDIR)/sim_ac_jsbsim.c $(SIMDIR)/sim_ac_fw.c +jsbsim.srcs += $(SIMDIR)/sim_ac_jsbsim.c $(SIMDIR)/sim_ac_fw.c $(SIMDIR)/sim_ac_flightgear.c # external libraries -jsbsim.CFLAGS += -I$(SIMDIR) -I/usr/include -I$(JSBSIM_INC) `pkg-config glib-2.0 --cflags` +jsbsim.CFLAGS += -I$(SIMDIR) -I/usr/include -I$(JSBSIM_INC) -I$(OCAMLLIBDIR) `pkg-config glib-2.0 --cflags` jsbsim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lpcre -lglibivy -L/usr/lib -lJSBSim jsbsim.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -jsbsim.srcs += downlink.c datalink.c $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/jsbsim_transport.c +jsbsim.srcs += downlink.c $(SRC_FIRMWARE)/datalink.c $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/jsbsim_transport.c ###################################################################### ## diff --git a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile index d4fab5b815..2e3249f679 100644 --- a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile +++ b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile @@ -2,9 +2,9 @@ ap.CFLAGS += -DUSE_GPS -DUBX -ap.CFLAGS += -DGPS_LINK=Uart$(GPS_UART_NR) -ap.CFLAGS += -DUSE_UART$(GPS_UART_NR) -ap.CFLAGS += -DUART$(GPS_UART_NR)_BAUD=$(GPS_BAUD) +ap.CFLAGS += -DGPS_LINK=$(GPS_PORT) +ap.CFLAGS += -DUSE_$(GPS_PORT) +ap.CFLAGS += -D$(GPS_PORT)_BAUD=$(GPS_BAUD) ifneq ($(GPS_LED),none) ap.CFLAGS += -DGPS_LED=$(GPS_LED) diff --git a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile index 27f46bc630..de753df714 100644 --- a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile +++ b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile @@ -2,9 +2,9 @@ ap.CFLAGS += -DUSE_GPS -DUBX -DGPS_USE_LATLONG -ap.CFLAGS += -DGPS_LINK=Uart$(GPS_UART_NR) -ap.CFLAGS += -DUSE_UART$(GPS_UART_NR) -ap.CFLAGS += -DUART$(GPS_UART_NR)_BAUD=$(GPS_BAUD) +ap.CFLAGS += -DGPS_LINK=$(GPS_PORT) +ap.CFLAGS += -DUSE_$(GPS_PORT) +ap.CFLAGS += -D$(GPS_PORT)_BAUD=$(GPS_BAUD) ifneq ($(GPS_LED),none) ap.CFLAGS += -DGPS_LED=$(GPS_LED) diff --git a/conf/autopilot/subsystems/fixedwing/imu_analog.makefile b/conf/autopilot/subsystems/fixedwing/imu_analog.makefile index 499706aa75..b2b3e8ca83 100644 --- a/conf/autopilot/subsystems/fixedwing/imu_analog.makefile +++ b/conf/autopilot/subsystems/fixedwing/imu_analog.makefile @@ -44,7 +44,7 @@ ifeq ($(ARCH), lpc21) -imu_CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_analog.h\" +imu_CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_analog.h\" -DUSE_IMU imu_CFLAGS += -DADC imu_CFLAGS += -DUSE_$(GYRO_P) -DUSE_$(GYRO_Q) -DUSE_$(GYRO_R) diff --git a/conf/autopilot/subsystems/fixedwing/imu_booz.makefile b/conf/autopilot/subsystems/fixedwing/imu_booz.makefile index 5de6f0bf69..e6ad633f17 100644 --- a/conf/autopilot/subsystems/fixedwing/imu_booz.makefile +++ b/conf/autopilot/subsystems/fixedwing/imu_booz.makefile @@ -41,7 +41,7 @@ # imu Booz2 v1.0, v1.1, v1.2, YAI v1.0 -imu_CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_b2.h\" +imu_CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_b2.h\" -DUSE_IMU imu_srcs += $(SRC_SUBSYSTEMS)/imu.c imu_srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c imu_srcs += $(SRC_ARCH)/subsystems/imu/imu_b2_arch.c @@ -52,7 +52,7 @@ imu_srcs += $(SRC_ARCH)/peripherals/max1168_arch.c #ifeq ($(ARCH), lpc21) imu_CFLAGS += -DSSP_VIC_SLOT=9 imu_CFLAGS += -DMAX1168_EOC_VIC_SLOT=8 -#FIXME ms2001 not used on this imu +#FIXME ms2100 not used on this imu #else ifeq ($(ARCH), stm32) #imu_CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ #imu_CFLAGS += -DMAX_1168_DRDY_PORT=$(MAX_1168_DRDY_PORT) diff --git a/conf/autopilot/subsystems/fixedwing/navigation_extra.makefile b/conf/autopilot/subsystems/fixedwing/navigation_extra.makefile index 91be2eba88..60cc01c1af 100644 --- a/conf/autopilot/subsystems/fixedwing/navigation_extra.makefile +++ b/conf/autopilot/subsystems/fixedwing/navigation_extra.makefile @@ -12,4 +12,6 @@ $(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/nav_cube.c $(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/discsurvey.c $(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/OSAMNav.c $(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/snav.c +$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/spiral.c +$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/poly_survey_adv.c diff --git a/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile b/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile index 6ad33ef3c8..c08b83ec9e 100644 --- a/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile +++ b/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile @@ -1,12 +1,8 @@ -ap.CFLAGS += -DUSE_UART$(MODEM_UART_NR) -ap.CFLAGS += -DUART$(MODEM_UART_NR)_BAUD=$(MODEM_BAUD) +ap.CFLAGS += -DUSE_$(MODEM_PORT) +ap.CFLAGS += -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -MODEM_UART = Uart$(MODEM_UART_NR) - -ap.CFLAGS += -DDOWNLINK -DDOWNLINK_FBW_DEVICE=$(MODEM_UART) -DDOWNLINK_AP_DEVICE=$(MODEM_UART) -DPPRZ_UART=$(MODEM_UART) +ap.CFLAGS += -DDOWNLINK -DDOWNLINK_FBW_DEVICE=$(MODEM_PORT) -DDOWNLINK_AP_DEVICE=$(MODEM_PORT) -DPPRZ_UART=$(MODEM_PORT) ap.CFLAGS += -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ -ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIXEDWING)/datalink.c $(SRC_FIXEDWING)/pprz_transport.c - - +ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIRMWARE)/datalink.c $(SRC_FIXEDWING)/pprz_transport.c diff --git a/conf/autopilot/subsystems/fixedwing/telemetry_transparent_usb.makefile b/conf/autopilot/subsystems/fixedwing/telemetry_transparent_usb.makefile index eb77b500bd..fdc2d31baf 100644 --- a/conf/autopilot/subsystems/fixedwing/telemetry_transparent_usb.makefile +++ b/conf/autopilot/subsystems/fixedwing/telemetry_transparent_usb.makefile @@ -3,7 +3,7 @@ ap.CFLAGS += -DDOWNLINK -DDOWNLINK_FBW_DEVICE=UsbS -DDOWNLINK_AP_DEVICE=UsbS -DPPRZ_UART=UsbS ap.CFLAGS += -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ -DUSE_USB_SERIAL -DUSE_USB_HIGH_PCLK -ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIXEDWING)/datalink.c $(SRC_FIXEDWING)/pprz_transport.c +ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIRMWARE)/datalink.c $(SRC_FIXEDWING)/pprz_transport.c ap.srcs += $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbcontrol.c ap.srcs += $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c diff --git a/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile b/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile index 1263c24044..5dc414e00d 100644 --- a/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile +++ b/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile @@ -1,10 +1,8 @@ # XBee modems in API mode -ap.CFLAGS += -DUSE_UART$(MODEM_UART_NR) -ap.CFLAGS += -DUART$(MODEM_UART_NR)_BAUD=$(MODEM_BAUD) +ap.CFLAGS += -DUSE_$(MODEM_PORT) +ap.CFLAGS += -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -MODEM_UART = Uart$(MODEM_UART_NR) - -ap.CFLAGS += -DDOWNLINK -DDOWNLINK_FBW_DEVICE=$(MODEM_UART) -DDOWNLINK_AP_DEVICE=$(MODEM_UART) -DXBEE_UART=$(MODEM_UART) +ap.CFLAGS += -DDOWNLINK -DDOWNLINK_FBW_DEVICE=$(MODEM_PORT) -DDOWNLINK_AP_DEVICE=$(MODEM_PORT) -DXBEE_UART=$(MODEM_PORT) ap.CFLAGS += -DDOWNLINK_TRANSPORT=XBeeTransport -DDATALINK=XBEE -ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIXEDWING)/datalink.c $(SRC_FIXEDWING)/xbee.c +ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIRMWARE)/datalink.c $(SRC_FIXEDWING)/xbee.c diff --git a/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile b/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile index 546bde2264..6bb570edb2 100644 --- a/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile +++ b/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile @@ -42,7 +42,7 @@ # imu Booz2 v1.1 imu_CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_b2.h\" -imu_CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 +imu_CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2100 imu_CFLAGS += -DIMU_B2_VERSION_1_1 imu_srcs += $(SRC_SUBSYSTEMS)/imu.c imu_srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c @@ -51,13 +51,13 @@ imu_srcs += $(SRC_ARCH)/subsystems/imu/imu_b2_arch.c imu_srcs += peripherals/max1168.c imu_srcs += $(SRC_ARCH)/peripherals/max1168_arch.c -imu_srcs += peripherals/ms2001.c -imu_srcs += $(SRC_ARCH)/peripherals/ms2001_arch.c +imu_srcs += peripherals/ms2100.c +imu_srcs += $(SRC_ARCH)/peripherals/ms2100_arch.c ifeq ($(ARCH), lpc21) imu_CFLAGS += -DSSP_VIC_SLOT=9 imu_CFLAGS += -DMAX1168_EOC_VIC_SLOT=8 -imu_CFLAGS += -DMS2001_DRDY_VIC_SLOT=11 +imu_CFLAGS += -DMS2100_DRDY_VIC_SLOT=11 else ifeq ($(ARCH), stm32) imu_CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ imu_CFLAGS += -DMAX_1168_DRDY_PORT=$(MAX_1168_DRDY_PORT) diff --git a/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.2.makefile b/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.2.makefile index 844b6c786d..1e562fcc24 100644 --- a/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.2.makefile +++ b/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.2.makefile @@ -57,8 +57,8 @@ imu_srcs += $(SRC_ARCH)/peripherals/hmc5843_arch.c ifeq ($(ARCH), lpc21) imu_CFLAGS += -DSSP_VIC_SLOT=9 imu_CFLAGS += -DMAX1168_EOC_VIC_SLOT=8 -#FIXME ms2001 not used on this imu -imu_CFLAGS += -DMS2001_DRDY_VIC_SLOT=11 +#FIXME ms2100 not used on this imu +imu_CFLAGS += -DMS2100_DRDY_VIC_SLOT=11 else ifeq ($(ARCH), stm32) imu_CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ imu_CFLAGS += -DMAX_1168_DRDY_PORT=$(MAX_1168_DRDY_PORT) diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile index a3c61afbef..be29427092 100644 --- a/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile +++ b/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile @@ -1,7 +1,5 @@ # asctec controllers ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c -ap.srcs += mcu_periph/i2c.c -ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c ifeq ($(ARCH), lpc21) ap.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c0 diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_asctec_v2.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_asctec_v2.makefile index c1cfc48f37..6b9d300c2e 100644 --- a/conf/autopilot/subsystems/rotorcraft/actuators_asctec_v2.makefile +++ b/conf/autopilot/subsystems/rotorcraft/actuators_asctec_v2.makefile @@ -19,8 +19,6 @@ ap.srcs += $(SRC_FIRMWARE)/actuators/supervision.c ap.CFLAGS += -DACTUATORS_ASCTEC_V2_PROTOCOL ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c -ap.srcs += mcu_periph/i2c.c -ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c ifeq ($(ARCH), lpc21) ap.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c0 diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_heli.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_heli.makefile index 95e3591951..d89410102e 100644 --- a/conf/autopilot/subsystems/rotorcraft/actuators_heli.makefile +++ b/conf/autopilot/subsystems/rotorcraft/actuators_heli.makefile @@ -5,6 +5,3 @@ ap.CFLAGS += -DUSE_HELI ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_heli.c ap.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c - -# fixme : this is needed by baro and usualy added by actuators_mkk or actuators_asctec -ap.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile index f70c299815..3529c03923 100644 --- a/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile +++ b/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile @@ -1,8 +1,15 @@ # -# Booz Mikrokopter Actuators +# Mikrokopter Actuators +# +# enable the subsystem for your firmware: +# +# ... +# +# +# # # -# required xml: +# required xml configuration: #
# # @@ -24,16 +31,17 @@ # # +# set default i2c timing if not already configured +ifeq ($(MKK_I2C_SCL_TIME), ) +MKK_I2C_SCL_TIME=150 +endif -# ap.srcs += $(SRC_FIRMWARE)/actuators/supervision.c ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c -ap.srcs += mcu_periph/i2c.c -ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c ifeq ($(ARCH), lpc21) ap.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c0 -ap.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=150 -DI2C0_SCLH=150 -DI2C0_VIC_SLOT=10 +ap.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(MKK_I2C_SCL_TIME) -DI2C0_SCLH=$(MKK_I2C_SCL_TIME) -DI2C0_VIC_SLOT=10 else ifeq ($(ARCH), stm32) ap.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c1 ap.CFLAGS += -DUSE_I2C1 @@ -42,6 +50,6 @@ endif # Simulator sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c -sim.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=150 -DI2C0_SCLH=150 -DI2C0_VIC_SLOT=10 -DACTUATORS_MKK_DEVICE=i2c1 +sim.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(MKK_I2C_SCL_TIME) -DI2C0_SCLH=$(MKK_I2C_SCL_TIME) -DI2C0_VIC_SLOT=10 -DACTUATORS_MKK_DEVICE=i2c1 sim.srcs += mcu_periph/i2c.c sim.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_pwm_supervision.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_pwm_supervision.makefile new file mode 100644 index 0000000000..5daf9d055f --- /dev/null +++ b/conf/autopilot/subsystems/rotorcraft/actuators_pwm_supervision.makefile @@ -0,0 +1,7 @@ + +# add actuatos arch to include directories +ap.CFLAGS += -I$(SRC_FIRMWARE)/actuators/arch/$(ARCH) + +ap.srcs += $(SRC_FIRMWARE)/actuators/supervision.c +ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_pwm_supervision.c +ap.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c diff --git a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile index 40f08f0fe6..1cd8ef6246 100644 --- a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile +++ b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile @@ -67,10 +67,12 @@ sim.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) sim.srcs += $(SRC_BOOZ_SIM)/booz2_unsimulated_peripherals.c sim.srcs += firmwares/rotorcraft/main.c +sim.srcs += mcu.c +sim.srcs += $(SRC_ARCH)/mcu_arch.c sim.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' # -DTIME_LED=1 -#sim.CFLAGS += -DLED +#sim.CFLAGS += -DUSE_LED sim.srcs += sys_time.c @@ -81,7 +83,7 @@ sim.srcs += $(SRC_FIRMWARE)/telemetry.c \ sim.srcs += $(SRC_BOOZ)/booz2_commands.c -sim.srcs += $(SRC_BOOZ)/booz2_datalink.c +sim.srcs += $(SRC_FIRMWARE)/datalink.c # # diff --git a/conf/autopilot/subsystems/rotorcraft/imu_aspirin.makefile b/conf/autopilot/subsystems/rotorcraft/imu_aspirin.makefile new file mode 100644 index 0000000000..d328823c55 --- /dev/null +++ b/conf/autopilot/subsystems/rotorcraft/imu_aspirin.makefile @@ -0,0 +1,62 @@ +# +# Booz2 IMU booz2v1.2 +# +# +# required xml: +#
+# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +#
+# +# + +# +# param: MAX_1168_DRDY_PORT + + + +# imu aspirin + +imu_CFLAGS += -DIMU_TYPE_H=\"imu/imu_aspirin.h\" -DIMU_OVERRIDE_CHANNELS +imu_srcs += $(SRC_SUBSYSTEMS)/imu.c +imu_srcs += $(SRC_SUBSYSTEMS)/imu/imu_aspirin.c +imu_srcs += $(SRC_ARCH)/subsystems/imu/imu_aspirin_arch.c +#imu_srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c + +#imu_srcs += peripherals/max1168.c +#imu_srcs += $(SRC_ARCH)/peripherals/max1168_arch.c + +imu_srcs += peripherals/hmc5843.c +imu_srcs += $(SRC_ARCH)/peripherals/hmc5843_arch.c + +imu_CFLAGS += -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_EXTI15_10_IRQ +imu_CFLAGS += -DUSE_I2C2 -DUSE_EXTI9_5_IRQ + +# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets +# see: conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile for example +ap.CFLAGS += $(imu_CFLAGS) +ap.srcs += $(imu_srcs) diff --git a/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.0.makefile b/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.0.makefile index dcf1a660a3..f3074ca2bb 100644 --- a/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.0.makefile +++ b/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.0.makefile @@ -9,25 +9,25 @@ # # # -# -# -# +# +# +# # # # # # -# -# -# +# +# +# # # # # # -# -# -# +# +# +# # # #
diff --git a/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.1.makefile b/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.1.makefile index bfef8c6aca..18db231194 100644 --- a/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.1.makefile +++ b/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.1.makefile @@ -9,25 +9,25 @@ # # # -# -# -# +# +# +# # # # # # -# -# -# +# +# +# # # # # # -# -# -# +# +# +# # # #
@@ -42,7 +42,7 @@ # imu Booz2 v1.1 imu_CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_b2.h\" -imu_CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 +imu_CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2100 imu_CFLAGS += -DIMU_B2_VERSION_1_1 imu_srcs += $(SRC_SUBSYSTEMS)/imu.c imu_srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c @@ -51,13 +51,13 @@ imu_srcs += $(SRC_ARCH)/subsystems/imu/imu_b2_arch.c imu_srcs += peripherals/max1168.c imu_srcs += $(SRC_ARCH)/peripherals/max1168_arch.c -imu_srcs += peripherals/ms2001.c -imu_srcs += $(SRC_ARCH)/peripherals/ms2001_arch.c +imu_srcs += peripherals/ms2100.c +imu_srcs += $(SRC_ARCH)/peripherals/ms2100_arch.c ifeq ($(ARCH), lpc21) imu_CFLAGS += -DSSP_VIC_SLOT=9 imu_CFLAGS += -DMAX1168_EOC_VIC_SLOT=8 -imu_CFLAGS += -DMS2001_DRDY_VIC_SLOT=11 +imu_CFLAGS += -DMS2100_DRDY_VIC_SLOT=11 else ifeq ($(ARCH), stm32) imu_CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ imu_CFLAGS += -DMAX_1168_DRDY_PORT=$(MAX_1168_DRDY_PORT) diff --git a/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.2.makefile b/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.2.makefile index 844b6c786d..e208c41664 100644 --- a/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.2.makefile +++ b/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.2.makefile @@ -9,25 +9,25 @@ # # # -# -# -# +# +# +# # # # # # -# -# -# +# +# +# # # # # # -# -# -# +# +# +# # # # @@ -57,8 +57,8 @@ imu_srcs += $(SRC_ARCH)/peripherals/hmc5843_arch.c ifeq ($(ARCH), lpc21) imu_CFLAGS += -DSSP_VIC_SLOT=9 imu_CFLAGS += -DMAX1168_EOC_VIC_SLOT=8 -#FIXME ms2001 not used on this imu -imu_CFLAGS += -DMS2001_DRDY_VIC_SLOT=11 +#FIXME ms2100 not used on this imu +imu_CFLAGS += -DMS2100_DRDY_VIC_SLOT=11 else ifeq ($(ARCH), stm32) imu_CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ imu_CFLAGS += -DMAX_1168_DRDY_PORT=$(MAX_1168_DRDY_PORT) @@ -68,8 +68,8 @@ endif # Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets # see: conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile for example -stm_passthrough.CFLAGS += $(imu_CFLAGS) -stm_passthrough.srcs += $(imu_srcs) +ap.CFLAGS += $(imu_CFLAGS) +ap.srcs += $(imu_srcs) # # Simulator diff --git a/conf/autopilot/subsystems/rotorcraft/telemetry_transparent.makefile b/conf/autopilot/subsystems/rotorcraft/telemetry_transparent.makefile new file mode 100644 index 0000000000..fbc1b89c2e --- /dev/null +++ b/conf/autopilot/subsystems/rotorcraft/telemetry_transparent.makefile @@ -0,0 +1,18 @@ +# +# Expected from board file or overriden as xml param : +# +# MODEM_PORT +# MODEM_BAUD +# + +ap.CFLAGS += -DUSE_$(MODEM_PORT) +ap.CFLAGS += -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) + +ap.CFLAGS += -DDOWNLINK -DDOWNLINK_DEVICE=$(MODEM_PORT) -DPPRZ_UART=$(MODEM_PORT) +ap.CFLAGS += -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ +ap.srcs += downlink.c pprz_transport.c +ap.srcs += $(SRC_FIRMWARE)/datalink.c $(SRC_FIRMWARE)/telemetry.c + +ifeq ($(ARCH), lpc21) +ap.CFLAGS += -D$(MODEM_PORT)_VIC_SLOT=6 +endif diff --git a/conf/autopilot/subsystems/rotorcraft/telemetry_xbee_api.makefile b/conf/autopilot/subsystems/rotorcraft/telemetry_xbee_api.makefile new file mode 100644 index 0000000000..a10f3fa95e --- /dev/null +++ b/conf/autopilot/subsystems/rotorcraft/telemetry_xbee_api.makefile @@ -0,0 +1,19 @@ +# XBee modems in API mode +# +# Expected from board file or overriden as xml param : +# +# MODEM_PORT +# MODEM_BAUD +# + +ap.CFLAGS += -DUSE_$(MODEM_PORT) +ap.CFLAGS += -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) + +ap.CFLAGS += -DDOWNLINK -DDOWNLINK_DEVICE=$(MODEM_PORT) -DXBEE_UART=$(MODEM_PORT) +ap.CFLAGS += -DDOWNLINK_TRANSPORT=XBeeTransport -DDATALINK=XBEE +ap.srcs += downlink.c xbee.c +ap.srcs += $(SRC_FIRMWARE)/datalink.c $(SRC_FIRMWARE)/telemetry.c + +ifeq ($(ARCH), lpc21) +ap.CFLAGS += -D$(MODEM_PORT)_VIC_SLOT=6 +endif diff --git a/conf/autopilot/subsystems/fixedwing/actuators_ppm.makefile b/conf/autopilot/subsystems/shared/actuators_ppm.makefile similarity index 75% rename from conf/autopilot/subsystems/fixedwing/actuators_ppm.makefile rename to conf/autopilot/subsystems/shared/actuators_ppm.makefile index ffa7bef601..99171e4448 100644 --- a/conf/autopilot/subsystems/fixedwing/actuators_ppm.makefile +++ b/conf/autopilot/subsystems/shared/actuators_ppm.makefile @@ -5,6 +5,6 @@ # The PPM is output on the SERV_CLK pin. The PPM frame rate, pulse width, and number of channels # can be adjusted in the "servos_ppm_hw.h" file to suit your particular receiver. -ap.CFLAGS += -DACTUATORS=\"servos_ppm_hw.h\" -DSERVOS_PPM_MAT -ap.srcs += $(SRC_ARCH)/servos_ppm_hw.c $(SRC_FIXEDWING)/actuators.c +$(TARGET).CFLAGS += -DACTUATORS=\"servos_ppm_hw.h\" -DSERVOS_PPM_MAT +$(TARGET).srcs += $(SRC_ARCH)/servos_ppm_hw.c actuators.c diff --git a/conf/autopilot/subsystems/shared/radio_control_ppm.makefile b/conf/autopilot/subsystems/shared/radio_control_ppm.makefile index e5479f0e9e..6b2fdeab88 100644 --- a/conf/autopilot/subsystems/shared/radio_control_ppm.makefile +++ b/conf/autopilot/subsystems/shared/radio_control_ppm.makefile @@ -19,9 +19,8 @@ ifeq ($(NORADIO), False) $(TARGET).CFLAGS += -DRADIO_CONTROL_TYPE_PPM $(TARGET).srcs += $(SRC_SUBSYSTEMS)/radio_control.c $(TARGET).srcs += $(SRC_SUBSYSTEMS)/radio_control/ppm.c - ifneq ($(ARCH),jsbsim) - $(TARGET).srcs += $(SRC_ARCH)/subsystems/radio_control/ppm_arch.c - endif + $(TARGET).srcs += $(SRC_ARCH)/subsystems/radio_control/ppm_arch.c + ifeq ($(ARCH),stm32) ap.CFLAGS += -DUSE_TIM2_IRQ endif diff --git a/conf/boards/booz_1.0.makefile b/conf/boards/booz_1.0.makefile index 7e9184cf5c..1f56efef5b 100644 --- a/conf/boards/booz_1.0.makefile +++ b/conf/boards/booz_1.0.makefile @@ -25,11 +25,19 @@ RADIO_CONTROL_LINK = UART0 BARO_LED = 2 +ifndef MODEM_PORT MODEM_PORT = UART1 +endif +ifndef MODEM_BAUD MODEM_BAUD = B57600 +endif AHRS_ALIGNER_LED = 3 +ifndef GPS_PORT GPS_PORT=UART0 +endif +ifndef GPS_BAUD GPS_BAUD=B38400 +endif GPS_LED=4 diff --git a/conf/boards/classix.makefile b/conf/boards/classix.makefile index 90ae9df340..79002ad107 100644 --- a/conf/boards/classix.makefile +++ b/conf/boards/classix.makefile @@ -22,7 +22,7 @@ LPC21ISP_XTAL = 12000 ### default settings for classix -GPS_BAUD = B38400 +GPS_BAUD = B38400 GPS_LED = none # All targets on the TINY board run on the same processor achitecture diff --git a/conf/boards/hb_1.1.makefile b/conf/boards/hb_1.1.makefile index 16c134efc5..b8d0c3ae0a 100644 --- a/conf/boards/hb_1.1.makefile +++ b/conf/boards/hb_1.1.makefile @@ -22,8 +22,36 @@ SYS_TIME_LED = 1 # not used on rotorcraft, only for tests RADIO_CONTROL_LINK = UART0 +ifndef MODEM_PORT MODEM_PORT = UART0 +endif +ifndef MODEM_BAUD MODEM_BAUD = B57600 +endif -GPS_PORT=UART1 -GPS_BAUD=B38400 +ifndef GPS_PORT +GPS_PORT = UART1 +endif +ifndef GPS_BAUD +GPS_BAUD = B38400 +endif + +GPS_LED = 2 + +ifndef ADC_IR1 +ADC_IR1 = 1 +ADC_IR1_CHAN = 0 +endif +ifndef ADC_IR2 +ADC_IR2 = 2 +ADC_IR2_CHAN = 1 +endif +ifndef ADC_IR3 +ADC_IR_TOP = 4 +ADC_IR_TOP_CHAN = 3 +endif +ifndef ADC_IR_NB_SAMPLES +ADC_IR_NB_SAMPLES = 16 +endif + +$(TARGET).ARCHDIR = $(ARCH) diff --git a/conf/boards/lisa_l_1.0.makefile b/conf/boards/lisa_l_1.0.makefile index a821a51298..0459e71ac0 100644 --- a/conf/boards/lisa_l_1.0.makefile +++ b/conf/boards/lisa_l_1.0.makefile @@ -41,13 +41,21 @@ RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3 RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5 RADIO_CONTROL_LED = 5 +ifndef MODEM_PORT MODEM_PORT=UART2 +endif +ifndef MODEM_BAUD MODEM_BAUD=B57600 +endif AHRS_ALIGNER_LED = 7 +ifndef GPS_PORT GPS_PORT=UART1 +endif +ifndef GPS_BAUD GPS_BAUD=B38400 +endif GPS_LED = 3 # @@ -61,14 +69,6 @@ MAX_1168_DRDY_PORT_SOURCE = PortSourceGPIOD #MAX_1168_DRDY_PORT = GPIOB -# -# definitions below were added to get fixedwing firmware to build -# -# modem is usualy connected there -ifndef MODEM_UART_NR -MODEM_UART_NR = 2 -endif - ifndef ADC_IR1 ADC_IR1 = 1 ADC_IR1_CHAN = 0 @@ -84,6 +84,3 @@ endif ifndef ADC_IR_NB_SAMPLES ADC_IR_NB_SAMPLES = 16 endif -ifndef GPS_UART_NR -GPS_UART_NR = 1 -endif diff --git a/conf/boards/lisa_m_1.0.makefile b/conf/boards/lisa_m_1.0.makefile index 89a1814674..78de8610ed 100644 --- a/conf/boards/lisa_m_1.0.makefile +++ b/conf/boards/lisa_m_1.0.makefile @@ -42,8 +42,12 @@ endif #AHRS_ALIGNER_LED = 7 +ifndef GPS_PORT GPS_PORT=UART1 +endif +ifndef GPS_BAUD GPS_BAUD=B38400 +endif GPS_LED = none # @@ -57,13 +61,6 @@ MAX_1168_DRDY_PORT_SOURCE = PortSourceGPIOD #MAX_1168_DRDY_PORT = GPIOB -# -# definitions below were added to get fixedwing firmware to build -# -# modem is usualy connected there -ifndef MODEM_UART_NR -MODEM_UART_NR = 2 -endif ifndef ADC_IR1 ADC_IR1 = 1 @@ -80,6 +77,3 @@ endif ifndef ADC_IR_NB_SAMPLES ADC_IR_NB_SAMPLES = 16 endif -ifndef GPS_UART_NR -GPS_UART_NR = 1 -endif diff --git a/conf/boards/pc.makefile b/conf/boards/pc.makefile index 4e8976f4f4..df5c1bbe3c 100644 --- a/conf/boards/pc.makefile +++ b/conf/boards/pc.makefile @@ -8,10 +8,7 @@ ARCH=sim BOARD = pc BOARD_VERSION= - -# TODO: update board -BOARD_CFG = \"tiny_sim.h\" - +BOARD_CFG = \"boards/tiny_sim.h\" $(TARGET).ARCHDIR = $(ARCH) diff --git a/conf/boards/tiny_0.99.makefile b/conf/boards/tiny_0.99.makefile index 22e454ffcd..f3879c0b70 100644 --- a/conf/boards/tiny_0.99.makefile +++ b/conf/boards/tiny_0.99.makefile @@ -13,6 +13,8 @@ BOARD_VERSION=0.99 BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" -GPS_UART_NR = 1 +GPS_PORT = UART1 GPS_LED = none -MODEM_UART_NR = 0 +MODEM_PORT = UART0 + +ACTUATORS = actuators_4015 diff --git a/conf/boards/tiny_1.1.makefile b/conf/boards/tiny_1.1.makefile index 538b7b186f..04cb4feaff 100644 --- a/conf/boards/tiny_1.1.makefile +++ b/conf/boards/tiny_1.1.makefile @@ -13,6 +13,8 @@ BOARD_VERSION=1.1 BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" -GPS_UART_NR = 1 +GPS_PORT = UART1 GPS_LED = none -MODEM_UART_NR = 0 +MODEM_PORT = UART0 + +ACTUATORS = actuators_4015 diff --git a/conf/boards/tiny_2.11.makefile b/conf/boards/tiny_2.11.makefile index 9faf7301a9..33c35ec77c 100644 --- a/conf/boards/tiny_2.11.makefile +++ b/conf/boards/tiny_2.11.makefile @@ -21,11 +21,20 @@ LPC21ISP_XTAL = 12000 ### default settings for tiny_2 and twog -GPS_UART_NR = 0 +ifndef GPS_PORT +GPS_PORT = UART0 +endif +ifndef GPS_BAUD GPS_BAUD = B38400 +endif GPS_LED = 2 -MODEM_UART_NR = 1 + +ifndef MODEM_PORT +MODEM_PORT = UART1 +endif +ifndef MODEM_BAUD MODEM_BAUD = B57600 +endif ADC_IR_TOP = ADC_0 ADC_IR1 = ADC_1 @@ -40,3 +49,4 @@ ADC_GENERIC_NB_SAMPLES = 16 # All targets on the TINY board run on the same processor achitecture $(TARGET).ARCHDIR = $(ARCH) +ACTUATORS = actuators_4017 diff --git a/conf/conf.xml.example b/conf/conf.xml.example index 5ba76d762e..86c4d30d5d 100644 --- a/conf/conf.xml.example +++ b/conf/conf.xml.example @@ -90,7 +90,6 @@ settings="settings/tuning_ins.xml" gui_color="blue" /> - - - - - - - - diff --git a/conf/control_panel.xml.example b/conf/control_panel.xml.example index e97471def0..e9a2ea99a1 100644 --- a/conf/control_panel.xml.example +++ b/conf/control_panel.xml.example @@ -64,7 +64,7 @@ - + @@ -78,7 +78,16 @@ - + + + + + + + + + + diff --git a/conf/control_panel.xml.example.booz b/conf/control_panel.xml.example.booz index fe52d43e0b..5ec2b32ed9 100644 --- a/conf/control_panel.xml.example.booz +++ b/conf/control_panel.xml.example.booz @@ -55,7 +55,7 @@ - + @@ -64,7 +64,6 @@ - @@ -75,7 +74,6 @@ - @@ -170,7 +168,7 @@ - + diff --git a/conf/flight_plans/basic_booz.xml b/conf/flight_plans/basic_booz.xml index 434d3c9a5a..7719308239 100644 --- a/conf/flight_plans/basic_booz.xml +++ b/conf/flight_plans/basic_booz.xml @@ -1,6 +1,9 @@ +
+#include "autopilot.h" +
diff --git a/conf/modules/adc_generic.xml b/conf/modules/adc_generic.xml index bdcda58620..8f2917cf2b 100644 --- a/conf/modules/adc_generic.xml +++ b/conf/modules/adc_generic.xml @@ -2,8 +2,8 @@ @@ -14,8 +14,16 @@ - - + + +ifneq ($(ADC_CHANNEL_GENERIC1),) +ap.CFLAGS += -DADC_CHANNEL_GENERIC1=$(ADC_CHANNEL_GENERIC1) -DUSE_$(ADC_CHANNEL_GENERIC1) +endif + +ifneq ($(ADC_CHANNEL_GENERIC2),) +ap.CFLAGS += -DADC_CHANNEL_GENERIC2=$(ADC_CHANNEL_GENERIC2) -DUSE_$(ADC_CHANNEL_GENERIC2) +endif + + - diff --git a/conf/modules/airborne_ant_track.xml b/conf/modules/airborne_ant_track.xml new file mode 100644 index 0000000000..c8cc079709 --- /dev/null +++ b/conf/modules/airborne_ant_track.xml @@ -0,0 +1,13 @@ + + + +
+ +
+ + + + + + +
diff --git a/conf/modules/airspeed_adc.xml b/conf/modules/airspeed_adc.xml index b064967f15..5d2e68c51e 100644 --- a/conf/modules/airspeed_adc.xml +++ b/conf/modules/airspeed_adc.xml @@ -2,9 +2,9 @@ @@ -19,8 +19,8 @@ - - + + diff --git a/conf/modules/airspeed_ets.xml b/conf/modules/airspeed_ets.xml index bc56326e73..e322cffc49 100644 --- a/conf/modules/airspeed_ets.xml +++ b/conf/modules/airspeed_ets.xml @@ -2,11 +2,11 @@ diff --git a/conf/modules/alt_srf08.xml b/conf/modules/alt_srf08.xml index e2a8b3d41d..2bade5054d 100644 --- a/conf/modules/alt_srf08.xml +++ b/conf/modules/alt_srf08.xml @@ -12,6 +12,6 @@ - + diff --git a/conf/modules/baro_MS5534A.xml b/conf/modules/baro_MS5534A.xml index 0863e5d9d9..2149d604bf 100644 --- a/conf/modules/baro_MS5534A.xml +++ b/conf/modules/baro_MS5534A.xml @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + diff --git a/conf/modules/baro_bmp.xml b/conf/modules/baro_bmp.xml index 288036c05c..7a14118844 100644 --- a/conf/modules/baro_bmp.xml +++ b/conf/modules/baro_bmp.xml @@ -2,8 +2,8 @@ diff --git a/conf/modules/baro_ets.xml b/conf/modules/baro_ets.xml index 7d2c9351ea..50f6a800d3 100644 --- a/conf/modules/baro_ets.xml +++ b/conf/modules/baro_ets.xml @@ -2,7 +2,7 @@ diff --git a/conf/modules/baro_scp.xml b/conf/modules/baro_scp.xml index 8bb3c9d8b2..dc5390aad0 100644 --- a/conf/modules/baro_scp.xml +++ b/conf/modules/baro_scp.xml @@ -2,7 +2,7 @@ @@ -14,8 +14,8 @@ - - + + diff --git a/conf/modules/baro_scp_i2c.xml b/conf/modules/baro_scp_i2c.xml index 972be683b7..5520670042 100644 --- a/conf/modules/baro_scp_i2c.xml +++ b/conf/modules/baro_scp_i2c.xml @@ -2,8 +2,8 @@ diff --git a/conf/modules/booz_cam.xml b/conf/modules/booz_cam.xml index 72d3b371f6..e489b6e290 100644 --- a/conf/modules/booz_cam.xml +++ b/conf/modules/booz_cam.xml @@ -8,7 +8,7 @@ - + diff --git a/conf/modules/booz_drop.xml b/conf/modules/booz_drop.xml index 168936049f..79f805cf74 100644 --- a/conf/modules/booz_drop.xml +++ b/conf/modules/booz_drop.xml @@ -8,9 +8,9 @@ - - - + + + diff --git a/conf/modules/booz_extra_dl.xml b/conf/modules/booz_extra_dl.xml index 4fb4cddd9e..7d2b1eb519 100644 --- a/conf/modules/booz_extra_dl.xml +++ b/conf/modules/booz_extra_dl.xml @@ -6,11 +6,11 @@ - - - - - + + + + + diff --git a/conf/modules/booz_pwm.xml b/conf/modules/booz_pwm.xml new file mode 100644 index 0000000000..2c5481c50c --- /dev/null +++ b/conf/modules/booz_pwm.xml @@ -0,0 +1,18 @@ + + + + + +
+ +
+ + + + +
+ diff --git a/conf/modules/cam_point.xml b/conf/modules/cam_point.xml index 1391379a27..811d3135a2 100644 --- a/conf/modules/cam_point.xml +++ b/conf/modules/cam_point.xml @@ -8,9 +8,9 @@ - - - + + + diff --git a/conf/modules/cam_roll.xml b/conf/modules/cam_roll.xml index 7bb14e1b35..9037cc76f5 100644 --- a/conf/modules/cam_roll.xml +++ b/conf/modules/cam_roll.xml @@ -7,7 +7,7 @@ - + diff --git a/conf/modules/demo_module.xml b/conf/modules/demo_module.xml index b2f1a5b9a0..7fd7e31464 100644 --- a/conf/modules/demo_module.xml +++ b/conf/modules/demo_module.xml @@ -11,12 +11,12 @@ #Exemple of RAW makefile part - + - - + + diff --git a/conf/modules/digital_cam.xml b/conf/modules/digital_cam.xml index f03907a0b3..e190c57f90 100644 --- a/conf/modules/digital_cam.xml +++ b/conf/modules/digital_cam.xml @@ -6,11 +6,11 @@
- - + + - - + +
# ap.CFLAGS += -DGPS_TRIGGERED_FUNCTION="dc_shoot_on_gps" @@ -30,10 +30,10 @@ - + - + diff --git a/conf/modules/digital_cam_i2c.xml b/conf/modules/digital_cam_i2c.xml index 17a91367ce..3fe59ff84a 100644 --- a/conf/modules/digital_cam_i2c.xml +++ b/conf/modules/digital_cam_i2c.xml @@ -14,15 +14,15 @@ - - - + + + - + diff --git a/conf/modules/enose.xml b/conf/modules/enose.xml index a3017a58da..2d6c1d34ff 100644 --- a/conf/modules/enose.xml +++ b/conf/modules/enose.xml @@ -15,7 +15,7 @@ - + diff --git a/conf/modules/humid_hih.xml b/conf/modules/humid_hih.xml index c8c4de5257..e25558fea0 100644 --- a/conf/modules/humid_hih.xml +++ b/conf/modules/humid_hih.xml @@ -8,8 +8,8 @@ - - + + diff --git a/conf/modules/humid_sht_i2c.xml b/conf/modules/humid_sht_i2c.xml index 415b5cb57b..949d3acf7c 100644 --- a/conf/modules/humid_sht_i2c.xml +++ b/conf/modules/humid_sht_i2c.xml @@ -2,7 +2,7 @@ diff --git a/conf/modules/infrared_adc.xml b/conf/modules/infrared_adc.xml new file mode 100644 index 0000000000..d5fd02f078 --- /dev/null +++ b/conf/modules/infrared_adc.xml @@ -0,0 +1,28 @@ + + + + +
+ +
+ + + + + + + + + + + + + + + + + + +
+ + diff --git a/conf/modules/infrared_i2c.xml b/conf/modules/infrared_i2c.xml index e5f68e2b3e..b73dd757d6 100644 --- a/conf/modules/infrared_i2c.xml +++ b/conf/modules/infrared_i2c.xml @@ -1,4 +1,5 @@ +
@@ -9,11 +10,12 @@ - - + + + - sim.srcs += $(SRC_ARCH)/sim_ir.c + diff --git a/conf/modules/ins_vn100.xml b/conf/modules/ins_vn100.xml index 09809157af..8ceda17cb8 100644 --- a/conf/modules/ins_vn100.xml +++ b/conf/modules/ins_vn100.xml @@ -6,7 +6,7 @@
- + diff --git a/conf/modules/ins_xsens_MTiG_Uart0.xml b/conf/modules/ins_xsens_MTiG_Uart0.xml index 6d82eed2fd..aaa1261dd2 100644 --- a/conf/modules/ins_xsens_MTiG_Uart0.xml +++ b/conf/modules/ins_xsens_MTiG_Uart0.xml @@ -9,14 +9,14 @@ - - - - + + + + - + - +
diff --git a/conf/modules/ins_xsens_MTiG_fixedwing.xml b/conf/modules/ins_xsens_MTiG_fixedwing.xml index 05ca9d8154..27e67847cd 100644 --- a/conf/modules/ins_xsens_MTiG_fixedwing.xml +++ b/conf/modules/ins_xsens_MTiG_fixedwing.xml @@ -10,11 +10,11 @@ - - - - - + + + + +
diff --git a/conf/modules/ins_xsens_MTi_Uart0.xml b/conf/modules/ins_xsens_MTi_Uart0.xml index ef2bd4e97a..c8911e24e2 100644 --- a/conf/modules/ins_xsens_MTi_Uart0.xml +++ b/conf/modules/ins_xsens_MTi_Uart0.xml @@ -8,13 +8,13 @@ - - - + + + - + - + diff --git a/conf/modules/lcd_dogm.xml b/conf/modules/lcd_dogm.xml index 1a1e7518b0..c2092f89e5 100644 --- a/conf/modules/lcd_dogm.xml +++ b/conf/modules/lcd_dogm.xml @@ -8,7 +8,7 @@ - + diff --git a/conf/modules/light.xml b/conf/modules/light.xml index 8b5a8c9f1b..2860bc40bb 100644 --- a/conf/modules/light.xml +++ b/conf/modules/light.xml @@ -8,12 +8,12 @@ - diff --git a/conf/modules/light_temt.xml b/conf/modules/light_temt.xml index 3749fc7215..ddf62982e4 100644 --- a/conf/modules/light_temt.xml +++ b/conf/modules/light_temt.xml @@ -8,8 +8,8 @@ - - + + diff --git a/conf/modules/mag_micromag_fw.xml b/conf/modules/mag_micromag_fw.xml index 11369dac34..65126faa0d 100644 --- a/conf/modules/mag_micromag_fw.xml +++ b/conf/modules/mag_micromag_fw.xml @@ -9,7 +9,7 @@ - + diff --git a/conf/modules/max11040.xml b/conf/modules/max11040.xml index 2c73114ee8..626fda2b5f 100644 --- a/conf/modules/max11040.xml +++ b/conf/modules/max11040.xml @@ -7,7 +7,7 @@ - + diff --git a/conf/modules/module.dtd b/conf/modules/module.dtd index 8845f1171a..33122841b8 100644 --- a/conf/modules/module.dtd +++ b/conf/modules/module.dtd @@ -8,11 +8,11 @@ - - - - + + + + +target CDATA #IMPLIED> - + + - - - - +dir CDATA #IMPLIED> + + diff --git a/conf/modules/servo_switch.xml b/conf/modules/servo_switch.xml index 683b13b46b..f6d93e2a34 100644 --- a/conf/modules/servo_switch.xml +++ b/conf/modules/servo_switch.xml @@ -10,9 +10,9 @@ diff --git a/conf/modules/sonar_maxbotix_booz.xml b/conf/modules/sonar_maxbotix_booz.xml index ef490bfc93..ce23345d65 100644 --- a/conf/modules/sonar_maxbotix_booz.xml +++ b/conf/modules/sonar_maxbotix_booz.xml @@ -8,9 +8,9 @@ - - - + + + diff --git a/conf/modules/tcas.xml b/conf/modules/tcas.xml index e7931a84cf..951ed06396 100644 --- a/conf/modules/tcas.xml +++ b/conf/modules/tcas.xml @@ -10,7 +10,7 @@ - + diff --git a/conf/modules/temp_temod.xml b/conf/modules/temp_temod.xml index 86356fbf57..fbac1fb159 100644 --- a/conf/modules/temp_temod.xml +++ b/conf/modules/temp_temod.xml @@ -2,8 +2,8 @@ diff --git a/conf/modules/trig_test.xml b/conf/modules/trig_test.xml index d8f358a648..0365fecb23 100644 --- a/conf/modules/trig_test.xml +++ b/conf/modules/trig_test.xml @@ -6,10 +6,10 @@ - + - - + + diff --git a/conf/modules/trigger_ext.xml b/conf/modules/trigger_ext.xml index 192ba1d30e..4db3c1663a 100644 --- a/conf/modules/trigger_ext.xml +++ b/conf/modules/trigger_ext.xml @@ -8,12 +8,12 @@ - + - - - - + + + + diff --git a/conf/modules/twog_extra_dl.xml b/conf/modules/twog_extra_dl.xml index a01f4539d2..636238baf9 100755 --- a/conf/modules/twog_extra_dl.xml +++ b/conf/modules/twog_extra_dl.xml @@ -6,10 +6,10 @@ - - - - + + + + diff --git a/conf/modules/vehicle_interface_overo_link.xml b/conf/modules/vehicle_interface_overo_link.xml index 3d6d40915d..5535ff4ebb 100644 --- a/conf/modules/vehicle_interface_overo_link.xml +++ b/conf/modules/vehicle_interface_overo_link.xml @@ -13,14 +13,14 @@ ap.srcs += lisa/lisa_overo_link.c lisa/arch/stm32/lisa_overo_link_arch.c - - - - - - - - + + + + + + + + diff --git a/conf/modules/wind_gfi.xml b/conf/modules/wind_gfi.xml index 8989322f00..5db44c9348 100644 --- a/conf/modules/wind_gfi.xml +++ b/conf/modules/wind_gfi.xml @@ -9,7 +9,7 @@ - + diff --git a/conf/modules/windturbine.xml b/conf/modules/windturbine.xml index 1af8b9651f..5d01713af6 100644 --- a/conf/modules/windturbine.xml +++ b/conf/modules/windturbine.xml @@ -8,8 +8,8 @@ - - + + diff --git a/conf/radios/T9cap.xml b/conf/radios/T9cap.xml old mode 100755 new mode 100644 diff --git a/conf/radios/mc22.xml b/conf/radios/mc22.xml new file mode 100644 index 0000000000..43adfdd64a --- /dev/null +++ b/conf/radios/mc22.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + diff --git a/conf/radios/vanguard.xml b/conf/radios/vanguard.xml old mode 100755 new mode 100644 diff --git a/conf/settings/tuning_basic_ins.xml b/conf/settings/tuning_basic_ins.xml new file mode 100644 index 0000000000..b052c9be53 --- /dev/null +++ b/conf/settings/tuning_basic_ins.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/settings/tuning_ins.xml b/conf/settings/tuning_ins.xml index fb7ac75c5d..08250f98b9 100644 --- a/conf/settings/tuning_ins.xml +++ b/conf/settings/tuning_ins.xml @@ -32,6 +32,9 @@ + + + @@ -41,7 +44,7 @@ - + diff --git a/conf/telemetry/default_fixedwing_imu.xml b/conf/telemetry/default_fixedwing_imu.xml index fcf88d9dfb..c106da4e29 100644 --- a/conf/telemetry/default_fixedwing_imu.xml +++ b/conf/telemetry/default_fixedwing_imu.xml @@ -7,7 +7,7 @@ - + @@ -26,8 +26,8 @@ - - + + diff --git a/data/pictures/gcs_icons/bungee_launch.png b/data/pictures/gcs_icons/bungee_launch.png new file mode 100644 index 0000000000..246f9832ed Binary files /dev/null and b/data/pictures/gcs_icons/bungee_launch.png differ diff --git a/data/pictures/gcs_icons/cam_lock.png b/data/pictures/gcs_icons/cam_lock.png new file mode 100644 index 0000000000..2bd61ff8bc Binary files /dev/null and b/data/pictures/gcs_icons/cam_lock.png differ diff --git a/data/pictures/gcs_icons/cam_unlock.png b/data/pictures/gcs_icons/cam_unlock.png new file mode 100644 index 0000000000..0079b59308 Binary files /dev/null and b/data/pictures/gcs_icons/cam_unlock.png differ diff --git a/data/pictures/gcs_icons/decide_landing_dir.png b/data/pictures/gcs_icons/decide_landing_dir.png new file mode 100644 index 0000000000..12df84bb18 Binary files /dev/null and b/data/pictures/gcs_icons/decide_landing_dir.png differ diff --git a/data/pictures/gcs_icons/observe.png b/data/pictures/gcs_icons/observe.png new file mode 100644 index 0000000000..dd6d6f9e94 Binary files /dev/null and b/data/pictures/gcs_icons/observe.png differ diff --git a/data/pictures/gcs_icons/parachute.png b/data/pictures/gcs_icons/parachute.png new file mode 100644 index 0000000000..06b7efba8f Binary files /dev/null and b/data/pictures/gcs_icons/parachute.png differ diff --git a/data/pictures/gcs_icons/target.png b/data/pictures/gcs_icons/target.png new file mode 100644 index 0000000000..afafafe609 Binary files /dev/null and b/data/pictures/gcs_icons/target.png differ diff --git a/data/srtm/Makefile b/data/srtm/Makefile new file mode 100644 index 0000000000..0e24687031 --- /dev/null +++ b/data/srtm/Makefile @@ -0,0 +1,31 @@ +DATADIR = $(PAPARAZZI_HOME)/conf/srtm_data +Q=@ + +SRTMData: $(DATADIR)/Africa $(DATADIR)/Australia $(DATADIR)/Eurasia $(DATADIR)/Islands $(DATADIR)/North_America $(DATADIR)/South_America + +$(DATADIR): + mkdir $(DATADIR) + +$(DATADIR)/Africa: $(DATADIR) + wget -O $(@) http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/$(@F) + +$(DATADIR)/Australia: $(DATADIR) + wget -O $(@) http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/$(@F) + +$(DATADIR)/Eurasia: $(DATADIR) + wget -O $(@) http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/$(@F) + +$(DATADIR)/Islands: $(DATADIR) + wget -O $(@) http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/$(@F) + +$(DATADIR)/North_America: $(DATADIR) + wget -O $(@) http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/$(@F) + +$(DATADIR)/South_America: $(DATADIR) + wget -O $(@) http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/$(@F) + +.SUFFIXES: .hgt.zip + +%.hgt.zip: SRTMData + $(Q)wget -c -nv -N http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/$(shell grep -l $(@F) $(DATADIR)/* | sed -e s#$(DATADIR)/##)/$(@F) + diff --git a/debian/changelog.lenny b/debian/changelog.lenny index 6a78c9aacf..55d3e0cb12 100644 --- a/debian/changelog.lenny +++ b/debian/changelog.lenny @@ -1,3 +1,10 @@ +paparazzi (3.3-1) unstable; urgency=low + + * New build system with modules and subsystems + * Change dependency from subversion to git + + -- Gautier Hattenberger Wed, 29 Dec 2010 12:49:00 +0100 + paparazzi (3.2-10) unstable; urgency=low * Dependencie over gpsd, libgps-dev, python-lxml, python-wxgtk2.8 added diff --git a/debian/control.lenny b/debian/control.lenny index 8abef20019..6587b5a8e3 100644 --- a/debian/control.lenny +++ b/debian/control.lenny @@ -1,15 +1,15 @@ Source: paparazzi Section: extra Priority: optional -Maintainer: Pascal Brisset +Maintainer: Gautier Hattenberger Build-Depends: debhelper (>= 4.0.0) Standards-Version: 3.6.1 Package: paparazzi-dev Architecture: any -Suggests: paparazzi-avr, paparazzi-arm7, eagle, gs-common, tetex-extra, dia-gnome, boa -Depends: ivy-c-dev, ivy-c, ivy-ocaml, libxml-light-ocaml-dev, liblablgtk2-ocaml-dev, make, gcc, gnuplot, libgnomecanvas2-dev, bzip2, subversion, liblablgtk2-gnome-ocaml-dev, libusb-dev, speech-dispatcher, glade, gedit, imagemagick, libpcre3-dev, libocamlnet-ocaml-dev, meschach-dev | libmeschach-dev, ivy-python, gpsd, libgps-dev, python-lxml, python-wxgtk2.8 +Suggests: paparazzi-avr, paparazzi-arm7, eagle, gs-common, tetex-extra, dia-gnome, boa, gitk +Depends: ivy-c-dev, ivy-c, ivy-ocaml, libxml-light-ocaml-dev, liblablgtk2-ocaml-dev, make, gcc, gnuplot, libgnomecanvas2-dev, bzip2, git-core, liblablgtk2-gnome-ocaml-dev, libusb-dev, speech-dispatcher, glade, gedit, imagemagick, libpcre3-dev, libocamlnet-ocaml-dev, meschach-dev | libmeschach-dev, ivy-python, gpsd, libgps-dev, python-lxml, python-wxgtk2.8 Description: Paparazzi Meta Package : common support diff --git a/debian/paparazzi-bin.postinst b/debian/paparazzi-bin.postinst index 6ae37e021d..83cbee528d 100755 --- a/debian/paparazzi-bin.postinst +++ b/debian/paparazzi-bin.postinst @@ -31,4 +31,4 @@ cd ${DESTDIR}/sw/supervision ${OCAMLC} -custom -I +xml-light -I +lablgtk2 -I ${DESTDIR}/sw/lib/ocaml unix.cma str.cma xml-light.cma lablgtk.cma glibivy-ocaml.cma lib-pprz.cma lablglade.cma lablgnomeui.cma gtkInit.cmo gtk_pc.cmo gtk_process.cmo pc_common.cmo pc_aircraft.cmo pc_control_panel.cmo paparazzicenter.cmo -o paparazzicenter cd ${DESTDIR}/sw/tools -${OCAMLC} -custom -I +xml-light -I +lablgtk2 -I ${DESTDIR}/sw/lib/ocaml unix.cma str.cma xml-light.cma ivy-ocaml.cma lib-pprz.cma fp_syntax.cmo fp_parser.cmo fp_lexer.cmo fp_proc.cmo gen_flight_plan.cmo -o gen_flight_plan.out +${OCAMLC} -custom -I +xml-light -I +lablgtk2 -I ${DESTDIR}/sw/lib/ocaml unix.cma str.cma xml-light.cma ivy-ocaml.cma lib-pprz.cma fp_proc.cmo gen_flight_plan.cmo -o gen_flight_plan.out diff --git a/debian/rules b/debian/rules old mode 100644 new mode 100755 diff --git a/paparazzi.osx b/paparazzi.osx deleted file mode 100755 index 7efa9dc9a6..0000000000 --- a/paparazzi.osx +++ /dev/null @@ -1,15 +0,0 @@ -#!/opt/local/bin/ocamlrun /opt/local/bin/ocaml -#load "unix.cma";; -let (//) = Filename.concat -let dirname = Filename.dirname Sys.argv.(0) -let dirname = if Filename.is_relative dirname && dirname <> Filename.current_dir_name then Sys.getcwd () // dirname else dirname -let env = - Array.map (fun var -> - let value = try Sys.getenv var with _ -> dirname in - let value = if value = "." then Sys.getcwd () else value in - Printf.sprintf "%s=%s" var value) - [|"PAPARAZZI_SRC"; "PAPARAZZI_HOME"|] -let com = dirname // "sw/supervision/paparazzicenter";; -Sys.argv.(0) <- com;; -let env = Array.append env (Unix.environment ());; -Unix.execve com Sys.argv env diff --git a/sw/simulator/launchsitl b/src/launchsitl similarity index 96% rename from sw/simulator/launchsitl rename to src/launchsitl index d6dbb69d89..261de6c477 100755 --- a/sw/simulator/launchsitl +++ b/src/launchsitl @@ -1,4 +1,4 @@ -#!/usr/bin/ocamlrun /usr/bin/ocaml +#!OCAMLRUN OCAML #load "unix.cma";; let (//) = Filename.concat let paparazzi_home = diff --git a/paparazzi b/src/paparazzi similarity index 94% rename from paparazzi rename to src/paparazzi index cc39f72a8c..8895cccacb 100755 --- a/paparazzi +++ b/src/paparazzi @@ -1,4 +1,4 @@ -#!/usr/bin/ocamlrun /usr/bin/ocaml +#!OCAMLRUN OCAML #load "unix.cma";; let (//) = Filename.concat let dirname = Filename.dirname Sys.argv.(0) diff --git a/sw/airborne/Makefile b/sw/airborne/Makefile index adb2189087..f969cc7499 100644 --- a/sw/airborne/Makefile +++ b/sw/airborne/Makefile @@ -42,6 +42,14 @@ ifneq ($(MAKECMDGOALS),clean) endif endif +# check for obsolete MODEM_UART_NR and GPS_UART_NR makefile vars +ifdef GPS_UART_NR + $(error GPS_UART_NR is obsolete, please use GPS_PORT instead to define the Uart to use, e.g. ) +endif +ifdef MODEM_UART_NR + $(error MODEM_UART_NR is obsolete, please use MODEM_PORT instead to define the Uart to use, e.g. ) +endif + $(TARGET).install : warn_conf warn_conf : diff --git a/sw/airborne/ap_downlink.h b/sw/airborne/ap_downlink.h index a45945cf33..71f341c1b4 100644 --- a/sw/airborne/ap_downlink.h +++ b/sw/airborne/ap_downlink.h @@ -115,8 +115,8 @@ #define PERIODIC_SEND_SETTINGS(_chan) {} #endif -#if defined USE_INFRARED || USE_INFRARED_I2C -#define PERIODIC_SEND_IR_SENSORS(_chan) DOWNLINK_SEND_IR_SENSORS(_chan, &infrared.ir1, &infrared.ir2, &infrared.pitch, &infrared.roll, &infrared.top); +#if defined USE_INFRARED || USE_INFRARED_TELEMETRY +#define PERIODIC_SEND_IR_SENSORS(_chan) DOWNLINK_SEND_IR_SENSORS(_chan, &infrared.value.ir1, &infrared.value.ir2, &infrared.pitch, &infrared.roll, &infrared.top); #else #define PERIODIC_SEND_IR_SENSORS(_chan) ; #endif @@ -142,8 +142,8 @@ #include "subsystems/imu.h" #define PERIODIC_SEND_IMU_ACCEL_RAW(_chan) { DOWNLINK_SEND_IMU_ACCEL_RAW(_chan, &imu.accel_unscaled.x, &imu.accel_unscaled.y, &imu.accel_unscaled.z)} #define PERIODIC_SEND_IMU_GYRO_RAW(_chan) { DOWNLINK_SEND_IMU_GYRO_RAW(_chan, &imu.gyro_unscaled.p, &imu.gyro_unscaled.q, &imu.gyro_unscaled.r)} -#define PERIODIC_SEND_IMU_ACCEL(_chan) { DOWNLINK_SEND_IMU_ACCEL_RAW(_chan, &imu.accel.x, &imu.accel.y, &imu.accel.z)} -#define PERIODIC_SEND_IMU_GYRO(_chan) { DOWNLINK_SEND_IMU_GYRO_RAW(_chan, &imu.gyro.p, &imu.gyro.q, &imu.gyro.r)} +#define PERIODIC_SEND_IMU_ACCEL(_chan) { DOWNLINK_SEND_IMU_ACCEL(_chan, &imu.accel.x, &imu.accel.y, &imu.accel.z)} +#define PERIODIC_SEND_IMU_GYRO(_chan) { DOWNLINK_SEND_IMU_GYRO(_chan, &imu.gyro.p, &imu.gyro.q, &imu.gyro.r)} #else #define PERIODIC_SEND_IMU_ACCEL_RAW(_chan) {} #define PERIODIC_SEND_IMU_GYRO_RAW(_chan) {} diff --git a/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.c b/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.c index 7d8541121d..378337c50b 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.c +++ b/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.c @@ -318,6 +318,10 @@ void i2c1_hw_init ( void ) { #endif /* USE_I2C1 */ +bool_t i2c_idle(struct i2c_periph* p) { + return p->status == I2CIdle; +} + bool_t i2c_submit(struct i2c_periph* p, struct i2c_transaction* t) { uint8_t idx; diff --git a/sw/airborne/booz/arch/lpc21/booz2_pwm_hw.c b/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.c similarity index 94% rename from sw/airborne/booz/arch/lpc21/booz2_pwm_hw.c rename to sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.c index 5c0081cab5..2dbf3c22ef 100644 --- a/sw/airborne/booz/arch/lpc21/booz2_pwm_hw.c +++ b/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.c @@ -1,7 +1,7 @@ /* * $Id: $ * - * Copyright (C) 2007 ENAC + * Copyright (C) 2011 ENAC * * This file is part of paparazzi. * @@ -22,12 +22,12 @@ * */ -#include "booz2_pwm_hw.h" +#include "modules/core/booz_pwm_arch.h" #define PWM_PERIOD SYS_TICS_OF_USEC(20000) #define PWM_DUTY SYS_TICS_OF_USEC(1500) -void booz2_pwm_init_hw( void ) { +void booz_pwm_init_arch( void ) { /* start PWM5 */ /* select P0.21 as PWM5 */ diff --git a/sw/airborne/booz/arch/lpc21/booz2_pwm_hw.h b/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.h similarity index 79% rename from sw/airborne/booz/arch/lpc21/booz2_pwm_hw.h rename to sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.h index f3289f41e4..b191caf29f 100644 --- a/sw/airborne/booz/arch/lpc21/booz2_pwm_hw.h +++ b/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.h @@ -1,7 +1,7 @@ /* * $Id: $ * - * Copyright (C) 2007 ENAC + * Copyright (C) 2011 ENAC * * This file is part of paparazzi. * @@ -22,25 +22,25 @@ * */ -#ifndef BOOZ2_PWM_HW_H -#define BOOZ2_PWM_HW_H +#ifndef BOOZ_PWM_ARCH_H +#define BOOZ_PWM_ARCH_H #include "std.h" #include "sys_time.h" -extern void booz2_pwm_init_hw(void); +extern void booz_pwm_init_arch(void); // Default PWM is PWM0 -#define Booz2SetPwmValue(_v) Booz2SetPwm0Value(_v) +#define BoozSetPwmValue(_v) BoozSetPwm0Value(_v) -#define Booz2SetPwm0Value(_v) { \ +#define BoozSetPwm0Value(_v) { \ PWMMR5 = SYS_TICS_OF_USEC(_v); \ PWMLER = PWMLER_LATCH5; \ } -#define Booz2SetPwm1Value(_v) { \ +#define BoozSetPwm1Value(_v) { \ PWMMR2 = SYS_TICS_OF_USEC(_v); \ PWMLER = PWMLER_LATCH2; \ } -#endif /* BOOZ2_PWM_HW_H */ +#endif /* BOOZ_PWM_ARCH_H */ diff --git a/sw/airborne/arch/lpc21/peripherals/max1168_arch.c b/sw/airborne/arch/lpc21/peripherals/max1168_arch.c index 14a45313da..060fafcde8 100644 --- a/sw/airborne/arch/lpc21/peripherals/max1168_arch.c +++ b/sw/airborne/arch/lpc21/peripherals/max1168_arch.c @@ -59,6 +59,7 @@ void max1168_read( void ) { SSP_DisableRti(); SSP_Enable(); /* write control byte - wait EOC on extint */ + /* use internal reference and clock, sequentially scan channels 0-7 */ SSPDR = (1 << 0 | 1 << 3 | 7 << 5) << 8; max1168_status = STA_MAX1168_SENDING_REQ; diff --git a/sw/airborne/arch/lpc21/peripherals/ms2001_arch.c b/sw/airborne/arch/lpc21/peripherals/ms2001_arch.c deleted file mode 100644 index a75530ac40..0000000000 --- a/sw/airborne/arch/lpc21/peripherals/ms2001_arch.c +++ /dev/null @@ -1,50 +0,0 @@ -/* PNI ms2001 connected on SPI1 */ -/* - IMU b2 - SS on P1.28 - RESET on P1.19 - DRDY on P0.30 ( EINT3) -*/ - -#include "peripherals/ms2001.h" - -volatile uint8_t ms2001_cur_axe; - -static void EXTINT_ISR(void) __attribute__((naked)); - -void ms2001_arch_init( void ) { - - ms2001_cur_axe = 0; - - /* configure SS pin */ - Ms2001Unselect(); /* pin idles high */ - SetBit(MS2001_SS_IODIR, MS2001_SS_PIN); /* pin is output */ - - /* configure RESET pin */ - Ms2001Reset(); /* pin idles low */ - SetBit(MS2001_RESET_IODIR, MS2001_RESET_PIN); /* pin is output */ - - /* configure DRDY pin */ - /* connected pin to EXINT */ - MS2001_DRDY_PINSEL |= MS2001_DRDY_PINSEL_VAL << MS2001_DRDY_PINSEL_BIT; - SetBit(EXTMODE, MS2001_DRDY_EINT); /* EINT is edge trigered */ - SetBit(EXTPOLAR,MS2001_DRDY_EINT); /* EINT is trigered on rising edge */ - SetBit(EXTINT,MS2001_DRDY_EINT); /* clear pending EINT */ - - /* initialize interrupt vector */ - VICIntSelect &= ~VIC_BIT( MS2001_DRDY_VIC_IT ); /* select EINT as IRQ source */ - VICIntEnable = VIC_BIT( MS2001_DRDY_VIC_IT ); /* enable it */ - _VIC_CNTL(MS2001_DRDY_VIC_SLOT) = VIC_ENABLE | MS2001_DRDY_VIC_IT; - _VIC_ADDR(MS2001_DRDY_VIC_SLOT) = (uint32_t)EXTINT_ISR; // address of the ISR - -} - -void EXTINT_ISR(void) { - ISR_ENTRY(); - /* no, we won't do anything asynchronously, so just notify */ - ms2001_status = MS2001_GOT_EOC; - /* clear EINT */ - EXTINT = (1< // for abs - -#include "std.h" -#include "LPC21xx.h" -#include "interrupt_hw.h" - -#include "ssp_hw.h" -#include BOARD_CONFIG - -#include "generated/airframe.h" - - - -extern volatile uint8_t ms2001_cur_axe; - -#define Ms2001Select() SetBit(MS2001_SS_IOCLR,MS2001_SS_PIN) -#define Ms2001Unselect() SetBit(MS2001_SS_IOSET,MS2001_SS_PIN) - -#define Ms2001Reset() SetBit(MS2001_RESET_IOCLR,MS2001_RESET_PIN) -#define Ms2001Set() SetBit(MS2001_RESET_IOSET,MS2001_RESET_PIN) - -#define Ms2001OnSpiIt() { \ - switch (ms2001_status) { \ - case MS2001_SENDING_REQ: \ - { \ - /* read dummy control byte reply */ \ - uint8_t foo __attribute__ ((unused)) = SSPDR; \ - ms2001_status = MS2001_WAITING_EOC; \ - Ms2001Unselect(); \ - SSP_ClearRti(); \ - SSP_DisableRti(); \ - SSP_Disable(); \ - } \ - break; \ - case MS2001_READING_RES: \ - { \ - int16_t new_val; \ - new_val = SSPDR << 8; \ - new_val += SSPDR; \ - if (abs(new_val) < 2000) \ - ms2001_values[ms2001_cur_axe] = new_val; \ - Ms2001Unselect(); \ - SSP_ClearRti(); \ - SSP_DisableRti(); \ - SSP_Disable(); \ - ms2001_cur_axe++; \ - if (ms2001_cur_axe > 2) { \ - ms2001_cur_axe = 0; \ - ms2001_status = MS2001_DATA_AVAILABLE; \ - } \ - else \ - ms2001_status = MS2001_IDLE; \ - } \ - break; \ - } \ - } - - -#define Ms2001SendReq() { \ - Ms2001Select(); \ - ms2001_status = MS2001_SENDING_REQ; \ - Ms2001Set(); \ - SSP_ClearRti(); \ - SSP_EnableRti(); \ - Ms2001Reset(); \ - uint8_t control_byte = (ms2001_cur_axe+1) << 0 | \ - MS2001_DIVISOR << 4; \ - SSP_Send(control_byte); \ - SSP_Enable(); \ - } - -#define Ms2001ReadRes() { \ - ms2001_status = MS2001_READING_RES; \ - Ms2001Select(); \ - /* trigger 2 bytes read */ \ - SSP_Send(0); \ - SSP_Send(0); \ - SSP_Enable(); \ - SSP_ClearRti(); \ - SSP_EnableRti(); \ - } - - - -#endif /* MS2001_ARCH_H */ diff --git a/sw/airborne/arch/lpc21/peripherals/ms2100_arch.c b/sw/airborne/arch/lpc21/peripherals/ms2100_arch.c new file mode 100644 index 0000000000..ec22b64b6c --- /dev/null +++ b/sw/airborne/arch/lpc21/peripherals/ms2100_arch.c @@ -0,0 +1,50 @@ +/* PNI ms2100 connected on SPI1 */ +/* + IMU b2 + SS on P1.28 + RESET on P1.19 + DRDY on P0.30 ( EINT3) +*/ + +#include "peripherals/ms2100.h" + +volatile uint8_t ms2100_cur_axe; + +static void EXTINT_ISR(void) __attribute__((naked)); + +void ms2100_arch_init( void ) { + + ms2100_cur_axe = 0; + + /* configure SS pin */ + Ms2001Unselect(); /* pin idles high */ + SetBit(MS2100_SS_IODIR, MS2100_SS_PIN); /* pin is output */ + + /* configure RESET pin */ + Ms2001Reset(); /* pin idles low */ + SetBit(MS2100_RESET_IODIR, MS2100_RESET_PIN); /* pin is output */ + + /* configure DRDY pin */ + /* connected pin to EXINT */ + MS2100_DRDY_PINSEL |= MS2100_DRDY_PINSEL_VAL << MS2100_DRDY_PINSEL_BIT; + SetBit(EXTMODE, MS2100_DRDY_EINT); /* EINT is edge trigered */ + SetBit(EXTPOLAR,MS2100_DRDY_EINT); /* EINT is trigered on rising edge */ + SetBit(EXTINT,MS2100_DRDY_EINT); /* clear pending EINT */ + + /* initialize interrupt vector */ + VICIntSelect &= ~VIC_BIT( MS2100_DRDY_VIC_IT ); /* select EINT as IRQ source */ + VICIntEnable = VIC_BIT( MS2100_DRDY_VIC_IT ); /* enable it */ + _VIC_CNTL(MS2100_DRDY_VIC_SLOT) = VIC_ENABLE | MS2100_DRDY_VIC_IT; + _VIC_ADDR(MS2100_DRDY_VIC_SLOT) = (uint32_t)EXTINT_ISR; // address of the ISR + +} + +void EXTINT_ISR(void) { + ISR_ENTRY(); + /* no, we won't do anything asynchronously, so just notify */ + ms2100_status = MS2100_GOT_EOC; + /* clear EINT */ + EXTINT = (1< // for abs + +#include "std.h" +#include "LPC21xx.h" +#include "interrupt_hw.h" + +#include "ssp_hw.h" +#include BOARD_CONFIG + +#include "generated/airframe.h" + + + +extern volatile uint8_t ms2100_cur_axe; + +#define Ms2001Select() SetBit(MS2100_SS_IOCLR,MS2100_SS_PIN) +#define Ms2001Unselect() SetBit(MS2100_SS_IOSET,MS2100_SS_PIN) + +#define Ms2001Reset() SetBit(MS2100_RESET_IOCLR,MS2100_RESET_PIN) +#define Ms2001Set() SetBit(MS2100_RESET_IOSET,MS2100_RESET_PIN) + +#define Ms2001OnSpiInt() { \ + switch (ms2100_status) { \ + case MS2100_SENDING_REQ: \ + { \ + /* read dummy control byte reply */ \ + uint8_t foo __attribute__ ((unused)) = SSPDR; \ + ms2100_status = MS2100_WAITING_EOC; \ + Ms2001Unselect(); \ + SSP_ClearRti(); \ + SSP_DisableRti(); \ + SSP_Disable(); \ + } \ + break; \ + case MS2100_READING_RES: \ + { \ + int16_t new_val; \ + new_val = SSPDR << 8; \ + new_val += SSPDR; \ + if (abs(new_val) < 2000) \ + ms2100_values[ms2100_cur_axe] = new_val; \ + Ms2001Unselect(); \ + SSP_ClearRti(); \ + SSP_DisableRti(); \ + SSP_Disable(); \ + ms2100_cur_axe++; \ + if (ms2100_cur_axe > 2) { \ + ms2100_cur_axe = 0; \ + ms2100_status = MS2100_DATA_AVAILABLE; \ + } \ + else \ + ms2100_status = MS2100_IDLE; \ + } \ + break; \ + } \ + } + + +#define Ms2001SendReq() { \ + Ms2001Select(); \ + ms2100_status = MS2100_SENDING_REQ; \ + Ms2001Set(); \ + SSP_ClearRti(); \ + SSP_EnableRti(); \ + Ms2001Reset(); \ + uint8_t control_byte = (ms2100_cur_axe+1) << 0 | \ + MS2100_DIVISOR << 4; \ + SSP_Send(control_byte); \ + SSP_Enable(); \ + } + +#define Ms2001ReadRes() { \ + ms2100_status = MS2100_READING_RES; \ + Ms2001Select(); \ + /* trigger 2 bytes read */ \ + SSP_Send(0); \ + SSP_Send(0); \ + SSP_Enable(); \ + SSP_ClearRti(); \ + SSP_EnableRti(); \ + } + + + +#endif /* MS2100_ARCH_H */ diff --git a/sw/airborne/arch/lpc21/subsystems/imu/imu_b2_arch.c b/sw/airborne/arch/lpc21/subsystems/imu/imu_b2_arch.c index 037196de75..0b98aee11e 100644 --- a/sw/airborne/arch/lpc21/subsystems/imu/imu_b2_arch.c +++ b/sw/airborne/arch/lpc21/subsystems/imu/imu_b2_arch.c @@ -23,11 +23,9 @@ #include "subsystems/imu.h" +int imu_overrun = 0; volatile uint8_t imu_ssp_status; static void SSP_ISR(void) __attribute__((naked)); -#if 0 -static inline bool_t isr_try_mag(void); -#endif /* SSPCR0 settings */ #define SSP_DDS8 0x07 << 0 /* data size : 8 bits */ @@ -84,7 +82,11 @@ void imu_b2_arch_init(void) { void imu_periodic(void) { // check ssp idle - // ASSERT((imu_status == IMU_STA_IDLE), DEBUG_IMU, IMU_ERR_OVERUN); + if (imu_ssp_status != IMU_SSP_STA_IDLE) + { + imu_overrun++; + return; //, DEBUG_IMU, IMU_ERR_OVERUN); + } // setup 16 bits ImuSetSSP16bits(); @@ -99,91 +101,65 @@ void imu_periodic(void) { -#include "led.h" - -#if 0 - - -static inline bool_t isr_try_mag(void) { - switch (micromag_status) { - case MS2001_IDLE : - ImuSetSSP8bits(); - Ms2001SendReq(); - return TRUE; - case MS2001_GOT_EOC: - ImuSetSSP8bits(); - Ms2001ReadRes(); - return TRUE; - } - return FALSE; -} +#if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2100 static void SSP_ISR(void) { - ISR_ENTRY(); + ISR_ENTRY(); - switch (imu_ssp_status) { - case IMU_SSP_STA_BUSY_MAX1168: - Max1168OnSpiInt(); - if (isr_try_mag()) - imu_ssp_status = IMU_SSP_STA_BUSY_MS2100; - else - imu_ssp_status = IMU_SSP_STA_IDLE; - break; - case IMU_SSP_STA_BUSY_MS2100: - Ms2001OnSpiIt(); - imu_ssp_status = IMU_SSP_STA_IDLE; - break; - default: - // spurious interrupt - LED_ON(1); - } + switch (imu_ssp_status) { + case IMU_SSP_STA_BUSY_MAX1168: + Max1168OnSpiInt(); + if (ms2100_status == MS2100_IDLE || ms2100_status == MS2100_GOT_EOC) { + ImuSetSSP8bits(); + if (ms2100_status == MS2100_IDLE) { + Ms2001SendReq(); + } + else { /* MS2100_GOT_EOC */ + Ms2001ReadRes(); + } + imu_ssp_status = IMU_SSP_STA_BUSY_MS2100; + } + else { + imu_ssp_status = IMU_SSP_STA_IDLE; + } + break; + case IMU_SSP_STA_BUSY_MS2100: + Ms2001OnSpiInt(); + if (ms2100_status == MS2100_IDLE) { + Ms2001SendReq(); + imu_ssp_status = IMU_SSP_STA_BUSY_MS2100; + } + else + imu_ssp_status = IMU_SSP_STA_IDLE; + break; - VICVectAddr = 0x00000000; /* clear this interrupt from the VIC */ - ISR_EXIT(); -} -#endif - - -static void SSP_ISR(void) { - ISR_ENTRY(); - - switch (imu_ssp_status) { - case IMU_SSP_STA_BUSY_MAX1168: - Max1168OnSpiInt(); -#if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001 - if (ms2001_status == MS2001_IDLE || ms2001_status == MS2001_GOT_EOC) { - ImuSetSSP8bits(); - if (ms2001_status == MS2001_IDLE) { - Ms2001SendReq(); - } - else { /* MS2001_GOT_EOC */ - Ms2001ReadRes(); - } - imu_ssp_status = IMU_SSP_STA_BUSY_MS2100; - } - else { -#endif - imu_ssp_status = IMU_SSP_STA_IDLE; -#if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001 - } -#endif - break; -#if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001 - case IMU_SSP_STA_BUSY_MS2100: - Ms2001OnSpiIt(); - if (ms2001_status == MS2001_IDLE) { - Ms2001SendReq(); - imu_ssp_status = IMU_SSP_STA_BUSY_MS2100; - } - else - imu_ssp_status = IMU_SSP_STA_IDLE; - break; -#endif // default: // spurious interrupt // FIXME LED_ON(1); - } + } - VICVectAddr = 0x00000000; /* clear this interrupt from the VIC */ - ISR_EXIT(); + VICVectAddr = 0x00000000; /* clear this interrupt from the VIC */ + ISR_EXIT(); } + +#else //no IMU_B2_MAG_MS2100 + +static void SSP_ISR(void) { + ISR_ENTRY(); + + switch (imu_ssp_status) { + case IMU_SSP_STA_BUSY_MAX1168: + Max1168OnSpiInt(); + imu_ssp_status = IMU_SSP_STA_IDLE; + break; + + // default: + // spurious interrupt + // FIXME LED_ON(1); + } + + VICVectAddr = 0x00000000; /* clear this interrupt from the VIC */ + ISR_EXIT(); +} + +#endif //no IMU_B2_MAG_MS2100 diff --git a/sw/airborne/arch/lpc21/subsystems/imu/imu_b2_arch.h b/sw/airborne/arch/lpc21/subsystems/imu/imu_b2_arch.h index d54b22452a..dce131ff6e 100644 --- a/sw/airborne/arch/lpc21/subsystems/imu/imu_b2_arch.h +++ b/sw/airborne/arch/lpc21/subsystems/imu/imu_b2_arch.h @@ -45,6 +45,8 @@ #define IMU_SSP_STA_BUSY_MAX1168 1 #define IMU_SSP_STA_BUSY_MS2100 2 extern volatile uint8_t imu_ssp_status; +extern int imu_overrun; + diff --git a/sw/airborne/arch/lpc21/uart_tunnel.c b/sw/airborne/arch/lpc21/uart_tunnel.c index 04fd72dce1..9f4bbd5ef2 100644 --- a/sw/airborne/arch/lpc21/uart_tunnel.c +++ b/sw/airborne/arch/lpc21/uart_tunnel.c @@ -3,7 +3,7 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "led.h" #define TXD0_PIN 0 @@ -14,7 +14,7 @@ int main (int argc, char** argv) { int tx=0, rx=0; int tx_shadow=1, rx_shadow=1; - hw_init(); + mcu_init(); led_init(); LED_ON(1); diff --git a/sw/airborne/arch/lpc21/usb_tunnel.c b/sw/airborne/arch/lpc21/usb_tunnel.c index f7f324da24..aeef32b1dc 100644 --- a/sw/airborne/arch/lpc21/usb_tunnel.c +++ b/sw/airborne/arch/lpc21/usb_tunnel.c @@ -53,7 +53,7 @@ int main( void ) { VCOM_init(); #endif - int_enable(); + mcu_int_enable(); LED_ON(3); diff --git a/sw/airborne/arch/lpc21/vic_slots.txt b/sw/airborne/arch/lpc21/vic_slots.txt index f289a4f48a..c75e66ef1e 100644 --- a/sw/airborne/arch/lpc21/vic_slots.txt +++ b/sw/airborne/arch/lpc21/vic_slots.txt @@ -6,7 +6,7 @@ 9 I2C0_VIC_SLOT I2C1_VIC_SLOT 11 SSP_VIC_SLOT -11 MS2001_DRDY_VIC_SLOT +11 MS2100_DRDY_VIC_SLOT 12 MICROMAG_DRDY_VIC_SLOT 12 MAX11040_DRDY_VIC_SLOT diff --git a/sw/airborne/arch/sim/mcu_periph/i2c_arch.c b/sw/airborne/arch/sim/mcu_periph/i2c_arch.c index cd16065446..ceb58123b6 100644 --- a/sw/airborne/arch/sim/mcu_periph/i2c_arch.c +++ b/sw/airborne/arch/sim/mcu_periph/i2c_arch.c @@ -2,4 +2,5 @@ void i2c_hw_init ( void ) {} +bool_t i2c_idle(struct i2c_periph *p __attribute__ ((unused))) { return TRUE; } bool_t i2c_submit(struct i2c_periph* p __attribute__ ((unused)), struct i2c_transaction* t __attribute__ ((unused))) { return TRUE;} diff --git a/sw/airborne/booz/arch/sim/booz2_pwm_hw.c b/sw/airborne/arch/sim/modules/core/booz_pwm_arch.c similarity index 91% rename from sw/airborne/booz/arch/sim/booz2_pwm_hw.c rename to sw/airborne/arch/sim/modules/core/booz_pwm_arch.c index 1ff53d6faa..e3768ca9c9 100644 --- a/sw/airborne/booz/arch/sim/booz2_pwm_hw.c +++ b/sw/airborne/arch/sim/modules/core/booz_pwm_arch.c @@ -22,8 +22,8 @@ * */ -#include "booz2_pwm_hw.h" +#include "modules/core/booz_pwm_arch.h" -void booz2_pwm_init_hw( void ) {} +void booz_pwm_init_arch( void ) {} diff --git a/sw/airborne/arch/sim/modules/core/booz_pwm_arch.h b/sw/airborne/arch/sim/modules/core/booz_pwm_arch.h new file mode 100644 index 0000000000..d3d5229b99 --- /dev/null +++ b/sw/airborne/arch/sim/modules/core/booz_pwm_arch.h @@ -0,0 +1,36 @@ +/* + * $Id: $ + * + * Copyright (C) 2007 ENAC + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +#ifndef BOOZ_PWM_ARCH_H +#define BOOZ_PWM_ARCH_H + +extern void booz_pwm_init_arch(void); + +// Default PWM is PWM0 +#define BoozSetPwmValue(_v) BoozSetPwm0Value(_v) + +#define BoozSetPwm0Value(_v) {} +#define BoozSetPwm1Value(_v) {} + +#endif /* BOOZ_PWM_ARCH_H */ diff --git a/sw/airborne/arch/sim/sim_ir.c b/sw/airborne/arch/sim/sim_ir.c index 88441205f8..1ec7884faf 100644 --- a/sw/airborne/arch/sim/sim_ir.c +++ b/sw/airborne/arch/sim/sim_ir.c @@ -21,7 +21,8 @@ value set_ir(value roll __attribute__ ((unused)), value top __attribute__ ((unused)), value air_speed ) { -#if defined USE_INFRARED || USE_INFRARED_I2C + // INFRARED_TELEMETRY : Stupid hack to use with modules +#if defined USE_INFRARED || USE_INFRARED_TELEMETRY infrared.roll = Int_val(roll); infrared.pitch = Int_val(front); infrared.top = Int_val(top); diff --git a/sw/airborne/arch/sim/subsystems/imu/imu_b2_arch.c b/sw/airborne/arch/sim/subsystems/imu/imu_b2_arch.c index f583072488..a8035a810f 100644 --- a/sw/airborne/arch/sim/subsystems/imu/imu_b2_arch.c +++ b/sw/airborne/arch/sim/subsystems/imu/imu_b2_arch.c @@ -47,11 +47,11 @@ void imu_feed_gyro_accel(void) { void imu_feed_mag(void) { -#if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001 - ms2001_values[IMU_MAG_X_CHAN] = sensors.mag.value.x; - ms2001_values[IMU_MAG_Y_CHAN] = sensors.mag.value.y; - ms2001_values[IMU_MAG_Z_CHAN] = sensors.mag.value.z; - ms2001_status = MS2001_DATA_AVAILABLE; +#if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2100 + ms2100_values[IMU_MAG_X_CHAN] = sensors.mag.value.x; + ms2100_values[IMU_MAG_Y_CHAN] = sensors.mag.value.y; + ms2100_values[IMU_MAG_Z_CHAN] = sensors.mag.value.z; + ms2100_status = MS2100_DATA_AVAILABLE; #elif defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_AMI601 ami601_values[IMU_MAG_X_CHAN] = sensors.mag.value.x; ami601_values[IMU_MAG_Y_CHAN] = sensors.mag.value.y; diff --git a/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c b/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c index 2099326c6c..6cdd1a310b 100644 --- a/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c +++ b/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c @@ -42,7 +42,6 @@ struct i2c_errors i2c1_errors; #define I2C1_ABORT_AND_RESET() { \ struct i2c_transaction* trans2 = i2c1.trans[i2c1.trans_extract_idx]; \ trans2->status = I2CTransFailed; \ - i2c1.status = I2CFailed; \ I2C_ITConfig(I2C1, I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR, DISABLE); \ I2C_Cmd(I2C1, DISABLE); \ I2C_DeInit(I2C1); \ @@ -275,7 +274,7 @@ void i2c2_hw_init(void) { /* Configure and enable I2C2 event interrupt --------------------------------*/ NVIC_InitStructure.NVIC_IRQChannel = I2C2_EV_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; + NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); @@ -349,14 +348,34 @@ static inline void on_status_restart_requested(struct i2c_transaction* trans, ui #define I2C2_ABORT_AND_RESET() { \ struct i2c_transaction* trans = i2c2.trans[i2c2.trans_extract_idx]; \ - trans->status = I2CTransFailed; \ + trans->status = I2CTransFailed; \ I2C_ITConfig(I2C2, I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR, DISABLE); \ + I2C_ClearITPendingBit(I2C2, 0xFF); \ I2C_Cmd(I2C2, DISABLE); \ I2C_DeInit(I2C2); \ - I2C_Cmd(I2C2, ENABLE); \ I2C2_APPLY_CONFIG(); \ + I2C_Cmd(I2C2, ENABLE); \ + /* do something to unstuck the bus */ \ + GPIO_InitTypeDef GPIO_InitStructure; \ + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; \ + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz; \ + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; \ + GPIO_Init(GPIOB, &GPIO_InitStructure); \ + for (__IO int i = 0; i < 10; i++) {\ + for (__IO int j = 0; j < 50; j++); \ + GPIOB->BSRR = GPIO_Pin_10; \ + for (__IO int j = 0; j < 50; j++); \ + GPIOB->BRR = GPIO_Pin_10; \ + } \ + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD; \ + GPIO_Init(GPIOB, &GPIO_InitStructure); \ + I2C_Cmd(I2C2, DISABLE); \ + I2C_DeInit(I2C2); \ + I2C2_APPLY_CONFIG(); \ + I2C_Cmd(I2C2, ENABLE); \ + I2C_ClearITPendingBit(I2C2, 0xFF); \ I2C_ITConfig(I2C2, I2C_IT_ERR, ENABLE); \ - I2C2_END_OF_TRANSACTION(); \ + I2C2_END_OF_TRANSACTION(); \ } @@ -423,6 +442,12 @@ static inline void on_status_sending_byte(struct i2c_transaction* trans, uint32_ I2C_ITConfig(I2C2, I2C_IT_BUF, DISABLE); if (trans->type == I2CTransTx) { I2C_GenerateSTOP(I2C2, ENABLE); + /* Make sure that the STOP bit is cleared by Hardware */ + static __IO uint8_t counter = 0; + while ((I2C2->CR1&0x200) == 0x200) { + counter++; + if (counter > 100) break; + } i2c2.status = I2CStopRequested; } else { @@ -486,6 +511,12 @@ static inline void on_status_addr_rd_sent(struct i2c_transaction* trans, uint32_ if(trans->len_r == 1) { // If we're going to read only one byte I2C_AcknowledgeConfig(I2C2, DISABLE); // make sure it's gonna be nacked I2C_GenerateSTOP(I2C2, ENABLE); // and followed by a stop + /* Make sure that the STOP bit is cleared by Hardware */ + static __IO uint8_t counter = 0; + while ((I2C2->CR1&0x200) == 0x200) { + counter++; + if (counter > 100) break; + } i2c2.status = I2CReadingLastByte; // and remember we did } else { @@ -512,6 +543,12 @@ static inline void on_status_reading_byte(struct i2c_transaction* trans, uint32_ if (i2c2.idx_buf >= trans->len_r-1) { // We're reading our last byte I2C_AcknowledgeConfig(I2C2, DISABLE); // give them a nack once it's done I2C_GenerateSTOP(I2C2, ENABLE); // and follow with a stop + /* Make sure that the STOP bit is cleared by Hardware */ + static __IO uint8_t counter = 0; + while ((I2C2->CR1&0x200) == 0x200) { + counter++; + if (counter > 100) break; + } i2c2.status = I2CStopRequested; // remember we already trigered the stop } } // else { something very wrong has happened } @@ -645,6 +682,12 @@ void i2c2_er_irq_handler(void) { i2c2_errors.ack_fail_cnt++; I2C_ClearITPendingBit(I2C2, I2C_IT_AF); I2C_GenerateSTOP(I2C2, ENABLE); + /* Make sure that the STOP bit is cleared by Hardware */ + static __IO uint8_t counter = 0; + while ((I2C2->CR1&0x200) == 0x200) { + counter++; + if (counter > 100) break; + } } if (I2C_GetITStatus(I2C2, I2C_IT_BERR)) { /* Misplaced Start or Stop condition */ i2c2_errors.miss_start_stop_cnt++; @@ -684,6 +727,11 @@ void i2c2_er_irq_handler(void) { +bool_t i2c_idle(struct i2c_periph* p) +{ + return !I2C_GetFlagStatus(p->reg_addr, I2C_FLAG_BUSY); +} + bool_t i2c_submit(struct i2c_periph* p, struct i2c_transaction* t) { uint8_t temp; diff --git a/sw/airborne/arch/stm32/peripherals/hmc8543_arch.c b/sw/airborne/arch/stm32/peripherals/hmc5843_arch.c similarity index 100% rename from sw/airborne/arch/stm32/peripherals/hmc8543_arch.c rename to sw/airborne/arch/stm32/peripherals/hmc5843_arch.c diff --git a/sw/airborne/arch/stm32/peripherals/hmc8543_arch.h b/sw/airborne/arch/stm32/peripherals/hmc5843_arch.h similarity index 100% rename from sw/airborne/arch/stm32/peripherals/hmc8543_arch.h rename to sw/airborne/arch/stm32/peripherals/hmc5843_arch.h diff --git a/sw/airborne/arch/stm32/peripherals/max1168_arch.c b/sw/airborne/arch/stm32/peripherals/max1168_arch.c index f39881bc80..3239a3ad86 100644 --- a/sw/airborne/arch/stm32/peripherals/max1168_arch.c +++ b/sw/airborne/arch/stm32/peripherals/max1168_arch.c @@ -97,6 +97,7 @@ void max1168_read( void ) { Max1168Select(); /* write control byte - wait EOC on extint */ + /* use internal reference and clock, sequentially scan channels 0-7 */ const uint16_t ctl_byte = (1 << 0 | 1 << 3 | 7 << 5) << 8; SPI_I2S_SendData(SPI2, ctl_byte); max1168_status = STA_MAX1168_SENDING_REQ; diff --git a/sw/airborne/arch/stm32/peripherals/ms2001_arch.c b/sw/airborne/arch/stm32/peripherals/ms2100_arch.c similarity index 86% rename from sw/airborne/arch/stm32/peripherals/ms2001_arch.c rename to sw/airborne/arch/stm32/peripherals/ms2100_arch.c index b9b91646e6..961ab71e53 100644 --- a/sw/airborne/arch/stm32/peripherals/ms2001_arch.c +++ b/sw/airborne/arch/stm32/peripherals/ms2100_arch.c @@ -21,7 +21,7 @@ * Boston, MA 02111-1307, USA. */ -#include "peripherals/ms2001.h" +#include "peripherals/ms2100.h" #include #include @@ -29,16 +29,16 @@ #include #include -uint8_t ms2001_cur_axe; -int16_t ms2001_last_reading; // can't write in place because that stupid beast +uint8_t ms2100_cur_axe; +int16_t ms2100_last_reading; // can't write in place because that stupid beast // stips stupid values once in a while that I need // to filter - high time we get rid of this crap hardware // and no, I checked with the logic analyzer, timing are // within specs -void ms2001_arch_init( void ) { +void ms2100_arch_init( void ) { - ms2001_cur_axe = 0; + ms2100_cur_axe = 0; /* set mag SS and reset as output and assert them (SS on PC12 reset on PC13) ----*/ Ms2001Unselect(); @@ -58,7 +58,7 @@ void ms2001_arch_init( void ) { GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructure); -#ifdef MS2001_HANDLES_DMA_IRQ +#ifdef MS2100_HANDLES_DMA_IRQ /* Enable DMA1 channel4 IRQ Channel */ NVIC_InitTypeDef NVIC_init_structure_dma = { .NVIC_IRQChannel = DMA1_Channel4_IRQn, @@ -67,9 +67,9 @@ void ms2001_arch_init( void ) { .NVIC_IRQChannelCmd = ENABLE }; NVIC_Init(&NVIC_init_structure_dma); -#endif /* MS2001_HANDLES_DMA_IRQ */ +#endif /* MS2100_HANDLES_DMA_IRQ */ -#ifdef MS2001_HANDLES_SPI_IRQ +#ifdef MS2100_HANDLES_SPI_IRQ NVIC_InitTypeDef NVIC_init_structure_spi = { .NVIC_IRQChannel = SPI2_IRQn, .NVIC_IRQChannelPreemptionPriority = 0, @@ -77,19 +77,19 @@ void ms2001_arch_init( void ) { .NVIC_IRQChannelCmd = ENABLE }; NVIC_Init(&NVIC_init_structure_spi); -#endif /* MS2001_HANDLES_SPI_IRQ */ +#endif /* MS2100_HANDLES_SPI_IRQ */ } -#ifdef MS2001_HANDLES_SPI_IRQ +#ifdef MS2100_HANDLES_SPI_IRQ void spi2_irq_handler(void) { Ms2001OnSpiIrq(); } #endif -#ifdef MS2001_HANDLES_DMA_IRQ +#ifdef MS2100_HANDLES_DMA_IRQ void dma1_c4_irq_handler(void) { Ms2001OnDmaIrq(); } -#endif /* MS2001_HANDLES_DMA_IRQ */ +#endif /* MS2100_HANDLES_DMA_IRQ */ diff --git a/sw/airborne/arch/stm32/peripherals/ms2001_arch.h b/sw/airborne/arch/stm32/peripherals/ms2100_arch.h similarity index 84% rename from sw/airborne/arch/stm32/peripherals/ms2001_arch.h rename to sw/airborne/arch/stm32/peripherals/ms2100_arch.h index 5008bc5f6c..c95a26ce84 100644 --- a/sw/airborne/arch/stm32/peripherals/ms2001_arch.h +++ b/sw/airborne/arch/stm32/peripherals/ms2100_arch.h @@ -1,5 +1,5 @@ -#ifndef MS2001_ARCH_H -#define MS2001_ARCH_H +#ifndef MS2100_ARCH_H +#define MS2100_ARCH_H /* * $Id$ @@ -27,8 +27,8 @@ #include #include -extern uint8_t ms2001_cur_axe; -extern int16_t ms2001_last_reading; +extern uint8_t ms2100_cur_axe; +extern int16_t ms2100_last_reading; #define Ms2001Select() GPIOC->BRR = GPIO_Pin_12 #define Ms2001Unselect() GPIOC->BSRR = GPIO_Pin_12 @@ -42,10 +42,10 @@ extern int16_t ms2001_last_reading; Ms2001Select(); \ __IO uint32_t nCount = 4;for(; nCount != 0; nCount--); \ Ms2001Reset(); \ - ms2001_status = MS2001_SENDING_REQ; \ + ms2100_status = MS2100_SENDING_REQ; \ nCount = 4;for(; nCount != 0; nCount--); \ Ms2001Set(); \ - uint16_t ctl_byte = ((ms2001_cur_axe+1) | (MS2001_DIVISOR << 4)); \ + uint16_t ctl_byte = ((ms2100_cur_axe+1) | (MS2100_DIVISOR << 4)); \ nCount = 20;for(; nCount != 0; nCount--); \ SPI_Cmd(SPI2, DISABLE); \ SPI_InitTypeDef SPI_InitStructure = { \ @@ -66,7 +66,7 @@ extern int16_t ms2001_last_reading; } #define Ms2001ReadRes() { \ - ms2001_status = MS2001_READING_RES; \ + ms2100_status = MS2100_READING_RES; \ Ms2001Select(); \ SPI_Cmd(SPI2, DISABLE); \ SPI_InitTypeDef SPI_InitStructure = { \ @@ -88,7 +88,7 @@ extern int16_t ms2001_last_reading; DMA_InitTypeDef DMA_InitStructure; \ DMA_DeInit(DMA1_Channel4); \ DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(SPI2_BASE+0x0C); \ - DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)(&ms2001_last_reading); \ + DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)(&ms2100_last_reading); \ DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC; \ DMA_InitStructure.DMA_BufferSize = 1; \ DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; \ @@ -102,7 +102,7 @@ extern int16_t ms2001_last_reading; /* SPI2_Tx_DMA_Channel configuration ------------------------------------*/ \ DMA_DeInit(DMA1_Channel5); \ DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(SPI2_BASE+0x0C); \ - DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&ms2001_values; \ + DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&ms2100_values; \ DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST; \ DMA_InitStructure.DMA_Priority = DMA_Priority_Medium; \ DMA_Init(DMA1_Channel5, &DMA_InitStructure); \ @@ -123,33 +123,33 @@ extern int16_t ms2001_last_reading; } #define Ms2001OnDmaIrq() { \ - /* ASSERT((ms2001_status == MS2001_READING_RES), \ - * DEBUG_MS2001, MS2001_ERR_SPURIOUS_DMA_IRQ); \ + /* ASSERT((ms2100_status == MS2100_READING_RES), \ + * DEBUG_MS2100, MS2100_ERR_SPURIOUS_DMA_IRQ); \ */ \ - if (abs(ms2001_last_reading) < 1000) \ - ms2001_values[ms2001_cur_axe] = ms2001_last_reading; \ + if (abs(ms2100_last_reading) < 1000) \ + ms2100_values[ms2100_cur_axe] = ms2100_last_reading; \ Ms2001Unselect(); \ - ms2001_cur_axe++; \ - if (ms2001_cur_axe > 2) { \ - ms2001_cur_axe = 0; \ - ms2001_status = MS2001_DATA_AVAILABLE; \ + ms2100_cur_axe++; \ + if (ms2100_cur_axe > 2) { \ + ms2100_cur_axe = 0; \ + ms2100_status = MS2100_DATA_AVAILABLE; \ } \ else \ - ms2001_status = MS2001_IDLE; \ + ms2100_status = MS2100_IDLE; \ SPI_Cmd(SPI2, DISABLE); \ DMA_ITConfig(DMA1_Channel4, DMA_IT_TC, DISABLE); \ } #define Ms2001OnSpiIrq() { \ - /* ASSERT((ms2001_status == MS2001_SENDING_REQ), \ - * DEBUG_MS2001, MS2001_ERR_SPURIOUS_SPI_IRQ); \ + /* ASSERT((ms2100_status == MS2100_SENDING_REQ), \ + * DEBUG_MS2100, MS2100_ERR_SPURIOUS_SPI_IRQ); \ */ \ /* read unused control byte reply */ \ uint8_t foo __attribute__ ((unused)) = SPI_I2S_ReceiveData(SPI2); \ Ms2001Unselect(); \ - ms2001_status = MS2001_WAITING_EOC; \ + ms2100_status = MS2100_WAITING_EOC; \ SPI_Cmd(SPI2, DISABLE); \ SPI_I2S_ITConfig(SPI2, SPI_I2S_IT_RXNE, DISABLE); \ } -#endif /* MS2001_ARCH_H */ +#endif /* MS2100_ARCH_H */ diff --git a/sw/airborne/arch/stm32/subsystems/imu/imu_aspirin_arch.c b/sw/airborne/arch/stm32/subsystems/imu/imu_aspirin_arch.c index ca50b9c639..3715342009 100644 --- a/sw/airborne/arch/stm32/subsystems/imu/imu_aspirin_arch.c +++ b/sw/airborne/arch/stm32/subsystems/imu/imu_aspirin_arch.c @@ -21,11 +21,44 @@ void exti2_irq_handler(void); /* accelerometer dma end of rx handler */ void dma1_c4_irq_handler(void); +void imu_aspirin_arch_int_enable(void) { + NVIC_InitTypeDef NVIC_InitStructure; + + NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn; + NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F; + NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F; + NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; + NVIC_Init(&NVIC_InitStructure); + + NVIC_InitStructure.NVIC_IRQChannel = EXTI2_IRQn; + NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F; + NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F; + NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; + NVIC_Init(&NVIC_InitStructure); + +} + +void imu_aspirin_arch_int_disable(void) { + NVIC_InitTypeDef NVIC_InitStructure; + + NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn; + NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F; + NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F; + NVIC_InitStructure.NVIC_IRQChannelCmd = DISABLE; + NVIC_Init(&NVIC_InitStructure); + + NVIC_InitStructure.NVIC_IRQChannel = EXTI2_IRQn; + NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F; + NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F; + NVIC_InitStructure.NVIC_IRQChannelCmd = DISABLE; + NVIC_Init(&NVIC_InitStructure); + +} + void imu_aspirin_arch_init(void) { GPIO_InitTypeDef GPIO_InitStructure; EXTI_InitTypeDef EXTI_InitStructure; - NVIC_InitTypeDef NVIC_InitStructure; SPI_InitTypeDef SPI_InitStructure; /* Set "mag ss" and "mag reset" as floating inputs ------------------------*/ @@ -57,13 +90,6 @@ void imu_aspirin_arch_init(void) { EXTI_InitStructure.EXTI_LineCmd = ENABLE; EXTI_Init(&EXTI_InitStructure); - NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn; - NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F; - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F; - NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_Init(&NVIC_InitStructure); - - /* Accel */ /* set accel slave select as output and assert it ( on PB12) */ Adxl345Unselect(); @@ -73,13 +99,13 @@ void imu_aspirin_arch_init(void) { GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructure); - /* configure external interrupt exti2 on PD2( accel int ) */ - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD | RCC_APB2Periph_AFIO, ENABLE); + /* configure external interrupt exti2 on PB2( accel int ) */ + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; - GPIO_Init(GPIOD, &GPIO_InitStructure); - GPIO_EXTILineConfig(GPIO_PortSourceGPIOD, GPIO_PinSource2); + GPIO_Init(GPIOB, &GPIO_InitStructure); + GPIO_EXTILineConfig(GPIO_PortSourceGPIOB, GPIO_PinSource2); EXTI_InitStructure.EXTI_Line = EXTI_Line2; EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; @@ -87,12 +113,6 @@ void imu_aspirin_arch_init(void) { EXTI_InitStructure.EXTI_LineCmd = ENABLE; EXTI_Init(&EXTI_InitStructure); - NVIC_InitStructure.NVIC_IRQChannel = EXTI2_IRQn; - NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F; - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F; - NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_Init(&NVIC_InitStructure); - /* Enable SPI2 Periph clock -------------------------------------------------*/ RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE); @@ -130,27 +150,6 @@ void imu_aspirin_arch_init(void) { RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE); - /* Mag */ - /* configure external interrupt exti5 on PB5( mag int ) */ - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO, ENABLE); - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; - GPIO_Init(GPIOB, &GPIO_InitStructure); - - GPIO_EXTILineConfig(GPIO_PortSourceGPIOB, GPIO_PinSource5); - EXTI_InitStructure.EXTI_Line = EXTI_Line5; - EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; - EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; - EXTI_InitStructure.EXTI_LineCmd = ENABLE; - EXTI_Init(&EXTI_InitStructure); - - NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQn; - NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F; - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F; - NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_Init(&NVIC_InitStructure); - } @@ -234,32 +233,11 @@ void exti15_10_irq_handler(void) { if(EXTI_GetITStatus(EXTI_Line14) != RESET) EXTI_ClearITPendingBit(EXTI_Line14); - imu_aspirin.i2c_trans_gyro.type = I2CTransTxRx; - imu_aspirin.i2c_trans_gyro.buf[0] = ITG3200_REG_GYRO_XOUT_H; - imu_aspirin.i2c_trans_gyro.slave_addr = ITG3200_ADDR; - imu_aspirin.i2c_trans_gyro.len_w = 1; - imu_aspirin.i2c_trans_gyro.len_r = 6; - // if (!i2c_submit(&i2c2,&imu_aspirin.i2c_trans_gyro)) while(1); - i2c_submit(&i2c2,&imu_aspirin.i2c_trans_gyro); + imu_aspirin.gyro_eoc = TRUE; imu_aspirin.status = AspirinStatusReadingGyro; } -/* - * - * Mag data ready - * - */ -void exti9_5_irq_handler(void) { - - /* clear EXTI */ - if(EXTI_GetITStatus(EXTI_Line5) != RESET) - EXTI_ClearITPendingBit(EXTI_Line5); - - imu_aspirin.mag_ready_for_read = TRUE; - -} - /* * * Accel data ready diff --git a/sw/airborne/arch/stm32/subsystems/imu/imu_aspirin_arch.h b/sw/airborne/arch/stm32/subsystems/imu/imu_aspirin_arch.h index e40fed4777..4345e8b14c 100644 --- a/sw/airborne/arch/stm32/subsystems/imu/imu_aspirin_arch.h +++ b/sw/airborne/arch/stm32/subsystems/imu/imu_aspirin_arch.h @@ -6,6 +6,8 @@ #include "led.h" extern void imu_aspirin_arch_init(void); +extern void imu_aspirin_arch_int_enable(void); +extern void imu_aspirin_arch_int_disable(void); extern void adxl345_write_to_reg(uint8_t addr, uint8_t val); extern void adxl345_clear_rx_buf(void); extern void adxl345_start_reading_data(void); diff --git a/sw/airborne/arch/stm32/subsystems/imu/imu_b2_arch.c b/sw/airborne/arch/stm32/subsystems/imu/imu_b2_arch.c index 0ab657a5a0..0f229c3de7 100644 --- a/sw/airborne/arch/stm32/subsystems/imu/imu_b2_arch.c +++ b/sw/airborne/arch/stm32/subsystems/imu/imu_b2_arch.c @@ -91,12 +91,12 @@ void dma1_c4_irq_handler(void) { case IMU_SSP_STA_BUSY_MAX1168: Max1168OnDmaIrq(); SPI_Cmd(SPI2, DISABLE); -#if IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001 - if (ms2001_status == MS2001_IDLE) { +#if IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2100 + if (ms2100_status == MS2100_IDLE) { Ms2001SendReq(); imu_ssp_status = IMU_SSP_STA_BUSY_MS2100; } - else if (ms2001_status == MS2001_WAITING_EOC && Ms2001HasEOC()) { + else if (ms2100_status == MS2100_WAITING_EOC && Ms2001HasEOC()) { Ms2001ReadRes(); imu_ssp_status = IMU_SSP_STA_BUSY_MS2100; } @@ -105,7 +105,7 @@ void dma1_c4_irq_handler(void) { imu_ssp_status = IMU_SSP_STA_IDLE; break; case IMU_SSP_STA_BUSY_MS2100: -#if IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001 +#if IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2100 Ms2001OnDmaIrq(); #endif break; @@ -117,7 +117,7 @@ void dma1_c4_irq_handler(void) { void spi2_irq_handler(void) { -#if IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001 +#if IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2100 Ms2001OnSpiIrq(); #endif } diff --git a/sw/airborne/boards/booz_1.0.h b/sw/airborne/boards/booz_1.0.h index 7634648333..9f44e89514 100644 --- a/sw/airborne/boards/booz_1.0.h +++ b/sw/airborne/boards/booz_1.0.h @@ -62,23 +62,23 @@ -/* MS2001 on SSP, IMU connector */ -#define MS2001_SS_PIN 28 -#define MS2001_SS_IODIR IO1DIR -#define MS2001_SS_IOSET IO1SET -#define MS2001_SS_IOCLR IO1CLR +/* MS2100 on SSP, IMU connector */ +#define MS2100_SS_PIN 28 +#define MS2100_SS_IODIR IO1DIR +#define MS2100_SS_IOSET IO1SET +#define MS2100_SS_IOCLR IO1CLR -#define MS2001_RESET_PIN 19 -#define MS2001_RESET_IODIR IO1DIR -#define MS2001_RESET_IOSET IO1SET -#define MS2001_RESET_IOCLR IO1CLR +#define MS2100_RESET_PIN 19 +#define MS2100_RESET_IODIR IO1DIR +#define MS2100_RESET_IOSET IO1SET +#define MS2100_RESET_IOCLR IO1CLR -#define MS2001_DRDY_PIN 30 -#define MS2001_DRDY_PINSEL PINSEL1 -#define MS2001_DRDY_PINSEL_BIT 28 -#define MS2001_DRDY_PINSEL_VAL 2 -#define MS2001_DRDY_EINT 3 -#define MS2001_DRDY_VIC_IT VIC_EINT3 +#define MS2100_DRDY_PIN 30 +#define MS2100_DRDY_PINSEL PINSEL1 +#define MS2100_DRDY_PINSEL_BIT 28 +#define MS2100_DRDY_PINSEL_VAL 2 +#define MS2100_DRDY_EINT 3 +#define MS2100_DRDY_VIC_IT VIC_EINT3 /* PWM5 on CAM connector */ /* P0.21 */ diff --git a/sw/airborne/boards/lisa_l/baro_board.c b/sw/airborne/boards/lisa_l/baro_board.c index 3bf8cc2a20..11829b5acf 100644 --- a/sw/airborne/boards/lisa_l/baro_board.c +++ b/sw/airborne/boards/lisa_l/baro_board.c @@ -26,6 +26,7 @@ void baro_init(void) { void baro_periodic(void) { // check i2c_done + if (!i2c_idle(&i2c2)) return; switch (baro_board.status) { case LBS_UNINITIALIZED: baro_board_send_reset(); diff --git a/sw/airborne/boards/lisa_l/test_baro.c b/sw/airborne/boards/lisa_l/test_baro.c index 20e9dbef66..8a24041f53 100644 --- a/sw/airborne/boards/lisa_l/test_baro.c +++ b/sw/airborne/boards/lisa_l/test_baro.c @@ -29,8 +29,9 @@ #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" +#include "mcu_periph/uart.h" #include "downlink.h" @@ -58,7 +59,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); baro_init(); diff --git a/conf/autopilot/tiny_sim.h b/sw/airborne/boards/tiny_sim.h similarity index 89% rename from conf/autopilot/tiny_sim.h rename to sw/airborne/boards/tiny_sim.h index c3bb4a9eea..ff3845ca86 100644 --- a/conf/autopilot/tiny_sim.h +++ b/sw/airborne/boards/tiny_sim.h @@ -2,20 +2,20 @@ #define CONFIG_TINY_H /* Master oscillator freq. */ -#define FOSC (12000000) +#define FOSC (12000000) /* PLL multiplier */ -#define PLL_MUL (5) +#define PLL_MUL (5) /* CPU clock freq. */ -#define CCLK (FOSC * PLL_MUL) +#define CCLK (FOSC * PLL_MUL) /* Peripheral bus speed mask 0x00->4, 0x01-> 1, 0x02 -> 2 */ -#define PBSD_BITS 0x00 +#define PBSD_BITS 0x00 #define PBSD_VAL 4 /* Peripheral bus clock freq. */ -#define PCLK (CCLK / PBSD_VAL) +#define PCLK (CCLK / PBSD_VAL) #define LED_1_BANK 1 #define LED_1_PIN 28 @@ -80,7 +80,14 @@ #define USE_AD0_1 #endif -/* #define ADC_3 AdcBank1(7) Used for VSUPPLY */ +#define ADC_3 AdcBank0(6) +#ifdef USE_ADC_3 +#ifndef USE_AD0 +#define USE_AD0 +#endif +#define USE_AD0_6 +#endif + #define ADC_4 AdcBank1(3) #ifdef USE_ADC_4 @@ -114,6 +121,7 @@ #define USE_AD1_2 #endif +/* #define ADC_3 AdcBank1(7) Used for VSUPPLY */ #define ADC_CHANNEL_VSUPPLY AdcBank1(7) #ifndef USE_AD1 #define USE_AD1 diff --git a/sw/airborne/booz/booz_gps.h b/sw/airborne/booz/booz_gps.h index 7d30611baf..d7d7a7cd8c 100644 --- a/sw/airborne/booz/booz_gps.h +++ b/sw/airborne/booz/booz_gps.h @@ -54,14 +54,9 @@ extern struct Booz_gps_state booz_gps_state; extern void booz_gps_impl_init(void); - -/* UBX NAV SOL */ #define BOOZ2_GPS_FIX_NONE 0x00 #define BOOZ2_GPS_FIX_3D 0x03 - -#include "ubx_protocol.h" - #define GpsFixValid() (booz_gps_state.fix == BOOZ2_GPS_FIX_3D) /* diff --git a/sw/airborne/booz/gps/booz_gps_skytraq.c b/sw/airborne/booz/gps/booz_gps_skytraq.c index 6fa2f1ccc8..853fa157c3 100644 --- a/sw/airborne/booz/gps/booz_gps_skytraq.c +++ b/sw/airborne/booz/gps/booz_gps_skytraq.c @@ -36,7 +36,7 @@ struct BoozGpsSkytraq booz_gps_skytraq; #define GOT_CHECKSUM 7 #define GOT_SYNC3 8 -#include "my_debug_servo.h" +//#include "my_debug_servo.h" #include "led.h" void booz_gps_impl_init(void) { @@ -44,14 +44,14 @@ void booz_gps_impl_init(void) { booz_gps_skytraq.status = UNINIT; - DEBUG_SERVO1_INIT(); + //DEBUG_SERVO1_INIT(); } void booz_gps_skytraq_read_message(void) { - DEBUG_S1_ON(); + //DEBUG_S1_ON(); if (booz_gps_skytraq.msg_id == SKYTRAQ_ID_NAVIGATION_DATA) { booz_gps_state.ecef_pos.x = SKYTRAQ_NAVIGATION_DATA_ECEFX(booz_gps_skytraq.msg_buf); @@ -70,7 +70,7 @@ void booz_gps_skytraq_read_message(void) { booz_gps_state.num_sv = SKYTRAQ_NAVIGATION_DATA_NumSV(booz_gps_skytraq.msg_buf); booz_gps_state.fix = SKYTRAQ_NAVIGATION_DATA_FixMode(booz_gps_skytraq.msg_buf); booz_gps_state.tow = SKYTRAQ_NAVIGATION_DATA_TOW(booz_gps_skytraq.msg_buf); - DEBUG_S2_TOGGLE(); + //DEBUG_S2_TOGGLE(); #ifdef GPS_LED if (booz_gps_state.fix == BOOZ2_GPS_FIX_3D) { @@ -82,7 +82,7 @@ void booz_gps_skytraq_read_message(void) { #endif } - DEBUG_S1_OFF(); + //DEBUG_S1_OFF(); } void booz_gps_skytraq_parse(uint8_t c) { diff --git a/sw/airborne/booz/gps/booz_gps_skytraq.h b/sw/airborne/booz/gps/booz_gps_skytraq.h index f3fe7703f3..27f2345764 100644 --- a/sw/airborne/booz/gps/booz_gps_skytraq.h +++ b/sw/airborne/booz/gps/booz_gps_skytraq.h @@ -63,7 +63,7 @@ extern struct BoozGpsSkytraq booz_gps_skytraq; extern void booz_gps_skytraq_read_message(void); extern void booz_gps_skytraq_parse(uint8_t c); -#include "my_debug_servo.h" +//#include "my_debug_servo.h" #define BoozGpsEvent(_sol_available_callback) { \ if (GpsBuffer()) { \ diff --git a/sw/airborne/booz/gps/booz_gps_ubx.h b/sw/airborne/booz/gps/booz_gps_ubx.h index 28d306a0e7..ab2d25f709 100644 --- a/sw/airborne/booz/gps/booz_gps_ubx.h +++ b/sw/airborne/booz/gps/booz_gps_ubx.h @@ -1,6 +1,8 @@ #ifndef BOOZ_GPS_UBX_H #define BOOZ_GPS_UBX_H +#include "ubx_protocol.h" + #define GPS_UBX_MAX_PAYLOAD 255 struct BoosGpsUbx { bool_t msg_available; diff --git a/sw/airborne/booz/test/booz2_test_buss_bldc_hexa.c b/sw/airborne/booz/test/booz2_test_buss_bldc_hexa.c index b20c2ccef4..c19f2ff874 100644 --- a/sw/airborne/booz/test/booz2_test_buss_bldc_hexa.c +++ b/sw/airborne/booz/test/booz2_test_buss_bldc_hexa.c @@ -23,7 +23,7 @@ #include -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "interrupt_hw.h" #include "downlink.h" @@ -59,9 +59,9 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/booz/test/booz2_test_crista.c b/sw/airborne/booz/test/booz2_test_crista.c index 21af105e1d..82f990afe4 100644 --- a/sw/airborne/booz/test/booz2_test_crista.c +++ b/sw/airborne/booz/test/booz2_test_crista.c @@ -24,10 +24,10 @@ #include #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" @@ -53,7 +53,7 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); @@ -66,7 +66,7 @@ static inline void main_init( void ) { imu_impl_init(); imu_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/booz/test/booz2_test_gps.c b/sw/airborne/booz/test/booz2_test_gps.c index 0c67b7886a..a85f6f30a0 100644 --- a/sw/airborne/booz/test/booz2_test_gps.c +++ b/sw/airborne/booz/test/booz2_test_gps.c @@ -24,7 +24,7 @@ #include #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" #include "booz_gps.h" @@ -47,11 +47,11 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); booz_gps_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/booz/test/booz2_test_led.c b/sw/airborne/booz/test/booz2_test_led.c index 126358b6b4..4986fb2a6d 100644 --- a/sw/airborne/booz/test/booz2_test_led.c +++ b/sw/airborne/booz/test/booz2_test_led.c @@ -24,7 +24,7 @@ #include #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "interrupt_hw.h" @@ -43,9 +43,9 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/booz/test/booz2_test_max1168.c b/sw/airborne/booz/test/booz2_test_max1168.c index 12c858a824..dc57a9a454 100644 --- a/sw/airborne/booz/test/booz2_test_max1168.c +++ b/sw/airborne/booz/test/booz2_test_max1168.c @@ -24,7 +24,7 @@ #include #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "interrupt_hw.h" #include "messages.h" @@ -56,13 +56,13 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); main_init_ssp(); max1168_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/booz/test/booz2_test_micromag.c b/sw/airborne/booz/test/booz2_test_micromag.c index 68377fb5ef..9ba50b7fee 100644 --- a/sw/airborne/booz/test/booz2_test_micromag.c +++ b/sw/airborne/booz/test/booz2_test_micromag.c @@ -24,10 +24,10 @@ #include #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" @@ -58,7 +58,7 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); @@ -72,7 +72,7 @@ static inline void main_init( void ) { main_init_ssp(); micromag_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/booz/test/booz2_test_modem.c b/sw/airborne/booz/test/booz2_test_modem.c index 1b5fb38628..df06203773 100644 --- a/sw/airborne/booz/test/booz2_test_modem.c +++ b/sw/airborne/booz/test/booz2_test_modem.c @@ -23,11 +23,11 @@ #include -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" #include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" @@ -47,11 +47,11 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); uart1_init_tx(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/booz/test/booz2_test_radio_control.c b/sw/airborne/booz/test/booz2_test_radio_control.c index f5b93da7a4..cc0ea59b95 100644 --- a/sw/airborne/booz/test/booz2_test_radio_control.c +++ b/sw/airborne/booz/test/booz2_test_radio_control.c @@ -23,9 +23,10 @@ #include -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "interrupt_hw.h" +#include "mcu_periph/uart.h" #include "downlink.h" @@ -48,10 +49,10 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); radio_control_init(); - int_enable(); + mcu_int_enable(); } extern uint32_t debug_len; diff --git a/sw/airborne/booz/test/booz2_test_rc.c b/sw/airborne/booz/test/booz2_test_rc.c index d88f5e9e75..5806e65250 100644 --- a/sw/airborne/booz/test/booz2_test_rc.c +++ b/sw/airborne/booz/test/booz2_test_rc.c @@ -24,10 +24,10 @@ #include #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" @@ -52,7 +52,7 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); @@ -61,7 +61,7 @@ static inline void main_init( void ) { ppm_init(); radio_control_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/booz/test/booz2_test_usb.c b/sw/airborne/booz/test/booz2_test_usb.c index c694603709..9e35042c62 100644 --- a/sw/airborne/booz/test/booz2_test_usb.c +++ b/sw/airborne/booz/test/booz2_test_usb.c @@ -24,7 +24,7 @@ #include #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" @@ -51,13 +51,13 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); VCOM_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/booz/test/booz2_tunnel.c b/sw/airborne/booz/test/booz2_tunnel.c index 9229ae1aef..9f8a4689ea 100644 --- a/sw/airborne/booz/test/booz2_tunnel.c +++ b/sw/airborne/booz/test/booz2_tunnel.c @@ -24,10 +24,10 @@ #include #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" static inline void main_init( void ); static inline void main_periodic_task( void ); @@ -44,12 +44,12 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); uart0_init(); uart1_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/booz/test/booz2_tunnel_bb.c b/sw/airborne/booz/test/booz2_tunnel_bb.c index 33f8b7ff65..db0deaa5d3 100644 --- a/sw/airborne/booz/test/booz2_tunnel_bb.c +++ b/sw/airborne/booz/test/booz2_tunnel_bb.c @@ -25,7 +25,7 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "led.h" #define TXD0_PIN 0 @@ -34,7 +34,7 @@ #define RXD1_PIN 9 int main (int argc, char** argv) { - hw_init(); + mcu_init(); led_init(); /* TXD0 and TXD1 output */ diff --git a/sw/airborne/booz/test/booz_test_imu.c b/sw/airborne/booz/test/booz_test_imu.c index c5f5c32291..fa4bd2591d 100644 --- a/sw/airborne/booz/test/booz_test_imu.c +++ b/sw/airborne/booz/test/booz_test_imu.c @@ -24,10 +24,10 @@ #include #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" @@ -42,6 +42,7 @@ static inline void main_periodic_task( void ); static inline void main_event_task( void ); static inline void on_gyro_accel_event(void); +static inline void on_accel_event(void); static inline void on_mag_event(void); int main( void ) { @@ -56,7 +57,7 @@ int main( void ) { static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); imu_init(); @@ -64,7 +65,7 @@ static inline void main_init( void ) { DEBUG_SERVO2_INIT(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { @@ -92,13 +93,32 @@ static inline void main_periodic_task( void ) { static inline void main_event_task( void ) { - ImuEvent(on_gyro_accel_event, on_mag_event); + ImuEvent(on_gyro_accel_event, on_accel_event, on_mag_event); } +static inline void on_accel_event(void) { + ImuScaleAccel(imu); + + static uint8_t cnt; + cnt++; + if (cnt > 15) cnt = 0; + if (cnt == 0) { + DOWNLINK_SEND_IMU_ACCEL_RAW(DefaultChannel, + &imu.accel_unscaled.x, + &imu.accel_unscaled.y, + &imu.accel_unscaled.z); + } + else if (cnt == 7) { + DOWNLINK_SEND_BOOZ2_ACCEL(DefaultChannel, + &imu.accel.x, + &imu.accel.y, + &imu.accel.z); + } +} + static inline void on_gyro_accel_event(void) { ImuScaleGyro(imu); - ImuScaleAccel(imu); LED_TOGGLE(2); static uint8_t cnt; @@ -110,22 +130,12 @@ static inline void on_gyro_accel_event(void) { &imu.gyro_unscaled.p, &imu.gyro_unscaled.q, &imu.gyro_unscaled.r); - - DOWNLINK_SEND_IMU_ACCEL_RAW(DefaultChannel, - &imu.accel_unscaled.x, - &imu.accel_unscaled.y, - &imu.accel_unscaled.z); } else if (cnt == 7) { DOWNLINK_SEND_BOOZ2_GYRO(DefaultChannel, &imu.gyro.p, &imu.gyro.q, &imu.gyro.r); - - DOWNLINK_SEND_BOOZ2_ACCEL(DefaultChannel, - &imu.accel.x, - &imu.accel.y, - &imu.accel.z); } } diff --git a/sw/airborne/booz/test/booz_test_telemetry.c b/sw/airborne/booz/test/booz_test_telemetry.c index 940952d9fd..f21b005ff9 100644 --- a/sw/airborne/booz/test/booz_test_telemetry.c +++ b/sw/airborne/booz/test/booz_test_telemetry.c @@ -23,7 +23,7 @@ #include -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "interrupt_hw.h" @@ -45,9 +45,9 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/csc/csc_ap_main.c b/sw/airborne/csc/csc_ap_main.c index 55273d6d65..012d151e38 100644 --- a/sw/airborne/csc/csc_ap_main.c +++ b/sw/airborne/csc/csc_ap_main.c @@ -28,11 +28,11 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" #include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "downlink.h" #include "generated/periodic.h" #include "generated/airframe.h" @@ -141,7 +141,7 @@ static void on_gpspos_cmd( struct CscGPSPosMsg *msg ) static void csc_main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); @@ -167,7 +167,7 @@ static void csc_main_init( void ) { actuators_init(); csc_ap_init(); - int_enable(); + mcu_int_enable(); } diff --git a/sw/airborne/csc/csc_baro.c b/sw/airborne/csc/csc_baro.c index ed6ddf8278..22649b4f4a 100644 --- a/sw/airborne/csc/csc_baro.c +++ b/sw/airborne/csc/csc_baro.c @@ -1,10 +1,10 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" #include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" #include "csc_booz2_ins.h" diff --git a/sw/airborne/csc/csc_datalink.c b/sw/airborne/csc/csc_datalink.c index 04362db411..72118be9e0 100644 --- a/sw/airborne/csc/csc_datalink.c +++ b/sw/airborne/csc/csc_datalink.c @@ -5,7 +5,7 @@ #include "downlink.h" #include "messages.h" #include "dl_protocol.h" -#include "uart.h" +#include "mcu_periph/uart.h" #define IdOfMsg(x) (x[1]) diff --git a/sw/airborne/csc/csc_protocol.c b/sw/airborne/csc/csc_protocol.c index f3167c7c20..f2027347eb 100644 --- a/sw/airborne/csc/csc_protocol.c +++ b/sw/airborne/csc/csc_protocol.c @@ -29,7 +29,7 @@ #include "mcu_periph/can.h" #include "csc_msg_def.h" -// #include "init_hw.h" +// #include "mcu.h" // #include "sys_time.h" // #include "downlink.h" diff --git a/sw/airborne/csc/csc_rc_spektrum.c b/sw/airborne/csc/csc_rc_spektrum.c index 4771fc55e9..9347a8d9f7 100644 --- a/sw/airborne/csc/csc_rc_spektrum.c +++ b/sw/airborne/csc/csc_rc_spektrum.c @@ -34,7 +34,7 @@ #include "paparazzi.h" #include "downlink.h" #include "messages.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "string.h" #include "csc_ap_link.h" #include "csc_msg_def.h" diff --git a/sw/airborne/csc/csc_xsens.c b/sw/airborne/csc/csc_xsens.c index e71569cbe5..ee0a2e6ec0 100644 --- a/sw/airborne/csc/csc_xsens.c +++ b/sw/airborne/csc/csc_xsens.c @@ -34,7 +34,7 @@ #include "downlink.h" #include "messages.h" -#include "uart.h" +#include "mcu_periph/uart.h" //#include "com_stats.h" #include "math/pprz_algebra_float.h" #include "string.h" diff --git a/sw/airborne/csc/mercury_csc_main.c b/sw/airborne/csc/mercury_csc_main.c index 18f81b3197..4c259524a9 100644 --- a/sw/airborne/csc/mercury_csc_main.c +++ b/sw/airborne/csc/mercury_csc_main.c @@ -28,7 +28,7 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" @@ -47,7 +47,7 @@ // #include "ams5812.h" #include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "csc_telemetry.h" #include "generated/periodic.h" diff --git a/sw/airborne/csc/mercury_main.c b/sw/airborne/csc/mercury_main.c index 637b5bf7c7..b6914fb70f 100644 --- a/sw/airborne/csc/mercury_main.c +++ b/sw/airborne/csc/mercury_main.c @@ -28,11 +28,11 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" #include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "downlink.h" #include "generated/periodic.h" #include "generated/airframe.h" @@ -105,7 +105,7 @@ static void on_rc_cmd(struct CscRCMsg *msg) static inline void csc_main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); @@ -136,7 +136,7 @@ static inline void csc_main_init( void ) { props_init(); csc_ap_init(); - int_enable(); + mcu_int_enable(); stabilization_attitude_enter(); } diff --git a/sw/airborne/csc/mercury_xsens.c b/sw/airborne/csc/mercury_xsens.c index d8a3692132..54f4c5e447 100644 --- a/sw/airborne/csc/mercury_xsens.c +++ b/sw/airborne/csc/mercury_xsens.c @@ -39,7 +39,7 @@ #include "downlink.h" #include "messages.h" -#include "uart.h" +#include "mcu_periph/uart.h" //#include "com_stats.h" #include "math/pprz_algebra_float.h" #include "string.h" diff --git a/sw/airborne/csc/ppm_bridge_main.c b/sw/airborne/csc/ppm_bridge_main.c index b2e1bcff8a..e2915321b7 100644 --- a/sw/airborne/csc/ppm_bridge_main.c +++ b/sw/airborne/csc/ppm_bridge_main.c @@ -28,11 +28,11 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" #include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "downlink.h" #include "generated/periodic.h" #include "generated/airframe.h" @@ -52,7 +52,7 @@ static uint16_t cpu_time = 0; static void csc_main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); @@ -66,7 +66,7 @@ static void csc_main_init( void ) { IO0DIR = IO0DIR | (0x1 << 21); IO0PIN = IO0DIR | (0x1 << 21); - int_enable(); + mcu_int_enable(); } diff --git a/sw/airborne/datalink.h b/sw/airborne/datalink.h index 690b06462a..9baa824a92 100644 --- a/sw/airborne/datalink.h +++ b/sw/airborne/datalink.h @@ -78,8 +78,8 @@ EXTERN void dl_parse_msg(void); #elif DATALINK == XBEE #define DatalinkEvent() { \ - if (XbeeBuffer()) { \ - ReadXbeeBuffer(); \ + if (XBeeBuffer()) { \ + ReadXBeeBuffer(); \ if (xbee_msg_received) { \ xbee_parse_payload(); \ xbee_msg_received = FALSE; \ diff --git a/sw/airborne/estimator.h b/sw/airborne/estimator.h index a26e5cdc89..54d25d9a4d 100644 --- a/sw/airborne/estimator.h +++ b/sw/airborne/estimator.h @@ -37,7 +37,7 @@ #endif #ifdef USE_BARO_ETS -#include "baro_ets.h" +#include "modules/sensors/baro_ets.h" #endif /* position in meters */ diff --git a/sw/airborne/firmwares/beth/main_beth.c b/sw/airborne/firmwares/beth/main_beth.c index 42da9633e3..ff7ee9a0b9 100644 --- a/sw/airborne/firmwares/beth/main_beth.c +++ b/sw/airborne/firmwares/beth/main_beth.c @@ -1,5 +1,5 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "interrupt_hw.h" @@ -24,9 +24,9 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/firmwares/beth/main_coders.c b/sw/airborne/firmwares/beth/main_coders.c index 31e873270d..c0ea74c6fd 100644 --- a/sw/airborne/firmwares/beth/main_coders.c +++ b/sw/airborne/firmwares/beth/main_coders.c @@ -1,5 +1,5 @@ #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "mcu_periph/can.h" #include "sys_time.h" #include "downlink.h" @@ -73,11 +73,11 @@ int main(void) { static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); main_init_adc(); bench_sensors_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic( void ) { diff --git a/sw/airborne/firmwares/beth/main_stm32.c b/sw/airborne/firmwares/beth/main_stm32.c index bec7f05419..ee5aca10d2 100644 --- a/sw/airborne/firmwares/beth/main_stm32.c +++ b/sw/airborne/firmwares/beth/main_stm32.c @@ -40,6 +40,7 @@ static inline void main_periodic( void ); static inline void main_event( void ); static inline void on_gyro_accel_event(void); +static inline void on_accel_event(void); static inline void on_mag_event(void); static inline void main_on_overo_msg_received(void); @@ -114,7 +115,7 @@ static inline void main_periodic( void ) { } static inline void main_event( void ) { - ImuEvent(on_gyro_accel_event, on_mag_event); + ImuEvent(on_gyro_accel_event, on_accel_event, on_mag_event); OveroLinkEvent(main_on_overo_msg_received,main_on_overo_link_error); } @@ -150,6 +151,10 @@ static inline void main_on_overo_link_lost(void) { } +static inline void on_accel_event(void) { + +} + static inline void on_gyro_accel_event(void) { ImuScaleGyro(imu); ImuScaleAccel(imu); diff --git a/sw/airborne/firmwares/beth/rcv_telemetry.c b/sw/airborne/firmwares/beth/rcv_telemetry.c index 904932f7de..72b1d92359 100755 --- a/sw/airborne/firmwares/beth/rcv_telemetry.c +++ b/sw/airborne/firmwares/beth/rcv_telemetry.c @@ -44,7 +44,7 @@ #ifndef DOWNLINK_DEVICE #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE #endif -#include "uart.h" +#include "mcu_periph/uart.h" #include "downlink.h" diff --git a/sw/airborne/firmwares/beth/uart_hw.c b/sw/airborne/firmwares/beth/uart_hw.c index 6b0c583ace..5a769e4a83 100644 --- a/sw/airborne/firmwares/beth/uart_hw.c +++ b/sw/airborne/firmwares/beth/uart_hw.c @@ -21,7 +21,7 @@ * Boston, MA 02111-1307, USA. */ -#include "uart.h" +#include "mcu_periph/uart.h" #include #include diff --git a/sw/airborne/datalink.c b/sw/airborne/firmwares/fixedwing/datalink.c similarity index 100% rename from sw/airborne/datalink.c rename to sw/airborne/firmwares/fixedwing/datalink.c diff --git a/sw/airborne/firmwares/fixedwing/main_ap.c b/sw/airborne/firmwares/fixedwing/main_ap.c index deb1512a6e..9ff099da95 100644 --- a/sw/airborne/firmwares/fixedwing/main_ap.c +++ b/sw/airborne/firmwares/fixedwing/main_ap.c @@ -39,7 +39,9 @@ #include "firmwares/fixedwing/stabilization/stabilization_attitude.h" #include "firmwares/fixedwing/guidance/guidance_v.h" #include "gps.h" +#ifdef USE_INFRARED #include "subsystems/sensors/infrared.h" +#endif #include "gyro.h" #include "ap_downlink.h" #include "subsystems/nav.h" @@ -65,12 +67,15 @@ #endif -#ifdef USE_ANALOG_IMU +#ifdef USE_IMU #include "subsystems/imu.h" +#endif +#ifdef USE_AHRS #include "subsystems/ahrs.h" #include "subsystems/ahrs/ahrs_aligner.h" #include "subsystems/ahrs/ahrs_float_dcm.h" static inline void on_gyro_accel_event( void ); +static inline void on_accel_event( void ); static inline void on_mag_event( void ); #endif @@ -369,12 +374,37 @@ static void navigation_task( void ) { * */ -void periodic_task_ap( void ) { - static uint8_t _20Hz = 0; - static uint8_t _10Hz = 0; - static uint8_t _4Hz = 0; - static uint8_t _1Hz = 0; +void periodic_task_ap( void ) { + + static uint8_t _60Hz = 0; + static uint8_t _20Hz = 0; + static uint8_t _10Hz = 0; + static uint8_t _4Hz = 0; + static uint8_t _1Hz = 0; + +#ifdef USE_IMU + // Run at PERIODIC_FREQUENCY (60Hz if not defined) + imu_periodic(); + +#endif // USE_IMU + +#define _check_periodic_freq_ PERIODIC_FREQUENCY % 60 +#if _check_periodic_freq_ +#error Using HighSpeed Periodic: PERIODIC_FREQUENCY has to be a multiple of 60! +#endif + _60Hz++; + if (_60Hz >= (PERIODIC_FREQUENCY / 60)) + { + _60Hz = 0; + } + else + { + return; + } + + + // Rest of the periodic function still runs at 60Hz like always _20Hz++; if (_20Hz>=3) _20Hz=0; _10Hz++; @@ -440,11 +470,6 @@ void periodic_task_ap( void ) { #error "Only 20 and 60 allowed for CONTROL_RATE" #endif -#ifdef USE_ANALOG_IMU - if (!_20Hz) { - imu_periodic(); - } -#endif // USE_ANALOG_IMU #if CONTROL_RATE == 20 if (!_20Hz) @@ -499,8 +524,10 @@ void init_ap( void ) { GpioInit(); #endif -#ifdef USE_ANALOG_IMU +#ifdef USE_IMU imu_init(); +#endif +#ifdef USE_AHRS ahrs_aligner_init(); ahrs_init(); #endif @@ -559,9 +586,13 @@ void init_ap( void ) { /*********** EVENT ***********************************************************/ void event_task_ap( void ) { -#ifdef USE_ANALOG_IMU - ImuEvent(on_gyro_accel_event, on_mag_event); -#endif // USE_ANALOG_IMU +#ifdef USE_INFRARED + infrared_event(); +#endif + +#ifdef USE_AHRS + ImuEvent(on_gyro_accel_event, on_accel_event, on_mag_event); +#endif // USE_AHRS #ifdef USE_GPS #if !(defined HITL) && !(defined UBX_EXTERNAL) /** else comes through the datalink */ @@ -593,33 +624,8 @@ void event_task_ap( void ) { #endif /** USE_GPS */ -#if defined DATALINK + DatalinkEvent(); -#if DATALINK == PPRZ - if (PprzBuffer()) { - ReadPprzBuffer(); - if (pprz_msg_received) { - pprz_parse_payload(); - pprz_msg_received = FALSE; - } - } -#elif DATALINK == XBEE - if (XBeeBuffer()) { - ReadXBeeBuffer(); - if (xbee_msg_received) { - xbee_parse_payload(); - xbee_msg_received = FALSE; - } - } -#else -#error "Unknown DATALINK" -#endif - - if (dl_msg_available) { - dl_parse_msg(); - dl_msg_available = FALSE; - } -#endif /** DATALINK */ #ifdef MCU_SPI_LINK link_mcu_event_task(); @@ -634,20 +640,75 @@ void event_task_ap( void ) { modules_event_task(); } /* event_task_ap() */ -#ifdef USE_ANALOG_IMU +#ifdef USE_AHRS +static inline void on_accel_event( void ) { +} + static inline void on_gyro_accel_event( void ) { - ImuScaleGyro(imu); - ImuScaleAccel(imu); + +#ifdef AHRS_CPU_LED + LED_ON(AHRS_CPU_LED); +#endif + + // Run aligner on raw data as it also makes averages. if (ahrs.status == AHRS_UNINIT) { + ImuScaleGyro(imu); + ImuScaleAccel(imu); ahrs_aligner_run(); if (ahrs_aligner.status == AHRS_ALIGNER_LOCKED) ahrs_align(); + return; } - else { + +#if PERIODIC_FREQUENCY == 60 + ImuScaleGyro(imu); + ImuScaleAccel(imu); + + ahrs_propagate(); + ahrs_update_accel(); + ahrs_update_fw_estimator(); + +#else //PERIODIC_FREQUENCY + static uint8_t _reduced_propagation_rate = 0; + static uint8_t _reduced_correction_rate = 0; + static struct Int32Vect3 acc_avg; + static struct Int32Rates gyr_avg; + + RATES_ADD(gyr_avg, imu.gyro_unscaled); + VECT3_ADD(acc_avg, imu.accel_unscaled); + + _reduced_propagation_rate++; + if (_reduced_propagation_rate < (PERIODIC_FREQUENCY / AHRS_PROPAGATE_FREQUENCY)) + { + } + else + { + _reduced_propagation_rate = 0; + + RATES_SDIV(imu.gyro_unscaled, gyr_avg, (PERIODIC_FREQUENCY / AHRS_PROPAGATE_FREQUENCY) ); + INT_RATES_ZERO(gyr_avg); + + ImuScaleGyro(imu); + ahrs_propagate(); - ahrs_update_accel(); - ahrs_update_fw_estimator(); + + _reduced_correction_rate++; + if (_reduced_correction_rate >= (AHRS_PROPAGATE_FREQUENCY / AHRS_CORRECT_FREQUENCY)) + { + _reduced_correction_rate = 0; + VECT3_SDIV(imu.accel_unscaled, acc_avg, (PERIODIC_FREQUENCY / AHRS_CORRECT_FREQUENCY) ); + INT_VECT3_ZERO(acc_avg); + ImuScaleAccel(imu); + ahrs_update_accel(); + ahrs_update_fw_estimator(); + } } +#endif //PERIODIC_FREQUENCY + +#ifdef AHRS_CPU_LED + LED_OFF(AHRS_CPU_LED); +#endif + } static inline void on_mag_event(void) { @@ -659,4 +720,4 @@ static inline void on_mag_event(void) { } */ } -#endif // USE_ANALOG_IMU +#endif // USE_AHRS diff --git a/sw/airborne/firmwares/logger/main_logger.c b/sw/airborne/firmwares/logger/main_logger.c index 69a104dde1..8f3eea1406 100644 --- a/sw/airborne/firmwares/logger/main_logger.c +++ b/sw/airborne/firmwares/logger/main_logger.c @@ -520,7 +520,7 @@ static inline void main_init( void ) { max11040_init(); #endif - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/firmwares/motor_bench/main_turntable.c b/sw/airborne/firmwares/motor_bench/main_turntable.c index d170077efc..8345c948e7 100644 --- a/sw/airborne/firmwares/motor_bench/main_turntable.c +++ b/sw/airborne/firmwares/motor_bench/main_turntable.c @@ -1,5 +1,5 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" #include "interrupt_hw.h" @@ -32,10 +32,10 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); main_init_tacho(); - int_enable(); + mcu_int_enable(); } #define NB_STEP 256 diff --git a/sw/airborne/firmwares/motor_bench/mb_tacho.c b/sw/airborne/firmwares/motor_bench/mb_tacho.c index 7875b3c3b7..31e26ae80d 100644 --- a/sw/airborne/firmwares/motor_bench/mb_tacho.c +++ b/sw/airborne/firmwares/motor_bench/mb_tacho.c @@ -31,7 +31,7 @@ uint32_t mb_tacho_get_duration( void ) { my_duration = mb_tacho_duration; } got_one_pulse = FALSE; - int_enable(); + mcu_int_enable(); return my_duration; } @@ -53,7 +53,7 @@ float mb_tacho_get_averaged( void ) { mb_tacho_averaged = 0.; mb_tacho_nb_pulse = 0; - int_enable(); + mcu_int_enable(); return ret; diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c new file mode 100644 index 0000000000..06fb68f5ad --- /dev/null +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c @@ -0,0 +1,62 @@ +/* + * $Id$ + * + * Copyright (C) 2010 The Paparazzi Team + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "firmwares/rotorcraft/actuators.h" +#include "actuators_pwm_supervision.h" +#include "booz/booz2_commands.h" +#include "subsystems/radio_control.h" + +/* let's start butchery now and use the actuators_pwm arch functions */ +#include "firmwares/rotorcraft/actuators/actuators_pwm.h" + +#include "generated/airframe.h" + +int32_t actuators_pwm_values[ACTUATORS_PWM_NB]; + +void actuators_init(void) +{ + supervision_init(); + actuators_pwm_arch_init(); +} + +#define PWM_GAIN_SCALE 2 +#define PWM_OFF 1000 + +void actuators_set(bool_t motors_on) { + booz2_commands[COMMAND_PITCH] = booz2_commands[COMMAND_PITCH] * PWM_GAIN_SCALE; + booz2_commands[COMMAND_ROLL] = booz2_commands[COMMAND_ROLL] * PWM_GAIN_SCALE; + booz2_commands[COMMAND_YAW] = booz2_commands[COMMAND_YAW] * PWM_GAIN_SCALE; + + supervision_run(motors_on, FALSE, booz2_commands); + + if (motors_on) { + for (int i = 0; i < SUPERVISION_NB_MOTOR; i++) + actuators_pwm_values[i] = supervision.commands[i]; + } else { + for (int i = 0; i < ACTUATORS_PWM_NB; i++) + actuators_pwm_values[i] = PWM_OFF; + } + actuators_pwm_commit(); + +} + diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h new file mode 100644 index 0000000000..cf10740cc2 --- /dev/null +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h @@ -0,0 +1,30 @@ +/* + * $Id: actuators_pwm_supervision$ + * + * Copyright (C) 2010 The Paparazzi Team + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +#ifndef ACTUATORS_PWM_SUPERVISION_H +#define ACTUATORS_PWM_SUPERVISION_H + +#include "firmwares/rotorcraft/actuators/supervision.h" + +#endif /* ACTUATORS_PWM_SUPERVISION_H */ diff --git a/sw/airborne/booz/booz2_datalink.c b/sw/airborne/firmwares/rotorcraft/datalink.c similarity index 100% rename from sw/airborne/booz/booz2_datalink.c rename to sw/airborne/firmwares/rotorcraft/datalink.c diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c index dff5047344..03a4b251b2 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c @@ -37,6 +37,14 @@ #include "generated/airframe.h" +/* In case Asctec controllers are used without supervision */ +#ifndef SUPERVISION_MIN_MOTOR +#define SUPERVISION_MIN_MOTOR 1 +#endif +#ifndef SUPERVISION_MAX_MOTOR +#define SUPERVISION_MAX_MOTOR 200 +#endif + uint8_t guidance_v_mode; int32_t guidance_v_ff_cmd; int32_t guidance_v_fb_cmd; @@ -103,7 +111,7 @@ void guidance_v_read_rc(void) { // used in RC_DIRECT directly and as saturation in CLIMB and HOVER #ifndef USE_HELI - guidance_v_rc_delta_t = (int32_t)radio_control.values[RADIO_THROTTLE] * 200 / MAX_PPRZ; + guidance_v_rc_delta_t = (int32_t)radio_control.values[RADIO_THROTTLE] * (SUPERVISION_MAX_MOTOR - SUPERVISION_MIN_MOTOR) / MAX_PPRZ + SUPERVISION_MIN_MOTOR; #else guidance_v_rc_delta_t = (int32_t)radio_control.values[RADIO_THROTTLE] * 4 / 5; #endif @@ -153,8 +161,9 @@ void guidance_v_run(bool_t in_flight) { // AKA SUPERVISION and co if (in_flight) { // we should use something after the supervision!!! fuck!!! - int32_t cmd_hack = Chop(stabilization_cmd[COMMAND_THRUST], 1, 200); + int32_t cmd_hack = Chop(stabilization_cmd[COMMAND_THRUST], SUPERVISION_MIN_MOTOR, SUPERVISION_MAX_MOTOR); gv_adapt_run(ins_ltp_accel.z, cmd_hack); + //gv_adapt_run(ins_ltp_accel.z, cmd_hack, guidance_v_zd_ref); } else { // reset vertical filter until takeoff diff --git a/sw/airborne/firmwares/rotorcraft/main.c b/sw/airborne/firmwares/rotorcraft/main.c index 4d72a022e3..ad0bf0e3c0 100644 --- a/sw/airborne/firmwares/rotorcraft/main.c +++ b/sw/airborne/firmwares/rotorcraft/main.c @@ -32,6 +32,7 @@ #include "downlink.h" #include "firmwares/rotorcraft/telemetry.h" #include "datalink.h" +#include "xbee.h" #include "booz2_commands.h" #include "firmwares/rotorcraft/actuators.h" @@ -42,6 +43,7 @@ #include "booz/booz2_analog.h" #include "subsystems/sensors/baro.h" +#include "baro_board.h" #include "firmwares/rotorcraft/battery.h" @@ -54,10 +56,6 @@ #include "subsystems/ahrs.h" #include "subsystems/ins.h" -#if defined USE_CAM || USE_DROP -#include "booz2_pwm_hw.h" -#endif - #include "firmwares/rotorcraft/main.h" #ifdef SITL @@ -66,7 +64,8 @@ #include "generated/modules.h" -static inline void on_gyro_accel_event( void ); +static inline void on_gyro_event( void ); +static inline void on_accel_event( void ); static inline void on_baro_abs_event( void ); static inline void on_baro_dif_event( void ); static inline void on_gps_event( void ); @@ -87,11 +86,13 @@ int main( void ) { STATIC_INLINE void main_init( void ) { +#ifndef NO_FUCKING_STARTUP_DELAY #ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT /* IF THIS IS NEEDED SOME PERHIPHERAL THEN PLEASE MOVE IT THERE */ for (uint32_t startup_counter=0; startup_counter<2000000; startup_counter++){ __asm("nop"); } +#endif #endif mcu_init(); @@ -101,13 +102,13 @@ STATIC_INLINE void main_init( void ) { actuators_init(); radio_control_init(); +#if DATALINK == XBEE + xbee_init(); +#endif + booz2_analog_init(); baro_init(); -#if defined USE_CAM || USE_DROP - booz2_pwm_init_hw(); -#endif - battery_init(); imu_init(); @@ -143,33 +144,32 @@ STATIC_INLINE void main_periodic( void ) { /* set actuators */ actuators_set(autopilot_motors_on); - PeriodicPrescaleBy10( \ - { \ - radio_control_periodic_task(); \ - if (radio_control.status != RC_OK && \ - autopilot_mode != AP_MODE_KILL && \ - autopilot_mode != AP_MODE_NAV) \ - autopilot_set_mode(AP_MODE_FAILSAFE); \ - }, \ - { \ - /* booz_fms_periodic(); FIXME */ \ - }, \ - { \ - /*BoozControlSurfacesSetFromCommands();*/ \ - }, \ - { \ - LED_PERIODIC(); \ - }, \ - { baro_periodic(); - }, \ - {}, \ - {}, \ - {}, \ - {}, \ - { \ - Booz2TelemetryPeriodic(); \ - } \ - ); \ + PeriodicPrescaleBy10( \ + { \ + radio_control_periodic_task(); \ + if (radio_control.status != RC_OK && \ + autopilot_mode != AP_MODE_KILL && \ + autopilot_mode != AP_MODE_NAV) \ + autopilot_set_mode(AP_MODE_FAILSAFE); \ + }, \ + { \ + /* booz_fms_periodic(); FIXME */ \ + }, \ + { \ + /*BoozControlSurfacesSetFromCommands();*/ \ + }, \ + { \ + LED_PERIODIC(); \ + }, \ + { baro_periodic(); \ + }, \ + {}, \ + {}, \ + {}, \ + {}, \ + { \ + Booz2TelemetryPeriodic(); \ + } ); #ifdef USE_GPS if (radio_control.status != RC_OK && \ @@ -198,7 +198,7 @@ STATIC_INLINE void main_event( void ) { RadioControlEvent(autopilot_on_rc_frame); } - ImuEvent(on_gyro_accel_event, on_mag_event); + ImuEvent(on_gyro_event, on_accel_event, on_mag_event); BaroEvent(on_baro_abs_event, on_baro_dif_event); @@ -214,10 +214,17 @@ STATIC_INLINE void main_event( void ) { } -static inline void on_gyro_accel_event( void ) { +static inline void on_accel_event( void ) { + ImuScaleAccel(imu); + + if (ahrs.status != AHRS_UNINIT) { + ahrs_update_accel(); + } +} + +static inline void on_gyro_event( void ) { ImuScaleGyro(imu); - ImuScaleAccel(imu); if (ahrs.status == AHRS_UNINIT) { ahrs_aligner_run(); @@ -226,7 +233,6 @@ static inline void on_gyro_accel_event( void ) { } else { ahrs_propagate(); - ahrs_update_accel(); #ifdef SITL if (nps_bypass_ahrs) sim_overwrite_ahrs(); #endif diff --git a/sw/airborne/firmwares/tutorial/main_demo2.c b/sw/airborne/firmwares/tutorial/main_demo2.c index 005b76e505..0ced604473 100644 --- a/sw/airborne/firmwares/tutorial/main_demo2.c +++ b/sw/airborne/firmwares/tutorial/main_demo2.c @@ -1,6 +1,6 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" @@ -17,7 +17,7 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); } diff --git a/sw/airborne/firmwares/tutorial/main_demo3.c b/sw/airborne/firmwares/tutorial/main_demo3.c index 29ae419e12..5699adefe5 100644 --- a/sw/airborne/firmwares/tutorial/main_demo3.c +++ b/sw/airborne/firmwares/tutorial/main_demo3.c @@ -19,11 +19,11 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); uart0_init_tx(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/firmwares/tutorial/main_demo6.c b/sw/airborne/firmwares/tutorial/main_demo6.c index af9d8f777a..dd312de7a2 100644 --- a/sw/airborne/firmwares/tutorial/main_demo6.c +++ b/sw/airborne/firmwares/tutorial/main_demo6.c @@ -1,5 +1,5 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" #include "interrupt_hw.h" @@ -21,11 +21,11 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); usb_serial_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/firmwares/vor/lpc_vor_main.c b/sw/airborne/firmwares/vor/lpc_vor_main.c index dd1e2e77d6..bb6ee1e1b4 100644 --- a/sw/airborne/firmwares/vor/lpc_vor_main.c +++ b/sw/airborne/firmwares/vor/lpc_vor_main.c @@ -1,9 +1,9 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" #include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "print.h" //#include "messages.h" //#include "downlink.h" @@ -86,14 +86,14 @@ static inline void main_report( void ) { static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); uart0_init(); vor_int_demod_init(); VorDacInit(); vor_adc_init(); - int_enable(); + mcu_int_enable(); } diff --git a/sw/airborne/firmwares/wind_tunnel/main.c b/sw/airborne/firmwares/wind_tunnel/main.c index a8f779296a..e32d4f3441 100644 --- a/sw/airborne/firmwares/wind_tunnel/main.c +++ b/sw/airborne/firmwares/wind_tunnel/main.c @@ -1,9 +1,9 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" #include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" @@ -38,7 +38,7 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); uart0_init(); @@ -50,7 +50,7 @@ static inline void main_init( void ) { spi_init(); wt_baro_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/firmwares/wind_tunnel/main_mb.c b/sw/airborne/firmwares/wind_tunnel/main_mb.c index 48e0403f44..437e0fab32 100644 --- a/sw/airborne/firmwares/wind_tunnel/main_mb.c +++ b/sw/airborne/firmwares/wind_tunnel/main_mb.c @@ -1,9 +1,9 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" #include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" @@ -37,7 +37,7 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); uart0_init(); @@ -49,7 +49,7 @@ static inline void main_init( void ) { //motor_power = 0; - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/fms/lpc_test_spi.c b/sw/airborne/fms/lpc_test_spi.c index 9ca9f5b902..97a0de0407 100644 --- a/sw/airborne/fms/lpc_test_spi.c +++ b/sw/airborne/fms/lpc_test_spi.c @@ -24,7 +24,7 @@ #include #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "interrupt_hw.h" #include "armVIC.h" @@ -50,10 +50,10 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); main_spi_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/fms/overo_test_passthrough.c b/sw/airborne/fms/overo_test_passthrough.c index 826975fd6c..47002d5037 100644 --- a/sw/airborne/fms/overo_test_passthrough.c +++ b/sw/airborne/fms/overo_test_passthrough.c @@ -84,7 +84,7 @@ static void dialog_with_io_proc() { uint8_t crc_valid; for (uint8_t i=0; i<6; i++) msg_out.payload.msg_down.pwm_outputs_usecs[i] = otp.servos_outputs_usecs[i]; - for (uint8_t i=0; i<4; i++) msg_out.payload.msg_down.csc_servo_cmd[i] = otp.csc_servo_outputs[i]; +// for (uint8_t i=0; i<4; i++) msg_out.payload.msg_down.csc_servo_cmd[i] = otp.csc_servo_outputs[i]; spi_link_send(&msg_out, sizeof(struct AutopilotMessageCRCFrame), &msg_in, &crc_valid); diff --git a/sw/airborne/gps.h b/sw/airborne/gps.h index b6c28317b8..e201bc4980 100644 --- a/sw/airborne/gps.h +++ b/sw/airborne/gps.h @@ -56,7 +56,7 @@ extern uint8_t gps_status_flags; extern uint8_t gps_sol_flags; extern uint16_t gps_week; /* weeks */ extern uint32_t gps_itow; /* ms */ -extern int32_t gps_alt; /* cm */ +extern int32_t gps_alt; /* above MSL in cm */ extern uint16_t gps_speed_3d; /* cm/s */ extern uint16_t gps_gspeed; /* cm/s */ extern int16_t gps_climb; /* m/s */ diff --git a/sw/airborne/latlong.c b/sw/airborne/latlong.c index f0f158ad48..9aff7963cc 100644 --- a/sw/airborne/latlong.c +++ b/sw/airborne/latlong.c @@ -69,15 +69,13 @@ static inline float inverse_isometric_latitude(float lat, float e, float epsilon return phi0; } -/** us on arm7@60MHz, i.e. % of cputime at 4Hz +/** use on ARM7 at 60MHz, i.e. percentage of cputime at 4Hz specialize CSin: 951us i.e. One CSin: 120us init: - iso_lat: 155, 172 + iso_lat: 155, 172 for loop: 258 - - - %*/ +*/ #define LambdaOfUtmZone(utm_zone) RadOfDeg((utm_zone-1)*6-180+3) diff --git a/sw/airborne/led.h b/sw/airborne/led.h index 98a943dbed..55a9c0493e 100644 --- a/sw/airborne/led.h +++ b/sw/airborne/led.h @@ -31,8 +31,7 @@ #ifndef LED_H #define LED_H -// FIXME : remove LED -#if defined USE_LED || defined LED +#if defined USE_LED #include "led_hw.h" diff --git a/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c b/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c index 5a115a0c74..a718ad9a7c 100644 --- a/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c +++ b/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c @@ -22,7 +22,7 @@ * */ -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "lisa/lisa_overo_link.h" #include "lisa/lisa_spistream.h" @@ -91,7 +91,7 @@ int main(void) { static inline void main_init(void) { - hw_init(); + mcu_init(); sys_time_init(); overo_link_init(); diff --git a/sw/airborne/lisa/lisa_stm_passthrough_main.c b/sw/airborne/lisa/lisa_stm_passthrough_main.c index 60a3725cd6..2a23a7c705 100644 --- a/sw/airborne/lisa/lisa_stm_passthrough_main.c +++ b/sw/airborne/lisa/lisa_stm_passthrough_main.c @@ -23,20 +23,21 @@ */ #include "mcu.h" +#include "mcu_periph/uart.h" #include "sys_time.h" #include "downlink.h" #include "booz/booz2_commands.h" #include "actuators.h" #include "actuators/actuators_pwm.h" #include "subsystems/imu.h" -#include "booz/booz_radio_control.h" +#include "subsystems/radio_control.h" #include "autopilot.h" -#include "ins.h" +#include "subsystems/ins.h" #include "guidance.h" #include "navigation.h" #include "lisa/lisa_overo_link.h" #include "generated/airframe.h" -#include "ahrs.h" +#include "subsystems/ahrs.h" #ifdef PASSTHROUGH_CYGNUS #include "stabilization.h" #endif @@ -54,6 +55,7 @@ static inline void main_periodic(void); static inline void main_event(void); static inline void on_gyro_accel_event(void); +static inline void on_accel_event(void); static inline void on_mag_event(void); static inline void on_overo_link_msg_received(void); @@ -283,6 +285,9 @@ static inline void on_overo_link_lost(void) { static inline void on_overo_link_crc_failed(void) { } +static inline void on_accel_event(void) { +} + static inline void on_gyro_accel_event(void) { ImuScaleGyro(imu); ImuScaleAccel(imu); @@ -336,7 +341,7 @@ static inline void main_on_baro_abs(void) { static inline void main_event(void) { - ImuEvent(on_gyro_accel_event, on_mag_event); + ImuEvent(on_gyro_accel_event, on_accel_event, on_mag_event); BaroEvent(main_on_baro_abs, main_on_baro_diff); OveroLinkEvent(on_overo_link_msg_received, on_overo_link_crc_failed); RadioControlEvent(on_rc_message); diff --git a/sw/airborne/lisa/stm_test_spi_link.c b/sw/airborne/lisa/stm_test_spi_link.c index 0f5ae21ae5..6aed277afc 100644 --- a/sw/airborne/lisa/stm_test_spi_link.c +++ b/sw/airborne/lisa/stm_test_spi_link.c @@ -27,7 +27,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "lisa/lisa_overo_link.h" @@ -42,7 +42,7 @@ static inline void on_overo_link_lost(void); int main(void) { - hw_init(); + mcu_init(); sys_time_init(); overo_link_init(); DEBUG_SERVO1_INIT(); diff --git a/sw/airborne/lisa/test/hs_gyro.c b/sw/airborne/lisa/test/hs_gyro.c index e82e1dd4be..544e4579c2 100644 --- a/sw/airborne/lisa/test/hs_gyro.c +++ b/sw/airborne/lisa/test/hs_gyro.c @@ -45,6 +45,7 @@ static inline void main_periodic_task( void ); static inline void main_event_task( void ); static inline void on_gyro_accel_event(void); +static inline void on_accel_event(void); static inline void on_mag_event(void); int main( void ) { @@ -77,10 +78,14 @@ static inline void main_periodic_task( void ) { static inline void main_event_task( void ) { - ImuEvent(on_gyro_accel_event, on_mag_event); + ImuEvent(on_gyro_accel_event, on_accel_event, on_mag_event); } + +static inline void on_accel_event(void) { +} + #define NB_SAMPLES 20 static inline void on_gyro_accel_event(void) { diff --git a/sw/airborne/lisa/test/lisa_test_actuators_mkk.c b/sw/airborne/lisa/test/lisa_test_actuators_mkk.c index 2c5a646ebc..bc3e4c8f64 100644 --- a/sw/airborne/lisa/test/lisa_test_actuators_mkk.c +++ b/sw/airborne/lisa/test/lisa_test_actuators_mkk.c @@ -22,7 +22,7 @@ */ -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "booz2_commands.h" #include "actuators.h" @@ -49,7 +49,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); actuators_init(); } diff --git a/sw/airborne/lisa/test/lisa_test_adxl345.c b/sw/airborne/lisa/test/lisa_test_adxl345.c index 40f6bd8906..6b8c65ca58 100644 --- a/sw/airborne/lisa/test/lisa_test_adxl345.c +++ b/sw/airborne/lisa/test/lisa_test_adxl345.c @@ -35,7 +35,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" @@ -63,7 +63,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); main_init_hw(); diff --git a/sw/airborne/lisa/test/lisa_test_adxl345_dma.c b/sw/airborne/lisa/test/lisa_test_adxl345_dma.c index 20dfd6f70b..fa74e5018a 100644 --- a/sw/airborne/lisa/test/lisa_test_adxl345_dma.c +++ b/sw/airborne/lisa/test/lisa_test_adxl345_dma.c @@ -29,7 +29,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" @@ -58,7 +58,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); main_init_hw(); diff --git a/sw/airborne/lisa/test/lisa_test_aspirin.c b/sw/airborne/lisa/test/lisa_test_aspirin.c index 4f7cbecbb3..2641273fe2 100644 --- a/sw/airborne/lisa/test/lisa_test_aspirin.c +++ b/sw/airborne/lisa/test/lisa_test_aspirin.c @@ -28,7 +28,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" @@ -60,7 +60,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); main_init_hw(); diff --git a/sw/airborne/lisa/test/lisa_test_hmc5843.c b/sw/airborne/lisa/test/lisa_test_hmc5843.c index 64b786a367..b21d0c84e9 100644 --- a/sw/airborne/lisa/test/lisa_test_hmc5843.c +++ b/sw/airborne/lisa/test/lisa_test_hmc5843.c @@ -34,11 +34,12 @@ */ #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" #include "std.h" +#include "mcu_periph/uart.h" #include "peripherals/hmc5843.h" #include "my_debug_servo.h" #include "math/pprz_algebra_int.h" @@ -74,7 +75,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); main_init_hw(); } diff --git a/sw/airborne/lisa/test/lisa_test_itg3200.c b/sw/airborne/lisa/test/lisa_test_itg3200.c index 9e425cdad2..66848cb408 100644 --- a/sw/airborne/lisa/test/lisa_test_itg3200.c +++ b/sw/airborne/lisa/test/lisa_test_itg3200.c @@ -35,7 +35,9 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" +#include "mcu_periph/uart.h" +#include "mcu_periph/i2c.h" #include "sys_time.h" #include "downlink.h" #include "std.h" @@ -71,7 +73,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); main_init_hw(); } diff --git a/sw/airborne/lisa/test/lisa_test_max1168.c b/sw/airborne/lisa/test/lisa_test_max1168.c index af7bc514c9..38a6cc67bc 100644 --- a/sw/airborne/lisa/test/lisa_test_max1168.c +++ b/sw/airborne/lisa/test/lisa_test_max1168.c @@ -29,7 +29,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" #include "peripherals/max1168.h" @@ -54,7 +54,7 @@ int main(void) { static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); max1168_init(); main_spi2_init(); diff --git a/sw/airborne/lisa/test/lisa_test_ms2001.c b/sw/airborne/lisa/test/lisa_test_ms2001.c deleted file mode 100644 index 1eb0342e80..0000000000 --- a/sw/airborne/lisa/test/lisa_test_ms2001.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2010 Antoine Drouin - * - * This file is part of paparazzi. - * - * paparazzi 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, or (at your option) - * any later version. - * - * paparazzi 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 paparazzi; see the file COPYING. If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include -#include - -#include BOARD_CONFIG -#include "init_hw.h" -#include "sys_time.h" -#include "downlink.h" -#include "peripherals/ms2001.h" - -static inline void main_init( void ); -static inline void main_periodic_task( void ); -static inline void main_event_task( void ); - -static inline void main_spi2_init(void); - -int main(void) { - main_init(); - - while(1) { - if (sys_time_periodic()) - main_periodic_task(); - main_event_task(); - } - - return 0; -} - - -static inline void main_init( void ) { - hw_init(); - sys_time_init(); - ms2001_init(); - main_spi2_init(); -} - -static inline void main_periodic_task( void ) { - RunOnceEvery(10, - { - DOWNLINK_SEND_BOOT(DefaultChannel, &cpu_time_sec); - LED_PERIODIC(); - }); - - switch(ms2001_status) { - case MS2001_IDLE: - Ms2001SendReq(); - break; - case MS2001_WAITING_EOC: - if (Ms2001HasEOC()) { - Ms2001ReadRes(); - } - break; - } -} - -static inline void main_event_task( void ) { - if (ms2001_status == MS2001_DATA_AVAILABLE) { - RunOnceEvery(10, { - DOWNLINK_SEND_IMU_MAG_RAW(DefaultChannel, - &ms2001_values[0], - &ms2001_values[1], - &ms2001_values[2]); - }); - ms2001_status = MS2001_IDLE; - } -} - -static inline void main_spi2_init( void ) { - - /* set max1168 slave select as output and assert it ( on PB12) */ - GPIOB->BSRR = GPIO_Pin_12; - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); - GPIO_InitTypeDef GPIO_InitStructure; - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; - GPIO_Init(GPIOB, &GPIO_InitStructure); - - /* Enable SPI2 Periph clock -------------------------------------------------*/ - RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE); - - /* Configure GPIOs: SCK, MISO and MOSI --------------------------------*/ - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; - GPIO_Init(GPIOB, &GPIO_InitStructure); - - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO , ENABLE); - - - /* Enable SPI_2 DMA clock ---------------------------------------------------*/ - RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE); - - - -} - diff --git a/sw/airborne/lisa/test/lisa_test_ms2100.c b/sw/airborne/lisa/test/lisa_test_ms2100.c index cedf7cacd2..1bf869b3fa 100644 --- a/sw/airborne/lisa/test/lisa_test_ms2100.c +++ b/sw/airborne/lisa/test/lisa_test_ms2100.c @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) 2009 Antoine Drouin + * Copyright (C) 2010 Antoine Drouin * * This file is part of paparazzi. * @@ -29,7 +29,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" #include "peripherals/ms2100.h" @@ -54,48 +54,53 @@ int main(void) { static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); - max1168_init(); + ms2100_init(); main_spi2_init(); } static inline void main_periodic_task( void ) { - // LED_TOGGLE(6); - max1168_read(); RunOnceEvery(10, { DOWNLINK_SEND_BOOT(DefaultChannel, &cpu_time_sec); LED_PERIODIC(); }); -} - -static inline void main_event_task( void ) { - if (max1168_status == STA_MAX1168_DATA_AVAILABLE) { - RunOnceEvery(10, { - DOWNLINK_SEND_IMU_GYRO_RAW(DefaultChannel, &max1168_values[0], &max1168_values[1], &max1168_values[2]); - DOWNLINK_SEND_IMU_ACCEL_RAW(DefaultChannel, &max1168_values[3], &max1168_values[4], &max1168_values[6]); - // DOWNLINK_SEND_BOOT(DefaultChannel, &max1168_values[7]); }); - }); - max1168_status = STA_MAX1168_IDLE; + switch(ms2100_status) { + case MS2100_IDLE: + Ms2001SendReq(); + break; + case MS2100_WAITING_EOC: + if (Ms2001HasEOC()) { + Ms2001ReadRes(); + } + break; } } +static inline void main_event_task( void ) { + if (ms2100_status == MS2100_DATA_AVAILABLE) { + RunOnceEvery(10, { + DOWNLINK_SEND_IMU_MAG_RAW(DefaultChannel, + &ms2100_values[0], + &ms2100_values[1], + &ms2100_values[2]); + }); + ms2100_status = MS2100_IDLE; + } +} static inline void main_spi2_init( void ) { - /* set mag ss as output and assert it (on PC12) ------------------------------*/ - /* set mag reset as output and assert it (on PC13) ------------------------------*/ - GPIOC->BSRR = GPIO_Pin_12; - GPIOC->BSRR = GPIO_Pin_13; - - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE); + /* set max1168 slave select as output and assert it ( on PB12) */ + GPIOB->BSRR = GPIO_Pin_12; + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); GPIO_InitTypeDef GPIO_InitStructure; - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13; + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; - GPIO_Init(GPIOC, &GPIO_InitStructure); + GPIO_Init(GPIOB, &GPIO_InitStructure); /* Enable SPI2 Periph clock -------------------------------------------------*/ RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE); @@ -108,24 +113,11 @@ static inline void main_spi2_init( void ) { RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO , ENABLE); - /* SPI Master configuration --------------------------------------------------*/ - SPI_InitTypeDef SPI_InitStructure; - SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; - SPI_InitStructure.SPI_Mode = SPI_Mode_Master; - SPI_InitStructure.SPI_DataSize = SPI_DataSize_16b; - SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low; - SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge; - SPI_InitStructure.SPI_NSS = SPI_NSS_Soft; - SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8; - SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; - SPI_InitStructure.SPI_CRCPolynomial = 7; - SPI_Init(SPI2, &SPI_InitStructure); - - /* Enable SPI */ - SPI_Cmd(SPI2, ENABLE); /* Enable SPI_2 DMA clock ---------------------------------------------------*/ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE); + + } diff --git a/sw/airborne/lisa/test/lisa_test_sc18is600.c b/sw/airborne/lisa/test/lisa_test_sc18is600.c index 044ba8cad3..846e4cab96 100644 --- a/sw/airborne/lisa/test/lisa_test_sc18is600.c +++ b/sw/airborne/lisa/test/lisa_test_sc18is600.c @@ -26,7 +26,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" #include "peripherals/sc18is600.h" @@ -51,7 +51,7 @@ int main(void) { static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); sc18is600_init(); main_spi2_init(); diff --git a/sw/airborne/lisa/test/lisa_tunnel.c b/sw/airborne/lisa/test/lisa_tunnel.c index 1a7bec287a..48c5072eca 100644 --- a/sw/airborne/lisa/test/lisa_tunnel.c +++ b/sw/airborne/lisa/test/lisa_tunnel.c @@ -44,7 +44,7 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); } diff --git a/sw/airborne/lisa/test/test_board.c b/sw/airborne/lisa/test/test_board.c index 292fb22bca..603f6ec155 100644 --- a/sw/airborne/lisa/test/test_board.c +++ b/sw/airborne/lisa/test/test_board.c @@ -98,7 +98,7 @@ int main( void ) { static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); diff --git a/sw/airborne/lisa/test/test_bswap.c b/sw/airborne/lisa/test/test_bswap.c index b1a9cc5bc3..ccf1a9ad33 100644 --- a/sw/airborne/lisa/test/test_bswap.c +++ b/sw/airborne/lisa/test/test_bswap.c @@ -1,6 +1,6 @@ #include -#include "init_hw.h" +#include "mcu.h" #define MyByteSwap16(n) \ diff --git a/sw/airborne/lisa/test/test_mc_asctec_v1_simple.c b/sw/airborne/lisa/test/test_mc_asctec_v1_simple.c index be1a213223..b83160e704 100644 --- a/sw/airborne/lisa/test/test_mc_asctec_v1_simple.c +++ b/sw/airborne/lisa/test/test_mc_asctec_v1_simple.c @@ -28,7 +28,7 @@ */ -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" @@ -51,7 +51,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); } diff --git a/sw/airborne/lisa/test_adc.c b/sw/airborne/lisa/test_adc.c index 7132bc90e3..2666e8f0bb 100644 --- a/sw/airborne/lisa/test_adc.c +++ b/sw/airborne/lisa/test_adc.c @@ -30,6 +30,7 @@ #include "sys_time.h" #include "led.h" #include "mcu_periph/adc.h" +#include "mcu_periph/uart.h" #include "downlink.h" int main_periodic(void); diff --git a/sw/airborne/lisa/test_csc_servo.c b/sw/airborne/lisa/test_csc_servo.c index d0fe135f49..7249d89ec4 100644 --- a/sw/airborne/lisa/test_csc_servo.c +++ b/sw/airborne/lisa/test_csc_servo.c @@ -22,7 +22,7 @@ */ -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "csc_msg_def.h" #include "csc_protocol.h" diff --git a/sw/airborne/lisa/test_datalink.c b/sw/airborne/lisa/test_datalink.c index 2315f1370f..ce5a02f314 100644 --- a/sw/airborne/lisa/test_datalink.c +++ b/sw/airborne/lisa/test_datalink.c @@ -24,7 +24,7 @@ #define DATALINK_C #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" @@ -47,7 +47,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); } diff --git a/sw/airborne/lisa/test_float.c b/sw/airborne/lisa/test_float.c index 0188012ca9..0339888cac 100644 --- a/sw/airborne/lisa/test_float.c +++ b/sw/airborne/lisa/test_float.c @@ -24,7 +24,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" static inline void main_init( void ); @@ -43,7 +43,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); } diff --git a/sw/airborne/lisa/test_led.c b/sw/airborne/lisa/test_led.c index 887d62e540..0052006f56 100644 --- a/sw/airborne/lisa/test_led.c +++ b/sw/airborne/lisa/test_led.c @@ -25,7 +25,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "led.h" void Delay(__IO uint32_t nCount); @@ -38,7 +38,7 @@ const int LED_PROG_OFF[LED_PROGRAM_SIZE] = {-1, -1, -1, -1, 3, 5, 7, 1, int main(void) { int i = 0; - hw_init(); + mcu_init(); while (1) { for (i=0; i< LED_PROGRAM_SIZE; i++) { diff --git a/sw/airborne/lisa/test_mc.c b/sw/airborne/lisa/test_mc.c index fa6f1a3d3c..978c2857d1 100644 --- a/sw/airborne/lisa/test_mc.c +++ b/sw/airborne/lisa/test_mc.c @@ -30,7 +30,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" static inline void main_init( void ); @@ -55,7 +55,7 @@ int main(void) { static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); main_i2c_init(); test_gpios(); diff --git a/sw/airborne/lisa/test_periodic.c b/sw/airborne/lisa/test_periodic.c index 40f8c1371f..6104c4ad3e 100644 --- a/sw/airborne/lisa/test_periodic.c +++ b/sw/airborne/lisa/test_periodic.c @@ -25,7 +25,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" static inline void main_init( void ); @@ -43,7 +43,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); } diff --git a/sw/airborne/lisa/test_servos.c b/sw/airborne/lisa/test_servos.c index 4bf9235b67..533feedc1a 100644 --- a/sw/airborne/lisa/test_servos.c +++ b/sw/airborne/lisa/test_servos.c @@ -23,7 +23,7 @@ #include -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "firmwares/rotorcraft/actuators/actuators_pwm.h" @@ -41,7 +41,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); actuators_init(); } diff --git a/sw/airborne/lisa/test_spi_slave.c b/sw/airborne/lisa/test_spi_slave.c index 001219a8e4..d78e32ccdd 100644 --- a/sw/airborne/lisa/test_spi_slave.c +++ b/sw/airborne/lisa/test_spi_slave.c @@ -26,7 +26,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" @@ -51,7 +51,7 @@ int main(void) { static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); main_spi_slave_init(); } diff --git a/sw/airborne/lisa/test_spi_slave2.c b/sw/airborne/lisa/test_spi_slave2.c index 75c5e8ecc8..09bdee54e5 100644 --- a/sw/airborne/lisa/test_spi_slave2.c +++ b/sw/airborne/lisa/test_spi_slave2.c @@ -27,7 +27,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "downlink.h" #include "fms/fms_autopilot_msg.h" @@ -59,7 +59,7 @@ int main(void) { static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); main_spi_slave_init(); } diff --git a/sw/airborne/lisa/test_uart.c b/sw/airborne/lisa/test_uart.c index cd0a3314f5..599c9581d2 100644 --- a/sw/airborne/lisa/test_uart.c +++ b/sw/airborne/lisa/test_uart.c @@ -28,7 +28,8 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" +#include "mcu_periph/uart.h" #include "sys_time.h" static inline void main_init( void ); @@ -46,7 +47,7 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); } diff --git a/sw/airborne/lisa/tunnel_hw.c b/sw/airborne/lisa/tunnel_hw.c index 0d9770e05b..10741ff5ae 100644 --- a/sw/airborne/lisa/tunnel_hw.c +++ b/sw/airborne/lisa/tunnel_hw.c @@ -27,7 +27,7 @@ #include #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" @@ -52,7 +52,7 @@ void Delay(__IO uint32_t nCount) { int main(void) { - hw_init(); + mcu_init(); sys_time_init(); diff --git a/sw/airborne/math/pprz_algebra.h b/sw/airborne/math/pprz_algebra.h index f090c8a189..6e687e8dd3 100644 --- a/sw/airborne/math/pprz_algebra.h +++ b/sw/airborne/math/pprz_algebra.h @@ -101,7 +101,7 @@ } /* a = b */ -#define VECT3_COPY(_a, _b) { \ +#define VECT3_COPY(_a, _b) { \ (_a).x = (_b).x; \ (_a).y = (_b).y; \ (_a).z = (_b).z; \ @@ -186,9 +186,9 @@ /* */ #define VECT3_BOUND_BOX(_v, _v_min, _v_max) { \ - if ((_v).x > (_v_max.x)) (_v).x = (_v_max.x); else if ((_v).x < (_v_min.x)) (_v).x = (_v_min.x); \ - if ((_v).y > (_v_max.y)) (_v).y = (_v_max.y); else if ((_v).y < (_v_min.y)) (_v).y = (_v_min.z); \ - if ((_v).z > (_v_max.y)) (_v).z = (_v_max.z); else if ((_v).z < (_v_min.z)) (_v).z = (_v_min.z); \ + if ((_v).x > (_v_max).x) (_v).x = (_v_max).x; else if ((_v).x < (_v_min).x) (_v).x = (_v_min).x; \ + if ((_v).y > (_v_max).y) (_v).y = (_v_max).y; else if ((_v).y < (_v_min).y) (_v).y = (_v_min).z; \ + if ((_v).z > (_v_max).y) (_v).z = (_v_max).z; else if ((_v).z < (_v_min).z) (_v).z = (_v_min).z; \ } @@ -204,9 +204,9 @@ } #define EULERS_ASSIGN(_e, _phi, _theta, _psi) { \ - (_e).phi = _phi; \ - (_e).theta = _theta; \ - (_e).psi = _psi; \ + (_e).phi = (_phi); \ + (_e).theta = (_theta); \ + (_e).psi = (_psi); \ } /* a += b */ @@ -247,9 +247,9 @@ /* _v = Bound(_v, _min, _max) */ #define EULERS_BOUND_CUBE(_v, _min, _max) { \ - (_v).phi = (_v).phi < _min ? _min : (_v).phi > _max ? _max : (_v).phi; \ - (_v).theta = (_v).theta < _min ? _min : (_v).theta > _max ? _max : (_v).theta; \ - (_v).psi = (_v).psi < _min ? _min : (_v).psi > _max ? _max : (_v).psi; \ + (_v).phi = (_v).phi < (_min) ? (_min) : (_v).phi > (_max) ? (_max) : (_v).phi; \ + (_v).theta = (_v).theta < (_min) ? (_min) : (_v).theta > (_max) ? (_max) : (_v).theta; \ + (_v).psi = (_v).psi < (_min) ? (_min) : (_v).psi > (_max) ? (_max) : (_v).psi; \ } /* @@ -313,24 +313,24 @@ } /* Element wise vector multiplication */ -#define RATES_EWMULT_RSHIFT(c, a, b, _s) { \ - c.p = (a.p * b.p) >> (_s); \ - c.q = (a.q * b.q) >> (_s); \ - c.r = (a.r * b.r) >> (_s); \ +#define RATES_EWMULT_RSHIFT(c, a, b, _s) { \ + (c).p = ((a).p * (b).p) >> (_s); \ + (c).q = ((a).q * (b).q) >> (_s); \ + (c).r = ((a).r * (b).r) >> (_s); \ } /* _v = Bound(_v, _min, _max) */ #define RATES_BOUND_CUBE(_v, _min, _max) { \ - (_v).p = (_v).p < _min ? _min : (_v).p > _max ? _max : (_v).p; \ - (_v).q = (_v).q < _min ? _min : (_v).q > _max ? _max : (_v).q; \ - (_v).r = (_v).r < _min ? _min : (_v).r > _max ? _max : (_v).r; \ + (_v).p = (_v).p < (_min) ? (_min) : (_v).p > (_max) ? (_max) : (_v).p; \ + (_v).q = (_v).q < (_min) ? (_min) : (_v).q > (_max) ? (_max) : (_v).q; \ + (_v).r = (_v).r < (_min) ? (_min) : (_v).r > (_max) ? (_max) : (_v).r; \ } #define RATES_BOUND_BOX(_v, _v_min, _v_max) { \ - if ((_v).p > (_v_max.p)) (_v).p = (_v_max.p); else if ((_v).p < (_v_min.p)) (_v).p = (_v_min.p); \ - if ((_v).q > (_v_max.q)) (_v).q = (_v_max.q); else if ((_v).q < (_v_min.q)) (_v).q = (_v_min.q); \ - if ((_v).r > (_v_max.r)) (_v).r = (_v_max.r); else if ((_v).r < (_v_min.r)) (_v).r = (_v_min.r); \ + if ((_v).p > (_v_max).p) (_v).p = (_v_max).p; else if ((_v).p < (_v_min).p) (_v).p = (_v_min).p; \ + if ((_v).q > (_v_max).q) (_v).q = (_v_max).q; else if ((_v).q < (_v_min).q) (_v).q = (_v_min).q; \ + if ((_v).r > (_v_max).r) (_v).r = (_v_max).r; else if ((_v).r < (_v_min).r) (_v).r = (_v_min).r; \ } @@ -339,7 +339,7 @@ * 3x3 matrices */ /* accessor : row and col range from 0 to 2 */ -#define MAT33_ELMT(_m, _row, _col) ((_m).m[_row*3+_col]) +#define MAT33_ELMT(_m, _row, _col) ((_m).m[(_row)*3+(_col)]) #define MAT33_COPY(_mat1,_mat2) { \ MAT33_ELMT((_mat1),0,0) = MAT33_ELMT((_mat2),0,0); \ @@ -427,26 +427,26 @@ (_qc).qz = (_qa).qz - (_qb).qz; \ } -#define QUAT_COPY(_qo, _qi) { \ +#define QUAT_COPY(_qo, _qi) { \ (_qo).qi = (_qi).qi; \ (_qo).qx = (_qi).qx; \ (_qo).qy = (_qi).qy; \ (_qo).qz = (_qi).qz; \ } -#define QUAT_EXPLEMENTARY(b,a) { \ - b.qi = -a.qi; \ - b.qx = -a.qx; \ - b.qy = -a.qy; \ - b.qz = -a.qz; \ +#define QUAT_EXPLEMENTARY(b,a) { \ + (b).qi = -(a).qi; \ + (b).qx = -(a).qx; \ + (b).qy = -(a).qy; \ + (b).qz = -(a).qz; \ } #define QUAT_SMUL(_qo, _qi, _s) { \ - (_qo).qi = (_qi).qi * _s; \ - (_qo).qx = (_qi).qx * _s; \ - (_qo).qy = (_qi).qy * _s; \ - (_qo).qz = (_qi).qz * _s; \ + (_qo).qi = (_qi).qi * (_s); \ + (_qo).qx = (_qi).qx * (_s); \ + (_qo).qy = (_qi).qy * (_s); \ + (_qo).qz = (_qi).qz * (_s); \ } #define QUAT_ADD(_qo, _qi) { \ @@ -568,27 +568,27 @@ } #define ACCELS_FLOAT_OF_BFP(_ef, _ei) { \ - (_ef).x = ACCEL_FLOAT_OF_BFP((_ei).x); \ - (_ef).y = ACCEL_FLOAT_OF_BFP((_ei).y); \ - (_ef).z = ACCEL_FLOAT_OF_BFP((_ei).z); \ + (_ef).x = ACCEL_FLOAT_OF_BFP((_ei).x); \ + (_ef).y = ACCEL_FLOAT_OF_BFP((_ei).y); \ + (_ef).z = ACCEL_FLOAT_OF_BFP((_ei).z); \ } #define ACCELS_BFP_OF_REAL(_ef, _ei) { \ - (_ef).x = ACCEL_BFP_OF_REAL((_ei).x); \ - (_ef).y = ACCEL_BFP_OF_REAL((_ei).y); \ - (_ef).z = ACCEL_BFP_OF_REAL((_ei).z); \ + (_ef).x = ACCEL_BFP_OF_REAL((_ei).x); \ + (_ef).y = ACCEL_BFP_OF_REAL((_ei).y); \ + (_ef).z = ACCEL_BFP_OF_REAL((_ei).z); \ } #define MAGS_FLOAT_OF_BFP(_ef, _ei) { \ - (_ef).x = MAG_FLOAT_OF_BFP((_ei).x); \ - (_ef).y = MAG_FLOAT_OF_BFP((_ei).y); \ - (_ef).z = MAG_FLOAT_OF_BFP((_ei).z); \ + (_ef).x = MAG_FLOAT_OF_BFP((_ei).x); \ + (_ef).y = MAG_FLOAT_OF_BFP((_ei).y); \ + (_ef).z = MAG_FLOAT_OF_BFP((_ei).z); \ } #define MAGS_BFP_OF_REAL(_ef, _ei) { \ - (_ef).x = MAG_BFP_OF_REAL((_ei).x); \ - (_ef).y = MAG_BFP_OF_REAL((_ei).y); \ - (_ef).z = MAG_BFP_OF_REAL((_ei).z); \ + (_ef).x = MAG_BFP_OF_REAL((_ei).x); \ + (_ef).y = MAG_BFP_OF_REAL((_ei).y); \ + (_ef).z = MAG_BFP_OF_REAL((_ei).z); \ } #endif /* PPRZ_ALGEBRA_H */ diff --git a/sw/airborne/math/pprz_algebra_double.h b/sw/airborne/math/pprz_algebra_double.h index fd70ee2073..d712ae2f5f 100644 --- a/sw/airborne/math/pprz_algebra_double.h +++ b/sw/airborne/math/pprz_algebra_double.h @@ -1,3 +1,32 @@ +/* + * Copyright (C) 2008-2011 The Paparazzi Team + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, see + * . + * + */ + +/** + * @file pprz_algebra_double.h + * @brief Paparazzi double precision floating point algebra. + * + * This is the more detailed description of this file. + * + */ + #ifndef PPRZ_ALGEBRA_DOUBLE_H #define PPRZ_ALGEBRA_DOUBLE_H @@ -15,6 +44,9 @@ struct DoubleVect3 { double z; }; +/** + * @brief Roation quaternion + */ struct DoubleQuat { double qi; double qx; @@ -26,20 +58,29 @@ struct DoubleMat33 { double m[3*3]; }; +/** + * @brief rotation matrix + */ struct DoubleRMat { double m[3*3]; }; +/** + * @brief euler angles + * @details Units: radians */ struct DoubleEulers { - double phi; - double theta; - double psi; + double phi; ///< in radians + double theta; ///< in radians + double psi; ///< in radians }; +/** + * @brief angular rates + * @details Units: rad/s^2 */ struct DoubleRates { - double p; - double q; - double r; + double p; ///< in rad/s^2 + double q; ///< in rad/s^2 + double r; ///< in rad/s^2 }; #define DOUBLE_VECT3_ROUND(_v) DOUBLE_VECT3_RINT(_v, _v) diff --git a/sw/airborne/math/pprz_algebra_float.h b/sw/airborne/math/pprz_algebra_float.h index a534bbbea3..3b2bfb9688 100644 --- a/sw/airborne/math/pprz_algebra_float.h +++ b/sw/airborne/math/pprz_algebra_float.h @@ -1,7 +1,5 @@ /* - * $Id$ - * - * Copyright (C) 2008-2010 The Paparazzi Team + * Copyright (C) 2008-2011 The Paparazzi Team * * This file is part of paparazzi. * @@ -16,9 +14,16 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with paparazzi; see the file COPYING. If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * along with paparazzi; see the file COPYING. If not, see + * . + * + */ + +/** + * @file pprz_algebra_float.h + * @brief Paparazzi floating point algebra. + * + * This is the more detailed description of this file. * */ @@ -46,6 +51,9 @@ struct FloatVect3 { float z; }; +/** + * @brief Roation quaternion + */ struct FloatQuat { float qi; float qx; @@ -57,20 +65,29 @@ struct FloatMat33 { float m[3*3]; }; +/** + * @brief rotation matrix + */ struct FloatRMat { float m[3*3]; }; +/** + * @brief euler angles + * @details Units: radians */ struct FloatEulers { - float phi; - float theta; - float psi; + float phi; ///< in radians + float theta; ///< in radians + float psi; ///< in radians }; +/** + * @brief angular rates + * @details Units: rad/s^2 */ struct FloatRates { - float p; - float q; - float r; + float p; ///< in rad/s^2 + float q; ///< in rad/s^2 + float r; ///< in rad/s^2 }; #define FLOAT_ANGLE_NORMALIZE(_a) { \ diff --git a/sw/airborne/math/pprz_algebra_int.h b/sw/airborne/math/pprz_algebra_int.h index 65c917207d..5570f8ee76 100644 --- a/sw/airborne/math/pprz_algebra_int.h +++ b/sw/airborne/math/pprz_algebra_int.h @@ -1,7 +1,5 @@ /* - * $Id$ - * - * Copyright (C) 2008-2010 The Paparazzi Team + * Copyright (C) 2008-2011 The Paparazzi Team * * This file is part of paparazzi. * @@ -16,9 +14,16 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with paparazzi; see the file COPYING. If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * along with paparazzi; see the file COPYING. If not, see + * . + * + */ + +/** + * @file pprz_algebra_int.h + * @brief Paparazzi fixed point algebra. + * + * This is the more detailed description of this file. * */ @@ -69,6 +74,9 @@ struct Int32Vect3 { /* Rotation quaternions */ #define INT32_QUAT_FRAC 15 +/** + * @brief Roation quaternion + * @details Units: INT32_QUAT_FRAC */ struct Int32Quat { int32_t qi; int32_t qx; @@ -84,17 +92,17 @@ struct Int32Quat { #define INT32_ANGLE_PI (int32_t)ANGLE_BFP_OF_REAL( 3.1415926535897932384626433832795029) #define INT32_ANGLE_2_PI (int32_t)ANGLE_BFP_OF_REAL(2.*3.1415926535897932384626433832795029) -#define INT32_RAD_OF_DEG(_deg) (int32_t)(((int64_t)_deg * 14964008)/857374503) -#define INT32_DEG_OF_RAD(_rad) (int32_t)(((int64_t)_rad * 857374503)/14964008) +#define INT32_RAD_OF_DEG(_deg) (int32_t)(((int64_t)(_deg) * 14964008)/857374503) +#define INT32_DEG_OF_RAD(_rad) (int32_t)(((int64_t)(_rad) * 857374503)/14964008) #define INT32_ANGLE_NORMALIZE(_a) { \ - while (_a > INT32_ANGLE_PI) _a -= INT32_ANGLE_2_PI; \ - while (_a < -INT32_ANGLE_PI) _a += INT32_ANGLE_2_PI; \ + while ((_a) > INT32_ANGLE_PI) (_a) -= INT32_ANGLE_2_PI; \ + while ((_a) < -INT32_ANGLE_PI) (_a) += INT32_ANGLE_2_PI; \ } #define INT32_COURSE_NORMALIZE(_a) { \ - while (_a < 0) _a += INT32_ANGLE_2_PI; \ - while (_a >= INT32_ANGLE_2_PI) _a -= INT32_ANGLE_2_PI; \ + while ((_a) < 0) (_a) += INT32_ANGLE_2_PI; \ + while ((_a) >= INT32_ANGLE_2_PI) (_a) -= INT32_ANGLE_2_PI; \ } @@ -104,15 +112,22 @@ struct Int16Eulers { int16_t psi; }; +/** + * @brief euler angles + * @details Units: rad with INT32_ANGLE_FRAC */ struct Int32Eulers { - int32_t phi; - int32_t theta; - int32_t psi; + int32_t phi; ///< in rad with INT32_ANGLE_FRAC + int32_t theta; ///< in rad with INT32_ANGLE_FRAC + int32_t psi; ///< in rad with INT32_ANGLE_FRAC }; /* Rotation matrix. */ #define INT32_TRIG_FRAC 14 + +/** + * @brief rotation matrix + * @details Units: rad with INT32_TRIG_FRAC */ struct Int32RMat { int32_t m[3*3]; }; @@ -130,10 +145,13 @@ struct Int16Rates { }; /* Rotational speed */ +/** + * @brief angular rates + * @details Units: rad/s^2 with INT32_RATE_FRAC */ struct Int32Rates { - int32_t p; - int32_t q; - int32_t r; + int32_t p; ///< in rad/s^2 with INT32_RATE_FRAC + int32_t q; ///< in rad/s^2 with INT32_RATE_FRAC + int32_t r; ///< in rad/s^2 with INT32_RATE_FRAC }; struct Int64Vect2 { @@ -150,22 +168,22 @@ struct Int64Vect3 { #define BFP_OF_REAL(_vr, _frac) ((_vr)*(1<<(_frac))) #define FLOAT_OF_BFP(_vbfp, _frac) ((float)(_vbfp)/(1<<(_frac))) -#define RATE_BFP_OF_REAL(_af) BFP_OF_REAL(_af, INT32_RATE_FRAC) +#define RATE_BFP_OF_REAL(_af) BFP_OF_REAL((_af), INT32_RATE_FRAC) #define RATE_FLOAT_OF_BFP(_ai) FLOAT_OF_BFP((_ai), INT32_RATE_FRAC) -#define ANGLE_BFP_OF_REAL(_af) BFP_OF_REAL(_af, INT32_ANGLE_FRAC) +#define ANGLE_BFP_OF_REAL(_af) BFP_OF_REAL((_af), INT32_ANGLE_FRAC) #define ANGLE_FLOAT_OF_BFP(_ai) FLOAT_OF_BFP((_ai), INT32_ANGLE_FRAC) -#define QUAT1_BFP_OF_REAL(_qf) BFP_OF_REAL(_qf, INT32_QUAT_FRAC) -#define QUAT1_FLOAT_OF_BFP(_qi) FLOAT_OF_BFP(_qi, INT32_QUAT_FRAC) -#define TRIG_BFP_OF_REAL(_tf) BFP_OF_REAL(_tf, INT32_TRIG_FRAC) -#define TRIG_FLOAT_OF_BFP(_ti) FLOAT_OF_BFP(_ti,INT32_TRIG_FRAC) -#define POS_BFP_OF_REAL(_af) BFP_OF_REAL(_af, INT32_POS_FRAC) +#define QUAT1_BFP_OF_REAL(_qf) BFP_OF_REAL((_qf), INT32_QUAT_FRAC) +#define QUAT1_FLOAT_OF_BFP(_qi) FLOAT_OF_BFP((_qi), INT32_QUAT_FRAC) +#define TRIG_BFP_OF_REAL(_tf) BFP_OF_REAL((_tf), INT32_TRIG_FRAC) +#define TRIG_FLOAT_OF_BFP(_ti) FLOAT_OF_BFP((_ti),INT32_TRIG_FRAC) +#define POS_BFP_OF_REAL(_af) BFP_OF_REAL((_af), INT32_POS_FRAC) #define POS_FLOAT_OF_BFP(_ai) FLOAT_OF_BFP((_ai), INT32_POS_FRAC) -#define SPEED_BFP_OF_REAL(_af) BFP_OF_REAL(_af, INT32_SPEED_FRAC) +#define SPEED_BFP_OF_REAL(_af) BFP_OF_REAL((_af), INT32_SPEED_FRAC) #define SPEED_FLOAT_OF_BFP(_ai) FLOAT_OF_BFP((_ai), INT32_SPEED_FRAC) -#define ACCEL_BFP_OF_REAL(_af) BFP_OF_REAL(_af, INT32_ACCEL_FRAC) +#define ACCEL_BFP_OF_REAL(_af) BFP_OF_REAL((_af), INT32_ACCEL_FRAC) #define ACCEL_FLOAT_OF_BFP(_ai) FLOAT_OF_BFP((_ai), INT32_ACCEL_FRAC) -#define MAG_BFP_OF_REAL(_af) BFP_OF_REAL(_af, INT32_MAG_FRAC) -#define MAG_FLOAT_OF_BFP(_ai) FLOAT_OF_BFP((_ai), INT32_MAG_FRAC) +#define MAG_BFP_OF_REAL(_af) BFP_OF_REAL((_af), INT32_MAG_FRAC) +#define MAG_FLOAT_OF_BFP(_ai) FLOAT_OF_BFP((_ai), INT32_MAG_FRAC) #define INT_MULT_RSHIFT(_a, _b, _r) (((_a)*(_b))>>(_r)) /* @@ -175,7 +193,7 @@ struct Int64Vect3 { #define INT_VECT2_ZERO(_v) VECT2_ASSIGN(_v, 0, 0) #define INT32_VECT2_NORM(n, v) { \ - int32_t n2 = v.x*v.x + v.y*v.y; \ + int32_t n2 = (v).x*(v).x + (v).y*(v).y; \ INT32_SQRT(n, n2); \ } @@ -201,29 +219,13 @@ struct Int64Vect3 { #define INT_VECT3_ZERO(_v) VECT3_ASSIGN(_v, 0, 0, 0) #define INT32_VECT3_ZERO(_v) VECT3_ASSIGN(_v, 0, 0, 0) -#define INT32_VECT3_COPY(_o, _i) { \ - _o.x = _i.x; \ - _o.y = _i.y; \ - _o.z = _i.z; \ - } +#define INT32_VECT3_COPY(_o, _i) VECT3_COPY(_o, _i) -#define INT32_VECT3_SUM(_c, _a, _b) { \ - _c.x = _a.x + _b.x; \ - _c.y = _a.y + _b.y; \ - _c.z = _a.z + _b.z; \ - } +#define INT32_VECT3_SUM(_c, _a, _b) VECT3_SUM(_c, _a, _b) -#define INT32_VECT3_DIFF(_c, _a, _b) { \ - _c.x = _a.x - _b.x; \ - _c.y = _a.y - _b.y; \ - _c.z = _a.z - _b.z; \ - } +#define INT32_VECT3_DIFF(_c, _a, _b) VECT3_DIFF(_c, _a, _b) -#define INT32_VECT3_ADD(_a, _b) { \ - _a.x += _b.x; \ - _a.y += _b.y; \ - _a.z += _b.z; \ - } +#define INT32_VECT3_ADD(_a, _b) VECT3_ADD(_a, _b) #define INT32_VECT3_SCALE_2(_a, _b, _num, _den) { \ (_a).x = ((_b).x * (_num)) / (_den); \ @@ -231,15 +233,11 @@ struct Int64Vect3 { (_a).z = ((_b).z * (_num)) / (_den); \ } -#define INT32_VECT3_SDIV(_a, _b, _s) { \ - (_a).x = (_b).x / (_s); \ - (_a).y = (_b).y / (_s); \ - (_a).z = (_b).z / (_s); \ - } +#define INT32_VECT3_SDIV(_a, _b, _s) VECT3_SDIV(_a, _b, _s) #define INT32_VECT3_NORM(n, v) { \ - int32_t n2 = v.x*v.x + v.y*v.y + v.z*v.z; \ + int32_t n2 = (v).x*(v).x + (v).y*(v).y + (v).z*(v).z; \ INT32_SQRT(n, n2); \ } @@ -262,27 +260,27 @@ struct Int64Vect3 { * 3x3 Matrices */ #define INT32_MAT33_ZERO(_m) { \ - MAT33_ELMT(_m, 0, 0) = 0; \ - MAT33_ELMT(_m, 0, 1) = 0; \ - MAT33_ELMT(_m, 0, 2) = 0; \ - MAT33_ELMT(_m, 1, 0) = 0; \ - MAT33_ELMT(_m, 1, 1) = 0; \ - MAT33_ELMT(_m, 1, 2) = 0; \ - MAT33_ELMT(_m, 2, 0) = 0; \ - MAT33_ELMT(_m, 2, 1) = 0; \ - MAT33_ELMT(_m, 2, 2) = 0; \ + MAT33_ELMT((_m), 0, 0) = 0; \ + MAT33_ELMT((_m), 0, 1) = 0; \ + MAT33_ELMT((_m), 0, 2) = 0; \ + MAT33_ELMT((_m), 1, 0) = 0; \ + MAT33_ELMT((_m), 1, 1) = 0; \ + MAT33_ELMT((_m), 1, 2) = 0; \ + MAT33_ELMT((_m), 2, 0) = 0; \ + MAT33_ELMT((_m), 2, 1) = 0; \ + MAT33_ELMT((_m), 2, 2) = 0; \ } #define INT32_MAT33_DIAG(_m, _d00, _d11, _d22) { \ - MAT33_ELMT(_m, 0, 0) = _d00; \ - MAT33_ELMT(_m, 0, 1) = 0; \ - MAT33_ELMT(_m, 0, 2) = 0; \ - MAT33_ELMT(_m, 1, 0) = 0; \ - MAT33_ELMT(_m, 1, 1) = _d11; \ - MAT33_ELMT(_m, 1, 2) = 0; \ - MAT33_ELMT(_m, 2, 0) = 0; \ - MAT33_ELMT(_m, 2, 1) = 0; \ - MAT33_ELMT(_m, 2, 2) = _d22; \ + MAT33_ELMT((_m), 0, 0) = (_d00); \ + MAT33_ELMT((_m), 0, 1) = 0; \ + MAT33_ELMT((_m), 0, 2) = 0; \ + MAT33_ELMT((_m), 1, 0) = 0; \ + MAT33_ELMT((_m), 1, 1) = (_d11); \ + MAT33_ELMT((_m), 1, 2) = 0; \ + MAT33_ELMT((_m), 2, 0) = 0; \ + MAT33_ELMT((_m), 2, 1) = 0; \ + MAT33_ELMT((_m), 2, 2) = (_d22); \ } @@ -301,28 +299,28 @@ struct Int64Vect3 { /* _m_a2c = _m_a2b comp _m_b2c , aka _m_a2c = _m_b2c * _m_a2b */ #define INT32_RMAT_COMP(_m_a2c, _m_a2b, _m_b2c) { \ - _m_a2c.m[0] = (_m_b2c.m[0]*_m_a2b.m[0] + _m_b2c.m[1]*_m_a2b.m[3] + _m_b2c.m[2]*_m_a2b.m[6])>>INT32_TRIG_FRAC; \ - _m_a2c.m[1] = (_m_b2c.m[0]*_m_a2b.m[1] + _m_b2c.m[1]*_m_a2b.m[4] + _m_b2c.m[2]*_m_a2b.m[7])>>INT32_TRIG_FRAC; \ - _m_a2c.m[2] = (_m_b2c.m[0]*_m_a2b.m[2] + _m_b2c.m[1]*_m_a2b.m[5] + _m_b2c.m[2]*_m_a2b.m[8])>>INT32_TRIG_FRAC; \ - _m_a2c.m[3] = (_m_b2c.m[3]*_m_a2b.m[0] + _m_b2c.m[4]*_m_a2b.m[3] + _m_b2c.m[5]*_m_a2b.m[6])>>INT32_TRIG_FRAC; \ - _m_a2c.m[4] = (_m_b2c.m[3]*_m_a2b.m[1] + _m_b2c.m[4]*_m_a2b.m[4] + _m_b2c.m[5]*_m_a2b.m[7])>>INT32_TRIG_FRAC; \ - _m_a2c.m[5] = (_m_b2c.m[3]*_m_a2b.m[2] + _m_b2c.m[4]*_m_a2b.m[5] + _m_b2c.m[5]*_m_a2b.m[8])>>INT32_TRIG_FRAC; \ - _m_a2c.m[6] = (_m_b2c.m[6]*_m_a2b.m[0] + _m_b2c.m[7]*_m_a2b.m[3] + _m_b2c.m[8]*_m_a2b.m[6])>>INT32_TRIG_FRAC; \ - _m_a2c.m[7] = (_m_b2c.m[6]*_m_a2b.m[1] + _m_b2c.m[7]*_m_a2b.m[4] + _m_b2c.m[8]*_m_a2b.m[7])>>INT32_TRIG_FRAC; \ - _m_a2c.m[8] = (_m_b2c.m[6]*_m_a2b.m[2] + _m_b2c.m[7]*_m_a2b.m[5] + _m_b2c.m[8]*_m_a2b.m[8])>>INT32_TRIG_FRAC; \ + (_m_a2c).m[0] = ((_m_b2c).m[0]*(_m_a2b).m[0] + (_m_b2c).m[1]*(_m_a2b).m[3] + (_m_b2c).m[2]*(_m_a2b).m[6])>>INT32_TRIG_FRAC; \ + (_m_a2c).m[1] = ((_m_b2c).m[0]*(_m_a2b).m[1] + (_m_b2c).m[1]*(_m_a2b).m[4] + (_m_b2c).m[2]*(_m_a2b).m[7])>>INT32_TRIG_FRAC; \ + (_m_a2c).m[2] = ((_m_b2c).m[0]*(_m_a2b).m[2] + (_m_b2c).m[1]*(_m_a2b).m[5] + (_m_b2c).m[2]*(_m_a2b).m[8])>>INT32_TRIG_FRAC; \ + (_m_a2c).m[3] = ((_m_b2c).m[3]*(_m_a2b).m[0] + (_m_b2c).m[4]*(_m_a2b).m[3] + (_m_b2c).m[5]*(_m_a2b).m[6])>>INT32_TRIG_FRAC; \ + (_m_a2c).m[4] = ((_m_b2c).m[3]*(_m_a2b).m[1] + (_m_b2c).m[4]*(_m_a2b).m[4] + (_m_b2c).m[5]*(_m_a2b).m[7])>>INT32_TRIG_FRAC; \ + (_m_a2c).m[5] = ((_m_b2c).m[3]*(_m_a2b).m[2] + (_m_b2c).m[4]*(_m_a2b).m[5] + (_m_b2c).m[5]*(_m_a2b).m[8])>>INT32_TRIG_FRAC; \ + (_m_a2c).m[6] = ((_m_b2c).m[6]*(_m_a2b).m[0] + (_m_b2c).m[7]*(_m_a2b).m[3] + (_m_b2c).m[8]*(_m_a2b).m[6])>>INT32_TRIG_FRAC; \ + (_m_a2c).m[7] = ((_m_b2c).m[6]*(_m_a2b).m[1] + (_m_b2c).m[7]*(_m_a2b).m[4] + (_m_b2c).m[8]*(_m_a2b).m[7])>>INT32_TRIG_FRAC; \ + (_m_a2c).m[8] = ((_m_b2c).m[6]*(_m_a2b).m[2] + (_m_b2c).m[7]*(_m_a2b).m[5] + (_m_b2c).m[8]*(_m_a2b).m[8])>>INT32_TRIG_FRAC; \ } /* _m_a2b = _m_a2c comp_inv _m_b2c , aka _m_a2b = inv(_m_b2c) * _m_a2c */ #define INT32_RMAT_COMP_INV(_m_a2b, _m_a2c, _m_b2c) { \ - _m_a2b.m[0] = (_m_b2c.m[0]*_m_a2c.m[0] + _m_b2c.m[3]*_m_a2c.m[3] + _m_b2c.m[6]*_m_a2c.m[6])>>INT32_TRIG_FRAC; \ - _m_a2b.m[1] = (_m_b2c.m[0]*_m_a2c.m[1] + _m_b2c.m[3]*_m_a2c.m[4] + _m_b2c.m[6]*_m_a2c.m[7])>>INT32_TRIG_FRAC; \ - _m_a2b.m[2] = (_m_b2c.m[0]*_m_a2c.m[2] + _m_b2c.m[3]*_m_a2c.m[5] + _m_b2c.m[6]*_m_a2c.m[8])>>INT32_TRIG_FRAC; \ - _m_a2b.m[3] = (_m_b2c.m[1]*_m_a2c.m[0] + _m_b2c.m[4]*_m_a2c.m[3] + _m_b2c.m[7]*_m_a2c.m[6])>>INT32_TRIG_FRAC; \ - _m_a2b.m[4] = (_m_b2c.m[1]*_m_a2c.m[1] + _m_b2c.m[4]*_m_a2c.m[4] + _m_b2c.m[7]*_m_a2c.m[7])>>INT32_TRIG_FRAC; \ - _m_a2b.m[5] = (_m_b2c.m[1]*_m_a2c.m[2] + _m_b2c.m[4]*_m_a2c.m[5] + _m_b2c.m[7]*_m_a2c.m[8])>>INT32_TRIG_FRAC; \ - _m_a2b.m[6] = (_m_b2c.m[2]*_m_a2c.m[0] + _m_b2c.m[5]*_m_a2c.m[3] + _m_b2c.m[8]*_m_a2c.m[6])>>INT32_TRIG_FRAC; \ - _m_a2b.m[7] = (_m_b2c.m[2]*_m_a2c.m[1] + _m_b2c.m[5]*_m_a2c.m[4] + _m_b2c.m[8]*_m_a2c.m[7])>>INT32_TRIG_FRAC; \ - _m_a2b.m[8] = (_m_b2c.m[2]*_m_a2c.m[2] + _m_b2c.m[5]*_m_a2c.m[5] + _m_b2c.m[8]*_m_a2c.m[8])>>INT32_TRIG_FRAC; \ + (_m_a2b).m[0] = ((_m_b2c).m[0]*(_m_a2c).m[0] + (_m_b2c).m[3]*(_m_a2c).m[3] + (_m_b2c).m[6]*(_m_a2c).m[6])>>INT32_TRIG_FRAC; \ + (_m_a2b).m[1] = ((_m_b2c).m[0]*(_m_a2c).m[1] + (_m_b2c).m[3]*(_m_a2c).m[4] + (_m_b2c).m[6]*(_m_a2c).m[7])>>INT32_TRIG_FRAC; \ + (_m_a2b).m[2] = ((_m_b2c).m[0]*(_m_a2c).m[2] + (_m_b2c).m[3]*(_m_a2c).m[5] + (_m_b2c).m[6]*(_m_a2c).m[8])>>INT32_TRIG_FRAC; \ + (_m_a2b).m[3] = ((_m_b2c).m[1]*(_m_a2c).m[0] + (_m_b2c).m[4]*(_m_a2c).m[3] + (_m_b2c).m[7]*(_m_a2c).m[6])>>INT32_TRIG_FRAC; \ + (_m_a2b).m[4] = ((_m_b2c).m[1]*(_m_a2c).m[1] + (_m_b2c).m[4]*(_m_a2c).m[4] + (_m_b2c).m[7]*(_m_a2c).m[7])>>INT32_TRIG_FRAC; \ + (_m_a2b).m[5] = ((_m_b2c).m[1]*(_m_a2c).m[2] + (_m_b2c).m[4]*(_m_a2c).m[5] + (_m_b2c).m[7]*(_m_a2c).m[8])>>INT32_TRIG_FRAC; \ + (_m_a2b).m[6] = ((_m_b2c).m[2]*(_m_a2c).m[0] + (_m_b2c).m[5]*(_m_a2c).m[3] + (_m_b2c).m[8]*(_m_a2c).m[6])>>INT32_TRIG_FRAC; \ + (_m_a2b).m[7] = ((_m_b2c).m[2]*(_m_a2c).m[1] + (_m_b2c).m[5]*(_m_a2c).m[4] + (_m_b2c).m[8]*(_m_a2c).m[7])>>INT32_TRIG_FRAC; \ + (_m_a2b).m[8] = ((_m_b2c).m[2]*(_m_a2c).m[2] + (_m_b2c).m[5]*(_m_a2c).m[5] + (_m_b2c).m[8]*(_m_a2c).m[8])>>INT32_TRIG_FRAC; \ } /* _vb = _m_a2b * _va */ @@ -363,47 +361,47 @@ struct Int64Vect3 { const int32_t one = TRIG_BFP_OF_REAL( 1); \ const int32_t two = TRIG_BFP_OF_REAL( 2); \ /* dcm00 = 1.0 - 2.*( qy2 + qz2 ); */ \ - _rm.m[0] = one - INT_MULT_RSHIFT( two, (qy2+qz2), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ + (_rm).m[0] = one - INT_MULT_RSHIFT( two, (qy2+qz2), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm01 = 2.*( qxqy + qiqz ); */ \ - _rm.m[1] = INT_MULT_RSHIFT( two, (qxqy+qiqz), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ + (_rm).m[1] = INT_MULT_RSHIFT( two, (qxqy+qiqz), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm02 = 2.*( qxqz - qiqy ); */ \ - _rm.m[2] = INT_MULT_RSHIFT( two, (qxqz-qiqy), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ + (_rm).m[2] = INT_MULT_RSHIFT( two, (qxqz-qiqy), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm10 = 2.*( qxqy - qiqz ); */ \ - _rm.m[3] = INT_MULT_RSHIFT( two, (qxqy-qiqz), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ + (_rm).m[3] = INT_MULT_RSHIFT( two, (qxqy-qiqz), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm11 = 1.0 - 2.*(qx2+qz2); */ \ - _rm.m[4] = one - INT_MULT_RSHIFT( two, (qx2+qz2), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ + (_rm).m[4] = one - INT_MULT_RSHIFT( two, (qx2+qz2), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm12 = 2.*( qyqz + qiqx ); */ \ - _rm.m[5] = INT_MULT_RSHIFT( two, (qyqz+qiqx), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ + (_rm).m[5] = INT_MULT_RSHIFT( two, (qyqz+qiqx), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm20 = 2.*( qxqz + qiqy ); */ \ - _rm.m[6] = INT_MULT_RSHIFT( two, (qxqz+qiqy), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ + (_rm).m[6] = INT_MULT_RSHIFT( two, (qxqz+qiqy), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm21 = 2.*( qyqz - qiqx ); */ \ - _rm.m[7] = INT_MULT_RSHIFT( two, (qyqz-qiqx), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ + (_rm).m[7] = INT_MULT_RSHIFT( two, (qyqz-qiqx), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ /* dcm22 = 1.0 - 2.*( qx2 + qy2 ); */ \ - _rm.m[8] = one - INT_MULT_RSHIFT( two, (qx2+qy2), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ + (_rm).m[8] = one - INT_MULT_RSHIFT( two, (qx2+qy2), INT32_TRIG_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC); \ } #else #define INT32_RMAT_OF_QUAT(_rm, _q) { \ const int32_t _2qi2_m1 = INT_MULT_RSHIFT((_q).qi,(_q).qi, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1)-TRIG_BFP_OF_REAL( 1); \ - _rm.m[0] = INT_MULT_RSHIFT((_q).qx,(_q).qx, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ - _rm.m[4] = INT_MULT_RSHIFT((_q).qy,(_q).qy, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ - _rm.m[8] = INT_MULT_RSHIFT((_q).qz,(_q).qz, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ + (_rm).m[0] = INT_MULT_RSHIFT((_q).qx,(_q).qx, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ + (_rm).m[4] = INT_MULT_RSHIFT((_q).qy,(_q).qy, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ + (_rm).m[8] = INT_MULT_RSHIFT((_q).qz,(_q).qz, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ \ const int32_t _2qiqx = INT_MULT_RSHIFT((_q).qi,(_q).qx, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ const int32_t _2qiqy = INT_MULT_RSHIFT((_q).qi,(_q).qy, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ const int32_t _2qiqz = INT_MULT_RSHIFT((_q).qi,(_q).qz, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ - _rm.m[1] = INT_MULT_RSHIFT((_q).qx,(_q).qy, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ - _rm.m[2] = INT_MULT_RSHIFT((_q).qx,(_q).qz, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ - _rm.m[5] = INT_MULT_RSHIFT((_q).qy,(_q).qz, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ + (_rm).m[1] = INT_MULT_RSHIFT((_q).qx,(_q).qy, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ + (_rm).m[2] = INT_MULT_RSHIFT((_q).qx,(_q).qz, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ + (_rm).m[5] = INT_MULT_RSHIFT((_q).qy,(_q).qz, INT32_QUAT_FRAC+INT32_QUAT_FRAC-INT32_TRIG_FRAC-1); \ \ - _rm.m[0] += _2qi2_m1; \ - _rm.m[3] = _rm.m[1]-_2qiqz; \ - _rm.m[6] = _rm.m[2]+_2qiqy; \ - _rm.m[7] = _rm.m[5]-_2qiqx; \ - _rm.m[4] += _2qi2_m1; \ - _rm.m[1] += _2qiqz; \ - _rm.m[2] -= _2qiqy; \ - _rm.m[5] += _2qiqx; \ - _rm.m[8] += _2qi2_m1; \ + (_rm).m[0] += _2qi2_m1; \ + (_rm).m[3] = (_rm).m[1]-_2qiqz; \ + (_rm).m[6] = (_rm).m[2]+_2qiqy; \ + (_rm).m[7] = (_rm).m[5]-_2qiqx; \ + (_rm).m[4] += _2qi2_m1; \ + (_rm).m[1] += _2qiqz; \ + (_rm).m[2] -= _2qiqy; \ + (_rm).m[5] += _2qiqx; \ + (_rm).m[8] += _2qi2_m1; \ } #endif @@ -508,36 +506,31 @@ struct Int64Vect3 { */ #define INT32_QUAT_ZERO(_q) { \ - _q.qi = QUAT1_BFP_OF_REAL(1); \ - _q.qx = 0; \ - _q.qy = 0; \ - _q.qz = 0; \ + (_q).qi = QUAT1_BFP_OF_REAL(1); \ + (_q).qx = 0; \ + (_q).qy = 0; \ + (_q).qz = 0; \ } -#define INT32_QUAT_INVERT(_qo, _qi) { \ - (_qo).qi = (_qi).qi; \ - (_qo).qx = -(_qi).qx; \ - (_qo).qy = -(_qi).qy; \ - (_qo).qz = -(_qi).qz; \ - } +#define INT32_QUAT_INVERT(_qo, _qi) QUAT_INVERT(_qo, _qi) #define INT32_QUAT_NORM(n, q) { \ - int32_t n2 = q.qi*q.qi + q.qx*q.qx + q.qy*q.qy + q.qz*q.qz; \ + int32_t n2 = (q).qi*(q).qi + (q).qx*(q).qx + (q).qy*(q).qy + (q).qz*(q).qz; \ INT32_SQRT(n, n2); \ } #define INT32_QUAT_WRAP_SHORTEST(q) { \ - if (q.qi < 0) \ + if ((q).qi < 0) \ QUAT_EXPLEMENTARY(q,q); \ } #define INT32_QUAT_NORMALISE(q) { \ int32_t n; \ INT32_QUAT_NORM(n, q); \ - q.qi = q.qi * QUAT1_BFP_OF_REAL(1) / n; \ - q.qx = q.qx * QUAT1_BFP_OF_REAL(1) / n; \ - q.qy = q.qy * QUAT1_BFP_OF_REAL(1) / n; \ - q.qz = q.qz * QUAT1_BFP_OF_REAL(1) / n; \ + (q).qi = (q).qi * QUAT1_BFP_OF_REAL(1) / n; \ + (q).qx = (q).qx * QUAT1_BFP_OF_REAL(1) / n; \ + (q).qy = (q).qy * QUAT1_BFP_OF_REAL(1) / n; \ + (q).qz = (q).qz * QUAT1_BFP_OF_REAL(1) / n; \ } /* _a2c = _a2b comp _b2c , aka _a2c = _b2c * _a2b */ @@ -566,16 +559,16 @@ struct Int64Vect3 { #ifdef ALGEBRA_INT_USE_SLOW_FUNCTIONS #define INT32_QUAT_VMULT(v_out, q, v_in) { \ - const int32_t qi2 = (q.qi*q.qi)>>INT32_QUAT_FRAC; \ - const int32_t qx2 = (q.qx*q.qx)>>INT32_QUAT_FRAC; \ - const int32_t qy2 = (q.qy*q.qy)>>INT32_QUAT_FRAC; \ - const int32_t qz2 = (q.qz*q.qz)>>INT32_QUAT_FRAC; \ - const int32_t qiqx = (q.qi*q.qx)>>INT32_QUAT_FRAC; \ - const int32_t qiqy = (q.qi*q.qy)>>INT32_QUAT_FRAC; \ - const int32_t qiqz = (q.qi*q.qz)>>INT32_QUAT_FRAC; \ - const int32_t qxqy = (q.qx*q.qy)>>INT32_QUAT_FRAC; \ - const int32_t qxqz = (q.qx*q.qz)>>INT32_QUAT_FRAC; \ - const int32_t qyqz = (q.qy*q.qz)>>INT32_QUAT_FRAC; \ + const int32_t qi2 = ((q).qi*(q).qi)>>INT32_QUAT_FRAC; \ + const int32_t qx2 = ((q).qx*(q).qx)>>INT32_QUAT_FRAC; \ + const int32_t qy2 = ((q).qy*(q).qy)>>INT32_QUAT_FRAC; \ + const int32_t qz2 = ((q).qz*(q).qz)>>INT32_QUAT_FRAC; \ + const int32_t qiqx = ((q).qi*(q).qx)>>INT32_QUAT_FRAC; \ + const int32_t qiqy = ((q).qi*(q).qy)>>INT32_QUAT_FRAC; \ + const int32_t qiqz = ((q).qi*(q).qz)>>INT32_QUAT_FRAC; \ + const int32_t qxqy = ((q).qx*(q).qy)>>INT32_QUAT_FRAC; \ + const int32_t qxqz = ((q).qx*(q).qz)>>INT32_QUAT_FRAC; \ + const int32_t qyqz = ((q).qy*(q).qz)>>INT32_QUAT_FRAC; \ const int32_t m00 = qi2 + qx2 - qy2 - qz2; \ const int32_t m01 = 2 * (qxqy + qiqz ); \ const int32_t m02 = 2 * (qxqz - qiqy ); \ @@ -585,25 +578,25 @@ struct Int64Vect3 { const int32_t m20 = 2 * (qxqz + qiqy ); \ const int32_t m21 = 2 * (qyqz - qiqx ); \ const int32_t m22 = qi2 - qx2 - qy2 + qz2; \ - v_out.x = (m00 * v_in.x + m01 * v_in.y + m02 * v_in.z)>>INT32_QUAT_FRAC; \ - v_out.y = (m10 * v_in.x + m11 * v_in.y + m12 * v_in.z)>>INT32_QUAT_FRAC; \ - v_out.z = (m20 * v_in.x + m21 * v_in.y + m22 * v_in.z)>>INT32_QUAT_FRAC; \ + (v_out).x = (m00 * (v_in).x + m01 * (v_in).y + m02 * (v_in).z)>>INT32_QUAT_FRAC; \ + (v_out).y = (m10 * (v_in).x + m11 * (v_in).y + m12 * (v_in).z)>>INT32_QUAT_FRAC; \ + (v_out).z = (m20 * (v_in).x + m21 * (v_in).y + m22 * (v_in).z)>>INT32_QUAT_FRAC; \ } #else #define INT32_QUAT_VMULT(v_out, q, v_in) { \ - const int32_t _2qi2_m1 = ((q.qi*q.qi)>>(INT32_QUAT_FRAC-1)) - QUAT1_BFP_OF_REAL( 1); \ - const int32_t _2qx2 = (q.qx*q.qx)>>(INT32_QUAT_FRAC-1); \ - const int32_t _2qy2 = (q.qy*q.qy)>>(INT32_QUAT_FRAC-1); \ - const int32_t _2qz2 = (q.qz*q.qz)>>(INT32_QUAT_FRAC-1); \ - const int32_t _2qiqx = (q.qi*q.qx)>>(INT32_QUAT_FRAC-1); \ - const int32_t _2qiqy = (q.qi*q.qy)>>(INT32_QUAT_FRAC-1); \ - const int32_t _2qiqz = (q.qi*q.qz)>>(INT32_QUAT_FRAC-1); \ - const int32_t m01 = ((q.qx*q.qy)>>(INT32_QUAT_FRAC-1)) + _2qiqz; \ - const int32_t m02 = ((q.qx*q.qz)>>(INT32_QUAT_FRAC-1)) - _2qiqy; \ - const int32_t m12 = ((q.qy*q.qz)>>(INT32_QUAT_FRAC-1)) + _2qiqx; \ - v_out.x = (_2qi2_m1*v_in.x + _2qx2 * v_in.x + m01 * v_in.y + m02 * v_in.z)>>INT32_QUAT_FRAC; \ - v_out.y = (_2qi2_m1*v_in.y + m01 * v_in.x -2*_2qiqz*v_in.x+ _2qy2 * v_in.y + m12 * v_in.z)>>INT32_QUAT_FRAC; \ - v_out.z = (_2qi2_m1*v_in.z + m02 * v_in.x +2*_2qiqy*v_in.x+ m12 * v_in.y -2*_2qiqx*v_in.y+ _2qz2 * v_in.z)>>INT32_QUAT_FRAC; \ + const int32_t _2qi2_m1 = (((q).qi*(q).qi)>>(INT32_QUAT_FRAC-1)) - QUAT1_BFP_OF_REAL( 1); \ + const int32_t _2qx2 = ((q).qx*(q).qx)>>(INT32_QUAT_FRAC-1); \ + const int32_t _2qy2 = ((q).qy*(q).qy)>>(INT32_QUAT_FRAC-1); \ + const int32_t _2qz2 = ((q).qz*(q).qz)>>(INT32_QUAT_FRAC-1); \ + const int32_t _2qiqx = ((q).qi*(q).qx)>>(INT32_QUAT_FRAC-1); \ + const int32_t _2qiqy = ((q).qi*(q).qy)>>(INT32_QUAT_FRAC-1); \ + const int32_t _2qiqz = ((q).qi*(q).qz)>>(INT32_QUAT_FRAC-1); \ + const int32_t m01 = (((q).qx*(q).qy)>>(INT32_QUAT_FRAC-1)) + _2qiqz; \ + const int32_t m02 = (((q).qx*(q).qz)>>(INT32_QUAT_FRAC-1)) - _2qiqy; \ + const int32_t m12 = (((q).qy*(q).qz)>>(INT32_QUAT_FRAC-1)) + _2qiqx; \ + (v_out).x = (_2qi2_m1*(v_in).x + _2qx2 * (v_in).x + m01 * (v_in).y + m02 * (v_in).z)>>INT32_QUAT_FRAC; \ + (v_out).y = (_2qi2_m1*(v_in).y + m01 * (v_in).x -2*_2qiqz*(v_in).x + _2qy2 * (v_in).y + m12 * (v_in).z)>>INT32_QUAT_FRAC; \ + (v_out).z = (_2qi2_m1*(v_in).z + m02 * (v_in).x +2*_2qiqy*(v_in).x+ m12 * (v_in).y -2*_2qiqx*(v_in).y+ _2qz2 * (v_in).z)>>INT32_QUAT_FRAC; \ } #endif @@ -653,14 +646,14 @@ struct Int64Vect3 { int32_t two_qi; \ INT32_SQRT(two_qi, (two_qi_two< 1) && (iter < INT32_SQRT_MAX_ITER)); \ - _out = s2; \ + (_out) = s2; \ } \ } @@ -884,16 +877,16 @@ struct Int64Vect3 { const int32_t c2 = 3 * INT32_ANGLE_PI_4; \ const int32_t abs_y = abs(_y) + 1; \ int32_t r; \ - if ( _x >= 0) { \ - r = ((_x-abs_y)<>R_FRAC); \ + if ( (_x) >= 0) { \ + r = (((_x)-abs_y)<>R_FRAC); \ } \ else { \ - r = ((_x+abs_y)<>R_FRAC); \ + r = (((_x)+abs_y)<>R_FRAC); \ } \ - if (_y<0) \ - _a = -_a; \ + if ((_y)<0) \ + (_a) = -(_a); \ } @@ -902,18 +895,18 @@ struct Int64Vect3 { const int32_t c2 = 3 * INT32_ANGLE_PI_4; \ const int32_t abs_y = abs(_y) + 1; \ int32_t r; \ - if ( _x >= 0) { \ - r = ((_x-abs_y)<= 0) { \ + r = (((_x)-abs_y)<>R_FRAC; \ int32_t tmp1 = ((r2 * (int32_t)ANGLE_BFP_OF_REAL(0.1963))>>INT32_ANGLE_FRAC) - ANGLE_BFP_OF_REAL(0.9817); \ - _a = ((tmp1 * r)>>R_FRAC) + c1; \ + (_a) = ((tmp1 * r)>>R_FRAC) + c1; \ } \ else { \ - r = ((_x+abs_y)<>R_FRAC); \ + r = (((_x)+abs_y)<>R_FRAC); \ } \ - if (_y<0) \ - _a = -_a; \ + if ((_y)<0) \ + (_a) = -(_a); \ } diff --git a/sw/airborne/math/pprz_geodetic_double.h b/sw/airborne/math/pprz_geodetic_double.h index df9d840705..2bed3451c2 100644 --- a/sw/airborne/math/pprz_geodetic_double.h +++ b/sw/airborne/math/pprz_geodetic_double.h @@ -1,71 +1,90 @@ +/* + * Copyright (C) 2008-2011 The Paparazzi Team + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, see + * . + * + */ + +/** + * @file pprz_geodetic_double.h + * @brief Paparazzi double-precision floating point math for geodetic calculations. + * + * This is the more detailed description of this file. + * + */ + #ifndef PPRZ_GEODETIC_DOUBLE_H #define PPRZ_GEODETIC_DOUBLE_H -#include - #include "pprz_geodetic.h" #include "pprz_algebra_double.h" -/* - * Definitions for coordinate systems - * - */ - -/* Earth Centered Earth Fixed - * x, y, z in meters - */ +/** + * @brief vector in EarthCenteredEarthFixed coordinates + * @details Origin at center of mass of the Earth. Z-axis is pointing north, + * the x-axis intersects the sphere of the earth at 0° latitude (Equator) + * and 0° longitude (Greenwich). Y-axis completes it to right-hand system. + * Units: meters */ struct EcefCoor_d { - double x; - double y; - double z; + double x; ///< in meters + double y; ///< in meters + double z; ///< in meters }; -/* Lon Lat Alt - * lon, lat in radians, alt in meters +/** + * @brief vector in Latitude, Longitude and Altitude + * @details Units lat,lon: radians + * Unit alt: meters above MSL */ struct LlaCoor_d { - double lon; - double lat; - double alt; + double lon; ///< in radians + double lat; ///< in radians + double alt; ///< in meters above MSL }; -/* North East Down local tangeant plane - * x, y, z in meters - */ +/** + * @brief vector in North East Down coordinates + * Units: meters */ struct NedCoor_d { - double x; - double y; - double z; + double x; ///< in meters + double y; ///< in meters + double z; ///< in meters }; -/* East North Up local tangeant plane - * x, y, z in meters - */ +/** + * @brief vector in East North Up coordinates + * Units: meters */ struct EnuCoor_d { - double x; - double y; - double z; + double x; ///< in meters + double y; ///< in meters + double z; ///< in meters }; -/* Local tangeant plane reference */ +/** + * @brief definition of the local (flat earth) coordinate system + * @details Defines the origin of the local coordinate system + * in ECEF and LLA coordinates and the roation matrix from + * ECEF to local frame */ struct LtpDef_d { - struct EcefCoor_d ecef; - struct LlaCoor_d lla; - struct DoubleMat33 ltp_of_ecef; + struct EcefCoor_d ecef; ///< origin of local frame in ECEF + struct LlaCoor_d lla; ///< origin of local frame in LLA + struct DoubleMat33 ltp_of_ecef; ///< rotation from ECEF to local frame }; -/* UTM projection -*/ -struct UTMCoor_d { - double east; - double north; - uint8_t zone; -}; - - -/* - * Convertions between coordinate systems - */ extern void ltp_def_from_ecef_d(struct LtpDef_d* def, struct EcefCoor_d* ecef); extern void lla_of_ecef_d(struct LlaCoor_d* out, struct EcefCoor_d* in); extern void ecef_of_lla_d(struct EcefCoor_d* out, struct LlaCoor_d* in); @@ -84,7 +103,5 @@ extern void ecef_of_ned_vect_d(struct EcefCoor_d* ecef, struct LtpDef_d* def, st extern double gc_of_gd_lat_d(double gd_lat, double hmsl); -extern void lla_of_utm(struct LlaCoor_d* out, struct UTMCoor_d* in); - #endif /* PPRZ_GEODETIC_DOUBLE_H */ diff --git a/sw/airborne/math/pprz_geodetic_float.c b/sw/airborne/math/pprz_geodetic_float.c index 6fef1d0411..9d5f4fdb5e 100644 --- a/sw/airborne/math/pprz_geodetic_float.c +++ b/sw/airborne/math/pprz_geodetic_float.c @@ -3,6 +3,9 @@ #include "pprz_algebra_float.h" #include +/* for ecef_of_XX functions the double versions are needed */ +#include "pprz_geodetic_double.h" + void ltp_def_from_ecef_f(struct LtpDef_f* def, struct EcefCoor_f* ecef) { /* store the origin of the tangeant plane */ @@ -16,7 +19,7 @@ void ltp_def_from_ecef_f(struct LtpDef_f* def, struct EcefCoor_f* ecef) { const float cos_lon = cosf(def->lla.lon); def->ltp_of_ecef.m[0] = -sin_lon; def->ltp_of_ecef.m[1] = cos_lon; - def->ltp_of_ecef.m[2] = 0.; + def->ltp_of_ecef.m[2] = 0.; /* this element is always zero http://en.wikipedia.org/wiki/Geodetic_system#From_ECEF_to_ENU */ def->ltp_of_ecef.m[3] = -sin_lat*cos_lon; def->ltp_of_ecef.m[4] = -sin_lat*sin_lon; def->ltp_of_ecef.m[5] = cos_lat; @@ -26,14 +29,28 @@ void ltp_def_from_ecef_f(struct LtpDef_f* def, struct EcefCoor_f* ecef) { } -#if 0 -void init_ltp_ref_from_lla_f(struct LtpRef_f* def, struct LlaCoor_f* ref_pos) { - def->lla.lon = ref_pos->lon; - def->lla.lat = ref_pos->lat; - /* compute ecef */ +void ltp_def_from_lla_f(struct LtpDef_f* def, struct LlaCoor_f* lla) { + /* store the origin of the tangeant plane */ + LLA_COPY(def->lla, *lla); + /* compute the ecef representation of the origin */ + ecef_of_lla_f(&def->ecef, &def->lla); + /* store the rotation matrix */ + const float sin_lat = sinf(def->lla.lat); + const float cos_lat = cosf(def->lla.lat); + const float sin_lon = sinf(def->lla.lon); + const float cos_lon = cosf(def->lla.lon); + + def->ltp_of_ecef.m[0] = -sin_lon; + def->ltp_of_ecef.m[1] = cos_lon; + def->ltp_of_ecef.m[2] = 0.; /* this element is always zero http://en.wikipedia.org/wiki/Geodetic_system#From_ECEF_to_ENU */ + def->ltp_of_ecef.m[3] = -sin_lat*cos_lon; + def->ltp_of_ecef.m[4] = -sin_lat*sin_lon; + def->ltp_of_ecef.m[5] = cos_lat; + def->ltp_of_ecef.m[6] = cos_lat*cos_lon; + def->ltp_of_ecef.m[7] = cos_lat*sin_lon; + def->ltp_of_ecef.m[8] = sin_lat; } -#endif void enu_of_ecef_point_f(struct EnuCoor_f* enu, struct LtpDef_f* def, struct EcefCoor_f* ecef) { struct EcefCoor_f delta; @@ -58,21 +75,79 @@ void ned_of_ecef_vect_f(struct NedCoor_f* ned, struct LtpDef_f* def, struct Ecef ENU_OF_TO_NED(*ned, enu); } -/* not enought precision with float - use double */ -# if 0 +void enu_of_lla_point_f(struct EnuCoor_f* enu, struct LtpDef_f* def, struct LlaCoor_f* lla) { + struct EcefCoor_f ecef; + ecef_of_lla_f(&ecef,lla); + enu_of_ecef_point_f(enu,def,&ecef); +} + +void ned_of_lla_point_f(struct NedCoor_f* ned, struct LtpDef_f* def, struct LlaCoor_f* lla) { + struct EcefCoor_f ecef; + ecef_of_lla_f(&ecef,lla); + ned_of_ecef_point_f(ned,def,&ecef); +} + +/* + * not enought precision with float - use double + */ void ecef_of_enu_point_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct EnuCoor_f* enu) { - MAT33_VECT3_TRANSP_MUL(*ecef, def->ltp_of_ecef.m, *enu); - VECT3_ADD(*ecef, def->ecef); + /* convert used floats to double */ + struct DoubleMat33 ltp_of_ecef_d; + ltp_of_ecef_d.m[0] = (double) def->ltp_of_ecef.m[0]; + ltp_of_ecef_d.m[1] = (double) def->ltp_of_ecef.m[1]; + ltp_of_ecef_d.m[2] = (double) def->ltp_of_ecef.m[2]; + ltp_of_ecef_d.m[3] = (double) def->ltp_of_ecef.m[3]; + ltp_of_ecef_d.m[4] = (double) def->ltp_of_ecef.m[4]; + ltp_of_ecef_d.m[5] = (double) def->ltp_of_ecef.m[5]; + ltp_of_ecef_d.m[6] = (double) def->ltp_of_ecef.m[6]; + ltp_of_ecef_d.m[7] = (double) def->ltp_of_ecef.m[7]; + ltp_of_ecef_d.m[8] = (double) def->ltp_of_ecef.m[8]; + struct EnuCoor_f enu_d; + enu_d.x = (double) enu->x; + enu_d.y = (double) enu->y; + enu_d.z = (double) enu->z; + + /* compute in double */ + struct EcefCoor_d ecef_d; + MAT33_VECT3_TRANSP_MUL(ecef_d, ltp_of_ecef_d, enu_d); + + /* convert result back to float and add it*/ + ecef->x = (float) ecef_d.x + def->ecef.x; + ecef->y = (float) ecef_d.y + def->ecef.y; + ecef->z = (float) ecef_d.z + def->ecef.z; } void ecef_of_ned_point_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct NedCoor_f* ned) { struct EnuCoor_f enu; ENU_OF_TO_NED(enu, *ned); - ecef_of_enu_pos_f(ecef, def, &enu); + ecef_of_enu_point_f(ecef, def, &enu); } void ecef_of_enu_vect_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct EnuCoor_f* enu) { - MAT33_VECT3_TRANSP_MUL(*ecef, def->ltp_of_ecef.m, *enu); + /* convert used floats to double */ + struct DoubleMat33 ltp_of_ecef_d; + ltp_of_ecef_d.m[0] = (double) def->ltp_of_ecef.m[0]; + ltp_of_ecef_d.m[1] = (double) def->ltp_of_ecef.m[1]; + ltp_of_ecef_d.m[2] = (double) def->ltp_of_ecef.m[2]; + ltp_of_ecef_d.m[3] = (double) def->ltp_of_ecef.m[3]; + ltp_of_ecef_d.m[4] = (double) def->ltp_of_ecef.m[4]; + ltp_of_ecef_d.m[5] = (double) def->ltp_of_ecef.m[5]; + ltp_of_ecef_d.m[6] = (double) def->ltp_of_ecef.m[6]; + ltp_of_ecef_d.m[7] = (double) def->ltp_of_ecef.m[7]; + ltp_of_ecef_d.m[8] = (double) def->ltp_of_ecef.m[8]; + struct EnuCoor_f enu_d; + enu_d.x = (double) enu->x; + enu_d.y = (double) enu->y; + enu_d.z = (double) enu->z; + + /* compute in double */ + struct EcefCoor_d ecef_d; + MAT33_VECT3_TRANSP_MUL(ecef_d, ltp_of_ecef_d, enu_d); + + /* convert result back to float*/ + ecef->x = (float) ecef_d.x; + ecef->y = (float) ecef_d.y; + ecef->z = (float) ecef_d.z; } void ecef_of_ned_vect_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct NedCoor_f* ned) { @@ -80,7 +155,7 @@ void ecef_of_ned_vect_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct Ne ENU_OF_TO_NED(enu, *ned); ecef_of_enu_vect_f(ecef, def, &enu); } -#endif +/* end use double versions */ diff --git a/sw/airborne/math/pprz_geodetic_float.h b/sw/airborne/math/pprz_geodetic_float.h index 4eef0066ee..47d3fdfd2c 100644 --- a/sw/airborne/math/pprz_geodetic_float.h +++ b/sw/airborne/math/pprz_geodetic_float.h @@ -1,61 +1,107 @@ +/* + * Copyright (C) 2008-2011 The Paparazzi Team + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, see + * . + * + */ + +/** + * @file pprz_geodetic_float.h + * @brief Paparazzi floating point math for geodetic calculations. + * + * This is the more detailed description of this file. + * + */ + #ifndef PPRZ_GEODETIC_FLOAT_H #define PPRZ_GEODETIC_FLOAT_H #include "pprz_geodetic.h" #include "pprz_algebra_float.h" -/* Earth Centered Earth Fixed in meters */ +/** + * @brief vector in EarthCenteredEarthFixed coordinates + * @details Origin at center of mass of the Earth. Z-axis is pointing north, + * the x-axis intersects the sphere of the earth at 0° latitude (Equator) + * and 0° longitude (Greenwich). Y-axis completes it to right-hand system. + * Units: meters */ struct EcefCoor_f { - float x; - float y; - float z; + float x;///< in meters + float y;///< in meters + float z;///< in meters }; -/* lon, lat in radians */ -/* alt in meters */ +/** + * @brief vector in Latitude, Longitude and Altitude + * @details Units lat,lon: radians + * Unit alt: meters above MSL + */ struct LlaCoor_f { - float lon; - float lat; - float alt; + float lon;///< in radians + float lat;///< in radians + float alt;///< in meters above MSL }; -/* North East Down local tangeant plane */ +/** + * @brief vector in North East Down coordinates + * Units: meters */ struct NedCoor_f { - float x; - float y; - float z; + float x;///< in meters + float y;///< in meters + float z;///< in meters }; -/* East North Up local tangeant plane */ +/** + * @brief vector in East North Up coordinates + * Units: meters */ struct EnuCoor_f { - float x; - float y; - float z; + float x;///< in meters + float y;///< in meters + float z;///< in meters }; -/* Local tangeant plane reference */ +/** + * @brief definition of the local (flat earth) coordinate system + * @details Defines the origin of the local coordinate system + * in ECEF and LLA coordinates and the roation matrix from + * ECEF to local frame */ struct LtpDef_f { - struct EcefCoor_f ecef; - struct LlaCoor_f lla; - struct FloatMat33 ltp_of_ecef; + struct EcefCoor_f ecef;///< origin of local frame in ECEF + struct LlaCoor_f lla;///< origin of local frame in LLA + struct FloatMat33 ltp_of_ecef;///< rotation from ECEF to local frame }; extern void ltp_def_from_ecef_f(struct LtpDef_f* def, struct EcefCoor_f* ecef); -//extern void ltp_def_from_lla_f(struct LtpDef_f* def, struct LlaCoor_f* lla); +extern void ltp_def_from_lla_f(struct LtpDef_f* def, struct LlaCoor_f* lla); extern void lla_of_ecef_f(struct LlaCoor_f* out, struct EcefCoor_f* in); extern void ecef_of_lla_f(struct EcefCoor_f* out, struct LlaCoor_f* in); extern void enu_of_ecef_point_f(struct EnuCoor_f* enu, struct LtpDef_f* def, struct EcefCoor_f* ecef); extern void ned_of_ecef_point_f(struct NedCoor_f* ned, struct LtpDef_f* def, struct EcefCoor_f* ecef); extern void enu_of_ecef_vect_f(struct EnuCoor_f* enu, struct LtpDef_f* def, struct EcefCoor_f* ecef); extern void ned_of_ecef_vect_f(struct NedCoor_f* ned, struct LtpDef_f* def, struct EcefCoor_f* ecef); +extern void enu_of_lla_point_f(struct EnuCoor_f* enu, struct LtpDef_f* def, struct LlaCoor_f* lla); +extern void ned_of_lla_point_f(struct NedCoor_f* ned, struct LtpDef_f* def, struct LlaCoor_f* lla); /* not enought precision with floats - used the double version */ -#if 0 extern void ecef_of_enu_point_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct EnuCoor_f* enu); extern void ecef_of_ned_point_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct NedCoor_f* ned); extern void ecef_of_enu_vect_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct EnuCoor_f* enu); extern void ecef_of_ned_vect_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct NedCoor_f* ned); -#endif +/* end use double versions */ #endif /* PPRZ_GEODETIC_FLOAT_H */ diff --git a/sw/airborne/math/pprz_geodetic_int.c b/sw/airborne/math/pprz_geodetic_int.c index e5675607c5..99153cc38c 100644 --- a/sw/airborne/math/pprz_geodetic_int.c +++ b/sw/airborne/math/pprz_geodetic_int.c @@ -24,10 +24,6 @@ #include "pprz_geodetic_int.h" #include "pprz_algebra_int.h" -#define CM_OF_M(_m) ((_m)*1e2) -#define M_OF_CM(_cm) ((_cm)/1e2) -#define EM7RAD_OF_RAD(_r) (_r*1e7) -#define RAD_OF_EM7RAD(_r) (_r/1e7) #define HIGH_RES_TRIG_FRAC 20 void ltp_def_from_ecef_i(struct LtpDef_i* def, struct EcefCoor_i* ecef) { @@ -53,7 +49,7 @@ void ltp_def_from_ecef_i(struct LtpDef_i* def, struct EcefCoor_i* ecef) { def->ltp_of_ecef.m[0] = -sin_lon; def->ltp_of_ecef.m[1] = cos_lon; - def->ltp_of_ecef.m[2] = 0; + def->ltp_of_ecef.m[2] = 0; /* this element is always zero http://en.wikipedia.org/wiki/Geodetic_system#From_ECEF_to_ENU */ def->ltp_of_ecef.m[3] = (int32_t)((-(int64_t)sin_lat*(int64_t)cos_lon)>>HIGH_RES_TRIG_FRAC); def->ltp_of_ecef.m[4] = (int32_t)((-(int64_t)sin_lat*(int64_t)sin_lon)>>HIGH_RES_TRIG_FRAC); def->ltp_of_ecef.m[5] = cos_lat; @@ -63,9 +59,38 @@ void ltp_def_from_ecef_i(struct LtpDef_i* def, struct EcefCoor_i* ecef) { } +void ltp_def_from_lla_i(struct LtpDef_i* def, struct LlaCoor_i* lla) { -//void init_ltp_from_lla_i(struct LtpRef_i* ref_param, struct LlaCoor_i* ref_pos) { -//} + /* store the origin of the tangeant plane */ + LLA_COPY(def->lla, *lla); + /* compute the ecef representation of the origin */ + ecef_of_lla_i(&def->ecef, &def->lla); + /* store the rotation matrix */ + +#if 1 + int32_t sin_lat = rint(BFP_OF_REAL(sinf(RAD_OF_EM7RAD((float)def->lla.lat)), HIGH_RES_TRIG_FRAC)); + int32_t cos_lat = rint(BFP_OF_REAL(cosf(RAD_OF_EM7RAD((float)def->lla.lat)), HIGH_RES_TRIG_FRAC)); + int32_t sin_lon = rint(BFP_OF_REAL(sinf(RAD_OF_EM7RAD((float)def->lla.lon)), HIGH_RES_TRIG_FRAC)); + int32_t cos_lon = rint(BFP_OF_REAL(cosf(RAD_OF_EM7RAD((float)def->lla.lon)), HIGH_RES_TRIG_FRAC)); +#else + int32_t sin_lat = rint(BFP_OF_REAL(sin(RAD_OF_EM7RAD((double)def->lla.lat)), HIGH_RES_TRIG_FRAC)); + int32_t cos_lat = rint(BFP_OF_REAL(cos(RAD_OF_EM7RAD((double)def->lla.lat)), HIGH_RES_TRIG_FRAC)); + int32_t sin_lon = rint(BFP_OF_REAL(sin(RAD_OF_EM7RAD((double)def->lla.lon)), HIGH_RES_TRIG_FRAC)); + int32_t cos_lon = rint(BFP_OF_REAL(cos(RAD_OF_EM7RAD((double)def->lla.lon)), HIGH_RES_TRIG_FRAC)); +#endif + + + def->ltp_of_ecef.m[0] = -sin_lon; + def->ltp_of_ecef.m[1] = cos_lon; + def->ltp_of_ecef.m[2] = 0; /* this element is always zero http://en.wikipedia.org/wiki/Geodetic_system#From_ECEF_to_ENU */ + def->ltp_of_ecef.m[3] = (int32_t)((-(int64_t)sin_lat*(int64_t)cos_lon)>>HIGH_RES_TRIG_FRAC); + def->ltp_of_ecef.m[4] = (int32_t)((-(int64_t)sin_lat*(int64_t)sin_lon)>>HIGH_RES_TRIG_FRAC); + def->ltp_of_ecef.m[5] = cos_lat; + def->ltp_of_ecef.m[6] = (int32_t)(( (int64_t)cos_lat*(int64_t)cos_lon)>>HIGH_RES_TRIG_FRAC); + def->ltp_of_ecef.m[7] = (int32_t)(( (int64_t)cos_lat*(int64_t)sin_lon)>>HIGH_RES_TRIG_FRAC); + def->ltp_of_ecef.m[8] = sin_lat; + +} void enu_of_ecef_point_i(struct EnuCoor_i* enu, struct LtpDef_i* def, struct EcefCoor_i* ecef) { @@ -73,14 +98,14 @@ void enu_of_ecef_point_i(struct EnuCoor_i* enu, struct LtpDef_i* def, struct Ece VECT3_DIFF(delta, *ecef, def->ecef); const int64_t tmpx = (int64_t)def->ltp_of_ecef.m[0]*delta.x + (int64_t)def->ltp_of_ecef.m[1]*delta.y + - 0; + 0; /* this element is always zero http://en.wikipedia.org/wiki/Geodetic_system#From_ECEF_to_ENU */ enu->x = (int32_t)(tmpx>>HIGH_RES_TRIG_FRAC); const int64_t tmpy = (int64_t)def->ltp_of_ecef.m[3]*delta.x + (int64_t)def->ltp_of_ecef.m[4]*delta.y + (int64_t)def->ltp_of_ecef.m[5]*delta.z; enu->y = (int32_t)(tmpy>>HIGH_RES_TRIG_FRAC); const int64_t tmpz = (int64_t)def->ltp_of_ecef.m[6]*delta.x + - (int64_t)def->ltp_of_ecef.m[7]*delta.y + + (int64_t)def->ltp_of_ecef.m[7]*delta.y + (int64_t)def->ltp_of_ecef.m[8]*delta.z; enu->z = (int32_t)(tmpz>>HIGH_RES_TRIG_FRAC); @@ -99,14 +124,14 @@ void enu_of_ecef_vect_i(struct EnuCoor_i* enu, struct LtpDef_i* def, struct Ecef const int64_t tmpx = (int64_t)def->ltp_of_ecef.m[0]*ecef->x + (int64_t)def->ltp_of_ecef.m[1]*ecef->y + - 0; + 0; /* this element is always zero http://en.wikipedia.org/wiki/Geodetic_system#From_ECEF_to_ENU */ enu->x = (int32_t)(tmpx>>HIGH_RES_TRIG_FRAC); const int64_t tmpy = (int64_t)def->ltp_of_ecef.m[3]*ecef->x + (int64_t)def->ltp_of_ecef.m[4]*ecef->y + (int64_t)def->ltp_of_ecef.m[5]*ecef->z; enu->y = (int32_t)(tmpy>>HIGH_RES_TRIG_FRAC); const int64_t tmpz = (int64_t)def->ltp_of_ecef.m[6]*ecef->x + - (int64_t)def->ltp_of_ecef.m[7]*ecef->y + + (int64_t)def->ltp_of_ecef.m[7]*ecef->y + (int64_t)def->ltp_of_ecef.m[8]*ecef->z; enu->z = (int32_t)(tmpz>>HIGH_RES_TRIG_FRAC); @@ -114,15 +139,57 @@ void enu_of_ecef_vect_i(struct EnuCoor_i* enu, struct LtpDef_i* def, struct Ecef void ned_of_ecef_vect_i(struct NedCoor_i* ned, struct LtpDef_i* def, struct EcefCoor_i* ecef) { - struct EnuCoor_i enu; enu_of_ecef_vect_i(&enu, def, ecef); ENU_OF_TO_NED(*ned, enu); +} +/* check if resolution of INT32_TRIG_FRAC (14) is enough here */ +void ecef_of_enu_point_i(struct EcefCoor_i* ecef, struct LtpDef_i* def, struct EnuCoor_i* enu) { + INT32_RMAT_TRANSP_VMULT(*ecef, def->ltp_of_ecef, *enu); + INT32_VECT3_ADD(*ecef, def->ecef); +} + +void ecef_of_ned_point_i(struct EcefCoor_i* ecef, struct LtpDef_i* def, struct NedCoor_i* ned) { + struct EnuCoor_i enu; + ENU_OF_TO_NED(enu, *ned); + ecef_of_enu_point_i(ecef, def, &enu); +} + +void ecef_of_enu_vect_i(struct EcefCoor_i* ecef, struct LtpDef_i* def, struct EnuCoor_i* enu) { + INT32_RMAT_TRANSP_VMULT(*ecef, def->ltp_of_ecef, *enu); +} + +void ecef_of_ned_vect_i(struct EcefCoor_i* ecef, struct LtpDef_i* def, struct NedCoor_i* ned) { + struct EnuCoor_i enu; + ENU_OF_TO_NED(enu, *ned); + ecef_of_enu_vect_i(ecef, def, &enu); } +void enu_of_lla_point_i(struct EnuCoor_i* enu, struct LtpDef_i* def, struct LlaCoor_i* lla) { + struct EcefCoor_i ecef; + ecef_of_lla_i(&ecef,lla); + enu_of_ecef_point_i(enu,def,&ecef); +} +void ned_of_lla_point_i(struct NedCoor_i* ned, struct LtpDef_i* def, struct LlaCoor_i* lla) { + struct EcefCoor_i ecef; + ecef_of_lla_i(&ecef,lla); + ned_of_ecef_point_i(ned,def,&ecef); +} + +void enu_of_lla_vect_i(struct EnuCoor_i* enu, struct LtpDef_i* def, struct LlaCoor_i* lla) { + struct EcefCoor_i ecef; + ecef_of_lla_i(&ecef,lla); + enu_of_ecef_vect_i(enu,def,&ecef); +} + +void ned_of_lla_vect_i(struct NedCoor_i* ned, struct LtpDef_i* def, struct LlaCoor_i* lla) { + struct EcefCoor_i ecef; + ecef_of_lla_i(&ecef,lla); + ned_of_ecef_vect_i(ned,def,&ecef); +} /* For now we cheat and call the floating point version @@ -164,19 +231,3 @@ void ecef_of_lla_i(struct EcefCoor_i* out, struct LlaCoor_i* in) { out->z = (int32_t)CM_OF_M(out_d.z); } - -//#include "stdio.h" -void enu_of_lla_point_i(struct EnuCoor_i* enu, struct LtpDef_i* def, struct LlaCoor_i* lla) { - struct EcefCoor_i ecef; - ecef_of_lla_i(&ecef,lla); - //printf("sim %d %d %d, def %d %d %d\n",ecef.x,ecef.y,ecef.z,def->ecef.x,def->ecef.y,def->ecef.z); - //printf("sim lla def %d %d %d\n",def->lla.lat,def->lla.lon,def->lla.alt); - enu_of_ecef_point_i(enu,def,&ecef); -} - -void ned_of_lla_point_i(struct NedCoor_i* ned, struct LtpDef_i* def, struct LlaCoor_i* lla) { - struct EcefCoor_i ecef; - ecef_of_lla_i(&ecef,lla); - ned_of_ecef_point_i(ned,def,&ecef); -} - diff --git a/sw/airborne/math/pprz_geodetic_int.h b/sw/airborne/math/pprz_geodetic_int.h index 93a640387d..7d95b30512 100644 --- a/sw/airborne/math/pprz_geodetic_int.h +++ b/sw/airborne/math/pprz_geodetic_int.h @@ -1,3 +1,32 @@ +/* + * Copyright (C) 2008-2011 The Paparazzi Team + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, see + * . + * + */ + +/** + * @file pprz_geodetic_int.h + * @brief Paparazzi fixed point math for geodetic calculations. + * + * This is the more detailed description of this file. + * + */ + #ifndef PPRZ_GEODETIC_INT_H #define PPRZ_GEODETIC_INT_H @@ -6,47 +35,62 @@ #include "std.h" #include "pprz_algebra_int.h" -/* - Earth Centered Earth Fixed in centimeters -*/ + +/** + * @brief vector in EarthCenteredEarthFixed coordinates + * @details Origin at center of mass of the Earth. Z-axis is pointing north, + * the x-axis intersects the sphere of the earth at 0° latitude (Equator) + * and 0° longitude (Greenwich). Y-axis completes it to right-hand system. + * Units: centimeters */ struct EcefCoor_i { - int32_t x; - int32_t y; - int32_t z; + int32_t x; ///< in centimeters + int32_t y; ///< in centimeters + int32_t z; ///< in centimeters }; -/* lon, lat in radians*1e7 */ -/* alt in centimeters */ +/** + * @brief vector in Latitude, Longitude and Altitude + * @details Units lat,lon: radians*1e7 + * Unit alt: centimeters above MSL + */ struct LlaCoor_i { - int32_t lon; - int32_t lat; - int32_t alt; + int32_t lon; ///< in radians*1e7 + int32_t lat; ///< in radians*1e7 + int32_t alt; ///< in centimeters above MSL }; -/* North East Down local tangeant plane */ +/** + * @brief vector in North East Down coordinates + */ struct NedCoor_i { int32_t x; int32_t y; int32_t z; }; -/* East North Up local tangeant plane */ +/** + * @brief vector in East North Up coordinates + */ struct EnuCoor_i { int32_t x; int32_t y; int32_t z; }; -/* Local tangeant plane definition */ +/** + * @brief definition of the local (flat earth) coordinate system + * @details Defines the origin of the local coordinate system + * in ECEF and LLA coordinates and the roation matrix from + * ECEF to local frame */ struct LtpDef_i { - struct EcefCoor_i ecef; /* Reference point in ecef */ - struct LlaCoor_i lla; /* Reference point in lla */ - struct Int32Mat33 ltp_of_ecef; /* Rotation matrix */ - int32_t hmsl; /* Height above mean sea level */ + struct EcefCoor_i ecef; ///< Reference point in ecef + struct LlaCoor_i lla; ///< Reference point in lla + struct Int32Mat33 ltp_of_ecef; ///< Rotation matrix + int32_t hmsl; ///< Height above mean sea level }; extern void ltp_def_from_ecef_i(struct LtpDef_i* def, struct EcefCoor_i* ecef); -//extern void ltp_def_from_lla_i(struct LtpRef_i* def, struct LlaCoor_i* lla); +extern void ltp_def_from_lla_i(struct LtpDef_i* def, struct LlaCoor_i* lla); extern void lla_of_ecef_i(struct LlaCoor_i* out, struct EcefCoor_i* in); extern void ecef_of_lla_i(struct EcefCoor_i* out, struct LlaCoor_i* in); extern void enu_of_ecef_point_i(struct EnuCoor_i* enu, struct LtpDef_i* def, struct EcefCoor_i* ecef); @@ -55,18 +99,69 @@ extern void enu_of_ecef_vect_i(struct EnuCoor_i* enu, struct LtpDef_i* def, stru extern void ned_of_ecef_vect_i(struct NedCoor_i* ned, struct LtpDef_i* def, struct EcefCoor_i* ecef); extern void enu_of_lla_point_i(struct EnuCoor_i* enu, struct LtpDef_i* def, struct LlaCoor_i* lla); extern void ned_of_lla_point_i(struct NedCoor_i* ned, struct LtpDef_i* def, struct LlaCoor_i* lla); +extern void enu_of_lla_vect_i(struct EnuCoor_i* enu, struct LtpDef_i* def, struct LlaCoor_i* lla); +extern void ned_of_lla_vect_i(struct NedCoor_i* ned, struct LtpDef_i* def, struct LlaCoor_i* lla); +extern void ecef_of_enu_point_i(struct EcefCoor_i* ecef, struct LtpDef_i* def, struct EnuCoor_i* enu); +extern void ecef_of_ned_point_i(struct EcefCoor_i* ecef, struct LtpDef_i* def, struct NedCoor_i* ned); +extern void ecef_of_enu_vect_i(struct EcefCoor_i* ecef, struct LtpDef_i* def, struct EnuCoor_i* enu); +extern void ecef_of_ned_vect_i(struct EcefCoor_i* ecef, struct LtpDef_i* def, struct NedCoor_i* ned); + +#define CM_OF_M(_m) ((_m)*1e2) +#define M_OF_CM(_cm) ((_cm)/1e2) +#define EM7RAD_OF_RAD(_r) (_r*1e7) +#define RAD_OF_EM7RAD(_r) (_r/1e7) #define INT32_VECT3_ENU_OF_NED(_o, _i) { \ - _o.x = _i.y; \ - _o.y = _i.x; \ - _o.z = -_i.z; \ + (_o).x = (_i).y; \ + (_o).y = (_i).x; \ + (_o).z = -(_i).z; \ } #define INT32_VECT3_NED_OF_ENU(_o, _i) INT32_VECT3_ENU_OF_NED(_o,_i) +#define ECEF_BFP_OF_REAL(_o, _i) { \ + (_o).x = (int32_t)CM_OF_M((_i).x); \ + (_o).y = (int32_t)CM_OF_M((_i).y); \ + (_o).z = (int32_t)CM_OF_M((_i).z); \ + } + +#define ECEF_FLOAT_OF_BFP(_o, _i) { \ + (_o).x = (float)M_OF_CM((_i).x); \ + (_o).y = (float)M_OF_CM((_i).y); \ + (_o).z = (float)M_OF_CM((_i).z); \ + } + +#define LLA_BFP_OF_REAL(_o, _i) { \ + (_o).lat = (int32_t)EM7RAD_OF_RAD((_i).lat); \ + (_o).lon = (int32_t)EM7RAD_OF_RAD((_i).lon); \ + (_o).alt = (int32_t)CM_OF_M((_i).alt); \ + } + +#define LLA_FLOAT_OF_BFP(_o, _i) { \ + (_o).lat = (float)RAD_OF_EM7RAD((_i).lat); \ + (_o).lon = (float)RAD_OF_EM7RAD((_i).lon); \ + (_o).alt = (float)M_OF_CM((_i).alt); \ + } + +#define NED_BFP_OF_REAL(_o, _i) { \ + (_o).x = POS_BFP_OF_REAL((_i).x); \ + (_o).y = POS_BFP_OF_REAL((_i).y); \ + (_o).z = POS_BFP_OF_REAL((_i).z); \ + } + +#define ENU_BFP_OF_REAL(_o, _i) NED_BFP_OF_REAL(_o, _i) + +#define NED_FLOAT_OF_BFP(_o, _i) { \ + (_o).x = POS_FLOAT_OF_BFP((_i).x); \ + (_o).y = POS_FLOAT_OF_BFP((_i).y); \ + (_o).z = POS_FLOAT_OF_BFP((_i).z); \ + } + +#define ENU_FLOAT_OF_BFP(_o, _i) NED_FLOAT_OF_BFP(_o, _i) + #define INT32_VECT2_ENU_OF_NED(_o, _i) { \ - _o.x = _i.y; \ - _o.y = _i.x; \ + (_o).x = (_i).y; \ + (_o).y = (_i).x; \ } #define INT32_VECT2_NED_OF_ENU(_o, _i) INT32_VECT2_ENU_OF_NED(_o,_i) diff --git a/sw/airborne/mcu.c b/sw/airborne/mcu.c index d1f02766d7..e0853e4bab 100644 --- a/sw/airborne/mcu.c +++ b/sw/airborne/mcu.c @@ -36,7 +36,7 @@ #if defined USE_UART0 || defined USE_UART1 || defined USE_UART2 || defined USE_UART3 || defined USE_UART4 || defined USE_UART5 #include "mcu_periph/uart.h" #endif -#if defined USE_I2C0 || defined USE_I2C1 || defined USE_I2C2 +#if defined USE_I2C0 || defined USE_I2C1 || defined USE_I2C2 #include "mcu_periph/i2c.h" #endif #if defined USE_ADC diff --git a/sw/airborne/mcu_periph/i2c.h b/sw/airborne/mcu_periph/i2c.h index 6c6b400682..43753823ce 100644 --- a/sw/airborne/mcu_periph/i2c.h +++ b/sw/airborne/mcu_periph/i2c.h @@ -48,7 +48,9 @@ struct i2c_transaction { volatile enum I2CTransactionStatus status; }; +#ifndef I2C_TRANSACTION_QUEUE_LEN #define I2C_TRANSACTION_QUEUE_LEN 8 +#endif struct i2c_periph { /* circular buffer holding transactions */ @@ -126,6 +128,7 @@ extern void i2c2_init(void); #endif /* USE_I2C2 */ extern void i2c_init(struct i2c_periph* p); +extern bool_t i2c_idle(struct i2c_periph* p); extern bool_t i2c_submit(struct i2c_periph* p, struct i2c_transaction* t); #define I2CReceive(_p, _t, _s_addr, _len) { \ diff --git a/sw/airborne/modules/airborne_ant_track/airborne_ant_track.c b/sw/airborne/modules/airborne_ant_track/airborne_ant_track.c new file mode 100755 index 0000000000..1e6ddb8dd0 --- /dev/null +++ b/sw/airborne/modules/airborne_ant_track/airborne_ant_track.c @@ -0,0 +1,177 @@ +/* + * Determines antenna pan angle. + * + * project: Paparazzi + * description: Determines antenna pan angle from + * plane's and home's positions and plane's heading angle. + * Software might be optimized + * by removing multiplications with 0, it is left this + * way for better understandabilty and changeability. + * + * authors: Arnold Schroeter, Martin Mueller, Chris Efstathiou + * + * + * + * + */ + +#if defined(USE_AIRBORNE_ANT_TRACKING) && USE_AIRBORNE_ANT_TRACKING == 1 + +#include +#include +#include "inter_mcu.h" +#include "subsystems/navigation/common_nav.h" +#include "autopilot.h" +#include "generated/flight_plan.h" +#include "estimator.h" +#include "subsystems/navigation/traffic_info.h" +#include "airborne_ant_track.h" + + +typedef struct { + float fx; + float fy; + float fz;} VECTOR; + +typedef struct { + float fx1; float fx2; float fx3; + float fy1; float fy2; float fy3; + float fz1; float fz2; float fz3;} MATRIX; + +float airborne_ant_pan; +static bool_t ant_pan_positive = 0; + +void ant_point(void); +static void vSubtractVectors(VECTOR* svA, VECTOR svB, VECTOR svC); +static void vMultiplyMatrixByVector(VECTOR* svA, MATRIX smB, VECTOR svC); + +/******************************************************************* +; function name: vSubtractVectors +; description: subtracts two vectors a = b - c +; parameters: +;*******************************************************************/ +static void vSubtractVectors(VECTOR* svA, VECTOR svB, VECTOR svC) +{ + svA->fx = svB.fx - svC.fx; + svA->fy = svB.fy - svC.fy; + svA->fz = svB.fz - svC.fz; +} + +/******************************************************************* +; function name: vMultiplyMatrixByVector +; description: multiplies matrix by vector svA = smB * svC +; parameters: +;*******************************************************************/ +static void vMultiplyMatrixByVector(VECTOR* svA, MATRIX smB, VECTOR svC) +{ + svA->fx = smB.fx1 * svC.fx + smB.fx2 * svC.fy + smB.fx3 * svC.fz; + svA->fy = smB.fy1 * svC.fx + smB.fy2 * svC.fy + smB.fy3 * svC.fz; + svA->fz = smB.fz1 * svC.fx + smB.fz2 * svC.fy + smB.fz3 * svC.fz; +} + +void airborne_ant_point_init(void){ + +return; +} + +void airborne_ant_point_periodic(void) +{ +float airborne_ant_pan_servo = 0; + + static VECTOR svPlanePosition, + Home_Position, + Home_PositionForPlane, + Home_PositionForPlane2; + + static MATRIX smRotation; + + svPlanePosition.fx = estimator_y; + svPlanePosition.fy = estimator_x; + svPlanePosition.fz = estimator_z; + + Home_Position.fx = waypoints[WP_HOME].y; + Home_Position.fy = waypoints[WP_HOME].x; + Home_Position.fz = waypoints[WP_HOME].a; + + /* distance between plane and object */ + vSubtractVectors(&Home_PositionForPlane, Home_Position, svPlanePosition); + + /* yaw */ + smRotation.fx1 = (float)(cos(estimator_hspeed_dir)); + smRotation.fx2 = (float)(sin(estimator_hspeed_dir)); + smRotation.fx3 = 0.; + smRotation.fy1 = -smRotation.fx2; + smRotation.fy2 = smRotation.fx1; + smRotation.fy3 = 0.; + smRotation.fz1 = 0.; + smRotation.fz2 = 0.; + smRotation.fz3 = 1.; + + vMultiplyMatrixByVector(&Home_PositionForPlane2, smRotation, Home_PositionForPlane); + + +/* + * This is for one axis pan antenna mechanisms. The default is to + * circle clockwise so view is right. The pan servo neutral makes + * the antenna look to the right with 0° given, 90° is to the back and + * -90° is to the front. + * + * + * + * plane front + * + * 90 + ^ + * I + * 135 I 45° + * \ I / + * \I/ + * 180-------I------- 0° + * /I\ + * / I \ + * -135 I -45° + * I + * -90 + * plane back + * + * + */ + + /* fPan = 0 -> antenna looks along the wing + 90 -> antenna looks in flight direction + -90 -> antenna looks backwards + */ + /* fixed to the plane*/ + airborne_ant_pan = (float)(atan2(Home_PositionForPlane2.fx, (Home_PositionForPlane2.fy))); + + // I need to avoid oscillations around the 180 degree mark. + if (airborne_ant_pan > 0 && airborne_ant_pan <= RadOfDeg(175)){ ant_pan_positive = 1; } + if (airborne_ant_pan < 0 && airborne_ant_pan >= RadOfDeg(-175)){ ant_pan_positive = 0; } + + if (airborne_ant_pan > RadOfDeg(175) && ant_pan_positive == 0){ + airborne_ant_pan = RadOfDeg(-180); + + }else if (airborne_ant_pan < RadOfDeg(-175) && ant_pan_positive){ + airborne_ant_pan = RadOfDeg(180); + ant_pan_positive = 0; + } + +#ifdef ANT_PAN_NEUTRAL + airborne_ant_pan = airborne_ant_pan - RadOfDeg(ANT_PAN_NEUTRAL); + if (airborne_ant_pan > 0) + airborne_ant_pan_servo = MAX_PPRZ * (airborne_ant_pan / (RadOfDeg(ANT_PAN_MAX - ANT_PAN_NEUTRAL))); + else + airborne_ant_pan_servo = MIN_PPRZ * (airborne_ant_pan / (RadOfDeg(ANT_PAN_MIN - ANT_PAN_NEUTRAL))); +#endif + + airborne_ant_pan_servo = TRIM_PPRZ(airborne_ant_pan_servo); + +#ifdef COMMAND_ANT_PAN + ap_state->commands[COMMAND_ANT_PAN] = airborne_ant_pan_servo; +#endif + + +return; +} + +#endif diff --git a/sw/airborne/modules/airborne_ant_track/airborne_ant_track.h b/sw/airborne/modules/airborne_ant_track/airborne_ant_track.h new file mode 100755 index 0000000000..64cfaf50e6 --- /dev/null +++ b/sw/airborne/modules/airborne_ant_track/airborne_ant_track.h @@ -0,0 +1,34 @@ +/* + * $Id: point.h 2304 2008-02-07 21:35:08Z mmm $ + * + * Copyright (C) 2005-2008 Arnold Schroeter + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +#if defined(USE_AIRBORNE_ANT_TRACKING) && USE_AIRBORNE_ANT_TRACKING == 1 +#ifndef AIRBORNE_ANT_TRACK_H +#define AIRBORNE_ANT_TRACK_H + +extern float airborne_ant_pan; +void airborne_ant_point_init(void); +void airborne_ant_point_periodic(void); + +#endif /* AIRBORNE_ANT_TRACK_H */ +#endif // #if defined(USE_AIRBORNE_ANT_TRACKING) && USE_AIRBORNE_ANT_TRACKING == 1 diff --git a/sw/airborne/modules/cam_control/booz_cam.c b/sw/airborne/modules/cam_control/booz_cam.c index 80f509db57..c595b787b1 100644 --- a/sw/airborne/modules/cam_control/booz_cam.c +++ b/sw/airborne/modules/cam_control/booz_cam.c @@ -23,7 +23,7 @@ */ #include "cam_control/booz_cam.h" -#include "booz2_pwm_hw.h" +#include "modules/core/booz_pwm_arch.h" #include "subsystems/ahrs.h" #include "firmwares/rotorcraft/navigation.h" #include "subsystems/ins.h" @@ -64,7 +64,7 @@ int16_t booz_cam_pan; // PWM definition #ifndef BOOZ_CAM_SetPwm -#define BOOZ_CAM_SetPwm(_v) Booz2SetPwmValue(_v) +#define BOOZ_CAM_SetPwm(_v) BoozSetPwmValue(_v) #endif #ifndef BOOZ_CAM_DEFAULT_MODE diff --git a/sw/airborne/modules/core/extra_pprz_dl.h b/sw/airborne/modules/core/extra_pprz_dl.h index 676075a90c..5c562122b2 100644 --- a/sw/airborne/modules/core/extra_pprz_dl.h +++ b/sw/airborne/modules/core/extra_pprz_dl.h @@ -138,7 +138,7 @@ extern uint8_t extra_pprz_ovrn, extra_pprz_error; extern volatile uint8_t extra_pprz_payload_len; #include "led.h" -//#include "uart.h" +//#include "mcu_periph/uart.h" //#include "messages.h" //#include "downlink.h" static inline void parse_extra_pprz( uint8_t c ) { diff --git a/sw/airborne/modules/drop/booz_drop.c b/sw/airborne/modules/drop/booz_drop.c index 2e2ba6c4d8..206c8a09f3 100644 --- a/sw/airborne/modules/drop/booz_drop.c +++ b/sw/airborne/modules/drop/booz_drop.c @@ -21,8 +21,8 @@ * Boston, MA 02111-1307, USA. */ -#include "booz_drop.h" -#include "booz2_pwm_hw.h" +#include "modules/drop/booz_drop.h" +#include "modules/core/booz_pwm_arch.h" #include "generated/airframe.h" bool_t booz_drop_ball; @@ -37,7 +37,7 @@ int16_t booz_drop_servo; // PWM definition #ifndef BoozDropPwm -#define BoozDropPwm(_v) Booz2SetPwmValue(_v) +#define BoozDropPwm(_v) BoozSetPwmValue(_v) #endif void booz_drop_init(void) { diff --git a/sw/airborne/modules/ins/fw_ins_vn100.c b/sw/airborne/modules/ins/fw_ins_vn100.c index 1b08545606..a8524a7f03 100644 --- a/sw/airborne/modules/ins/fw_ins_vn100.c +++ b/sw/airborne/modules/ins/fw_ins_vn100.c @@ -28,9 +28,19 @@ #include "modules/ins/ins_vn100.h" #include "mcu_periph/spi.h" +#include "estimator.h" +#include "generated/airframe.h" + +#ifndef INS_YAW_NEUTRAL_DEFAULT +#define INS_YAW_NEUTRAL_DEFAULT 0. +#endif void ins_init( void ) { + ins_roll_neutral = INS_ROLL_NEUTRAL_DEFAULT; + ins_pitch_neutral = INS_PITCH_NEUTRAL_DEFAULT; + ins_yaw_neutral = INS_YAW_NEUTRAL_DEFAULT; + /* SPI polarity = 1 - data sampled on rising edge */ SpiSetCPOL(); /* SPI phase = 1 - SCK idle high */ @@ -100,6 +110,11 @@ void ins_event_task( void ) { if (spi_message_received) { spi_message_received = FALSE; parse_ins_msg(); +#ifndef INS_VN100_READ_ONLY + // Update estimator + // FIXME Use a proper rotation matrix here + EstimatorSetAtt((ins_eulers.phi - ins_roll_neutral), ins_eulers.psi, (ins_eulers.theta - ins_pitch_neutral)); +#endif //uint8_t s = 4+VN100_REG_QMR_SIZE; //DOWNLINK_SEND_DEBUG(DefaultChannel,s,spi_buffer_input); } diff --git a/sw/airborne/modules/ins/ins_vn100.c b/sw/airborne/modules/ins/ins_vn100.c index d0670ca565..576272072d 100644 --- a/sw/airborne/modules/ins/ins_vn100.c +++ b/sw/airborne/modules/ins/ins_vn100.c @@ -34,6 +34,11 @@ #include "downlink.h" #include "messages.h" +/* neutrals */ +float ins_roll_neutral; +float ins_pitch_neutral; +float ins_yaw_neutral; + struct FloatEulers ins_eulers; struct FloatQuat ins_quat; struct FloatRates ins_rates; @@ -176,6 +181,9 @@ void parse_ins_msg( void ) { } +#ifndef DOWNLINK_DEVICE +#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE +#endif #include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/ins/ins_vn100.h b/sw/airborne/modules/ins/ins_vn100.h index f60f485de3..20d58f153f 100644 --- a/sw/airborne/modules/ins/ins_vn100.h +++ b/sw/airborne/modules/ins/ins_vn100.h @@ -35,6 +35,11 @@ #include "VN100.h" #include "math/pprz_algebra_float.h" +/* neutrals */ +extern float ins_roll_neutral; +extern float ins_pitch_neutral; +extern float ins_yaw_neutral; + /* state */ extern struct FloatEulers ins_eulers; extern struct FloatQuat ins_quat; diff --git a/sw/airborne/modules/sensors/baro_MS5534A.c b/sw/airborne/modules/sensors/baro_MS5534A.c index d922cff51b..ecd698bbed 100644 --- a/sw/airborne/modules/sensors/baro_MS5534A.c +++ b/sw/airborne/modules/sensors/baro_MS5534A.c @@ -235,19 +235,19 @@ void baro_MS5534A_event_task( void ) { baro_MS5534A_available = TRUE; break; - case STATUS_RESET: - break; + case STATUS_RESET: + break; default: /* Init status */ words[status] = Uint16(buf_input); if (status == STATUS_INIT4) { - calibration(); + calibration(); } } } /* else nothing to read */ NextStatus(); if (!status_read_data) { - /* Ask next conversion now */ + /* Ask next conversion now */ baro_MS5534A_send(); } } @@ -261,9 +261,8 @@ void baro_MS5534A_event( void ) { baro_MS5534A_available = FALSE; baro_MS5534A_z = ground_alt +((float)baro_MS5534A_ground_pressure - baro_MS5534A_pressure)*0.084; if (alt_baro_enabled) { - EstimatorSetAlt(baro_MS5534A_z); + EstimatorSetAlt(baro_MS5534A_z); } } } } - diff --git a/sw/airborne/modules/sensors/baro_ets.c b/sw/airborne/modules/sensors/baro_ets.c index 462956a181..520eac4f2f 100644 --- a/sw/airborne/modules/sensors/baro_ets.c +++ b/sw/airborne/modules/sensors/baro_ets.c @@ -40,6 +40,8 @@ #include "estimator.h" #include +#include "subsystems/nav.h" + #ifdef SITL #include "gps.h" #endif @@ -132,12 +134,13 @@ void baro_ets_read_event( void ) { baro_ets_offset_tmp += baro_ets_adc; } // Convert raw to m/s - if (baro_ets_offset_init) - baro_ets_altitude = BARO_ETS_SCALE * (float)(baro_ets_offset-baro_ets_adc); - else + if (baro_ets_offset_init) { + baro_ets_altitude = ground_alt + BARO_ETS_SCALE * (float)(baro_ets_offset-baro_ets_adc); + // New value available + EstimatorSetAlt(baro_ets_altitude); + } else { baro_ets_altitude = 0.0; - // New value available - EstimatorSetAlt(baro_ets_altitude); + } } else { baro_ets_altitude = 0.0; } diff --git a/sw/airborne/modules/sensors/baro_scp.c b/sw/airborne/modules/sensors/baro_scp.c index 8cc888dc60..a4321049ae 100644 --- a/sw/airborne/modules/sensors/baro_scp.c +++ b/sw/airborne/modules/sensors/baro_scp.c @@ -3,9 +3,6 @@ #include "led.h" #include "mcu.h" -#ifndef DOWNLINK_DEVICE -#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE -#endif #include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/sensors/baro_scp_i2c.c b/sw/airborne/modules/sensors/baro_scp_i2c.c index 9a8d848f70..1c85bb5d16 100644 --- a/sw/airborne/modules/sensors/baro_scp_i2c.c +++ b/sw/airborne/modules/sensors/baro_scp_i2c.c @@ -11,9 +11,6 @@ #include "mcu_periph/i2c.h" #include "led.h" -#ifndef DOWNLINK_DEVICE -#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE -#endif #include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/booz/arch/sim/booz2_pwm_hw.h b/sw/airborne/modules/sensors/infrared_adc.h similarity index 79% rename from sw/airborne/booz/arch/sim/booz2_pwm_hw.h rename to sw/airborne/modules/sensors/infrared_adc.h index 3c8f3d00e1..9a0efb291a 100644 --- a/sw/airborne/booz/arch/sim/booz2_pwm_hw.h +++ b/sw/airborne/modules/sensors/infrared_adc.h @@ -1,7 +1,5 @@ /* - * $Id: $ - * - * Copyright (C) 2007 ENAC + * Copyright (C) 2010 ENAC * * This file is part of paparazzi. * @@ -22,11 +20,14 @@ * */ -#ifndef BOOZ2_PWM_HW_H -#define BOOZ2_PWM_HW_H +/* + * Wrapper for adc infrared sensor module + */ -extern void booz2_pwm_init_hw(void); +#ifndef INFRARED_ADC_H +#define INFRARED_ADC_H -#define Booz2SetPwmValue(_v) {} +#include "subsystems/sensors/infrared_adc.h" + +#endif // INFRARED_ADC_H -#endif /* BOOZ2_PWM_HW_H */ diff --git a/sw/airborne/modules/sensors/infrared_i2c.h b/sw/airborne/modules/sensors/infrared_i2c.h index 0b3422667c..95e9ea1d01 100644 --- a/sw/airborne/modules/sensors/infrared_i2c.h +++ b/sw/airborne/modules/sensors/infrared_i2c.h @@ -21,43 +21,12 @@ */ /* - * Driver for i2c infrared sensor + * Wrapper for i2c infrared sensor module */ #ifndef INFRARED_I2C_H #define INFRARED_I2C_H -#include "std.h" -#include "generated/airframe.h" -#include "subsystems/sensors/infrared.h" -#include "mcu_periph/i2c.h" - -extern int16_t ir_i2c_ir1; -extern int16_t ir_i2c_ir2; -extern int16_t ir_i2c_top; -extern volatile bool_t ir_i2c_done; -extern bool_t ir_i2c_data_available; -extern uint8_t ir_i2c_conf_word; -extern bool_t ir_i2c_conf_hor_done, ir_i2c_conf_ver_done; - -extern struct i2c_transaction irh_trans, irv_trans; - -extern void infrared_i2c_init( void ); -extern void infrared_i2c_update( void ); -extern void infrared_i2c_hor_event( void ); -extern void infrared_i2c_ver_event( void ); - -#define infrared_i2cEvent() { \ - if (irh_trans.status == I2CTransSuccess) infrared_i2c_hor_event(); \ - if (irv_trans.status == I2CTransSuccess) infrared_i2c_ver_event(); \ -} - -#define infrared_i2cDownlink() DOWNLINK_SEND_DEBUG_IR_I2C(DefaultChannel, &ir_i2c_ir1, &ir_i2c_ir2, &ir_i2c_top) - -#define infrared_i2c_SetConfWord(_v) { \ - ir_i2c_conf_hor_done = FALSE; \ - ir_i2c_conf_ver_done = FALSE; \ - ir_i2c_conf_word = _v; \ -} +#include "subsystems/sensors/infrared_i2c.h" #endif // INFRARED_I2C_H diff --git a/sw/airborne/obsolete/3dmg.c b/sw/airborne/obsolete/3dmg.c index eaaa3c6917..589dcc14e8 100644 --- a/sw/airborne/obsolete/3dmg.c +++ b/sw/airborne/obsolete/3dmg.c @@ -26,7 +26,7 @@ #include "std.h" #include "3dmg.h" -#include "uart.h" +#include "mcu_periph/uart.h" volatile bool_t _3dmg_data_ready; int16_t _3dmg_roll, _3dmg_pitch, _3dmg_yaw; diff --git a/sw/airborne/peripherals/hmc5843.c b/sw/airborne/peripherals/hmc5843.c index 34aa71fb89..3f5c63f9f3 100644 --- a/sw/airborne/peripherals/hmc5843.c +++ b/sw/airborne/peripherals/hmc5843.c @@ -45,11 +45,13 @@ static void send_config(void) void hmc5843_idle_task(void) { if (hmc5843.initialized && hmc5843.ready_for_read && (hmc5843.i2c_trans.status == I2CTransSuccess || hmc5843.i2c_trans.status == I2CTransFailed)) { + if (i2c2.status == I2CIdle && i2c_idle(&i2c2)) { hmc5843.i2c_trans.type = I2CTransRx; hmc5843.i2c_trans.len_r = 7; i2c_submit(&i2c2, &hmc5843.i2c_trans); hmc5843.reading = TRUE; hmc5843.ready_for_read = FALSE; + } } if (hmc5843.reading && hmc5843.i2c_trans.status == I2CTransSuccess) { @@ -70,6 +72,11 @@ void hmc5843_periodic(void) hmc5843.initialized = TRUE; } else if (hmc5843.timeout++ > HMC5843_TIMEOUT) { hmc5843_arch_reset(); + hmc5843.i2c_trans.type = I2CTransRx; + hmc5843.i2c_trans.len_r = 7; + i2c_submit(&i2c2, &hmc5843.i2c_trans); + hmc5843.reading = TRUE; + hmc5843.ready_for_read = FALSE; hmc5843.timeout = 0; } } diff --git a/sw/airborne/peripherals/ms2001.c b/sw/airborne/peripherals/ms2100.c similarity index 74% rename from sw/airborne/peripherals/ms2001.c rename to sw/airborne/peripherals/ms2100.c index 310efe2f83..1e0940339a 100644 --- a/sw/airborne/peripherals/ms2001.c +++ b/sw/airborne/peripherals/ms2100.c @@ -21,21 +21,21 @@ * Boston, MA 02111-1307, USA. */ -#include "ms2001.h" +#include "ms2100.h" -volatile uint8_t ms2001_status; -volatile int16_t ms2001_values[MS2001_NB_AXIS]; +volatile uint8_t ms2100_status; +volatile int16_t ms2100_values[MS2100_NB_AXIS]; -void ms2001_init( void ) { +void ms2100_init( void ) { - ms2001_arch_init(); + ms2100_arch_init(); uint8_t i; - for (i=0; i -//FIXME this is still needed for fixedwing integration +// FIXME this is still needed for fixedwing integration #include "estimator.h" +#include "led.h" + +// FIXME Debugging Only +#ifndef DOWNLINK_DEVICE +#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE +#endif +#include "mcu_periph/uart.h" +#include "messages.h" +#include "downlink.h" + struct AhrsFloatDCM ahrs_impl; @@ -49,7 +59,7 @@ float ins_pitch_neutral = INS_PITCH_NEUTRAL_DEFAULT; // Positive yaw : clockwise // DCM Working variables -float G_Dt=0.05; +const float G_Dt = 1. / ((float) AHRS_PROPAGATE_FREQUENCY ); struct FloatVect3 accel_float = {0,0,0}; @@ -69,14 +79,30 @@ float MAG_Heading; static inline void compute_body_orientation_and_rates(void); void Normalize(void); void Drift_correction(void); -void Euler_angles(void); void Matrix_update(void); +#if PERFORMANCE_REPORTING == 1 +int renorm_sqrt_count = 0; +int renorm_blowup_count = 0; +float imu_health = 0.; +#endif + + /**************************************************/ void ahrs_update_fw_estimator( void ) { - Euler_angles(); +#if (OUTPUTMODE==2) // Only accelerometer info (debugging purposes) + ahrs_float.ltp_to_imu_euler.phi = atan2(accel_float.y,accel_float.z); // atan2(acc_y,acc_z) + ahrs_float.ltp_to_imu_euler.theta = -asin((accel_float.x)/GRAVITY); // asin(acc_x) + ahrs_float.ltp_to_imu_euler.psi = 0; +#else + ahrs_float.ltp_to_imu_euler.phi = atan2(DCM_Matrix[2][1],DCM_Matrix[2][2]); + ahrs_float.ltp_to_imu_euler.theta = -asin(DCM_Matrix[2][0]); + ahrs_float.ltp_to_imu_euler.psi = atan2(DCM_Matrix[1][0],DCM_Matrix[0][0]); + ahrs_float.ltp_to_imu_euler.psi += M_PI; // Rotating the angle 180deg to fit for PPRZ +#endif + //warning, only eulers written to ahrs struct so far //compute_body_orientation_and_rates(); @@ -85,6 +111,24 @@ void ahrs_update_fw_estimator( void ) estimator_phi = ahrs_float.ltp_to_imu_euler.phi - ins_roll_neutral; estimator_theta = ahrs_float.ltp_to_imu_euler.theta - ins_pitch_neutral; estimator_psi = ahrs_float.ltp_to_imu_euler.psi; + + estimator_p = Omega_Vector[0]; + + RunOnceEvery(6,DOWNLINK_SEND_RMAT_DEBUG(DefaultChannel, + &(DCM_Matrix[0][0]), + &(DCM_Matrix[0][1]), + &(DCM_Matrix[0][2]), + + &(DCM_Matrix[1][0]), + &(DCM_Matrix[1][1]), + &(DCM_Matrix[1][2]), + + &(DCM_Matrix[2][0]), + &(DCM_Matrix[2][1]), + &(DCM_Matrix[2][2]) + + )); + } @@ -143,13 +187,30 @@ void ahrs_propagate(void) /* unbias rate measurement */ RATES_DIFF(ahrs_float.imu_rate, gyro_float, ahrs_impl.gyro_bias); + /* Uncouple Motions */ +#ifdef IMU_GYRO_P_Q + float dp=0,dq=0,dr=0; + dp += ahrs_float.imu_rate.q * IMU_GYRO_P_Q; + dp += ahrs_float.imu_rate.r * IMU_GYRO_P_R; + dq += ahrs_float.imu_rate.p * IMU_GYRO_Q_P; + dq += ahrs_float.imu_rate.r * IMU_GYRO_Q_R; + dr += ahrs_float.imu_rate.p * IMU_GYRO_R_P; + dr += ahrs_float.imu_rate.q * IMU_GYRO_R_Q; + + ahrs_float.imu_rate.p += dp; + ahrs_float.imu_rate.q += dq; + ahrs_float.imu_rate.r += dr; +#endif + Matrix_update(); + // INFO, ahrs struct only updated in ahrs_update_fw_estimator + Normalize(); - //INFO, ahrs struct only updated in ahrs_update_fw_estimator } void ahrs_update_accel(void) { + ACCELS_FLOAT_OF_BFP(accel_float, imu.accel); #ifdef USE_GPS @@ -375,20 +436,6 @@ void Matrix_update(void) } } -void Euler_angles(void) -{ -#if (OUTPUTMODE==2) // Only accelerometer info (debugging purposes) - ahrs_float.ltp_to_imu_euler.phi = atan2(accel_float.y,accel_float.z); // atan2(acc_y,acc_z) - ahrs_float.ltp_to_imu_euler.theta = -asin((accel_float.x)/GRAVITY); // asin(acc_x) - ahrs_float.ltp_to_imu_euler.psi = 0; -#else - ahrs_float.ltp_to_imu_euler.phi = atan2(DCM_Matrix[2][1],DCM_Matrix[2][2]); - ahrs_float.ltp_to_imu_euler.theta = -asin(DCM_Matrix[2][0]); - ahrs_float.ltp_to_imu_euler.psi = atan2(DCM_Matrix[1][0],DCM_Matrix[0][0]); - ahrs_float.ltp_to_imu_euler.psi += M_PI; // Rotating the angle 180deg to fit for PPRZ -#endif -} - /* * Compute body orientation and rates from imu orientation and rates */ diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_dcm.h b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.h index 6bf2551539..ea54f0c1d4 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_float_dcm.h +++ b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.h @@ -47,7 +47,7 @@ void ahrs_update_fw_estimator(void); //#define Kp_ROLLPITCH 0.2 #define Kp_ROLLPITCH 0.015 #define Ki_ROLLPITCH 0.000010 -#define Kp_YAW 1.2 //High yaw drift correction gain - use with caution! +#define Kp_YAW 0.9 //High yaw drift correction gain - use with caution! #define Ki_YAW 0.00005 #define GRAVITY 9.81 @@ -59,7 +59,7 @@ void ahrs_update_fw_estimator(void); // Mode 2 = direct accelerometer -> euler -#define PERFORMANCE_REPORTING 0 +#define PERFORMANCE_REPORTING 1 #if PERFORMANCE_REPORTING == 1 extern int renorm_sqrt_count; extern int renorm_blowup_count; diff --git a/sw/airborne/subsystems/imu/imu_analog.c b/sw/airborne/subsystems/imu/imu_analog.c index 91727c687f..7901d0e86f 100644 --- a/sw/airborne/subsystems/imu/imu_analog.c +++ b/sw/airborne/subsystems/imu/imu_analog.c @@ -24,12 +24,14 @@ #include "mcu_periph/uart.h" volatile bool_t analog_imu_available; +int imu_overrun; static struct adc_buf analog_imu_adc_buf[NB_ANALOG_IMU_ADC]; void imu_impl_init(void) { analog_imu_available = FALSE; + imu_overrun = 0; adc_buf_channel(ADC_CHANNEL_GYRO_P, &analog_imu_adc_buf[0], ADC_CHANNEL_GYRO_NB_SAMPLES); adc_buf_channel(ADC_CHANNEL_GYRO_Q, &analog_imu_adc_buf[1], ADC_CHANNEL_GYRO_NB_SAMPLES); @@ -41,6 +43,15 @@ void imu_impl_init(void) { } void imu_periodic(void) { + // Actual Nr of ADC measurements per channel per periodic loop + static int last_head = 0; + + imu_overrun = analog_imu_adc_buf[0].head - last_head; + if (imu_overrun < 0) + imu_overrun += ADC_CHANNEL_GYRO_NB_SAMPLES; + last_head = analog_imu_adc_buf[0].head; + + // Read All Measurements imu.gyro_unscaled.p = analog_imu_adc_buf[0].sum / ADC_CHANNEL_GYRO_NB_SAMPLES; imu.gyro_unscaled.q = analog_imu_adc_buf[1].sum / ADC_CHANNEL_GYRO_NB_SAMPLES; imu.gyro_unscaled.r = analog_imu_adc_buf[2].sum / ADC_CHANNEL_GYRO_NB_SAMPLES; diff --git a/sw/airborne/subsystems/imu/imu_analog.h b/sw/airborne/subsystems/imu/imu_analog.h index c0ef110251..c7f7270fbf 100644 --- a/sw/airborne/subsystems/imu/imu_analog.h +++ b/sw/airborne/subsystems/imu/imu_analog.h @@ -27,11 +27,13 @@ #define NB_ANALOG_IMU_ADC 6 extern volatile bool_t analog_imu_available; +extern int imu_overrun; -#define ImuEvent(_gyro_accel_handler, _mag_handler) { \ +#define ImuEvent(_gyro_handler, _accel_handler, _mag_handler) { \ if (analog_imu_available) { \ analog_imu_available = FALSE; \ - _gyro_accel_handler(); \ + _gyro_handler(); \ + _accel_handler(); \ } \ ImuMagEvent(_mag_handler); \ } diff --git a/sw/airborne/subsystems/imu/imu_aspirin.c b/sw/airborne/subsystems/imu/imu_aspirin.c index 887bd724c8..7cb6f88b7c 100644 --- a/sw/airborne/subsystems/imu/imu_aspirin.c +++ b/sw/airborne/subsystems/imu/imu_aspirin.c @@ -1,4 +1,5 @@ #include "subsystems/imu.h" +#include "peripherals/hmc5843.h" #include "mcu_periph/i2c.h" @@ -9,6 +10,18 @@ static void configure_gyro(void); static void configure_mag(void); static void configure_accel(void); +static void send_i2c_msg_with_retry(struct i2c_transaction* t) { + uint8_t max_retry = 8; + uint8_t nb_retry = 0; + do { + i2c_submit(&i2c2, t); + while(I2C_GetFlagStatus(I2C2, I2C_FLAG_BUSY)); + while (t->status == I2CTransPending || t->status == I2CTransRunning); + if (t->status == I2CTransFailed) + nb_retry++; + } + while (t->status != I2CTransSuccess && nb_retry < max_retry); +} void imu_impl_init(void) { @@ -20,25 +33,29 @@ void imu_impl_init(void) { imu_aspirin.accel_available = FALSE; imu_aspirin_arch_init(); + hmc5843_init(); } void imu_periodic(void) { + hmc5843_periodic(); if (imu_aspirin.status == AspirinStatusUninit) { configure_gyro(); - configure_mag(); configure_accel(); + imu_aspirin_arch_int_enable(); imu_aspirin.status = AspirinStatusIdle; } - else + else { imu_aspirin.gyro_available_blaaa = TRUE; + imu_aspirin.time_since_last_reading++; + } + } /* sends a serie of I2C commands to configure the ITG3200 gyro */ static void configure_gyro(void) { - struct i2c_transaction t; t.type = I2CTransTx; t.slave_addr = ITG3200_ADDR; @@ -46,62 +63,22 @@ static void configure_gyro(void) { t.buf[0] = ITG3200_REG_DLPF_FS; t.buf[1] = (0x03<<3); t.len_w = 2; - i2c_submit(&i2c2,&t); - while (t.status != I2CTransSuccess); + send_i2c_msg_with_retry(&t); /* set sample rate to 533Hz */ t.buf[0] = ITG3200_REG_SMPLRT_DIV; t.buf[1] = 0x0E; - i2c_submit(&i2c2,&t); - while (t.status != I2CTransSuccess); + send_i2c_msg_with_retry(&t); /* switch to gyroX clock */ t.buf[0] = ITG3200_REG_PWR_MGM; t.buf[1] = 0x01; - i2c_submit(&i2c2,&t); - while (t.status != I2CTransSuccess); + send_i2c_msg_with_retry(&t); /* enable interrupt on data ready, idle hight */ t.buf[0] = ITG3200_REG_INT_CFG; t.buf[1] = (0x01 | 0x01<<7); - i2c_submit(&i2c2,&t); - while (t.status != I2CTransSuccess); + send_i2c_msg_with_retry(&t); } -/* sends a serie of I2C commands to configure the ITG3200 gyro */ -static void configure_mag(void) { - - struct i2c_transaction t; - t.type = I2CTransTx; - t.slave_addr = HMC5843_ADDR; - /* set to rate to 50Hz */ - t.buf[0] = HMC5843_REG_CFGA; - t.buf[1] = 0x00 | (0x06 << 2); - i2c_submit(&i2c2,&t); - while (t.status != I2CTransSuccess); - /* set to gain to 1 Gauss */ - t.buf[0] = HMC5843_REG_CFGB; - t.buf[1] = 0x01<<5; - i2c_submit(&i2c2,&t); - while (t.status != I2CTransSuccess); - /* set to continuous mode */ - t.buf[0] = HMC5843_REG_MODE; - t.buf[1] = 0x00; - i2c_submit(&i2c2,&t); - while (t.status != I2CTransSuccess); - -} - - -static void send_i2c_msg_with_retry(struct i2c_transaction* t) { - uint8_t max_retry = 8; - uint8_t nb_retry = 0; - do { - i2c_submit(&i2c2,&t); - while (t.status == I2CTransPending || t.status == I2CTransRunning); - if (t.status == I2CTransFailed) - nb_retry++; - } - while (t.status != I2CTransSuccess || nb_retry < max_retry); -} static void configure_accel(void) { diff --git a/sw/airborne/subsystems/imu/imu_aspirin.h b/sw/airborne/subsystems/imu/imu_aspirin.h index 740fad584c..439f755e5e 100644 --- a/sw/airborne/subsystems/imu/imu_aspirin.h +++ b/sw/airborne/subsystems/imu/imu_aspirin.h @@ -32,6 +32,9 @@ #include "peripherals/hmc5843.h" #include "peripherals/adxl345.h" +#define IMU_MAG_X_CHAN 0 +#define IMU_MAG_Y_CHAN 1 +#define IMU_MAG_Z_CHAN 2 #if !defined IMU_GYRO_P_SIGN & !defined IMU_GYRO_Q_SIGN & !defined IMU_GYRO_R_SIGN #define IMU_GYRO_P_SIGN 1 @@ -60,6 +63,7 @@ struct ImuAspirin { volatile enum AspirinStatus status; struct i2c_transaction i2c_trans_gyro; struct i2c_transaction i2c_trans_mag; + uint8_t gyro_eoc; uint8_t gyro_available; uint8_t gyro_available_blaaa; uint8_t mag_available; @@ -67,50 +71,63 @@ struct ImuAspirin { volatile uint8_t accel_available; volatile uint8_t accel_tx_buf[7]; volatile uint8_t accel_rx_buf[7]; + uint32_t time_since_last_reading; }; extern struct ImuAspirin imu_aspirin; +#define ASPIRIN_GYRO_TIMEOUT 3 -#define ImuMagEvent(_mag_handler) {} +#include "peripherals/hmc5843.h" +#define foo_handler() {} +#define ImuMagEvent(_mag_handler) { \ + MagEvent(foo_handler); \ + if (hmc5843.data_available) { \ + imu.mag_unscaled.x = hmc5843.data.value[IMU_MAG_X_CHAN]; \ + imu.mag_unscaled.y = hmc5843.data.value[IMU_MAG_Y_CHAN]; \ + imu.mag_unscaled.z = hmc5843.data.value[IMU_MAG_Z_CHAN]; \ + _mag_handler(); \ + hmc5843.data_available = FALSE; \ + } \ +} - -#define ImuEvent(_gyro_accel_handler, _mag_handler) { \ +#define ImuEvent(_gyro_handler, _accel_handler, _mag_handler) { \ + if (imu_aspirin.status != AspirinStatusUninit) { \ + ImuMagEvent(_mag_handler); \ + imu_aspirin_arch_int_disable(); \ if (imu_aspirin.status == AspirinStatusReadingGyro && \ - imu_aspirin.i2c_trans_gyro.status == I2CTransSuccess) { \ + imu_aspirin.i2c_trans_gyro.status == I2CTransSuccess && i2c_idle(&i2c2)) { \ int16_t gp = imu_aspirin.i2c_trans_gyro.buf[0]<<8 | imu_aspirin.i2c_trans_gyro.buf[1]; \ int16_t gq = imu_aspirin.i2c_trans_gyro.buf[2]<<8 | imu_aspirin.i2c_trans_gyro.buf[3]; \ int16_t gr = imu_aspirin.i2c_trans_gyro.buf[4]<<8 | imu_aspirin.i2c_trans_gyro.buf[5]; \ RATES_ASSIGN(imu.gyro_unscaled, gp, gq, gr); \ - if (imu_aspirin.mag_ready_for_read ) { \ - /* read mag */ \ - imu_aspirin.i2c_trans_mag.type = I2CTransRx; \ - imu_aspirin.i2c_trans_mag.slave_addr = HMC5843_ADDR; \ - imu_aspirin.i2c_trans_mag.len_r = 7; \ - i2c_submit(&i2c2,&imu_aspirin.i2c_trans_mag); \ - imu_aspirin.mag_ready_for_read = FALSE; \ - imu_aspirin.status = AspirinStatusReadingMag; \ - } \ - else { \ - imu_aspirin.status = AspirinStatusIdle; \ - } \ - } \ - if (imu_aspirin.status == AspirinStatusReadingMag && \ - imu_aspirin.i2c_trans_mag.status == I2CTransSuccess) { \ - int16_t mx = imu_aspirin.i2c_trans_mag.buf[0]<<8 | imu_aspirin.i2c_trans_mag.buf[1]; \ - int16_t my = imu_aspirin.i2c_trans_mag.buf[2]<<8 | imu_aspirin.i2c_trans_mag.buf[3]; \ - int16_t mz = imu_aspirin.i2c_trans_mag.buf[4]<<8 | imu_aspirin.i2c_trans_mag.buf[5]; \ - VECT3_ASSIGN(imu.mag_unscaled, mx, my, mz); \ - imu_aspirin.mag_available = TRUE; \ imu_aspirin.status = AspirinStatusIdle; \ - \ } \ - if (imu_aspirin.gyro_available_blaaa) { \ + if (imu_aspirin.gyro_eoc && i2c2.status == I2CIdle && i2c_idle(&i2c2)) { \ + if (imu_aspirin.i2c_trans_gyro.status == I2CTransSuccess) { \ + imu_aspirin.time_since_last_reading = 0; \ + } \ + imu_aspirin.gyro_eoc = FALSE; \ + imu_aspirin.i2c_trans_gyro.type = I2CTransTxRx; \ + imu_aspirin.i2c_trans_gyro.buf[0] = ITG3200_REG_GYRO_XOUT_H; \ + imu_aspirin.i2c_trans_gyro.slave_addr = ITG3200_ADDR; \ + imu_aspirin.i2c_trans_gyro.len_w = 1; \ + imu_aspirin.i2c_trans_gyro.len_r = 6; \ + i2c_submit(&i2c2,&imu_aspirin.i2c_trans_gyro); \ + } \ + if (imu_aspirin.time_since_last_reading > ASPIRIN_GYRO_TIMEOUT) { \ + imu_aspirin.gyro_eoc = FALSE; \ + i2c2_er_irq_handler(); \ + imu_aspirin.i2c_trans_gyro.type = I2CTransTxRx; \ + imu_aspirin.i2c_trans_gyro.buf[0] = ITG3200_REG_GYRO_XOUT_H; \ + imu_aspirin.i2c_trans_gyro.slave_addr = ITG3200_ADDR; \ + imu_aspirin.i2c_trans_gyro.len_w = 1; \ + imu_aspirin.i2c_trans_gyro.len_r = 6; \ + i2c_submit(&i2c2,&imu_aspirin.i2c_trans_gyro); \ + imu_aspirin.time_since_last_reading = 0; \ + } \ + if (imu_aspirin.gyro_available_blaaa && imu_aspirin.i2c_trans_gyro.status == I2CTransSuccess) { \ imu_aspirin.gyro_available_blaaa = FALSE; \ - _gyro_accel_handler(); \ - } \ - if (imu_aspirin.mag_available) { \ - imu_aspirin.mag_available = FALSE; \ - _mag_handler(); \ + _gyro_handler(); \ } \ if (imu_aspirin.accel_available) { \ imu_aspirin.accel_available = FALSE; \ @@ -118,8 +135,10 @@ extern struct ImuAspirin imu_aspirin; const int16_t ay = imu_aspirin.accel_rx_buf[3] | (imu_aspirin.accel_rx_buf[4]<<8); \ const int16_t az = imu_aspirin.accel_rx_buf[5] | (imu_aspirin.accel_rx_buf[6]<<8); \ VECT3_ASSIGN(imu.accel_unscaled, ax, ay, az); \ - _gyro_accel_handler(); \ + _accel_handler(); \ } \ + imu_aspirin_arch_int_enable(); \ + } \ } diff --git a/sw/airborne/subsystems/imu/imu_b2.c b/sw/airborne/subsystems/imu/imu_b2.c index 394bcc16da..5d4bf680a6 100644 --- a/sw/airborne/subsystems/imu/imu_b2.c +++ b/sw/airborne/subsystems/imu/imu_b2.c @@ -28,8 +28,8 @@ void imu_impl_init(void) { imu_b2_arch_init(); max1168_init(); -#if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001 - ms2001_init(); +#if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2100 + ms2100_init(); #elif defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_AMI601 ami601_init(); #elif defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_HMC5843 diff --git a/sw/airborne/subsystems/imu/imu_b2.h b/sw/airborne/subsystems/imu/imu_b2.h index fc9aa8660f..91f7b34759 100644 --- a/sw/airborne/subsystems/imu/imu_b2.h +++ b/sw/airborne/subsystems/imu/imu_b2.h @@ -31,7 +31,7 @@ /* type of magnetometer */ #define IMU_B2_MAG_NONE 0 -#define IMU_B2_MAG_MS2001 1 +#define IMU_B2_MAG_MS2100 1 #define IMU_B2_MAG_AMI601 2 @@ -135,21 +135,21 @@ #define IMU_ACCEL_Z_SIGN 1 #endif #if !defined IMU_MAG_X_SIGN & !defined IMU_MAG_Y_SIGN & !defined IMU_MAG_Z_SIGN -#define IMU_MAG_X_SIGN -1 -#define IMU_MAG_Y_SIGN 1 +#define IMU_MAG_X_SIGN 1 +#define IMU_MAG_Y_SIGN -1 #define IMU_MAG_Z_SIGN -1 #endif #endif /* IMU_B2_VERSION_1_2 */ -#if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001 -#include "peripherals/ms2001.h" +#if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2100 +#include "peripherals/ms2100.h" #define ImuMagEvent(_mag_handler) { \ - if (ms2001_status == MS2001_DATA_AVAILABLE) { \ - imu.mag_unscaled.x = ms2001_values[IMU_MAG_X_CHAN]; \ - imu.mag_unscaled.y = ms2001_values[IMU_MAG_Y_CHAN]; \ - imu.mag_unscaled.z = ms2001_values[IMU_MAG_Z_CHAN]; \ - ms2001_status = MS2001_IDLE; \ + if (ms2100_status == MS2100_DATA_AVAILABLE) { \ + imu.mag_unscaled.x = ms2100_values[IMU_MAG_X_CHAN]; \ + imu.mag_unscaled.y = ms2100_values[IMU_MAG_Y_CHAN]; \ + imu.mag_unscaled.z = ms2100_values[IMU_MAG_Z_CHAN]; \ + ms2100_status = MS2100_IDLE; \ _mag_handler(); \ } \ } @@ -184,7 +184,7 @@ #endif -#define ImuEvent(_gyro_accel_handler, _mag_handler) { \ +#define ImuEvent(_gyro_handler, _accel_handler, _mag_handler) { \ if (max1168_status == STA_MAX1168_DATA_AVAILABLE) { \ imu.gyro_unscaled.p = max1168_values[IMU_GYRO_P_CHAN]; \ imu.gyro_unscaled.q = max1168_values[IMU_GYRO_Q_CHAN]; \ @@ -193,7 +193,8 @@ imu.accel_unscaled.y = max1168_values[IMU_ACCEL_Y_CHAN]; \ imu.accel_unscaled.z = max1168_values[IMU_ACCEL_Z_CHAN]; \ max1168_status = STA_MAX1168_IDLE; \ - _gyro_accel_handler(); \ + _gyro_handler(); \ + _accel_handler(); \ } \ ImuMagEvent(_mag_handler); \ } diff --git a/sw/airborne/subsystems/imu/imu_crista.h b/sw/airborne/subsystems/imu/imu_crista.h index 7f19861efa..6d7c1ab85a 100644 --- a/sw/airborne/subsystems/imu/imu_crista.h +++ b/sw/airborne/subsystems/imu/imu_crista.h @@ -31,7 +31,7 @@ extern uint16_t ADS8344_values[ADS8344_NB_CHANNELS]; extern volatile bool_t ADS8344_available; -#define ImuEvent(_gyro_accel_handler, _mag_handler) { \ +#define ImuEvent(_gyro_handler, _accel_handler, _mag_handler) { \ if (ADS8344_available) { \ ADS8344_available = FALSE; \ imu.gyro_unscaled.p = ADS8344_values[IMU_GYRO_P_CHAN]; \ @@ -41,7 +41,8 @@ extern volatile bool_t ADS8344_available; imu.accel_unscaled.y = ADS8344_values[IMU_ACCEL_Y_CHAN]; \ imu.accel_unscaled.z = ADS8344_values[IMU_ACCEL_Z_CHAN]; \ /* spare 3, temp 7 */ \ - _gyro_accel_handler(); \ + _gyro_handler(); \ + _accel_handler(); \ } \ ImuMagEvent(_mag_handler); \ } diff --git a/sw/airborne/subsystems/ins.c b/sw/airborne/subsystems/ins.c index df47371b6f..cd098c51b5 100644 --- a/sw/airborne/subsystems/ins.c +++ b/sw/airborne/subsystems/ins.c @@ -90,7 +90,7 @@ void ins_init() { #ifdef USE_INS_NAV_INIT ins_ltp_initialised = TRUE; - /** FIXME: should use the same code than MOVE_WP in booz2_datalink.c */ + /** FIXME: should use the same code than MOVE_WP in firmwares/rotorcraft/datalink.c */ struct LlaCoor_i llh; /* Height above the ellipsoid */ llh.lat = INT32_RAD_OF_DEG(NAV_LAT0); llh.lon = INT32_RAD_OF_DEG(NAV_LON0); diff --git a/sw/airborne/subsystems/ins/hf_float.c b/sw/airborne/subsystems/ins/hf_float.c index e990dc896d..126a35c476 100644 --- a/sw/airborne/subsystems/ins/hf_float.c +++ b/sw/airborne/subsystems/ins/hf_float.c @@ -259,7 +259,7 @@ void b2_hff_init(float init_x, float init_xdot, float init_y, float init_ydot) { printf("GPS_LAG_N: %d\n", GPS_LAG_N); printf("GPS_DT_N: %d\n", GPS_DT_N); printf("DT_HFILTER: %f\n", DT_HFILTER); - printf("GPS_LAG_TOL_N: %f\n", GPS_LAG_TOL_N); + printf("GPS_LAG_TOL_N: %i\n", GPS_LAG_TOL_N); #endif #else b2_hff_rb_last = &b2_hff_state; diff --git a/sw/airborne/subsystems/navigation/OSAMNav.c b/sw/airborne/subsystems/navigation/OSAMNav.c index 95cd4959ee..efd1c72099 100644 --- a/sw/airborne/subsystems/navigation/OSAMNav.c +++ b/sw/airborne/subsystems/navigation/OSAMNav.c @@ -365,9 +365,6 @@ bool_t InitializePolygonSurvey(uint8_t EntryWP, uint8_t Size, float sw, float Or CSurveyStatus = Init; - if (Size == 0) - return TRUE; - if (Size == 0) return TRUE; diff --git a/sw/airborne/subsystems/navigation/poly_survey_adv.c b/sw/airborne/subsystems/navigation/poly_survey_adv.c new file mode 100644 index 0000000000..b56ff6f579 --- /dev/null +++ b/sw/airborne/subsystems/navigation/poly_survey_adv.c @@ -0,0 +1,332 @@ +#include "poly_survey_adv.h" + +#include "subsystems/nav.h" +#include "estimator.h" +#include "autopilot.h" +#include "generated/flight_plan.h" +//#include "modules/digital_cam/dc.h" + + +/** +The following variables are set by poly_survey_init and not changed later on +**/ + +// precomputed vectors to ease calculations +point2d dir_vec; +point2d sweep_vec; +point2d rad_vec; + +//the polygon from the flightplan +uint8_t poly_first; +uint8_t poly_count; + +//desired properties of the flyover +float psa_min_rad; +float psa_sweep_width; +float psa_shot_dist; +float psa_altitude; + +//direction for the flyover (0° == N) +int segment_angle; +int return_angle; + +/** +The Following variables are dynamic, changed while navigating. +**/ + +/* +psa_stage starts at ENTRY and than circles trought the other +states until to polygon is completely covered +ENTRY : getting in the right position and height for the first flyover +SEG : fly from seg_start to seg_end and take pictures, + then calculate navigation points of next flyover +TURN1 : do a 180° turn around seg_center1 +RET : fly from ret_start to ret_end +TURN2 : do a 180° turn around seg_center2 +*/ +survey_stage psa_stage; + +// points for navigation +point2d seg_start; +point2d seg_end; +point2d seg_center1; +point2d seg_center2; +point2d entry_center; +point2d ret_start; +point2d ret_end; + + +//helper functions and macro +#define VEC_CALC(A, B, C, OP) A.x = B.x OP C.x; A.y = B.y OP C.y; + +static point2d vec_add(point2d a, point2d b) +{ + point2d tmp; + VEC_CALC(tmp, a, b, +); + + return tmp; +} + +static void nav_points(point2d start, point2d end) +{ + nav_route_xy(start.x, start.y, end.x, end.y); +} + +/** + intercept two lines and give back the point of intersection + returns : FALSE if no intersection can be found or intersection does not lie between points a and b + else TRUE + p : returns intersection + x, y : first line is defined by point x and y (goes through this points) + a1, a2, b1, b2 : second line by coordinates a1/a2, b1/b2 +**/ +static bool_t intercept_two_lines(point2d *p, point2d x, point2d y, float a1, float a2, float b1, float b2) +{ + float div, fac; + + div = (((b2 - a2)*(y.x - x.x)) + ((x.y - y.y)*(b1 - a1))); + if (div == 0) return FALSE; + fac = ((y.x*(x.y - a2)) + (x.x*(a2 - y.y)) + (a1*(y.y - x.y))) / div; + if (fac > 1.0) return FALSE; + if (fac < 0.0) return FALSE; + + p->x = a1 + fac*(b1 - a1); + p->y = a2 + fac*(b2 - a2); + + return TRUE; +} + +/** + intersects a line with the polygon and gives back the two intersection points + returns : TRUE if two intersection can be found, else FALSE + x, y : intersection points + a, b : define the line to intersection +**/ +static bool_t get_two_intersects(point2d *x, point2d *y, point2d a, point2d b) +{ + int i, count = 0; + point2d tmp; + + for (i=0;i fabs(dir_vec.y)) { + if ((y->x - x->x) / dir_vec.x < 0.0){ + tmp = *x; + *x = *y; + *y = tmp; + } + } + else + if ((y->y - x->y) / dir_vec.y < 0.0) { + tmp = *x; + *x = *y; + *y = tmp; + } + + return TRUE; +} + +/** + initializes the variables needed for the survey to start + first_wp : the first Waypoint of the polygon + size : the number of points that make up the polygon + angle : angle in which to do the flyovers + sweep_width : distance between the sweeps + shot_dist : distance between the shots + min_rad : minimal radius when navigating + altitude : the altitude that must be reached before the flyover starts +**/ +bool_t init_poly_survey_adv(uint8_t first_wp, uint8_t size, float angle, float sweep_width, float shot_dist, float min_rad, float altitude) +{ + int i; + point2d small, sweep; + float div, len, angle_rad = angle/180.0*M_PI; + + if (angle < 0.0) angle += 360.0; + if (angle >= 360.0) angle -= 360.0; + + poly_first = first_wp; + poly_count = size; + + psa_sweep_width = sweep_width; + psa_min_rad = min_rad; + psa_shot_dist = shot_dist; + psa_altitude = altitude; + + segment_angle = angle; + return_angle = angle+180; + if (return_angle > 359) return_angle -= 360; + + if (angle <= 45.0 || angle >= 315.0) { + //north + dir_vec.y = 1.0; + dir_vec.x = 1.0*tanf(angle_rad); + sweep.x = 1.0; + sweep.y = - dir_vec.x / dir_vec.y; + } + else if (angle <= 135.0) { + //east + dir_vec.x = 1.0; + dir_vec.y = 1.0/tanf(angle_rad); + sweep.y = - 1.0; + sweep.x = dir_vec.y / dir_vec.x; + } + else if (angle <= 225.0) { + //south + dir_vec.y = -1.0; + dir_vec.x = -1.0*tanf(angle_rad); + sweep.x = -1.0; + sweep.y = dir_vec.x / dir_vec.y; + } + else { + //west + dir_vec.x = -1.0; + dir_vec.y = -1.0/tanf(angle_rad); + sweep.y = 1.0; + sweep.x = - dir_vec.y / dir_vec.x; + } + + //normalize + len = sqrt(sweep.x*sweep.x+sweep.y*sweep.y); + sweep.x = sweep.x / len; + sweep.y = sweep.y / len; + + rad_vec.x = sweep.x * psa_min_rad; + rad_vec.y = sweep.y * psa_min_rad; + sweep_vec.x = sweep.x * psa_sweep_width; + sweep_vec.y = sweep.y * psa_sweep_width; + + //begin at leftmost position (relative to dir_vec) + small.x = waypoints[poly_first].x; + small.y = waypoints[poly_first].y; + + div = (sweep_vec.y*dir_vec.x) - (sweep_vec.x*dir_vec.y); + + //cacluate the leftmost point if one sees the dir vec as going "up" and the sweep vec as going right + if (div < 0.0) { + for(i=1;i 0.0) { + small.x = waypoints[poly_first+i].x; + small.y = waypoints[poly_first+i].y; + } + } + else + for(i=1;i 0.0) { + small.x = waypoints[poly_first+i].x; + small.y = waypoints[poly_first+i].y; + } + + //calculate the line the defines the first flyover + seg_start.x = small.x + 0.5*sweep_vec.x; + seg_start.y = small.y + 0.5*sweep_vec.y; + VEC_CALC(seg_end, seg_start, dir_vec, +); + + if (!get_two_intersects(&seg_start, &seg_end, seg_start, seg_end)) { + psa_stage = ERR; + return FALSE; + } + + //center of the entry circle + entry_center.x = seg_start.x - rad_vec.x; + entry_center.y = seg_start.y - rad_vec.y; + + //fast climbing to desired altitude + NavVerticalAutoThrottleMode(100.0); + NavVerticalAltitudeMode(psa_altitude, 0.0); + + psa_stage = ENTRY; + + return FALSE; +} + +/** + main navigation routine. This is called periodically evaluates the current + Position and stage and navigates accordingly. + Returns True until the survey is finished +**/ +bool_t poly_survey_adv(void) +{ + //entry circle around entry-center until the desired altitude is reached + if (psa_stage == ENTRY) { + nav_circle_XY(entry_center.x, entry_center.y, -psa_min_rad); + if (NavCourseCloseTo(segment_angle) + && nav_approaching_xy(seg_start.x, seg_start.y, last_x, last_y, CARROT) + && fabs(estimator_z - psa_altitude) <= 20) { + psa_stage = SEG; + NavVerticalAutoThrottleMode(0.0); + nav_init_stage(); + //dc_distance(psa_shot_dist, seg_start.x - dir_vec.x*psa_shot_dist*0.5, seg_start.y - dir_vec.y*psa_shot_dist*0.5); + } + } + //fly the segment until seg_end is reached + if (psa_stage == SEG) { + nav_points(seg_start, seg_end); + //calculate all needed points for the next flyover + if (nav_approaching_xy(seg_end.x, seg_end.y, seg_start.x, seg_start.y, 0)) { + //dc_stop(); + VEC_CALC(seg_center1, seg_end, rad_vec, -); + ret_start.x = seg_end.x - 2*rad_vec.x; + ret_start.y = seg_end.y - 2*rad_vec.y; + + //if we get no intersection the survey is finished + if (!get_two_intersects(&seg_start, &seg_end, vec_add(seg_start, sweep_vec), vec_add(seg_end, sweep_vec))) + return FALSE; + + ret_end.x = seg_start.x - sweep_vec.x - 2*rad_vec.x; + ret_end.y = seg_start.y - sweep_vec.y - 2*rad_vec.y; + + seg_center2.x = seg_start.x - 0.5*(2.0*rad_vec.x+sweep_vec.x); + seg_center2.y = seg_start.y - 0.5*(2.0*rad_vec.y+sweep_vec.y); + + psa_stage = TURN1; + nav_init_stage(); + } + } + //turn from stage to return + else if (psa_stage == TURN1) { + nav_circle_XY(seg_center1.x, seg_center1.y, -psa_min_rad); + if (NavCourseCloseTo(return_angle)) { + psa_stage = RET; + nav_init_stage(); + } + //return + } else if (psa_stage == RET) { + nav_points(ret_start, ret_end); + if (nav_approaching_xy(ret_end.x, ret_end.y, ret_start.x, ret_start.y, 0)) { + psa_stage = TURN2; + nav_init_stage(); + } + //turn from return to stage + } else if (psa_stage == TURN2) { + nav_circle_XY(seg_center2.x, seg_center2.y, -(2*psa_min_rad+psa_sweep_width)*0.5); + if (NavCourseCloseTo(segment_angle)) { + psa_stage = SEG; + nav_init_stage(); + //dc_distance(psa_shot_dist, seg_start.x - dir_vec.x*psa_shot_dist*0.5, seg_start.y - dir_vec.y*psa_shot_dist*0.5); + } + } + + return TRUE; +} diff --git a/sw/airborne/subsystems/navigation/poly_survey_adv.h b/sw/airborne/subsystems/navigation/poly_survey_adv.h new file mode 100644 index 0000000000..90b0164565 --- /dev/null +++ b/sw/airborne/subsystems/navigation/poly_survey_adv.h @@ -0,0 +1,13 @@ +#ifndef POLY_ADV_H +#define POLY_ADV_H + +#include "std.h" + +typedef struct {float x; float y;} point2d; + +typedef enum {ERR, ENTRY, SEG, TURN1, RET, TURN2} survey_stage; + +extern bool_t init_poly_survey_adv(uint8_t first_wp, uint8_t size, float angle, float sweep_width, float shot_dist, float min_rad, float altitude); +extern bool_t poly_survey_adv(void); + +#endif diff --git a/sw/airborne/subsystems/navigation/spiral.c b/sw/airborne/subsystems/navigation/spiral.c new file mode 100644 index 0000000000..b25ef937e2 --- /dev/null +++ b/sw/airborne/subsystems/navigation/spiral.c @@ -0,0 +1,160 @@ +/************** Spiral Navigation **********************************************/ + +/** creating a helix: + start radius to end radius, increasing after reaching alphamax + Alphamax is calculated from given segments + IMPORTANT: numer of segments has to be larger than 2! +*/ + +#include "spiral.h" + +#include "subsystems/nav.h" +#include "estimator.h" +#include "autopilot.h" +#include "generated/flight_plan.h" +//#include "modules/digital_cam/dc.h" + +enum SpiralStatus { Outside, StartCircle, Circle, IncSpiral }; +static enum SpiralStatus CSpiralStatus; +// static float SpiralTheta; +// static float Fly2X; +// static float Fly2Y; + +static float FlyFromX; +static float FlyFromY; +static float TransCurrentX; +static float TransCurrentY; +static float TransCurrentZ; +static float EdgeCurrentX; +static float EdgeCurrentY; +static float LastCircleX; +static float LastCircleY; +static float DistanceFromCenter; +static float Spiralradius; +static uint8_t Center; +static uint8_t Edge; +static float SRad; +static float IRad; +static float Alphalimit; +static float Segmente; +static float CamAngle; +static float ZPoint; +static float nav_radius_min; + +#ifndef MIN_CIRCLE_RADIUS +#define MIN_CIRCLE_RADIUS 120 +#endif + + +bool_t InitializeSpiral(uint8_t CenterWP, uint8_t EdgeWP, float StartRad, float IncRad, float Segments, float ZKoord) +{ + Center = CenterWP; // center of the helix + Edge = EdgeWP; // edge point on the maximaum radius + SRad = StartRad; // start radius of the helix + Segmente = Segments; + ZPoint = ZKoord; + nav_radius_min = MIN_CIRCLE_RADIUS; + if (SRad < nav_radius_min) SRad = nav_radius_min; + IRad = IncRad; // multiplier for increasing the spiral + + EdgeCurrentX = waypoints[Edge].x - waypoints[Center].x; + EdgeCurrentY = waypoints[Edge].y - waypoints[Center].y; + + Spiralradius = sqrt(EdgeCurrentX*EdgeCurrentX+EdgeCurrentY*EdgeCurrentY); + + TransCurrentX = estimator_x - waypoints[Center].x; + TransCurrentY = estimator_y - waypoints[Center].y; + TransCurrentZ = estimator_z - ZPoint; + DistanceFromCenter = sqrt(TransCurrentX*TransCurrentX+TransCurrentY*TransCurrentY); + + // SpiralTheta = atan2(TransCurrentY,TransCurrentX); + // Fly2X = Spiralradius*cos(SpiralTheta+3.14)+waypoints[Center].x; + // Fly2Y = Spiralradius*sin(SpiralTheta+3.14)+waypoints[Center].y; + + // Alphalimit denotes angle, where the radius will be increased + Alphalimit = 2*3.14 / Segments; + //current position + FlyFromX = estimator_x; + FlyFromY = estimator_y; + + if(DistanceFromCenter > Spiralradius) + CSpiralStatus = Outside; + return FALSE; +} + +bool_t SpiralNav(void) +{ + TransCurrentX = estimator_x - waypoints[Center].x; + TransCurrentY = estimator_y - waypoints[Center].y; + DistanceFromCenter = sqrt(TransCurrentX*TransCurrentX+TransCurrentY*TransCurrentY); + + bool_t InCircle = TRUE; + + if(DistanceFromCenter > Spiralradius) + InCircle = FALSE; + + switch(CSpiralStatus) + { + case Outside: + //flys until center of the helix is reached an start helix + nav_route_xy(FlyFromX,FlyFromY,waypoints[Center].x, waypoints[Center].y); + // center reached? + if (nav_approaching_xy(waypoints[Center].x, waypoints[Center].y, FlyFromX, FlyFromY, 0)) { + // nadir image + //dc_shutter(); + CSpiralStatus = StartCircle; + } + break; + case StartCircle: + // Starts helix + // storage of current coordinates + // calculation needed, State switch to Circle + nav_circle_XY(waypoints[Center].x, waypoints[Center].y, SRad); + if(DistanceFromCenter >= SRad){ + LastCircleX = estimator_x; + LastCircleY = estimator_y; + CSpiralStatus = Circle; + // Start helix + //dc_Circle(360/Segmente); + } + break; + case Circle: + nav_circle_XY(waypoints[Center].x, waypoints[Center].y, SRad); + // Trigonometrische Berechnung des bereits geflogenen Winkels alpha + // equation: + // alpha = 2 * asin ( |Starting position angular - current positon| / (2* SRad) + // if alphamax already reached, increase radius. + + //DistanceStartEstim = |Starting position angular - current positon| + float DistanceStartEstim = sqrt (((LastCircleX-estimator_x)*(LastCircleX-estimator_x)) + + ((LastCircleY-estimator_y)*(LastCircleY-estimator_y))); + float CircleAlpha = (2.0 * asin (DistanceStartEstim / (2 * SRad))); + if (CircleAlpha >= Alphalimit) { + LastCircleX = estimator_x; + LastCircleY = estimator_y; + CSpiralStatus = IncSpiral; + } + break; + case IncSpiral: + // increasing circle radius as long as it is smaller than max helix radius + if(SRad + IRad < Spiralradius) + { + SRad = SRad + IRad; + /*if (dc_cam_tracing) { + // calculating Camwinkel for camera alignment + TransCurrentZ = estimator_z - ZPoint; + CamAngle = atan(SRad/TransCurrentZ) * 180 / 3.14; + //dc_cam_angle = CamAngle; + }*/ + } + else { + SRad = Spiralradius; + // Stopps DC + //dc_stop(); + } + CSpiralStatus = Circle; + break; + + } + return TRUE; +} diff --git a/sw/airborne/subsystems/navigation/spiral.h b/sw/airborne/subsystems/navigation/spiral.h new file mode 100644 index 0000000000..7eea57cd54 --- /dev/null +++ b/sw/airborne/subsystems/navigation/spiral.h @@ -0,0 +1,11 @@ +#ifndef SPIRAL_H +#define SPIRAL_H + +#include "std.h" + +extern bool_t SpiralNav(void); +extern bool_t InitializeSpiral(uint8_t CenterWP, uint8_t EdgeWP, float StartRad, float IncRad, + float Segments, float ZKoord ); + +#endif + diff --git a/sw/airborne/subsystems/sensors/infrared.c b/sw/airborne/subsystems/sensors/infrared.c index c90784dd89..caa00a1b5d 100644 --- a/sw/airborne/subsystems/sensors/infrared.c +++ b/sw/airborne/subsystems/sensors/infrared.c @@ -23,105 +23,22 @@ */ /** \file subsystems/sensors/infrared.c - * \brief Regroup all functions link to \a ir + * \brief common infrared */ - - - -#include - #include "subsystems/sensors/infrared.h" -#include "mcu_periph/adc.h" - -#include BOARD_CONFIG #include "generated/airframe.h" - -#if defined IR_ESTIMATED_PHI_PI_4 || defined IR_ESTIMATED_PHI_MINUS_PI_4 || defined IR_ESTIMATED_THETA_PI_4 -#error "IR_ESTIMATED_PHI_PI_4 correction has been deprecated. Please remove the definition from your airframe config file" -#endif #ifdef INFRARED #error "The flag INFRARED has been deprecated. Please replace it with USE_INFRARED." #endif -#if defined IR_ADC_ROLL_NEUTRAL || defined IR_ADC_PITCH_NEUTRAL -#error "Neutrals on ROLL and PITCH deprecated. Please define IR_ADC_IR1_NEUTRAL and IR_ADC_IR2_NEUTRAL" -#endif -#ifdef IR_360 -#warning "IR_360 flag deprecated. Now default" -#endif -#ifdef IR_360_LATERAL_CORRECTION -#error "IR_360_LATERAL_CORRECTION now IR_LATERAL_CORRECTION" -#endif - -#ifdef IR_360_LONGITUDINAL_CORRECTION -#error "IR_360_LONGITUDINAL_CORRECTION now IR_LONGITUDINAL_CORRECTION" -#endif - -#ifdef IR_360_VERTICAL_CORRECTION -#error "IR_360_VERTICAL_CORRECTION now IR_VERTICAL_CORRECTION" -#endif - struct Infrared infrared; -#if !defined IR_CORRECTION_LEFT -#define IR_CORRECTION_LEFT 1. -#endif - -#if !defined IR_CORRECTION_RIGHT -#define IR_CORRECTION_RIGHT 1. -#endif - -#if !defined IR_CORRECTION_UP -#define IR_CORRECTION_UP 1. -#endif - -#if !defined IR_CORRECTION_DOWN -#define IR_CORRECTION_DOWN 1. -#endif - -#if ! (defined SITL || defined HITL) -static struct adc_buf buf_ir1; -static struct adc_buf buf_ir2; - -#ifdef ADC_CHANNEL_IR_TOP -static struct adc_buf buf_ir_top; -#endif -#endif - - -#ifndef ADC_CHANNEL_IR_NB_SAMPLES -#define ADC_CHANNEL_IR_NB_SAMPLES DEFAULT_AV_NB_SAMPLE -#endif - -#ifndef IR_LATERAL_CORRECTION -#define IR_LATERAL_CORRECTION 1. -#endif - -#ifndef IR_LONGITUDINAL_CORRECTION -#define IR_LONGITUDINAL_CORRECTION 1. -#endif - -#ifndef IR_VERTICAL_CORRECTION -#define IR_VERTICAL_CORRECTION 1. -#endif - - -/** \brief Initialisation of \a ir */ -/** Initialize \a adc_buf_channel +/** \brief Initialisation of \a ir structure */ -void infrared_init(void) { -#if ! (defined SITL || defined HITL) - adc_buf_channel(ADC_CHANNEL_IR1, &buf_ir1, ADC_CHANNEL_IR_NB_SAMPLES); - adc_buf_channel(ADC_CHANNEL_IR2, &buf_ir2, ADC_CHANNEL_IR_NB_SAMPLES); -#ifdef ADC_CHANNEL_IR_TOP - adc_buf_channel(ADC_CHANNEL_IR_TOP, &buf_ir_top, ADC_CHANNEL_IR_NB_SAMPLES); -#endif -#endif - - - infrared.roll_neutral = RadOfDeg(IR_ROLL_NEUTRAL_DEFAULT); +void infrared_struct_init(void) { + infrared.roll_neutral = RadOfDeg(IR_ROLL_NEUTRAL_DEFAULT); infrared.pitch_neutral = RadOfDeg(IR_PITCH_NEUTRAL_DEFAULT); infrared.correction_left = IR_CORRECTION_LEFT; @@ -133,57 +50,6 @@ void infrared_init(void) { infrared.longitudinal_correction = IR_LONGITUDINAL_CORRECTION; infrared.vertical_correction = IR_VERTICAL_CORRECTION; -#if ! (defined ADC_CHANNEL_IR_TOP || defined HITL || defined SITL) - infrared.top = IR_DEFAULT_CONTRAST; -#endif } -#ifndef IR_IR1_SIGN -#define IR_IR1_SIGN 1 -#endif /* IR_IR1_SIGN */ - -#ifndef IR_IR2_SIGN -#define IR_IR2_SIGN 1 -#endif /* IR_IR2_SIGN */ - -#ifndef IR_TOP_SIGN -#define IR_TOP_SIGN 1 -#endif /* IR_TOP_SIGN */ - -/* Sensor installation */ -#if defined IR_HORIZ_SENSOR_ALIGNED -/* IR1 on the lateral axis, IR2 on the longitudal axis */ -#define IR_RollOfIrs(_ir1, _ir2) (_ir1) -#define IR_PitchOfIrs(_ir1, _ir2) (_ir2) -#elif IR_HORIZ_SENSOR_TILTED -/* IR1 rear-left -- front-right, IR2 rear-right -- front-left - IR1_SIGN and IR2_SIGN give positive values when it's warm on the right side -*/ -#define IR_RollOfIrs(_ir1, _ir2) (_ir1 + _ir2) -#define IR_PitchOfIrs(_ir1, _ir2) (-(_ir1) + _ir2) -#endif - -#ifdef ADC_CHANNEL_IR_TOP -#ifndef IR_TopOfIr -#define IR_TopOfIr(_ir) ((IR_TOP_SIGN)*(_ir)) -#endif -#endif - - -/** \brief Update \a ir_roll and ir_pitch from ADCs or from simulator - * message in HITL and SITL modes - */ -void infrared_update(void) { -#if ! (defined SITL || defined HITL) - infrared.ir1 = (IR_IR1_SIGN)*((int32_t)(buf_ir1.sum/buf_ir1.av_nb_sample) - IR_ADC_IR1_NEUTRAL); - infrared.ir2 = (IR_IR2_SIGN)*((int32_t)(buf_ir2.sum/buf_ir2.av_nb_sample) - IR_ADC_IR2_NEUTRAL); - infrared.roll = infrared.lateral_correction * IR_RollOfIrs(infrared.ir1, infrared.ir2); - infrared.pitch = infrared.longitudinal_correction * IR_PitchOfIrs(infrared.ir1, infrared.ir2); -#ifdef ADC_CHANNEL_IR_TOP - infrared.ir3 = (int32_t)(buf_ir_top.sum/buf_ir_top.av_nb_sample) - IR_ADC_TOP_NEUTRAL; - infrared.top = infrared.vertical_correction * IR_TopOfIr(infrared.ir3); -#endif // IR_TOP -#endif /* !SITL && !HITL */ -/** #else ir_roll set by simulator in sim_ir.c */ -} diff --git a/sw/airborne/subsystems/sensors/infrared.h b/sw/airborne/subsystems/sensors/infrared.h index 60a1baf3c8..f49a9b0187 100644 --- a/sw/airborne/subsystems/sensors/infrared.h +++ b/sw/airborne/subsystems/sensors/infrared.h @@ -27,19 +27,91 @@ #include "std.h" #include "generated/airframe.h" +#include "estimator.h" -struct Infrared { +/* + * Sensor installation + */ + +#ifndef IR_IR1_SIGN +#define IR_IR1_SIGN 1 +#endif /* IR_IR1_SIGN */ + +#ifndef IR_IR2_SIGN +#define IR_IR2_SIGN 1 +#endif /* IR_IR2_SIGN */ + +#ifndef IR_TOP_SIGN +#define IR_TOP_SIGN 1 +#endif /* IR_TOP_SIGN */ + +#if defined IR_HORIZ_SENSOR_ALIGNED +/* IR1 on the lateral axis, IR2 on the longitudal axis */ +#define IR_RollOfIrs(_ir1, _ir2) (_ir1) +#define IR_PitchOfIrs(_ir1, _ir2) (_ir2) +#elif IR_HORIZ_SENSOR_TILTED +/* IR1 rear-left -- front-right, IR2 rear-right -- front-left + IR1_SIGN and IR2_SIGN give positive values when it's warm on the right side +*/ +#define IR_RollOfIrs(_ir1, _ir2) (_ir1 + _ir2) +#define IR_PitchOfIrs(_ir1, _ir2) (-(_ir1) + _ir2) +#endif +/* Vertical sensor, TOP_SIGN gives positice values when it's warm on the bottom */ +#ifndef IR_TopOfIr +#define IR_TopOfIr(_ir) (_ir) +#endif + +/* + * Default correction values + */ + +#ifndef IR_LATERAL_CORRECTION +#define IR_LATERAL_CORRECTION 1. +#endif + +#ifndef IR_LONGITUDINAL_CORRECTION +#define IR_LONGITUDINAL_CORRECTION 1. +#endif + +#ifndef IR_VERTICAL_CORRECTION +#define IR_VERTICAL_CORRECTION 1. +#endif + +#ifndef IR_CORRECTION_LEFT +#define IR_CORRECTION_LEFT 1. +#endif + +#ifndef IR_CORRECTION_RIGHT +#define IR_CORRECTION_RIGHT 1. +#endif + +#ifndef IR_CORRECTION_UP +#define IR_CORRECTION_UP 1. +#endif + +#ifndef IR_CORRECTION_DOWN +#define IR_CORRECTION_DOWN 1. +#endif + +struct Infrared_raw { /* the 3 channels of the sensor */ int16_t ir1; int16_t ir2; int16_t ir3; +}; + +/** Infrared structure */ +struct Infrared { + /* raw infrared values + */ + struct Infrared_raw value; /* neutrals in radians */ float roll_neutral; float pitch_neutral; float pitch_vneutral; - /* roll, pitch, yaw unscaled reading + /* roll, pitch, top unscaled reading */ int16_t roll; int16_t pitch; @@ -61,7 +133,22 @@ struct Infrared { extern struct Infrared infrared; +#define UpdateIRValue(_v) { \ + infrared.value.ir1 = (IR_IR1_SIGN)*_v.ir1; \ + infrared.value.ir2 = (IR_IR2_SIGN)*_v.ir2; \ + infrared.value.ir3 = (IR_TOP_SIGN)*_v.ir3; \ + infrared.roll = infrared.lateral_correction * IR_RollOfIrs(infrared.value.ir1, infrared.value.ir2); \ + infrared.pitch = infrared.longitudinal_correction * IR_PitchOfIrs(infrared.value.ir1, infrared.value.ir2); \ + infrared.top = infrared.vertical_correction * IR_TopOfIr(infrared.value.ir3); \ + estimator_update_state_infrared(); \ +} + +// initialization of the infrared structure +void infrared_struct_init(void); + +// implementation dependent functions void infrared_init(void); void infrared_update(void); +void infrared_event(void); #endif /* SUBSYSTEMS_SENSORS_INFRARED_H */ diff --git a/sw/airborne/subsystems/sensors/infrared_adc.c b/sw/airborne/subsystems/sensors/infrared_adc.c new file mode 100644 index 0000000000..86533aeb67 --- /dev/null +++ b/sw/airborne/subsystems/sensors/infrared_adc.c @@ -0,0 +1,104 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2010 The Paparazzi Team + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +/** \file subsystems/sensors/infrared_adc.c + * \brief Regroup all functions link to ADC \a ir + */ + + + + +#include + +#include "subsystems/sensors/infrared_adc.h" +#include "mcu_periph/adc.h" + +#include BOARD_CONFIG +#include "generated/airframe.h" + +// TODO Specific sim implementation +#if ! (defined SITL || defined HITL) +static struct adc_buf buf_ir1; +static struct adc_buf buf_ir2; + +#ifdef ADC_CHANNEL_IR_TOP +static struct adc_buf buf_ir3; +#endif +#endif + +#ifndef ADC_CHANNEL_IR_NB_SAMPLES +#define ADC_CHANNEL_IR_NB_SAMPLES DEFAULT_AV_NB_SAMPLE +#endif + +struct Infrared_raw ir_adc; + +// Standard infrared implementation +void infrared_init(void) { + infrared_adc_init(); +} + +void infrared_update(void) { + infrared_adc_update(); +} + +/* No event with adc ir */ +void infrared_event(void) {} + +/** \brief Initialisation of \a ir */ +/** Initialize \a adc_buf_channel + */ +void infrared_adc_init(void) { +#if ! (defined SITL || defined HITL) + adc_buf_channel(ADC_CHANNEL_IR1, &buf_ir1, ADC_CHANNEL_IR_NB_SAMPLES); + adc_buf_channel(ADC_CHANNEL_IR2, &buf_ir2, ADC_CHANNEL_IR_NB_SAMPLES); +#ifdef ADC_CHANNEL_IR_TOP + adc_buf_channel(ADC_CHANNEL_IR_TOP, &buf_ir3, ADC_CHANNEL_IR_NB_SAMPLES); +#endif +#endif + + infrared_struct_init(); + +#if ! (defined ADC_CHANNEL_IR_TOP || defined HITL || defined SITL) + ir_adc.ir3 = IR_DEFAULT_CONTRAST; +#endif +} + + +/** \brief Update \a ir_roll and ir_pitch from ADCs or from simulator + * message in HITL and SITL modes + */ +void infrared_adc_update(void) { +#if ! (defined SITL || defined HITL) + ir_adc.ir1 = (int32_t)(buf_ir1.sum/buf_ir1.av_nb_sample) - IR_ADC_IR1_NEUTRAL; + ir_adc.ir2 = (int32_t)(buf_ir2.sum/buf_ir2.av_nb_sample) - IR_ADC_IR2_NEUTRAL; +#ifdef ADC_CHANNEL_IR_TOP + ir_adc.ir3 = (int32_t)(buf_ir3.sum/buf_ir3.av_nb_sample) - IR_ADC_TOP_NEUTRAL; +#endif // IR_TOP +#ifndef IR_ADC_READ_ONLY + UpdateIRValue(ir_adc); +#endif +#endif /* !SITL && !HITL */ +/** #else ir_roll set by simulator in sim_ir.c */ +} + diff --git a/sw/airborne/subsystems/sensors/infrared_adc.h b/sw/airborne/subsystems/sensors/infrared_adc.h new file mode 100644 index 0000000000..74dd729daa --- /dev/null +++ b/sw/airborne/subsystems/sensors/infrared_adc.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2010 ENAC + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +/* + * Driver for adc infrared sensor + */ + +#ifndef SUBSYSTEMS_SENSORS_INFRARED_ADC_H +#define SUBSYSTEMS_SENSORS_INFRARED_ADC_H + +#include "std.h" +#include "subsystems/sensors/infrared.h" + +extern struct Infrared_raw ir_adc; + +extern void infrared_adc_init(void); +extern void infrared_adc_update(void); + +#endif // SUBSYSTEMS_SENSORS_INFRARED_ADC_H + diff --git a/sw/airborne/modules/sensors/infrared_i2c.c b/sw/airborne/subsystems/sensors/infrared_i2c.c similarity index 55% rename from sw/airborne/modules/sensors/infrared_i2c.c rename to sw/airborne/subsystems/sensors/infrared_i2c.c index a6c4520766..40df90406d 100644 --- a/sw/airborne/modules/sensors/infrared_i2c.c +++ b/sw/airborne/subsystems/sensors/infrared_i2c.c @@ -34,102 +34,20 @@ #define IR_START_CONV (1 << 7) -#ifndef IR_IR1_NEUTRAL -#define IR_IR1_NEUTRAL 0 +#ifndef IR_I2C_IR1_NEUTRAL +#define IR_I2C_IR1_NEUTRAL 0 #endif -#ifndef IR_IR2_NEUTRAL -#define IR_IR2_NEUTRAL 0 +#ifndef IR_I2C_IR2_NEUTRAL +#define IR_I2C_IR2_NEUTRAL 0 #endif -#ifndef IR_TOP_NEUTRAL -#define IR_TOP_NEUTRAL 0 +#ifndef IR_I2C_TOP_NEUTRAL +#define IR_I2C_TOP_NEUTRAL 0 #endif -// Standard infrared interface -int16_t ir_ir1; -int16_t ir_ir2; -int16_t ir_roll; -int16_t ir_pitch; -int16_t ir_top; - -#ifndef IR_IR1_SIGN -#define IR_IR1_SIGN 1 -#endif // IR_IR1_SIGN - -#ifndef IR_IR2_SIGN -#define IR_IR2_SIGN 1 -#endif // IR_IR2_SIGN - -#ifndef IR_TOP_SIGN -#define IR_TOP_SIGN 1 -#endif // IR_TOP_SIGN - -float ir_roll_neutral; -float ir_pitch_neutral; - -float ir_correction_left; -float ir_correction_right; -float ir_correction_down; -float ir_correction_up; - -#ifndef IR_CORRECTION_LEFT -#define IR_CORRECTION_LEFT 1. -#endif - -#ifndef IR_CORRECTION_RIGHT -#define IR_CORRECTION_RIGHT 1. -#endif - -#ifndef IR_CORRECTION_UP -#define IR_CORRECTION_UP 1. -#endif - -#ifndef IR_CORRECTION_DOWN -#define IR_CORRECTION_DOWN 1. -#endif - -float ir_lateral_correction; -float ir_longitudinal_correction; -float ir_vertical_correction; - -#ifndef IR_LATERAL_CORRECTION -#define IR_LATERAL_CORRECTION 1. -#endif - -#ifndef IR_LONGITUDINAL_CORRECTION -#define IR_LONGITUDINAL_CORRECTION 1. -#endif - -#ifndef IR_VERTICAL_CORRECTION -#define IR_VERTICAL_CORRECTION 1. -#endif - -/* Sensor installation */ -#if defined IR_HORIZ_SENSOR_ALIGNED -/* IR1 on the lateral axis, IR2 on the longitudal axis */ -#define IR_RollOfIrs(_ir1, _ir2) (_ir1) -#define IR_PitchOfIrs(_ir1, _ir2) (_ir2) -#elif IR_HORIZ_SENSOR_TILTED -/* IR1 rear-left -- front-right, IR2 rear-right -- front-left - IR1_SIGN and IR2_SIGN give positive values when it's warm on the right side -*/ -#define IR_RollOfIrs(_ir1, _ir2) (_ir1 + _ir2) -#define IR_PitchOfIrs(_ir1, _ir2) (-(_ir1) + _ir2) -#endif -/* Vertical sensor, TOP_SIGN gives positice values when it's warm on the bottom */ -#define IR_TopOfIr(_ir) ((IR_TOP_SIGN)*(_ir)) - - - -// Global variables -int16_t ir_i2c_ir1; -int16_t ir_i2c_ir2; -int16_t ir_i2c_top; - -float ir_i2c_phi, ir_i2c_theta; - -bool_t ir_i2c_data_available; +struct Infrared_raw ir_i2c; +bool_t ir_i2c_data_hor_available, ir_i2c_data_ver_available; uint8_t ir_i2c_conf_word; bool_t ir_i2c_conf_hor_done, ir_i2c_conf_ver_done; @@ -149,13 +67,24 @@ static uint8_t ir_i2c_hor_status; // I2C structure struct i2c_transaction irh_trans, irv_trans; -//FIXME standard infrared should not ba ADC-dependent -void ir_init(void) {} +// Standard infrared implementation +void infrared_init(void) { + infrared_i2c_init(); +} + +void infrared_update(void) { + infrared_i2c_update(); +} + +void infrared_event(void) { + infrared_i2cEvent(); +} /** Initialisation */ void infrared_i2c_init( void ) { - ir_i2c_data_available = FALSE; + ir_i2c_data_hor_available = FALSE; + ir_i2c_data_ver_available = FALSE; ir_i2c_hor_status = IR_I2C_IDLE; ir_i2c_conf_word = IR_I2C_DEFAULT_CONF; ir_i2c_conf_hor_done = FALSE; @@ -163,21 +92,9 @@ void infrared_i2c_init( void ) { irh_trans.status = I2CTransDone; irv_trans.status = I2CTransDone; - // Initialisation of standard infrared interface - ir_roll_neutral = RadOfDeg(IR_ROLL_NEUTRAL_DEFAULT); - ir_pitch_neutral = RadOfDeg(IR_PITCH_NEUTRAL_DEFAULT); - - ir_correction_left = IR_CORRECTION_LEFT; - ir_correction_right = IR_CORRECTION_RIGHT; - ir_correction_up = IR_CORRECTION_UP; - ir_correction_down = IR_CORRECTION_DOWN; - - ir_lateral_correction = IR_LATERAL_CORRECTION; - ir_longitudinal_correction = IR_LONGITUDINAL_CORRECTION; - ir_vertical_correction = IR_VERTICAL_CORRECTION; + infrared_struct_init(); } -#include "led.h" void infrared_i2c_update( void ) { #if ! (defined SITL || defined HITL) // IR horizontal @@ -189,7 +106,7 @@ void infrared_i2c_update( void ) { } else { // Read next values I2CReceive(i2c0, irh_trans, IR_HOR_I2C_ADDR, 3); - ir_i2c_data_available = FALSE; + ir_i2c_data_hor_available = FALSE; ir_i2c_hor_status = IR_I2C_READ_IR1; } } @@ -201,7 +118,7 @@ void infrared_i2c_update( void ) { } else { // Read next values I2CReceive(i2c0, irv_trans, IR_VER_I2C_ADDR, 2); - ir_i2c_data_available = FALSE; + ir_i2c_data_ver_available = FALSE; } } #else /* SITL || HITL */ @@ -225,7 +142,8 @@ void infrared_i2c_hor_event( void ) { } // Read IR1 value int16_t ir1 = (irh_trans.buf[0]<<8) | irh_trans.buf[1]; - ir_i2c_ir1 = FilterIR(ir_i2c_ir1, ir1); + ir1 = ir1 - (IR_I2C_IR1_NEUTRAL << ir_i2c_conf_word); + ir_i2c.ir1 = FilterIR(ir_i2c.ir1, ir1); // Select IR2 channel irh_trans.buf[0] = IR_HOR_I2C_SELECT_IR2 | IR_HOR_OC_BIT | ir_i2c_conf_word | IR_START_CONV; I2CTransmit(i2c0, irh_trans, IR_HOR_I2C_ADDR, 1); @@ -243,11 +161,17 @@ void infrared_i2c_hor_event( void ) { break; } int16_t ir2 = (irh_trans.buf[0]<<8) | irh_trans.buf[1]; - ir_i2c_ir2 = FilterIR(ir_i2c_ir2, ir2); + ir2 = ir2 - (IR_I2C_IR2_NEUTRAL << ir_i2c_conf_word); + ir_i2c.ir2 = FilterIR(ir_i2c.ir2, ir2); // Update estimator - ir_i2c_data_available = TRUE; - ir_update(); - estimator_update_state_infrared(); + ir_i2c_data_hor_available = TRUE; +#ifndef IR_I2C_READ_ONLY + if (ir_i2c_data_ver_available) { + ir_i2c_data_hor_available = FALSE; + ir_i2c_data_ver_available = FALSE; + UpdateIRValue(ir_i2c); + } +#endif // Select IR1 channel irh_trans.buf[0] = IR_HOR_I2C_SELECT_IR1 | IR_HOR_OC_BIT | ir_i2c_conf_word | IR_START_CONV; I2CTransmit(i2c0, irh_trans, IR_HOR_I2C_ADDR, 1); @@ -271,11 +195,17 @@ void infrared_i2c_ver_event( void ) { irv_trans.status = I2CTransDone; // Read TOP value if (irv_trans.type == I2CTransRx) { - int16_t top = (irv_trans.buf[0]<<8) | irv_trans.buf[1]; - ir_i2c_top = FilterIR(ir_i2c_top, top); - ir_i2c_data_available = TRUE; - ir_update(); - estimator_update_state_infrared(); + int16_t ir3 = (irv_trans.buf[0]<<8) | irv_trans.buf[1]; + ir3 = ir3 - (IR_I2C_TOP_NEUTRAL << ir_i2c_conf_word); + ir_i2c.ir3 = FilterIR(ir_i2c.ir3, ir3); + ir_i2c_data_ver_available = TRUE; +#ifndef IR_I2C_READ_ONLY + if (ir_i2c_data_hor_available) { + ir_i2c_data_hor_available = FALSE; + ir_i2c_data_ver_available = FALSE; + UpdateIRValue(ir_i2c); + } +#endif } if (irv_trans.type == I2CTransTx) { ir_i2c_conf_ver_done = TRUE; @@ -283,34 +213,3 @@ void infrared_i2c_ver_event( void ) { #endif /* !SITL && !HITL */ } -#include "stdio.h" - -void ir_update(void) { - ir_ir1 = (IR_IR1_SIGN)*(ir_i2c_ir1 - (IR_IR1_NEUTRAL << ir_i2c_conf_word)); - ir_ir2 = (IR_IR2_SIGN)*(ir_i2c_ir2 - (IR_IR2_NEUTRAL << ir_i2c_conf_word)); - ir_roll = ir_lateral_correction * IR_RollOfIrs(ir_ir1, ir_ir2); - ir_pitch = ir_longitudinal_correction * IR_PitchOfIrs(ir_ir1, ir_ir2); - ir_top = ir_vertical_correction * IR_TopOfIr(ir_i2c_top - (IR_TOP_NEUTRAL << ir_i2c_conf_word)); -} - -void estimator_update_state_infrared(void) { - - estimator_phi = atan2(ir_roll, ir_top) - ir_roll_neutral; - estimator_theta = atan2(ir_pitch, ir_top) - ir_pitch_neutral; - - if (estimator_theta < -M_PI_2) - estimator_theta += M_PI; - else if (estimator_theta > M_PI_2) - estimator_theta -= M_PI; - - if (estimator_phi >= 0) - estimator_phi *= ir_correction_right; - else - estimator_phi *= ir_correction_left; - - if (estimator_theta >= 0) - estimator_theta *= ir_correction_up; - else - estimator_theta *= ir_correction_down; - -} diff --git a/sw/airborne/subsystems/sensors/infrared_i2c.h b/sw/airborne/subsystems/sensors/infrared_i2c.h new file mode 100644 index 0000000000..855e186424 --- /dev/null +++ b/sw/airborne/subsystems/sensors/infrared_i2c.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2010 ENAC + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +/* + * Driver for i2c infrared sensor + */ + +#ifndef SUBSYSTEMS_SENSORS_INFRARED_I2C_H +#define SUBSYSTEMS_SENSORS_INFRARED_I2C_H + +#include "std.h" +#include "generated/airframe.h" +#include "subsystems/sensors/infrared.h" +#include "mcu_periph/i2c.h" + +extern struct Infrared_raw ir_i2c; +extern bool_t ir_i2c_data_hor_available, ir_i2c_data_ver_available; +extern uint8_t ir_i2c_conf_word; +extern bool_t ir_i2c_conf_hor_done, ir_i2c_conf_ver_done; + +extern struct i2c_transaction irh_trans, irv_trans; + +extern void infrared_i2c_init( void ); +extern void infrared_i2c_update( void ); +extern void infrared_i2c_hor_event( void ); +extern void infrared_i2c_ver_event( void ); + +#define infrared_i2cEvent() { \ + if (irh_trans.status == I2CTransSuccess) infrared_i2c_hor_event(); \ + if (irv_trans.status == I2CTransSuccess) infrared_i2c_ver_event(); \ +} + +#define infrared_i2cDownlink() DOWNLINK_SEND_DEBUG_IR_I2C(DefaultChannel, &ir_i2c.ir1, &ir_i2c.ir2, &ir_i2c.ir3) + +#define infrared_i2c_SetConfWord(_v) { \ + ir_i2c_conf_hor_done = FALSE; \ + ir_i2c_conf_ver_done = FALSE; \ + ir_i2c_conf_word = _v; \ +} + +#endif // SUBSYSTEMS_SENSORS_INFRARED_I2C_H diff --git a/sw/airborne/test/nova_test_imu.c b/sw/airborne/test/nova_test_imu.c index e3a764b1e2..35f6a89d5e 100644 --- a/sw/airborne/test/nova_test_imu.c +++ b/sw/airborne/test/nova_test_imu.c @@ -1,10 +1,10 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "interrupt_hw.h" #include "sys_time.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" @@ -25,7 +25,7 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); @@ -35,7 +35,7 @@ static inline void main_init( void ) { ADS8344_init(); - int_enable(); + mcu_int_enable(); ADS8344_start(); } diff --git a/sw/airborne/test/test_esc_mkk_simple.c b/sw/airborne/test/test_esc_mkk_simple.c index bc0f778bca..232890665a 100644 --- a/sw/airborne/test/test_esc_mkk_simple.c +++ b/sw/airborne/test/test_esc_mkk_simple.c @@ -22,7 +22,7 @@ */ -#include "mcuw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" diff --git a/sw/airborne/test/test_geodetic.c b/sw/airborne/test/test_geodetic.c index 4e017bdb30..9d04e24b60 100644 --- a/sw/airborne/test/test_geodetic.c +++ b/sw/airborne/test/test_geodetic.c @@ -28,7 +28,7 @@ static void test_ned_to_ecef_to_ned(void); static void test_enu_to_ecef_to_enu( void ); /* - * toulouse 43.6052765, 1.4427764, 180.123019274324 -> 4624497.0 116475.0 4376563.0 + * toulouse lat 43.6052765, lon 1.4427764, alt 180.123019274324 -> x 4624497.0 y 116475.0 z 4376563.0 */ int main(int argc, char** argv) { @@ -152,11 +152,11 @@ static void test_enu_of_ecef_int(void) { M_OF_CM((double)my_enu_point_i.z)); #endif - FLOAT_T ex = my_enu_point_f.x - M_OF_CM((double)my_enu_point_i.x); + float ex = my_enu_point_f.x - M_OF_CM((double)my_enu_point_i.x); if (fabs(ex) > max_err.x) max_err.x = fabs(ex); - FLOAT_T ey = my_enu_point_f.y - M_OF_CM((double)my_enu_point_i.y); + float ey = my_enu_point_f.y - M_OF_CM((double)my_enu_point_i.y); if (fabs(ey) > max_err.y) max_err.y = fabs(ey); - FLOAT_T ez = my_enu_point_f.z - M_OF_CM((double)my_enu_point_i.z); + float ez = my_enu_point_f.z - M_OF_CM((double)my_enu_point_i.z); if (fabs(ez) > max_err.z) max_err.z = fabs(ez); sum_err += ex*ex + ey*ey + ez*ez; } diff --git a/sw/airborne/test/test_telemetry.c b/sw/airborne/test/test_telemetry.c index 81c1c64e29..bd2760fc7f 100644 --- a/sw/airborne/test/test_telemetry.c +++ b/sw/airborne/test/test_telemetry.c @@ -22,7 +22,8 @@ */ #include BOARD_CONFIG -#include "init_hw.h" +#include "mcu.h" +#include "mcu_periph/uart.h" #include "interrupt_hw.h" #include "sys_time.h" #include "downlink.h" @@ -41,9 +42,9 @@ int main(void) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic( void ) { diff --git a/sw/airborne/xbee.h b/sw/airborne/xbee.h index fa6f3e8870..28b8493047 100644 --- a/sw/airborne/xbee.h +++ b/sw/airborne/xbee.h @@ -57,20 +57,15 @@ extern uint8_t xbee_ovrn, xbee_error; #define XBEE_MY_ADDR AC_ID void xbee_init( void ); -#define __XBeeLink(dev, _x) dev##_x -#define _XBeeLink(dev, _x) __XBeeLink(dev, _x) -#define XBeeLink(_x) _XBeeLink(XBEE_UART, _x) +#define __Link(dev, _x) dev##_x +#define _Link(dev, _x) __Link(dev, _x) +#define Link(_x) _Link(DOWNLINK_DEVICE, _x) -#define XBeeBuffer() XBeeLink(ChAvailable()) -#define ReadXBeeBuffer() { while (XBeeLink(ChAvailable())&&!xbee_msg_received) parse_xbee(XBeeLink(Getch())); } - -#define XBeePrintString(s) XBeeLink(PrintString(s)) -#define XBeePrintHex16(x) XBeeLink(PrintHex16(x)) -#define XBeeTransportPut1Byte(x) XBeeLink(Transmit(x)) -#define XBeeTransportCheckFreeSpace(x) XBeeLink(CheckFreeSpace(x)) +#define XBeeTransportPut1Byte(x) Link(Transmit(x)) +#define XBeeTransportCheckFreeSpace(x) Link(CheckFreeSpace(x)) /* 5 = Start + len_msb + len_lsb + API_id + checksum */ #define XBeeAPISizeOf(_x) (_x+5) -#define XBeeTransportSendMessage() XBeeLink(SendMessage()) +#define XBeeTransportSendMessage() Link(SendMessage()) #define XBeeTransportPutUint8(_x) { \ xbee_cs += _x; \ @@ -225,4 +220,14 @@ static inline void xbee_parse_payload(void) { } } +#define __XBeeLink(dev, _x) dev##_x +#define _XBeeLink(dev, _x) __XBeeLink(dev, _x) +#define XBeeLink(_x) _XBeeLink(XBEE_UART, _x) + +#define XBeeBuffer() XBeeLink(ChAvailable()) +#define ReadXBeeBuffer() { while (XBeeLink(ChAvailable())&&!xbee_msg_received) parse_xbee(XBeeLink(Getch())); } + +#define XBeePrintString(s) XBeeLink(PrintString(s)) +#define XBeePrintHex16(x) XBeeLink(PrintHex16(x)) + #endif /* XBEE_H */ diff --git a/sw/ground_segment/cockpit/compass.ml b/sw/ground_segment/cockpit/compass.ml index 43aeac96bd..2a0b62f7c8 100644 --- a/sw/ground_segment/cockpit/compass.ml +++ b/sw/ground_segment/cockpit/compass.ml @@ -113,10 +113,9 @@ let draw = fun (da_object:Gtk_tools.pixmap_in_drawin_area) desired_course course (*********************** Main ************************************************) let _ = - let ivy_bus = ref "127.255.255.255:2010" in - + let ivy_bus = ref Defivybus.default_ivy_bus in Arg.parse - [ "-b", Arg.String (fun x -> ivy_bus := x), "Bus\tDefault is 127.255.255.255:2010"] + [ "-b", Arg.String (fun x -> ivy_bus := x), (sprintf " Default is %s" !ivy_bus)] (fun x -> prerr_endline ("WARNING: don't do anything with "^x)) "Usage: "; diff --git a/sw/ground_segment/cockpit/gcs.ml b/sw/ground_segment/cockpit/gcs.ml index c2d765dd60..22a147a0f4 100644 --- a/sw/ground_segment/cockpit/gcs.ml +++ b/sw/ground_segment/cockpit/gcs.ml @@ -320,7 +320,7 @@ let keys_help = fun () -> (***************** MAIN ******************************************************) -let ivy_bus = ref "127.255.255.255:2010" +let ivy_bus = ref Defivybus.default_ivy_bus and geo_ref = ref "" and map_files = ref [] and center = ref "" @@ -340,7 +340,7 @@ and srtm = ref false let options = [ "-auto_ortho", Arg.Set auto_ortho, "IGN tiles path"; - "-b", Arg.String (fun x -> ivy_bus := x), "Bus\tDefault is 127.255.255.25:2010"; + "-b", Arg.String (fun x -> ivy_bus := x),(sprintf " Default is %s" !ivy_bus); "-center", Arg.Set_string center, "Initial map center (e.g. 'WGS84 43.605 1.443')"; "-center_ac", Arg.Set auto_center_new_ac, "Centers the map on any new A/C"; "-edit", Arg.Unit (fun () -> edit := true; layout_file := "editor.xml"), "Flight plan editor"; diff --git a/sw/ground_segment/cockpit/live.ml b/sw/ground_segment/cockpit/live.ml index 6b357416d1..1f33553984 100644 --- a/sw/ground_segment/cockpit/live.ml +++ b/sw/ground_segment/cockpit/live.ml @@ -1039,7 +1039,8 @@ let listen_flight_params = fun geomap auto_center_new_ac alert alt_graph -> end else if agl > 25. then ac.ground_prox <- false; try - draw_altgraph alt_graph geomap aircrafts + if not (alt_graph#drawing_area#misc#parent = None) then + draw_altgraph alt_graph geomap aircrafts with _ -> () in @@ -1157,11 +1158,11 @@ let listen_flight_params = fun geomap auto_center_new_ac alert alt_graph -> let label = Pprz.string_assoc "ap_mode" vs in ac.strip#set_label "AP" (if label="MANUAL" then "MANU" else label); let color = - match ap_mode with - "AUTO2" -> ok_color - | "AUTO1" -> "#10F0E0" - | "MANUAL" -> warning_color - | _ -> alert_color in + match ap_mode with + "AUTO2" | "NAV" -> ok_color + | "AUTO1" | "R_RCC" | "A_RCC" | "ATT_C" | "R_ZH" | "A_ZH" | "HOVER" | "HOV_C" | "H_ZH" -> "#10F0E0" + | "MANUAL" | "RATE" | "ATT" -> warning_color + | _ -> alert_color in ac.strip#set_color "AP" color; end; let gps_mode = Pprz.string_assoc "gps_mode" vs in diff --git a/sw/ground_segment/joystick/Makefile b/sw/ground_segment/joystick/Makefile index a82d224c96..7c56f9f226 100644 --- a/sw/ground_segment/joystick/Makefile +++ b/sw/ground_segment/joystick/Makefile @@ -26,7 +26,7 @@ Q=@ OCAMLC = ocamlc OCAMLLIB = ../../lib/ocaml TOOLSDIR = ../../tools -OCAMLINCLUDES= -I $(OCAMLLIB) -I +lablgtk2 -I +xml-light -I $(TOOLSDIR) +OCAMLINCLUDES= -I $(OCAMLLIB) $(shell ocamlfind query -r -i-format lablgtk2) $(shell ocamlfind query -r -i-format xml-light) -I $(TOOLSDIR) LIBPPRZCMA=$(OCAMLLIB)/lib-pprz.cma all: test_stick input2ivy diff --git a/sw/ground_segment/joystick/input2ivy.ml b/sw/ground_segment/joystick/input2ivy.ml index 65b2ebeb36..df2a3b8fcb 100644 --- a/sw/ground_segment/joystick/input2ivy.ml +++ b/sw/ground_segment/joystick/input2ivy.ml @@ -2,7 +2,7 @@ * $Id$ * * Forwarding events from an USB input device to the ivy bus - * + * * Copyright (C) 2009 ENAC, Pascal Brisset * * This file is part of paparazzi. @@ -20,7 +20,7 @@ * You should have received a copy of the GNU General Public License * along with paparazzi; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Boston, MA 02111-1307, USA. * *) @@ -117,7 +117,7 @@ let hash_index_of_blocks = fun ac_name -> List.iter (fun block -> Hashtbl.add index_of_blocks - (Xml.attrib block "name") + (Xml.attrib block "name") (ExtXml.int_attrib block "no")) (Xml.children blocks) @@ -135,15 +135,15 @@ let eval_settings_and_blocks = fun field_descr expr -> let rec loop = function Syntax.Call ("IndexOfEnum", [Syntax.Ident enum]) -> begin try Syntax.Int (rank enum field_descr.Pprz.enum) with - Not_found -> failwith (sprintf "IndexOfEnum: unknown value '%s'" enum) + Not_found -> failwith (sprintf "IndexOfEnum: unknown value '%s'" enum) end | Syntax.Call ("IndexOfSetting", [Syntax.Ident var]) -> begin try Syntax.Int (Hashtbl.find index_of_settings var) with - Not_found -> failwith (sprintf "IndexOfSetting: unknown var '%s'" var) + Not_found -> failwith (sprintf "IndexOfSetting: unknown var '%s'" var) end | Syntax.Call ("IndexOfBlock", [Syntax.Ident name]) -> begin try Syntax.Int (Hashtbl.find index_of_blocks name) with - Not_found -> failwith (sprintf "IndexOfBlock: unknown block '%s'" name) + Not_found -> failwith (sprintf "IndexOfBlock: unknown block '%s'" name) end | Syntax.Call (ident, exprs) | Syntax.CallOperator (ident, exprs) -> Syntax.Call (ident, List.map loop exprs) @@ -157,12 +157,12 @@ let parse_input = fun input -> let name = Xml.attrib x "name" and index = ExtXml.int_attrib x "index" in let value = - match Xml.tag x with - "axis" -> + match Xml.tag x with + "axis" -> let deadband = try ExtXml.int_attrib x "deadband" with _ -> 0 in Axis (index, deadband) - | "button" -> Button index - | _ -> failwith "parse_input: unexepcted tag" in + | "button" -> Button index + | _ -> failwith "parse_input: unexepcted tag" in (name, value)) (Xml.children input) @@ -240,17 +240,17 @@ let eval_call = fun f args -> let eval_expr = fun buttons axis inputs expr -> let rec eval = function Syntax.Ident ident -> - let input = my_assoc ident inputs in - eval_input buttons axis input + let input = my_assoc ident inputs in + eval_input buttons axis input | Syntax.Int int -> int | Syntax.Float float -> failwith "eval_expr: float" | Syntax.Call (ident, exprs) | Syntax.CallOperator (ident, exprs) -> - eval_call ident (List.map eval exprs) + eval_call ident (List.map eval exprs) | Syntax.Index _ -> failwith "eval_expr: index" | Syntax.Field _ -> failwith "eval_expr: Field" in eval expr - + (** Store for the last sent values: msg_name->values *) let last_values = Hashtbl.create 5 @@ -269,7 +269,7 @@ let execute_action = fun ac_id inputs buttons axis message -> (fun (name, expr) -> (name, Pprz.Int (eval_expr buttons axis inputs expr))) message.fields - and on_event = + and on_event = match message.on_event with None -> true | Some expr -> eval_expr buttons axis inputs expr <> 0 in @@ -296,7 +296,7 @@ let print_inputs = fun nb_buttons buttons axis -> fprintf stderr "%d:%d " i (eval_input buttons axis (Axis (i, 0))) done; fprintf stderr "\n%!" - + (** Get the values from the input values and send messages *) let execute_actions = fun actions ac_id -> @@ -305,7 +305,7 @@ let execute_actions = fun actions ac_id -> if !verbose then print_inputs nb_buttons buttons axis; - + List.iter (execute_action ac_id actions.inputs buttons axis) actions.messages with exc -> prerr_endline (Printexc.to_string exc) @@ -314,14 +314,14 @@ let execute_actions = fun actions ac_id -> (************************************* MAIN **********************************) let () = - let ivy_bus = ref "127.255.255.255:2010" in +let ivy_bus = ref Defivybus.default_ivy_bus in let device_name = ref "" and ac_name = ref "MYAC" and xml_descr = ref "" in let anon_fun = (fun x -> xml_descr := x) in - let speclist = - [ "-b", Arg.String (fun x -> ivy_bus := x), "Bus\tDefault is 127.255.255.255:2010"; + let speclist = + [ "-b", Arg.String (fun x -> ivy_bus := x),(sprintf " Default is %s" !ivy_bus); "-ac", Arg.Set_string ac_name, ""; "-d", Arg.Set_string device_name, ""; "-v", Arg.Set verbose, "Verbose mode (useful to identify the channels of an input device)"; @@ -351,8 +351,7 @@ let () = Ivy.start !ivy_bus; ignore (Glib.Timeout.add actions.period_ms (fun () -> execute_actions actions ac_id; true)); - + (** Start the main loop *) let loop = Glib.Main.create true in while Glib.Main.is_running loop do ignore (Glib.Main.iteration true) done - diff --git a/sw/ground_segment/tmtc/150m.ml b/sw/ground_segment/tmtc/150m.ml index c340af1e9c..db16831947 100644 --- a/sw/ground_segment/tmtc/150m.ml +++ b/sw/ground_segment/tmtc/150m.ml @@ -61,7 +61,7 @@ let get_gps_message = fun label _sender vs -> (********************************* Main *********************************************) let () = - let ivy_bus = ref "127.255.255.255:2010" in + let ivy_bus = Defivybus.default_ivy_bus in (** Connect to the Ivy bus *) Ivy.init "Paparazzi 150m" "READY" (fun _ _ -> ()); diff --git a/sw/ground_segment/tmtc/Makefile b/sw/ground_segment/tmtc/Makefile index 9eb2547cec..72824e30df 100644 --- a/sw/ground_segment/tmtc/Makefile +++ b/sw/ground_segment/tmtc/Makefile @@ -48,7 +48,7 @@ OCAMLNETCMA=$(shell ocamlfind query -r -a-format -predicates byte netstring) INCLUDES= -I $(OCAMLLIB) -I ../multimon $(shell ocamlfind query -r -i-format lablgtk2) $(shell ocamlfind query -r -i-format xml-light) $(OCAMLNETINCLUDES) LIBPPRZCMA=$(OCAMLLIB)/lib-pprz.cma -SERVERCMO = server_globals.cmo aircraft.cmo wind.cmo airprox.cmo kml.cmo fw_server.ml booz_server.ml server.cmo +SERVERCMO = server_globals.cmo aircraft.cmo wind.cmo airprox.cmo kml.cmo fw_server.ml rotorcraft_server.ml server.cmo SERVERCMX = $(SERVERCMO:.cmo=.cmx) $(VAR)/boa.conf :$(CONF)/boa.conf @@ -112,10 +112,6 @@ diadec : diadec.cmo ../multimon/multimon.cma $(Q)$(OCAMLC) -custom $(INCLUDES) -o $@ unix.cma str.cma xml-light.cma lablgtk.cma glibivy-ocaml.cma lib-pprz.cma multimon.cma $^ -booz_translator : booz_translator.cmo ../../lib/ocaml/lib-pprz.cma - @echo OL $@ - $(Q)$(OCAMLC) -custom $(INCLUDES) -o $@ unix.cma str.cma xml-light.cma lablgtk.cma glibivy-ocaml.cma lib-pprz.cma booz_translator.cmo - 150m : 150m.cmo @echo OL $@ $(Q)$(OCAMLC) -custom $(INCLUDES) -o $@ unix.cma str.cma xml-light.cma lablgtk.cma glibivy-ocaml.cma lib-pprz.cma gtkInit.cmo $^ diff --git a/sw/ground_segment/tmtc/aircraft.ml b/sw/ground_segment/tmtc/aircraft.ml index dbc3118ca9..2d1c320df1 100644 --- a/sw/ground_segment/tmtc/aircraft.ml +++ b/sw/ground_segment/tmtc/aircraft.ml @@ -70,6 +70,11 @@ type nav_ref = | Utm of Latlong.utm | Ltp of Latlong.ecef +type vehicle_type = + FixedWing + | Rotorcraft + | UnknownVehicleType + let add_pos_to_nav_ref = fun nav_ref ?(z = 0.) (x, y) -> let rec lat_of_xy = fun lat last geo (_x, _y) n e -> if n > 0 && abs_float (lat -. last) > e then @@ -92,6 +97,7 @@ let add_pos_to_nav_ref = fun nav_ref ?(z = 0.) (x, y) -> type waypoint = { altitude : float; wp_geo : Latlong.geographic } type aircraft = { + mutable vehicle_type : vehicle_type; id : string; name : string; flight_plan : Xml.xml; @@ -150,7 +156,7 @@ let max_nb_dl_setting_values = 256 (** indexed iwth an uint8 (messages.xml) *) let new_aircraft = fun id name fp airframe -> let svsinfo_init = Array.init gps_nb_channels (fun _ -> svinfo_init ()) in - { id = id ; name = name; flight_plan = fp; airframe = airframe; + { vehicle_type = UnknownVehicleType; id = id; name = name; flight_plan = fp; airframe = airframe; pos = { Latlong.posn_lat = 0.; posn_long = 0. }; unix_time = 0.; itow = Int32.of_int 0; roll = 0.; pitch = 0.; diff --git a/sw/ground_segment/tmtc/aircraft.mli b/sw/ground_segment/tmtc/aircraft.mli index f043e7f0c5..c4df220c03 100644 --- a/sw/ground_segment/tmtc/aircraft.mli +++ b/sw/ground_segment/tmtc/aircraft.mli @@ -54,11 +54,17 @@ type nav_ref = | Utm of Latlong.utm | Ltp of Latlong.ecef +type vehicle_type = + FixedWing + | Rotorcraft + | UnknownVehicleType + val add_pos_to_nav_ref : nav_ref -> ?z:float -> (float * float) -> Latlong.geographic type waypoint = { altitude : float; wp_geo : Latlong.geographic } type aircraft = { + mutable vehicle_type : vehicle_type; id : string; name : string; flight_plan : Xml.xml; diff --git a/sw/ground_segment/tmtc/broadcaster.ml b/sw/ground_segment/tmtc/broadcaster.ml index 42a0520062..720c1f636c 100644 --- a/sw/ground_segment/tmtc/broadcaster.ml +++ b/sw/ground_segment/tmtc/broadcaster.ml @@ -1,8 +1,8 @@ open Printf let () = - let ivy_bus = ref "127.255.255.255:2010" in - + let ivy_bus = ref Defivybus.default_ivy_bus in + let port = ref 4242 and ivy_from = ref "DL" and ivy_to = ref "TM" in diff --git a/sw/ground_segment/tmtc/dia.ml b/sw/ground_segment/tmtc/dia.ml index 9cfe6501b4..691e7dd189 100644 --- a/sw/ground_segment/tmtc/dia.ml +++ b/sw/ground_segment/tmtc/dia.ml @@ -89,7 +89,7 @@ let fp_msg = fun _sender vs -> let _ = - let ivy_bus = ref "127.255.255.255:2010" + let ivy_bus = ref Defivybus.default_ivy_bus and port = ref "/dev/dsp" in let options = [ "-b", Arg.Set_string ivy_bus, (sprintf " Default is %s" !ivy_bus); diff --git a/sw/ground_segment/tmtc/fw_server.ml b/sw/ground_segment/tmtc/fw_server.ml index ce4a4fe2ba..4c1a4f7467 100644 --- a/sw/ground_segment/tmtc/fw_server.ml +++ b/sw/ground_segment/tmtc/fw_server.ml @@ -187,7 +187,8 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values -> a.bat <- fvalue "vsupply" /. 10.; a.fbw.rc_rate <- ivalue "frame_rate" | "PPRZ_MODE" -> - a.ap_mode <- check_index (ivalue "ap_mode") ap_modes "AP_MODE"; + a.vehicle_type <- FixedWing; + a.ap_mode <- check_index (ivalue "ap_mode") fixedwing_ap_modes "AP_MODE"; a.gaz_mode <- check_index (ivalue "ap_gaz") gaz_modes "AP_GAZ"; a.lateral_mode <- check_index (ivalue "ap_lateral") lat_modes "AP_LAT"; a.horizontal_mode <- check_index (ivalue "ap_horizontal") horiz_modes "AP_HORIZ"; diff --git a/sw/ground_segment/tmtc/ihm.ml b/sw/ground_segment/tmtc/ihm.ml index 65ace6c35d..2b3a9c10f2 100644 --- a/sw/ground_segment/tmtc/ihm.ml +++ b/sw/ground_segment/tmtc/ihm.ml @@ -271,7 +271,9 @@ let listen = fun () -> (*** Options ***) -let ivy_bus = ref "127.255.255.255:2010" + +let ivy_bus = Defivybus.default_ivy_bus + let options = [ "-b", Arg.String (fun x -> ivy_bus := x), (Printf.sprintf "Bus\tDefault is %s" !ivy_bus)] diff --git a/sw/ground_segment/tmtc/ivy2udp.ml b/sw/ground_segment/tmtc/ivy2udp.ml index 1501d37ee8..e54b41a663 100644 --- a/sw/ground_segment/tmtc/ivy2udp.ml +++ b/sw/ground_segment/tmtc/ivy2udp.ml @@ -33,7 +33,7 @@ module PprzTransport = Serial.Transport(Pprz.Transport) open Printf let () = - let ivy_bus = ref "127.255.255.255:2010" in + let ivy_bus = ref Defivybus.default_ivy_bus in let host = ref "85.214.48.162" and port = ref 4242 and datalink_port = ref 4243 diff --git a/sw/ground_segment/tmtc/ivy_tcp_aircraft.ml b/sw/ground_segment/tmtc/ivy_tcp_aircraft.ml index f18689efd7..083902273b 100644 --- a/sw/ground_segment/tmtc/ivy_tcp_aircraft.ml +++ b/sw/ground_segment/tmtc/ivy_tcp_aircraft.ml @@ -5,7 +5,7 @@ module PprzTransport = Serial.Transport(Pprz.Transport) open Printf let () = - let ivy_bus = ref "127.255.255.255:2010" in + let ivy_bus = ref Defivybus.default_ivy_bus in let host = ref "10.31.1.98" and port = ref 4242 and id = ref "6" in diff --git a/sw/ground_segment/tmtc/ivy_tcp_controller.ml b/sw/ground_segment/tmtc/ivy_tcp_controller.ml index 87358de8b8..9b346beaea 100644 --- a/sw/ground_segment/tmtc/ivy_tcp_controller.ml +++ b/sw/ground_segment/tmtc/ivy_tcp_controller.ml @@ -6,7 +6,7 @@ module PprzTransport = Serial.Transport(Pprz.Transport) let () = let host = ref "10.31.1.98" - and ivy_bus = ref "127.255.255.255:2010" in + and ivy_bus = ref Defivybus.default_ivy_bus in let port = ref 4243 in let options = [ diff --git a/sw/ground_segment/tmtc/kml.ml b/sw/ground_segment/tmtc/kml.ml index e3b36ac49b..8b0fc9aeef 100644 --- a/sw/ground_segment/tmtc/kml.ml +++ b/sw/ground_segment/tmtc/kml.ml @@ -259,10 +259,15 @@ let update_ac = fun ac -> else sprintf "http://%s:%d/var/%s/flight_plan.kml" !hostname !port ac.name in + let ap_mode = match ac.vehicle_type with + Rotorcraft -> rotorcraft_ap_modes.(ac.ap_mode) + | FixedWing -> fixedwing_ap_modes.(ac.ap_mode) + | UnknownVehicleType -> "UNK" + in let blocks = ExtXml.child ac.flight_plan "blocks" in let block = ExtXml.child blocks (string_of_int ac.cur_block) in let block_name = ExtXml.attrib block "name" in - let description = sprintf "%s: %s\nBat: %.1fV\nAGL: %.0fm\nSpeed: %.1fm/s" ap_modes.(ac.ap_mode) block_name ac.bat ac.agl ac.gspeed in + let description = sprintf "%s: %s\nBat: %.1fV\nAGL: %.0fm\nSpeed: %.1fm/s" ap_mode block_name ac.bat ac.agl ac.gspeed in let change = change_placemark ~description ac.name ac.pos ac.alt in let kml_changes = link_update url_flight_plan [change] in print_xml ac.name "ac_changes.kml" kml_changes diff --git a/sw/ground_segment/tmtc/link.ml b/sw/ground_segment/tmtc/link.ml index 426da505c3..e6689f1740 100644 --- a/sw/ground_segment/tmtc/link.ml +++ b/sw/ground_segment/tmtc/link.ml @@ -423,7 +423,7 @@ let send_ping_msg = fun device -> (** Main *********************************************************************) let () = - let ivy_bus = ref "127.255.255.255:2010" + let ivy_bus = ref Defivybus.default_ivy_bus and port = ref "/dev/ttyUSB0" and baudrate = ref "9600" and transport = ref "pprz" diff --git a/sw/ground_segment/tmtc/messages.ml b/sw/ground_segment/tmtc/messages.ml index 476347aa68..8d657693db 100644 --- a/sw/ground_segment/tmtc/messages.ml +++ b/sw/ground_segment/tmtc/messages.ml @@ -183,12 +183,14 @@ let rec one_class = fun (notebook:GPack.notebook) (ident, xml_class, sender) -> List.iter (fun m -> ignore (one_page sender_name class_name class_notebook bind m)) messages + + (*********************** Main ************************************************) let _ = - let ivy_bus = ref "127.255.255.255:2010" in + let ivy_bus = ref Defivybus.default_ivy_bus in let classes = ref ["telemetry:*"] in Arg.parse - [ "-b", Arg.String (fun x -> ivy_bus := x), "Bus\tDefault is 127.255.255.255:2010"; + [ "-b", Arg.String (fun x -> ivy_bus := x), (sprintf " Default is %s" !ivy_bus); "-c", Arg.String (fun x -> classes := x :: !classes), "class name"] (fun x -> prerr_endline ("WARNING: don't do anything with "^x)) "Usage: "; diff --git a/sw/ground_segment/tmtc/booz_server.ml b/sw/ground_segment/tmtc/rotorcraft_server.ml similarity index 95% rename from sw/ground_segment/tmtc/booz_server.ml rename to sw/ground_segment/tmtc/rotorcraft_server.ml index a076cb9d27..7217143aac 100644 --- a/sw/ground_segment/tmtc/booz_server.ml +++ b/sw/ground_segment/tmtc/rotorcraft_server.ml @@ -1,7 +1,5 @@ (* - * $Id: fw_server.ml,v 1.1 2009/03/22 17:53:48 hecto Exp $ - * - * Server part specific to booz vehicles + * Server part specific to rotorcraft vehicles * * Copyright (C) ENAC * @@ -97,12 +95,13 @@ let update_waypoint = fun ac wp_id p alt -> Not_found -> Hashtbl.add ac.waypoints wp_id new_wp -let get_pprz_mode = fun ap_mode -> +(*let get_pprz_mode = fun ap_mode -> let mode = ref 0 in if ap_mode = 0 || ap_mode = 1 || ap_mode = 2 || ap_mode = 4 || ap_mode = 7 then mode := 0 (* MANUAL *) else if ap_mode = 3 || ap_mode = 5 || ap_mode = 6 || ap_mode = 8 then mode := 1 (* AUTO1 *) else if ap_mode = 9 || ap_mode = 10 || ap_mode = 11 || ap_mode = 12 then mode := 2; (* AUTO2 *) !mode +*) let get_rc_status = fun rc_status -> let status = ref "" in @@ -178,13 +177,14 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values -> (*a.unix_time <- LL.unix_time_of_tow (truncate (fvalue "itow" /. 1000.)); a.itow <- Int32.of_float (fvalue "itow");*) a.flight_time <- ivalue "flight_time"; - if a.gspeed > 3. && a.ap_mode = _AUTO2 then - Wind.update ac_name a.gspeed a.course + (*if a.gspeed > 3. && a.ap_mode = _AUTO2 then + Wind.update ac_name a.gspeed a.course*) | "ROTORCRAFT_STATUS" -> + a.vehicle_type <- Rotorcraft; a.fbw.rc_status <- get_rc_status (ivalue "rc_status"); a.fbw.rc_rate <- ivalue "frame_rate"; a.gps_mode <- check_index (ivalue "gps_status") gps_modes "GPS_MODE"; - a.ap_mode <- check_index (get_pprz_mode (ivalue "ap_mode")) ap_modes "BOOZ_AP_MODE"; + a.ap_mode <- check_index (ivalue "ap_mode") rotorcraft_ap_modes "ROTORCRAFT_AP_MODE"; a.kill_mode <- ivalue "ap_motors_on" == 0; a.bat <- fvalue "vsupply" /. 10.; | "INS_REF" -> diff --git a/sw/ground_segment/tmtc/booz_server.mli b/sw/ground_segment/tmtc/rotorcraft_server.mli similarity index 89% rename from sw/ground_segment/tmtc/booz_server.mli rename to sw/ground_segment/tmtc/rotorcraft_server.mli index 14fc8f6fc8..9cbf3fdc0f 100644 --- a/sw/ground_segment/tmtc/booz_server.mli +++ b/sw/ground_segment/tmtc/rotorcraft_server.mli @@ -1,7 +1,5 @@ (* - * $Id: fw_server.mli,v 1.1 2009/03/22 17:53:48 hecto Exp $ - * - * Server part specific to booz vehicles + * Server part specific to rotorcraft vehicles * * Copyright (C) ENAC * diff --git a/sw/ground_segment/tmtc/server.ml b/sw/ground_segment/tmtc/server.ml index a66e209bad..747b63dccb 100644 --- a/sw/ground_segment/tmtc/server.ml +++ b/sw/ground_segment/tmtc/server.ml @@ -52,6 +52,12 @@ let srtm_path = Env.paparazzi_home // "data" // "srtm" let get_indexed_value = fun t i -> if i >= 0 then t.(i) else "UNK" +let modes_of_type = fun vt -> + match vt with + FixedWing -> fixedwing_ap_modes + | Rotorcraft -> rotorcraft_ap_modes + | UnknownVehicleType -> [| |] + (** The aircrafts store *) let aircrafts = Hashtbl.create 3 @@ -64,12 +70,25 @@ let send_aircrafts_msg = fun _asker _values -> let names = String.concat "," (Hashtbl.fold (fun k _v r -> k::r) aircrafts []) ^ "," in ["ac_list", Pprz.String names] + +let expand_aicraft x = + let ac_name = ExtXml.attrib x "name" in + try + Env.expand_ac_xml x + with Failure msg -> + begin + prerr_endline ("A failure occurred while processing aircraft '"^ac_name^"'"); + prerr_endline "Please remove it from 'conf.xml' or fix its parameter(s)"; + flush stderr; + failwith msg + end + let make_element = fun t a c -> Xml.Element (t,a,c) let log_xml = fun timeofday data_file -> let conf_children = List.map - (fun x -> if Xml.tag x = "aircraft" then Env.expand_ac_xml x else x) + (fun x -> if Xml.tag x = "aircraft" then expand_aicraft x else x) (Xml.children conf_xml) in let expanded_conf = make_element (Xml.tag conf_xml) (Xml.attribs conf_xml) conf_children in make_element @@ -122,7 +141,7 @@ let ac_msg = fun messages_xml logging ac_name ac -> let msg = Tele_Pprz.message_of_id msg_id in log ?timestamp logging ac_name msg.Pprz.name values; Fw_server.log_and_parse ac_name ac msg values; - Booz_server.log_and_parse ac_name ac msg values + Rotorcraft_server.log_and_parse ac_name ac msg values with Telemetry_error (ac_name, msg) -> Ground_Pprz.message_send my_id "TELEMETRY_ERROR" ["ac_id", Pprz.String ac_name;"message", Pprz.String msg]; @@ -342,7 +361,7 @@ let send_aircraft_msg = fun ac -> "energy", Pprz.Int a.energy] in Ground_Pprz.message_send my_id "ENGINE_STATUS" values; - let ap_mode = get_indexed_value ap_modes a.ap_mode in + let ap_mode = get_indexed_value (modes_of_type a.vehicle_type) a.ap_mode in let gaz_mode = get_indexed_value gaz_modes a.gaz_mode in let lat_mode = get_indexed_value lat_modes a.lateral_mode in let horiz_mode = get_indexed_value horiz_modes a.horizontal_mode in @@ -652,7 +671,7 @@ let ground_to_uplink = fun logging -> (* main loop *) let () = - let ivy_bus = ref "127.255.255.255:2010" + let ivy_bus = ref Defivybus.default_ivy_bus and logging = ref true and http = ref false in diff --git a/sw/ground_segment/tmtc/server_globals.ml b/sw/ground_segment/tmtc/server_globals.ml index 0255bca0b1..029a66bb68 100644 --- a/sw/ground_segment/tmtc/server_globals.ml +++ b/sw/ground_segment/tmtc/server_globals.ml @@ -3,7 +3,8 @@ exception Telemetry_error of string * string let hostname = ref "localhost" (** FIXME: Should be read from messages.xml *) -let ap_modes = [|"MANUAL";"AUTO1";"AUTO2";"HOME";"NOGPS"|] +let fixedwing_ap_modes = [|"MANUAL";"AUTO1";"AUTO2";"HOME";"NOGPS"|] +let rotorcraft_ap_modes = [|"SAFE";"KILL";"RATE";"ATT";"R_RCC";"A_RCC";"ATT_C";"R_ZH";"A_ZH";"HOVER";"HOV_C";"H_ZH";"NAV"|] let _AUTO2 = 2 let gaz_modes = [|"MANUAL";"GAZ";"CLIMB";"ALT"|] let lat_modes = [|"MANUAL";"ROLL_RATE";"ROLL";"COURSE"|] diff --git a/sw/ground_segment/tmtc/settings.ml b/sw/ground_segment/tmtc/settings.ml index 73642add5b..f7725daa01 100644 --- a/sw/ground_segment/tmtc/settings.ml +++ b/sw/ground_segment/tmtc/settings.ml @@ -23,6 +23,7 @@ * Boston, MA 02111-1307, USA. * *) +open Printf module Ground_Pprz = Pprz.Messages(struct let name = "ground" end) module Tele_Pprz = Pprz.Messages(struct let name = "telemetry" end) @@ -78,10 +79,11 @@ let one_ac = fun (notebook:GPack.notebook) ac_name -> let _ = - let ivy_bus = ref "127.255.255.255:2010" in + + let ivy_bus = ref Defivybus.default_ivy_bus in let acs = ref [] in Arg.parse - [ "-b", Arg.String (fun x -> ivy_bus := x), "Bus\tDefault is 127.255.255.255:2010"; + [ "-b", Arg.String (fun x -> ivy_bus := x), (sprintf " Default is %s" !ivy_bus); "-ac", Arg.String (fun x -> acs := x :: !acs), "A/C name"] (fun x -> prerr_endline ("WARNING: don't do anything with "^x)) "Usage: "; diff --git a/sw/ground_segment/tmtc/stereo_demod.ml b/sw/ground_segment/tmtc/stereo_demod.ml index be2d05deb5..740fc66bd7 100644 --- a/sw/ground_segment/tmtc/stereo_demod.ml +++ b/sw/ground_segment/tmtc/stereo_demod.ml @@ -112,7 +112,7 @@ let send_modem_msg = fun status -> (* main loop *) let _ = - let ivy_bus = ref "127.255.255.255:2010" in + let ivy_bus = Defivybus.default_ivy_bus in let port = ref "/dev/dsp" in let options = [ "-b", Arg.Set_string ivy_bus, (sprintf "Ivy bus (%s)" !ivy_bus); diff --git a/sw/ground_segment/visu3d/Makefile b/sw/ground_segment/visu3d/Makefile index 4bf6b5a338..707d9f2684 100644 --- a/sw/ground_segment/visu3d/Makefile +++ b/sw/ground_segment/visu3d/Makefile @@ -1,7 +1,7 @@ OCAMLOPT0 = ocamlopt -OCAMLC = ocamlc -I +xml-light +OCAMLC = ocamlc $(shell ocamlfind query -r -i-format xml-light) -MLFLAGS = -I +lablgtk2 -I +lablGL -I +camlimages -I ../../lib/ocaml +MLFLAGS = $(shell ocamlfind query -r -i-format lablGL) $(shell ocamlfind query -r -i-format lablgtk2) $(shell ocamlfind query -r -i-format camlimages) -I ../../lib/ocaml OCAMLOPT = $(OCAMLOPT0) $(OCAMLOPT_OPTIONS) diff --git a/sw/ground_segment/visu3d/mapGL.ml b/sw/ground_segment/visu3d/mapGL.ml index f93e3b68c6..4ecfd04286 100644 --- a/sw/ground_segment/visu3d/mapGL.ml +++ b/sw/ground_segment/visu3d/mapGL.ml @@ -511,11 +511,11 @@ let build_interface = fun map_file mission_file -> (* = Programme principal = *) (* ========================================================================= *) let _ = - let ivy_bus = ref "127.255.255.255:2010" and + let ivy_bus = Defivybus.default_ivy_bus and map_file = ref "" and mission_file = ref "" in let options = - [ "-b", Arg.String (fun x -> ivy_bus := x), "Bus\tDefault is 127.255.255.25:2010"; + [ "-b", Arg.String (fun x -> ivy_bus := x), (sprintf " Default is %s" !ivy_bus); "-m", Arg.String (fun x -> map_file := x), "Map description file"; "-f", Arg.String (fun x -> mission_file := x), "Mission description file"] in Arg.parse (options) diff --git a/sw/in_progress/button/Makefile b/sw/in_progress/button/Makefile index ab2a4195aa..73b93e66ae 100644 --- a/sw/in_progress/button/Makefile +++ b/sw/in_progress/button/Makefile @@ -25,7 +25,7 @@ Q=@ OCAMLC = ocamlc OCAMLOPT = ocamlopt -INCLUDES= -I +xml-light -I +lablgtk2 -I ../../lib/ocaml +INCLUDES= $(shell ocamlfind query -r -i-format xml-light) $(shell ocamlfind query -r -i-format lablgtk2) -I ../../lib/ocaml all: panic diff --git a/sw/in_progress/pow/InstallCert.java b/sw/in_progress/pow/InstallCert.java deleted file mode 100644 index f979cc7868..0000000000 --- a/sw/in_progress/pow/InstallCert.java +++ /dev/null @@ -1,188 +0,0 @@ - -/* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of Sun Microsystems nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/** - * @see http://blogs.sun.com/gc/entry/unable_to_find_valid_certification - */ -import java.io.*; - -import java.security.*; -import java.security.cert.*; - -import javax.net.ssl.*; - -public class InstallCert { - - public static void main(String[] args) throws Exception { - String host; - int port; - char[] passphrase; - if ((args.length == 1) || (args.length == 2)) { - String[] c = args[0].split(":"); - host = c[0]; - port = (c.length == 1) ? 443 : Integer.parseInt(c[1]); - String p = (args.length == 1) ? "changeit" : args[1]; - passphrase = p.toCharArray(); - } else { - System.out.println("Usage: java InstallCert [:port] [passphrase]"); - return; - } - - File file = new File("jssecacerts"); - if (file.isFile() == false) { - char SEP = File.separatorChar; - File dir = new File(System.getProperty("java.home") + SEP - + "lib" + SEP + "security"); - file = new File(dir, "jssecacerts"); - if (file.isFile() == false) { - file = new File(dir, "cacerts"); - } - } - System.out.println("Loading KeyStore " + file + "..."); - InputStream in = new FileInputStream(file); - KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); - ks.load(in, passphrase); - in.close(); - - SSLContext context = SSLContext.getInstance("TLS"); - TrustManagerFactory tmf = - TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - tmf.init(ks); - X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0]; - SavingTrustManager tm = new SavingTrustManager(defaultTrustManager); - context.init(null, new TrustManager[] {tm}, null); - SSLSocketFactory factory = context.getSocketFactory(); - - System.out.println("Opening connection to " + host + ":" + port + "..."); - SSLSocket socket = (SSLSocket)factory.createSocket(host, port); - socket.setSoTimeout(10000); - try { - System.out.println("Starting SSL handshake..."); - socket.startHandshake(); - socket.close(); - System.out.println(); - System.out.println("No errors, certificate is already trusted"); - } catch (SSLException e) { - System.out.println(); - e.printStackTrace(System.out); - } - - X509Certificate[] chain = tm.chain; - if (chain == null) { - System.out.println("Could not obtain server certificate chain"); - return; - } - - BufferedReader reader = - new BufferedReader(new InputStreamReader(System.in)); - - System.out.println(); - System.out.println("Server sent " + chain.length + " certificate(s):"); - System.out.println(); - MessageDigest sha1 = MessageDigest.getInstance("SHA1"); - MessageDigest md5 = MessageDigest.getInstance("MD5"); - for (int i = 0; i < chain.length; i++) { - X509Certificate cert = chain[i]; - System.out.println - (" " + (i + 1) + " Subject " + cert.getSubjectDN()); - System.out.println(" Issuer " + cert.getIssuerDN()); - sha1.update(cert.getEncoded()); - System.out.println(" sha1 " + toHexString(sha1.digest())); - md5.update(cert.getEncoded()); - System.out.println(" md5 " + toHexString(md5.digest())); - System.out.println(); - } - - System.out.println("Enter certificate to add to trusted keystore or 'q' to quit: [1]"); - String line = reader.readLine().trim(); - int k; - try { - k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1; - } catch (NumberFormatException e) { - System.out.println("KeyStore not changed"); - return; - } - - X509Certificate cert = chain[k]; - String alias = host + "-" + (k + 1); - ks.setCertificateEntry(alias, cert); - - OutputStream out = new FileOutputStream("jssecacerts"); - ks.store(out, passphrase); - out.close(); - - System.out.println(); - System.out.println(cert); - System.out.println(); - System.out.println - ("Added certificate to keystore 'jssecacerts' using alias '" - + alias + "'"); - } - - private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray(); - - private static String toHexString(byte[] bytes) { - StringBuilder sb = new StringBuilder(bytes.length * 3); - for (int b : bytes) { - b &= 0xff; - sb.append(HEXDIGITS[b >> 4]); - sb.append(HEXDIGITS[b & 15]); - sb.append(' '); - } - return sb.toString(); - } - - private static class SavingTrustManager implements X509TrustManager { - - private final X509TrustManager tm; - private X509Certificate[] chain; - - SavingTrustManager(X509TrustManager tm) { - this.tm = tm; - } - - public X509Certificate[] getAcceptedIssuers() { - throw new UnsupportedOperationException(); - } - - public void checkClientTrusted(X509Certificate[] chain, String authType) - throws CertificateException { - throw new UnsupportedOperationException(); - } - - public void checkServerTrusted(X509Certificate[] chain, String authType) - throws CertificateException { - this.chain = chain; - tm.checkServerTrusted(chain, authType); - } - } - -} diff --git a/sw/in_progress/pow/ServletPow/InstallCert.java b/sw/in_progress/pow/ServletPow/InstallCert.java deleted file mode 100644 index f979cc7868..0000000000 --- a/sw/in_progress/pow/ServletPow/InstallCert.java +++ /dev/null @@ -1,188 +0,0 @@ - -/* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of Sun Microsystems nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/** - * @see http://blogs.sun.com/gc/entry/unable_to_find_valid_certification - */ -import java.io.*; - -import java.security.*; -import java.security.cert.*; - -import javax.net.ssl.*; - -public class InstallCert { - - public static void main(String[] args) throws Exception { - String host; - int port; - char[] passphrase; - if ((args.length == 1) || (args.length == 2)) { - String[] c = args[0].split(":"); - host = c[0]; - port = (c.length == 1) ? 443 : Integer.parseInt(c[1]); - String p = (args.length == 1) ? "changeit" : args[1]; - passphrase = p.toCharArray(); - } else { - System.out.println("Usage: java InstallCert [:port] [passphrase]"); - return; - } - - File file = new File("jssecacerts"); - if (file.isFile() == false) { - char SEP = File.separatorChar; - File dir = new File(System.getProperty("java.home") + SEP - + "lib" + SEP + "security"); - file = new File(dir, "jssecacerts"); - if (file.isFile() == false) { - file = new File(dir, "cacerts"); - } - } - System.out.println("Loading KeyStore " + file + "..."); - InputStream in = new FileInputStream(file); - KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); - ks.load(in, passphrase); - in.close(); - - SSLContext context = SSLContext.getInstance("TLS"); - TrustManagerFactory tmf = - TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - tmf.init(ks); - X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0]; - SavingTrustManager tm = new SavingTrustManager(defaultTrustManager); - context.init(null, new TrustManager[] {tm}, null); - SSLSocketFactory factory = context.getSocketFactory(); - - System.out.println("Opening connection to " + host + ":" + port + "..."); - SSLSocket socket = (SSLSocket)factory.createSocket(host, port); - socket.setSoTimeout(10000); - try { - System.out.println("Starting SSL handshake..."); - socket.startHandshake(); - socket.close(); - System.out.println(); - System.out.println("No errors, certificate is already trusted"); - } catch (SSLException e) { - System.out.println(); - e.printStackTrace(System.out); - } - - X509Certificate[] chain = tm.chain; - if (chain == null) { - System.out.println("Could not obtain server certificate chain"); - return; - } - - BufferedReader reader = - new BufferedReader(new InputStreamReader(System.in)); - - System.out.println(); - System.out.println("Server sent " + chain.length + " certificate(s):"); - System.out.println(); - MessageDigest sha1 = MessageDigest.getInstance("SHA1"); - MessageDigest md5 = MessageDigest.getInstance("MD5"); - for (int i = 0; i < chain.length; i++) { - X509Certificate cert = chain[i]; - System.out.println - (" " + (i + 1) + " Subject " + cert.getSubjectDN()); - System.out.println(" Issuer " + cert.getIssuerDN()); - sha1.update(cert.getEncoded()); - System.out.println(" sha1 " + toHexString(sha1.digest())); - md5.update(cert.getEncoded()); - System.out.println(" md5 " + toHexString(md5.digest())); - System.out.println(); - } - - System.out.println("Enter certificate to add to trusted keystore or 'q' to quit: [1]"); - String line = reader.readLine().trim(); - int k; - try { - k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1; - } catch (NumberFormatException e) { - System.out.println("KeyStore not changed"); - return; - } - - X509Certificate cert = chain[k]; - String alias = host + "-" + (k + 1); - ks.setCertificateEntry(alias, cert); - - OutputStream out = new FileOutputStream("jssecacerts"); - ks.store(out, passphrase); - out.close(); - - System.out.println(); - System.out.println(cert); - System.out.println(); - System.out.println - ("Added certificate to keystore 'jssecacerts' using alias '" - + alias + "'"); - } - - private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray(); - - private static String toHexString(byte[] bytes) { - StringBuilder sb = new StringBuilder(bytes.length * 3); - for (int b : bytes) { - b &= 0xff; - sb.append(HEXDIGITS[b >> 4]); - sb.append(HEXDIGITS[b & 15]); - sb.append(' '); - } - return sb.toString(); - } - - private static class SavingTrustManager implements X509TrustManager { - - private final X509TrustManager tm; - private X509Certificate[] chain; - - SavingTrustManager(X509TrustManager tm) { - this.tm = tm; - } - - public X509Certificate[] getAcceptedIssuers() { - throw new UnsupportedOperationException(); - } - - public void checkClientTrusted(X509Certificate[] chain, String authType) - throws CertificateException { - throw new UnsupportedOperationException(); - } - - public void checkServerTrusted(X509Certificate[] chain, String authType) - throws CertificateException { - this.chain = chain; - tm.checkServerTrusted(chain, authType); - } - } - -} diff --git a/sw/in_progress/pow/ServletPow/JARLIB/commons-codec-1.4.jar b/sw/in_progress/pow/ServletPow/JARLIB/commons-codec-1.4.jar deleted file mode 100755 index 458d432da8..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/commons-codec-1.4.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/commons-fileupload-1.2.1.jar b/sw/in_progress/pow/ServletPow/JARLIB/commons-fileupload-1.2.1.jar deleted file mode 100755 index aa209b3887..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/commons-fileupload-1.2.1.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/commons-httpclient-3.1.jar b/sw/in_progress/pow/ServletPow/JARLIB/commons-httpclient-3.1.jar deleted file mode 100755 index 7c59774aed..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/commons-httpclient-3.1.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/commons-io-1.4.jar b/sw/in_progress/pow/ServletPow/JARLIB/commons-io-1.4.jar deleted file mode 100755 index 133dc6cb35..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/commons-io-1.4.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/commons-logging-1.1.1.jar b/sw/in_progress/pow/ServletPow/JARLIB/commons-logging-1.1.1.jar deleted file mode 100755 index 8758a96b70..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/commons-logging-1.1.1.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/ivy-1.2.13.jar b/sw/in_progress/pow/ServletPow/JARLIB/ivy-1.2.13.jar deleted file mode 100755 index be51c0e1f0..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/ivy-1.2.13.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/jakarta-regexp-1.5.jar b/sw/in_progress/pow/ServletPow/JARLIB/jakarta-regexp-1.5.jar deleted file mode 100755 index 652bc822c9..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/jakarta-regexp-1.5.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/jdom.jar b/sw/in_progress/pow/ServletPow/JARLIB/jdom.jar deleted file mode 100755 index 65a1b3f737..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/jdom.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/log4j-1.2.16.jar b/sw/in_progress/pow/ServletPow/JARLIB/log4j-1.2.16.jar deleted file mode 100755 index 3f9d847618..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/log4j-1.2.16.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/mysql-connector-java-5.1.12-bin.jar b/sw/in_progress/pow/ServletPow/JARLIB/mysql-connector-java-5.1.12-bin.jar deleted file mode 100755 index af5847eed4..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/mysql-connector-java-5.1.12-bin.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/pushlet.jar b/sw/in_progress/pow/ServletPow/JARLIB/pushlet.jar deleted file mode 100755 index 6dc1c22e21..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/pushlet.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/pushletclient.jar b/sw/in_progress/pow/ServletPow/JARLIB/pushletclient.jar deleted file mode 100755 index c699b8b25f..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/pushletclient.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/rome-1.0.jar b/sw/in_progress/pow/ServletPow/JARLIB/rome-1.0.jar deleted file mode 100755 index 7138baaca1..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/rome-1.0.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/serializer.jar b/sw/in_progress/pow/ServletPow/JARLIB/serializer.jar deleted file mode 100755 index de9b007b4c..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/serializer.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/servlet-api.jar b/sw/in_progress/pow/ServletPow/JARLIB/servlet-api.jar deleted file mode 100755 index a71c371333..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/servlet-api.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/JARLIB/xerces.jar b/sw/in_progress/pow/ServletPow/JARLIB/xerces.jar deleted file mode 100755 index e9fe08ad45..0000000000 Binary files a/sw/in_progress/pow/ServletPow/JARLIB/xerces.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/ServletPow.war b/sw/in_progress/pow/ServletPow/ServletPow.war deleted file mode 100755 index 0888047d40..0000000000 Binary files a/sw/in_progress/pow/ServletPow/ServletPow.war and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/jk.load b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/jk.load deleted file mode 100755 index 841cf3d0c2..0000000000 --- a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/jk.load +++ /dev/null @@ -1,6 +0,0 @@ -LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so - -JkWorkersFile /etc/apache2/workers.properties -JkLogFile /var/log/apache2/mod_jk.log -JkLogLevel debug -JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " diff --git a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/php5.conf b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/php5.conf deleted file mode 100755 index 9152fe14f6..0000000000 --- a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/php5.conf +++ /dev/null @@ -1,20 +0,0 @@ - -AddType application/x-httpd-php .php .phtml .php3 -AddType application/x-httpd-php-source .phps - - - - SetHandler application/x-httpd-php - - - SetHandler application/x-httpd-php-source - - # To re-enable php in user directories comment the following lines - # (from to .) Do NOT set it to On as it - # prevents .htaccess files from disabling it. - - - php_admin_value engine Off - - - diff --git a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/php5.load b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/php5.load deleted file mode 100755 index 0d6a55eb43..0000000000 --- a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/php5.load +++ /dev/null @@ -1 +0,0 @@ -LoadModule php5_module /usr/lib/apache2/modules/libphp5.so \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/ssl.conf b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/ssl.conf deleted file mode 100755 index 1e4ce40c44..0000000000 --- a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/ssl.conf +++ /dev/null @@ -1,64 +0,0 @@ - -# -# Pseudo Random Number Generator (PRNG): -# Configure one or more sources to seed the PRNG of the SSL library. -# The seed data should be of good random quality. -# WARNING! On some platforms /dev/random blocks if not enough entropy -# is available. This means you then cannot use the /dev/random device -# because it would lead to very long connection times (as long as -# it requires to make more entropy available). But usually those -# platforms additionally provide a /dev/urandom device which doesn't -# block. So, if available, use this one instead. Read the mod_ssl User -# Manual for more details. -# -SSLRandomSeed startup builtin -SSLRandomSeed startup file:/dev/urandom 512 -SSLRandomSeed connect builtin -SSLRandomSeed connect file:/dev/urandom 512 - -## -## SSL Global Context -## -## All SSL configuration in this context applies both to -## the main server and all SSL-enabled virtual hosts. -## - -# -# Some MIME-types for downloading Certificates and CRLs -# -AddType application/x-x509-ca-cert .crt -AddType application/x-pkcs7-crl .crl - -# Pass Phrase Dialog: -# Configure the pass phrase gathering process. -# The filtering dialog program (`builtin' is a internal -# terminal dialog) has to provide the pass phrase on stdout. -SSLPassPhraseDialog builtin - -# Inter-Process Session Cache: -# Configure the SSL Session Cache: First the mechanism -# to use and second the expiring timeout (in seconds). -#SSLSessionCache dbm:/var/run/apache2/ssl_scache -SSLSessionCache shmcb:/var/run/apache2/ssl_scache(512000) -SSLSessionCacheTimeout 300 - -# Semaphore: -# Configure the path to the mutual exclusion semaphore the -# SSL engine uses internally for inter-process synchronization. -SSLMutex file:/var/run/apache2/ssl_mutex - -# SSL Cipher Suite: -# List the ciphers that the client is permitted to negotiate. -# See the mod_ssl documentation for a complete list. -# enable only secure ciphers: -SSLCipherSuite HIGH:MEDIUM:!ADH -# Use this instead if you want to allow cipher upgrades via SGC facility. -# In this case you also have to use something like -# SSLRequire %{SSL_CIPHER_USEKEYSIZE} >= 128 -# see http://httpd.apache.org/docs/2.2/ssl/ssl_howto.html.en#upgradeenc -#SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL - -# enable only secure protocols: SSLv3 and TLSv1, but not SSLv2 -SSLProtocol all -SSLv2 - - diff --git a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/ssl.load b/sw/in_progress/pow/ServletPow/conf apache2/mods_available/ssl.load deleted file mode 100755 index ff861daab5..0000000000 --- a/sw/in_progress/pow/ServletPow/conf apache2/mods_available/ssl.load +++ /dev/null @@ -1 +0,0 @@ -LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so diff --git a/sw/in_progress/pow/ServletPow/conf apache2/ports.conf b/sw/in_progress/pow/ServletPow/conf apache2/ports.conf deleted file mode 100755 index 7830895dc0..0000000000 --- a/sw/in_progress/pow/ServletPow/conf apache2/ports.conf +++ /dev/null @@ -1,23 +0,0 @@ -# If you just change the port or add more ports here, you will likely also -# have to change the VirtualHost statement in -# /etc/apache2/sites-enabled/000-default -# This is also true if you have upgraded from before 2.2.9-3 (i.e. from -# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and -# README.Debian.gz - -#NameVirtualHost *:80 -Listen 80 - - - # If you add NameVirtualHost *:443 here, you will also have to change - # the VirtualHost statement in /etc/apache2/sites-available/default-ssl - # to - # Server Name Indication for SSL named virtual hosts is currently not - # supported by MSIE on Windows XP. - Listen 443 - - - - Listen 443 - - diff --git a/sw/in_progress/pow/ServletPow/conf apache2/sites-available/default b/sw/in_progress/pow/ServletPow/conf apache2/sites-available/default deleted file mode 100755 index 0559ce148e..0000000000 --- a/sw/in_progress/pow/ServletPow/conf apache2/sites-available/default +++ /dev/null @@ -1,42 +0,0 @@ -NameVirtualHost *:80 - - ServerAdmin webmaster@localhost - - DocumentRoot /var/www - - Options FollowSymLinks - AllowOverride None - - - Options Indexes FollowSymLinks MultiViews - AllowOverride None - Order allow,deny - allow from all - - - ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ - - AllowOverride None - Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch - Order allow,deny - Allow from all - - - ErrorLog /var/log/apache2/error.log - - # Possible values include: debug, info, notice, warn, error, crit, - # alert, emerg. - LogLevel warn - - CustomLog /var/log/apache2/access.log combined - - Alias /doc/ "/usr/share/doc/" - - Options Indexes MultiViews FollowSymLinks - AllowOverride None - Order deny,allow - Deny from all - Allow from 127.0.0.0/255.0.0.0 ::1/128 - - - diff --git a/sw/in_progress/pow/ServletPow/conf apache2/sites-available/powV2_ssl b/sw/in_progress/pow/ServletPow/conf apache2/sites-available/powV2_ssl deleted file mode 100755 index 7a4efcaca3..0000000000 --- a/sw/in_progress/pow/ServletPow/conf apache2/sites-available/powV2_ssl +++ /dev/null @@ -1,42 +0,0 @@ - -NameVirtualHost *:443 - - - ServerAdmin admin@pow.fr - ServerName blanc - - LogLevel warn - - CustomLog /var/log/apache2/access.log combined - ServerSignature On - - SSLEngine on - SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP - #SSLCertificateFile /etc/ssl/private/serveur.cert - #SSLCertificateKeyFile /etc/ssl/private/serveur.key - #SSLCACertificateFile /etc/ssl/private/ca-root.cert - SSLCertificateFile /etc/ssl/server.crt - SSLCertificateKeyFile /etc/ssl/server.key - SSLCACertificatePath /etc/ssl - -#SSLVerifyClient optional_no_ca -#SSLOptions +ExportCertData +StdEnvVars - SetEnvIf User-Agent ".*MSIE.*" \ - nokeepalive ssl-unclean-shutdown \ - downgrade-1.0 force-response-1.0 - - JkExtractSSL On - JkOptions +FlushPackets - JkOptions +FlushHeader - JkMount /ServletPow worker1 - JkMount /ServletPow/* worker1 - JkMount /examples/* worker1 - JkMount /examples worker1 - -#Redirect https://www.recherche.enac.fr/TestServletPow https://www.recherche.enac.fr/evaluation/TestServletPow - - - - - - diff --git a/sw/in_progress/pow/ServletPow/conf apache2/workers.properties b/sw/in_progress/pow/ServletPow/conf apache2/workers.properties deleted file mode 100755 index 996a10559b..0000000000 --- a/sw/in_progress/pow/ServletPow/conf apache2/workers.properties +++ /dev/null @@ -1,9 +0,0 @@ -workers.tomcat_home=/users/genin/apache-tomcat-6.0.26 - -workers.java_home=/usr/lib/jvm/java-6-sun -ps=/ -worker.list=worker1 -worker.worker1.port=8009 -worker.worker1.host=localhost -worker.worker1.type=ajp13 -worker.worker1.lbfactor=1 diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.classpath b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.classpath deleted file mode 100755 index fd0f78ce42..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.classpath +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.project b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.project deleted file mode 100755 index 3470d17f2e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.project +++ /dev/null @@ -1,36 +0,0 @@ - - - ServletPow - - - - - - org.eclipse.wst.jsdt.core.javascriptValidator - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.wst.validation.validationbuilder - - - - - - org.eclipse.jem.workbench.JavaEMFNature - org.eclipse.wst.common.modulecore.ModuleCoreNature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.jdt.core.javanature - org.eclipse.wst.jsdt.core.jsNature - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/.jsdtscope b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/.jsdtscope deleted file mode 100755 index bbb8e68be8..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/.jsdtscope +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.jdt.core.prefs b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.jdt.core.prefs deleted file mode 100755 index 420b6fb9b2..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -#Tue Apr 20 15:09:25 CEST 2010 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.common.component b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.common.component deleted file mode 100755 index 72dafadb28..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.common.component +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.common.project.facet.core.xml b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.common.project.facet.core.xml deleted file mode 100755 index 53d628c892..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.common.project.facet.core.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.jsdt.ui.superType.container b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.jsdt.ui.superType.container deleted file mode 100755 index 3bd5d0a480..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.jsdt.ui.superType.container +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.jsdt.ui.superType.name b/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.jsdt.ui.superType.name deleted file mode 100755 index 05bd71b6ec..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/.settings/org.eclipse.wst.jsdt.ui.superType.name +++ /dev/null @@ -1 +0,0 @@ -Window \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/design.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/design.css deleted file mode 100755 index c982ac6974..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/design.css +++ /dev/null @@ -1,220 +0,0 @@ -body -{ - background-color: #CCFFCC; - margin: 0%; - padding: 0%; - outline: 0%; - height: 100%; - overflow:hidden; - max-width:2048px; - font-size : 11; -} - -select{ - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; - vertical-align: middle; - background-color: #F5F5DC; -} -input { - background-color:#F5F5DC; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 10px; -} - -label { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -#welcome -{ - position:absolute; - top:0; - left:0; - height:3%; - width: 100%; - background-color: #EEEEEE; - text-align: center; - font-weight:bold; - font-size : 12; -} -#usr -{ - position:absolute; - top:0; - right:6%; - height:3%; - width:25%; - background-color: #EEEEEE; - text-align: right; - white-space:nowrap; -} -#page -{ -position:absolute; -top:3%; -left:0; -height:97%; -width: 100%; -} - - -#choicePanel{ - position:absolute; - top:0%; - left:0%; - height: 13%; - width : 15%; - background-color: #EEEEEE; - border: 1px solid black; -} - -#aircraftSelector -{ - text-align: center; - background-color: #EEEEEE; -} - -#trackdiv -{ - text-align: center; - background-color: #EEEEEE; - -moz-border-radius: 7px 7px 7px 7px; - -webkit-border-radius: 7px 7px 7px 7px; - border-radius: 7px 7px 7px 7px; - -webkit-border-top-left-radius: 7px; /* pour Chrome */ - -webkit-border-top-right-radius: 7px; /* pour Chrome */ - -webkit-border-bottom-left-radius: 7px; /* pour Chrome */ - -webkit-border-bottom-right-radius: 7px; /* pour Chrome */ - width: 140px; - color: white; - vertical-align:middle; -} - -#active_block -{ - font-size:11; - text-align: center; -} - -#FlightPlan -{ - overflow:auto; - position:absolute; - top:0%; - left:15%; - height: 40%; - width : 14.9%; - background-color: #EEEEEE; - border: 1px solid black; -} - -#FlightParams -{ - position:absolute; - top:13%; - left :0% - text-align: center; - height: 27%; - width : 14.9%; - border: 1px solid black; - background-color: #EEEEEE; -} - -#map_canvas -{ - position:absolute; - top:0; - left:30%; - width:70%; - height: 95%; - border:1px solid black; -} - - -#Settings -{ - overflow:auto; - position:absolute; - left:0%; - top:40%; - text-align: left; - height: 55%; - width: 29.9%; - background-color: #EEEEEE; - border: 1px solid black; -} - -#page_setting { - -} - -#setting { - width: 400px; - height: 250px; - padding: 0.5em; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 8; -} -#param -{ - overflow:auto; -} - -#NewsDiv -{ - position:absolute; - overflow:auto; - left:0%; - top:95%; - height: 5%; - width: 100%; - text-align: left; - vertical-align:top; - background-color: #EEEEEE; - border: 1px solid black; -} - -#info -{ - text-align: left; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -#Debug -{ - overflow:auto; - position:absolute; - left:65%; - top:50%; - text-align: center; - height: 50%; - width: 35%; - background-color: #EEEEEE; - border: 1px solid black; - padding-top:20px; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -#title{ - font-weight:bold; - font-size:18; - text-align:center; -} - -table.param { -border:3px solid #6495ed; -border-collapse:collapse; -width:90%; -margin:auto; -} -td.param { -font-family:sans-serif; -font-size:11px; -border:1px solid #6495ed; -padding:5px; -text-align:left; -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designHelp.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designHelp.css deleted file mode 100755 index e8fcfd7a3d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designHelp.css +++ /dev/null @@ -1,21 +0,0 @@ -body -{ - width: 90%; - margin-top: 5px; - margin-bottom: 5px; - margin-left:5%; - margin-reight:5%; - background-color: #CCFFCC; - text-align:justify; -} - -h3,h2 -{ - color : navy; - text-align:center; - text-decoration:underline; -} -#problem -{ - color:red; -} \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designLogOut.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designLogOut.css deleted file mode 100755 index c6ce91f1e9..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designLogOut.css +++ /dev/null @@ -1,12 +0,0 @@ -body -{ - background-color: #CCFFCC; - margin-top: 2%; - padding: 0%; - outline: 0%; - height: 100%; - overflow:hidden; - max-width:2048px; - text-align:center; - font-size:24px; -} \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designWelcome.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designWelcome.css deleted file mode 100755 index fe096f7074..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designWelcome.css +++ /dev/null @@ -1,30 +0,0 @@ -body -{ - width: 960px; - margin-top: 100px; - margin-bottom: 5px; - background-image: url("Icons/logo.png"); - background-repeat:no-repeat; - background-color: #CCFFCC; - -} - -#signIn -{ - margin: auto; - width: 300px; - height: 140px; - border: 1px solid black; -} - -#log -{ - margin-left: 30px; -} - -a -{ - position:absolute; - right:1%; - top:80%; -} \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/design_admin.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/design_admin.css deleted file mode 100755 index 867056a7a6..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/design_admin.css +++ /dev/null @@ -1,99 +0,0 @@ -body { - background-color: #EEEEEE; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -select{ - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; - vertical-align: middle; - background-color: #F5F5DC; -} -input { - border:1px solid black; - background-color:#F5F5DC; - font-size: 11px; -} - -label { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -span { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -td { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -#title { - position : absolute; - top : 0%; - left : 0%; - height : 5%; - width : 100%; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - text-align : right; - font-size : 11px; - background-color: #BC8F8F; - border: 1px solid black; -} - -#page { - position : absolute; - top : 15%; - left : 15%; - width : 70%; - height : 65%; - border: 1px solid black; - background-color: #EEEEEE; -} - - -#modifImmat { - position : absolute; - top : 15%; -} - - -#modifPwd { - position : absolute; - top : 15%; -} - - -#modifRight { - position : absolute; - top : 15%; -} - -#modifyUser { - position : absolute; - top : 15%; -} - -#createUser { - position : absolute; - top : 15%; -} - -#mainForm { - position : absolute; - top : 15%; -} - - -#createIvyUser { - position : absolute; - top : 15%; -} - -#listIvyUser { - position : absolute; - top : 15%; -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designbackup.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designbackup.css deleted file mode 100755 index b00585c71d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/designbackup.css +++ /dev/null @@ -1,87 +0,0 @@ -body -{ - background-color: #CCFFCC; - margin: 0%; - padding: 0%; - outline: 0%; - height: 95%; -} -#page -{ - width: 100%; - height: 95%; -} - -#logo -{ - width: 960px; - height: 100px; - background-image: url("banniere.jpg"); - background-repeat: repeat-x; - margin-bottom: 10px; -} - -#leftmenu -{ - /* float: left; /* Le menu flottera à gauche */ - /* width: 120px; *//* Très important : donner une taille au menu */ -} -#welcome -{ - text-align: center; - background-color: #EEEEEE; - border: 2px solid black; - margin-bottom: 10px; /* Pour éviter que les éléments du menu ne soient trop collés */ -} -#choice -{ -float: left; - text-align: center; - background-color: #EEEEEE; - border: 2px solid black; - height: 190px; - width: 20px; -} -#map_canvas -{ - width: 690px; - height: 350px; - margin-left: 125px; -} - -#FlightPlan -{ - float: right; - width: 135px; /* Très important : donner une taille au menu */ - height: 345px; - border: 2px solid black; - background-color: #EEEEEE; -} - - - -#ControlPanel -{ - float: left; - text-align: center; - height: 150px; - width: 600px; - border: 2px solid black; - background-color: #EEEEEE; -} -#FlightParams -{ - text-align: center; - float: right; - height: 150px; - width: 350px; - border: 2px solid black; - background-color: #EEEEEE; -} -table -{ - margin-left: 20px; - margin-bottom: 20px; -} - - \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/dtree.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/dtree.css deleted file mode 100755 index b201c2fd60..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/dtree.css +++ /dev/null @@ -1,34 +0,0 @@ -/*--------------------------------------------------| -| dTree 2.05 | www.destroydrop.com/javascript/tree/ | -|---------------------------------------------------| -| Copyright (c) 2002-2003 Geir Landrö | -|--------------------------------------------------*/ - -.dtree { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; - color: #666; - white-space: nowrap; -} -.dtree img { - border: 0px; - vertical-align: middle; -} -.dtree a { - color: #333; - text-decoration: none; -} -.dtree a.node, .dtree a.nodeSel { - white-space: nowrap; - padding: 1px 2px 1px 2px; -} -.dtree a.node:hover, .dtree a.nodeSel:hover { - color: #333; - text-decoration: underline; -} -.dtree a.nodeSel { - background-color: #c0d2ec; -} -.dtree .clip { - overflow: hidden; -} \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/tab.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/tab.css deleted file mode 100755 index 2e9043ed76..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/tab.css +++ /dev/null @@ -1,110 +0,0 @@ -/* $Id: example.css,v 1.5 2006/03/27 02:44:36 pat Exp $ */ - -/*-------------------------------------------------- - REQUIRED to hide the non-active tab content. - But do not hide them in the print stylesheet! - --------------------------------------------------*/ -.tabberlive .tabbertabhide { - display:none; -} - -/*-------------------------------------------------- - .tabber = before the tabber interface is set up - .tabberlive = after the tabber interface is set up - --------------------------------------------------*/ -.tabber { -} -.tabberlive { - margin-top:1em; -} - -/*-------------------------------------------------- - ul.tabbernav = the tab navigation list - li.tabberactive = the active tab - --------------------------------------------------*/ -ul.tabbernav -{ - margin:0; - padding: 3px 0; - border-bottom: 1px solid #778; - font: bold 12px Verdana, sans-serif; -} - -ul.tabbernav li -{ - list-style: none; - margin: 0; - display: inline; -} - -ul.tabbernav li a -{ - padding: 3px 0.5em; - margin-left: 3px; - border: 1px solid #778; - border-bottom: none; - background: #DDE; - text-decoration: none; -} - -ul.tabbernav li a:link { color: #448; } -ul.tabbernav li a:visited { color: #667; } - -ul.tabbernav li a:hover -{ - color: #000; - background: #AAE; - border-color: #227; -} - -ul.tabbernav li.tabberactive a -{ - background-color: #fff; - border-bottom: 1px solid #fff; -} - -ul.tabbernav li.tabberactive a:hover -{ - color: #000; - background: white; - border-bottom: 1px solid white; -} - -/*-------------------------------------------------- - .tabbertab = the tab content - Add style only after the tabber interface is set up (.tabberlive) - --------------------------------------------------*/ -.tabberlive .tabbertab { - padding:5px; - border:1px solid #aaa; - border-top:0; - - /* If you don't want the tab size changing whenever a tab is changed - you can set a fixed height */ - - /* height:200px; */ - - /* If you set a fix height set overflow to auto and you will get a - scrollbar when necessary */ - - /* overflow:auto; */ -} - -/* If desired, hide the heading since a heading is provided by the tab */ -.tabberlive .tabbertab h2 { - display:none; -} -.tabberlive .tabbertab h3 { - display:none; -} - -/* Example of using an ID to set different styles for the tabs on the page */ -.tabberlive#tab1 { -} -.tabberlive#tab2 { -} -.tabberlive#tab2 .tabbertab { - height:200px; - overflow:auto; -} - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-anim_basic_16x16.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-anim_basic_16x16.gif deleted file mode 100755 index 085ccaecaf..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-anim_basic_16x16.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png deleted file mode 100755 index 954e22dbd9..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png deleted file mode 100755 index 64ece5707d..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_flat_10_000000_40x100.png deleted file mode 100755 index abdc01082b..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_flat_10_000000_40x100.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png deleted file mode 100755 index 9b383f4d2e..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png deleted file mode 100755 index a23baad25b..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png deleted file mode 100755 index 42ccba269b..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png deleted file mode 100755 index 39d5824d6a..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png deleted file mode 100755 index f1273672d2..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png deleted file mode 100755 index 359397acff..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_222222_256x240.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_222222_256x240.png deleted file mode 100755 index b273ff111d..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_222222_256x240.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_228ef1_256x240.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_228ef1_256x240.png deleted file mode 100755 index c357355aa7..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_228ef1_256x240.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ef8c08_256x240.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ef8c08_256x240.png deleted file mode 100755 index 85e63e9f60..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ef8c08_256x240.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ffd27a_256x240.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ffd27a_256x240.png deleted file mode 100755 index e117effa3d..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ffd27a_256x240.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ffffff_256x240.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ffffff_256x240.png deleted file mode 100755 index 42f8f992c7..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/images/ui-icons_ffffff_256x240.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/jquery-ui-1.8.2.custom.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/jquery-ui-1.8.2.custom.css deleted file mode 100755 index 312dd8043e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/CSS/ui-lightness/jquery-ui-1.8.2.custom.css +++ /dev/null @@ -1,489 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } -.ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } -.ui-widget-content a { color: #333333; } -.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -.ui-widget-header a { color: #ffffff; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; } -.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; } -.ui-widget :active { outline: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } -.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } - -/* Overlays */ -.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } -.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Selectable -----------------------------------*/ -.ui-selectable-helper { border:1px dotted black } -/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } -/* IE7-/Win - Fix extra vertical space in lists */ -.ui-accordion a { zoom: 1; } -.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } -.ui-accordion .ui-accordion-content-active { display: block; }/* Autocomplete -----------------------------------*/ -.ui-autocomplete { position: absolute; cursor: default; } -.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; } - -/* workarounds */ -* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ - -/* Menu -----------------------------------*/ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; -} -/* Button -----------------------------------*/ - -.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ -.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ -button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ -.ui-button-icons-only { width: 3.4em; } -button.ui-button-icons-only { width: 3.7em; } - -/*button text element */ -.ui-button .ui-button-text { display: block; line-height: 1.4; } -.ui-button-text-only .ui-button-text { padding: .4em 1em; } -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } -.ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } -.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } -/* no icon support for input elements, provide padding by default */ -input.ui-button { padding: .4em 1em; } - -/*button icon element(s) */ -.ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } -.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } -.ui-button-text-icon .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } -.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } - -/*button sets*/ -.ui-buttonset { margin-right: 7px; } -.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } - -/* workarounds */ -button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ - - - - - -/* Dialog -----------------------------------*/ -.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 0.8em; height: 0.8em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs -----------------------------------*/ -.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ -.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } -.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } -/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/E.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/E.png deleted file mode 100755 index c54150820a..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/E.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/N.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/N.png deleted file mode 100755 index b7a747cd39..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/N.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/NE.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/NE.png deleted file mode 100755 index 14d39ae0f0..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/NE.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/NW.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/NW.png deleted file mode 100755 index e57382d0d4..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/NW.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/S.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/S.png deleted file mode 100755 index edeabb494d..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/S.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/SE.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/SE.png deleted file mode 100755 index e2e35ba552..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/SE.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/SW.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/SW.png deleted file mode 100755 index 71f3be47ae..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/SW.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/W.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/W.png deleted file mode 100755 index baa74b59ad..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/W.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/arrow.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/arrow.png deleted file mode 100755 index 3a004f60b5..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/arrow.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/arrow2.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/arrow2.png deleted file mode 100755 index d2cae73712..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/arrow2.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/blue-dot.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/blue-dot.png deleted file mode 100755 index 98b280d301..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/blue-dot.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/favicon.ico b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/favicon.ico deleted file mode 100755 index 7cd42a2755..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/favicon.ico and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/logo.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/logo.png deleted file mode 100755 index 032f6d16e7..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/logo.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/losange.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/losange.gif deleted file mode 100755 index dfadf2d823..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/losange.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/losange.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/losange.png deleted file mode 100755 index 0786209c39..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/losange.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/red-dot.png b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/red-dot.png deleted file mode 100755 index b0f3f0e928..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Icons/red-dot.png and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Interface.jsp b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Interface.jsp deleted file mode 100755 index 3ef63cc678..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/Interface.jsp +++ /dev/null @@ -1,1943 +0,0 @@ -<%@page import="pow.webserver.Conf,java.util.StringTokenizer,java.util.NoSuchElementException" %> - -<% - if (session.getAttribute("login")==null) { - out.println(""); - } -%> - - - - - - - - POW - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "); - } - else { - String login = ((String) (session.getAttribute("login"))).toString(); - String right = ((String) (session.getAttribute("rights"))).toString(); - if (right.equals("visitor")) - { out.println("var usr_right=\"visitor\";"); - out.println("var usr_login=\"nologged\";"); - } - else if (right.equals("admin")) - { - out.println("var usr_right=\"admin\";"); - out.println("var usr_login=\""+login+"\";"); - } - else if (right.equals("user")){ // gestion de la liste des drones controlables - out.println("var usr_right=\"user\";"); - out.println("var usr_login=\""+login+"\";"); - out.println("var drone_ctl=new Array();"); - String droneCtl = ((String) (session.getAttribute("dronectl"))).toString(); - StringTokenizer st = new StringTokenizer(droneCtl,";"); - String d; - for(int i = 0 ; i< st.countTokens() ;i++){ - d=st.nextToken(); - out.println("drone_ctl[\""+ d +"\"]=1;"); - } - try{ - while (st.hasMoreTokens()) { - d=st.nextToken(); - } - } - catch (NoSuchElementException ex){} - - } - } - String default_folder = this.getServletConfig().getServletContext().getRealPath(""); - Conf myconf =new Conf(default_folder,"pow_conf.xml"); - out.println("//10sec after plane_die event remove drone"); - out.println("var dieEventTimeoutTime = "+myconf.getDieEventTimeoutTime()+";"); - out.println("//5sec without any position data about a drone remove drone"); - out.println("var dataEventTimeoutTime = "+myconf.getDataEventTimeoutTime()+";"); - out.println("// time to wait before order was cancelled"); - out.println("var order_response_timeout = "+myconf.getOrderResponseTimeout()+";"); - %> - var noPlaneBefore=true; // pour initialiser au premier push flight param - var ajax_url = "ajaxRqst.srv"; -/* ********** drone state timeout ******** */ - var droneStateDieEvent = new Array(); // timeout en cas d'event die - var droneStateDataEvent = new Array(); // timeout en cas de non evenement data - var waypoint_modif = new Array(); // - var block_jump_timeout=-1; - var setting_change_timeout=-1; - var setting_to_change_id=-1; -/* *************************************************************************** Global variables *************************************************************************************** */ - var map; - - var planes = new Array(); - var nb_planes =0; - var markers = new Array(); - var markers_color = new Array(); // stock les balises de couleurs de chaque drone - var diametre_drone_balise = 50; //50m de base - var selected_plane = ""; - var selected_plane_id = 0; - var selected_index=0; - var tracking = false; - -/* *******************Flight Plan variables :******************** */ - var waypoints = new Array(); - var waypoint_tmp = null; - var index_wpt = 0; - var blocks= new Array(); - var index_block = 0; - var active_block_id=0; - var active_block_name=""; - var fpl_name=""; - var lat0=0; - var lon0=0; - var fpl_alt=0; - var security_height=0; - var fpl_ground_alt=0; - var max_dist=0; - - -/* ********************Planes and waypoints icons******************** */ - var plane_icons = new Array(); - for (var i=0;i<8;i++){ - plane_icons[i] = new GIcon(); - plane_icons[i].shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; - plane_icons[i].iconSize = new GSize(60,60); - plane_icons[i].shadowSize = new GSize(22, 20); - plane_icons[i].infoWindowAnchor = new GPoint(50, 1); - plane_icons[i].iconAnchor = new GPoint(30, 30); - } - plane_icons[0].image="Icons/N.png"; - plane_icons[1].image="Icons/NE.png"; - plane_icons[2].image="Icons/E.png"; - plane_icons[3].image="Icons/SE.png"; - plane_icons[4].image="Icons/S.png"; - plane_icons[5].image="Icons/SW.png"; - plane_icons[6].image="Icons/W.png"; - plane_icons[7].image="Icons/NW.png"; - - var wpt_icon=new GIcon(); - wpt_icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; - wpt_icon.iconSize = new GSize(20,20); - wpt_icon.shadowSize = new GSize(22, 20); - wpt_icon.infoWindowAnchor = new GPoint(8, 1); - wpt_icon.iconAnchor = new GPoint(6, 20); - //wpt_icon.image="Icons/losange.png"; - wpt_icon.image="Icons/blue-dot.png"; - - var iconMarkerTemp=new GIcon(); - iconMarkerTemp.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; - iconMarkerTemp.iconSize = new GSize(20,20); - iconMarkerTemp.shadowSize = new GSize(22, 20); - iconMarkerTemp.infoWindowAnchor = new GPoint(8, 1); - iconMarkerTemp.iconAnchor = new GPoint(6, 20); - iconMarkerTemp.image="Icons/red-dot.png"; -/* *************************************************************************** Functions **************************************************************************************************** */ - -/* ************ prevent user from going back to this page by browser's forward button****************************** */ - -function backButtonOverride() -{ - // Work around a Safari bug - // that sometimes produces a blank page - setTimeout("backButtonOverrideBody()", 1); - -} - -function backButtonOverrideBody() -{ - // Works if we backed up to get here - try { - history.forward(); - } catch (e) { - // OK to ignore - } - // Every quarter-second, try again. The only - // guaranteed method for Opera, Firefox, - // and Safari, which don't always call - // onLoad but *do* resume any timers when - // returning to a page - setTimeout("backButtonOverrideBody()", 500); -} -/* ******************* Useful functions ******************** */ -// Gets an element of the html document by its class name - function getElementsByClass(tag, className){ - var elements = document.getElementsByTagName(tag); - var results = new Array(); - for(var i=0; i< elements.length; i++){ - if(elements[i].className == className){ - results[results.length] = elements[i]; - } - } - return results; - } - - - function pause(time){ - d=new Date(); - diff=0; - while(diff < time){ - n=new Date(); - diff=n-d; - } - } - - - //Creates a GoogleMaps marker - - - - - function createMarker(point, legend, icon){ - var marker = new GMarker(point, icon); - GEvent.addListener(marker, 'click', function() { - marker.openInfoWindowHtml(legend); - }); - return marker; - } - - var old_lat; - var old_lon; - //Creates a draggable marker with an EventListener - function createDraggableMarker(point,namewpt,wpt_icon,index_wpt, bool){ - var fpl_file_name="upload/"+planes[selected_index]["id"]+"/flight_plan.xml"; - var marker = new GMarker(point,{legend: namewpt,icon: wpt_icon,draggable: bool,bouncy:true}); - //var marker = new GMarker(point,{title: name,draggable: bool}); - //var marker = new GMarker(point,{draggable: bool}); - GEvent.addListener(marker, 'click', function() { - marker.openInfoWindowHtml(namewpt); - }); - if (bool){ - GEvent.addListener(marker, 'dragend', function(latlng) { - if (latlng){ - //alert("id wpt="+index_wpt+" name=" +namewpt+" lat="+latlng.lat()+" lon="+latlng.lng()); - var lat = latlng.lat(); - var lon = latlng.lng(); - moveWpt(selected_plane_id,namewpt,lat,lon,false,true,index_wpt); - } - }); - - GEvent.addListener(marker, 'dragstart', function(latlng) { - if (latlng){ - old_lat=latlng.lat(); - old_lon=latlng.lng(); - } - }); - } - - return marker; - } - - - - - -//Converts ditances from (lat0,lon0) given in meters into latitudes or longitudes, and vice versa - function xMetersToDegrees(x,lat0){ - return (x/1852/60+parseFloat(lat0)); - } - function yMetersToDegrees(y,lat,lon0){ - return (y/1852/60*Math.cos(lat)+parseFloat(lon0)); - } - - function xDegreesToMeters(lat,lat0){ - return((lat-lat0)*1852*60); - } - function yDegreesToMeters(lat,lon,lon0){ - return(lat!=0?(lon-lon0)/Math.cos(lat)*1852*60:0); - } - - - function name_from_id(id){ - var match=false; - for (var i=0;i< planes.length;i++){ - if(planes[i]["id"]==id){match=true;break;} - } - if (match){ - return (planes[i]["name"]); - }else{ - return (null); - } - } - /* *************** JQUERY stuffs ***************************** */ - $(function(){ - //init(); - //$("#Settings").draggable();$("#Settings").resizable(); - //$("#map_canvas").draggable();$("#map_canvas").resizable(); - //$("#Debug").draggable();$("#Debug").resizable(); - //$("#choicePanel").draggable();$("#choicePanel").resizable(); - //$("#FlightPlan").draggable();$("#FlightPlan").resizable(); - //$("#FlightParams").draggable();$("#FlightParams").resizable(); - }); -/* ********************* Fonctions de Push ******************** */ - - function initialize_push() { - // alert('go'); - p_join_listen(null, 'stream'); - // TODO il faudra gerer le cas ou cela bloque !!!! et passer en pull - // p_join_listen(null, 'pull'); - p_subscribe('/data/drone/iskill', 'msg from serveur'); - p_subscribe('/data/drones_maj', 'msg from serveur'); - p_subscribe('/data/order/waypoint_moved', 'msg from serveur'); - p_subscribe('/data/order/change_setting', 'msg from serveur'); - p_subscribe('/data/order/plane_die', 'msg from serveur'); - p_subscribe('/data/order/plane_resurect', 'msg from serveur'); - p_subscribe('/data/order/new_plane', 'msg from serveur'); - p_subscribe('/data/order/block_changed', 'msg from serveur'); - p_subscribe('/data/order/other', 'msg from serveur'); - p_subscribe('/data/order/settings', 'msg from serveur'); - - p_subscribe('/chat','msg from web client'); - p_subscribe('/client_action','action from web client'); - } - - function initialize_push_pullmode() { - - p_join_listen(null, 'pull'); - p_subscribe('/data/drone/iskill', 'msg from serveur'); - p_subscribe('/data/drones_maj', 'msg from serveur'); - p_subscribe('/data/order/waypoint_moved', 'msg from serveur'); - p_subscribe('/data/order/change_setting', 'msg from serveur'); - p_subscribe('/data/order/plane_die', 'msg from serveur'); - p_subscribe('/data/order/plane_resurect', 'msg from serveur'); - p_subscribe('/data/order/new_plane', 'msg from serveur'); - p_subscribe('/data/order/block_changed', 'msg from serveur'); - p_subscribe('/data/order/other', 'msg from serveur'); - p_subscribe('/data/order/settings', 'msg from serveur'); - - p_subscribe('/chat','msg from web client'); - p_subscribe('/client_action','action from web client'); - } - - function displayControl(aString) { - document.debugEventDisplay.event.value = aString; - } - // callback on data Events - // call apropirate function according to the received event - - function onData(event) { - var subject = event.get('p_subject'); - - // displayControl(""+ event.toString()); - - if (subject=="/data/drones_maj") { handleDronePositionUpsate(event);} - else if (subject =="/data/order/waypoint_moved") {orderprocessing_waypoint(event);} - else if (subject =="/data/order/block_changed") {orderprocessing_jump2block(event);} - else if (subject =="/data/order/change_setting") {orderprocessing_setting(event);} - else if (subject =="/data/order/plane_die") {orderprocessing_planedie(event);} - else if (subject =="/data/order/plane_resurect"){orderprocessing_planeressurect(event);} - else if (subject =="/data/order/new_plane") {orderprocessing_newplane(event);} - else if (subject =="/data/drone/iskill") {orderprocessing_planekilled(event);} - else if (subject =="/data/order/settings") {orderprocessing_csv_settings(event);} - else if (subject =="/chat") {orderprocessing_chat(event);} - else if (subject =="/client_action") {orderprocessing_client_action(event);} - } - - // callback on all other kind of Events - - <%--function onEvent(event) { - var subject = event.get('p_subject'); - displayControl("EVENT CALLBACK "+subject+"\n" + event.toString()); - - - } - --%> -/* ********************* initilization de l'interface ******************* */ - function initialize_display(){ - var aircraftList = document.getElementById("aircraftForm").aircraftList; - if (nb_planes ==0)//If there is no active aircraft, the list only has one option : No aircraft - {aircraftList.options[0]=new Option("No aircraft");} -} - -/* *********************functions to check airplanes ******************* */ - -/* *********************Processing events ******************* */ - // recherche si l'id de l'avion est deja present dans le tableau des drones deja - function handleDronePositionUpsate(event){ - if (planes.length==0) {noPlaneBefore=true;} - var id = parseInt(event.get('aircraftId')); - var match=false; - var insert=false; - var aircraftList = document.getElementById("aircraftForm").aircraftList; - nb_planes=planes.length; - for (var i=0;i< nb_planes;i++){ - if(planes[i]["id"]> id){insert=true;break;} // on garde le tableau trié - if (planes[i]["id"]==id){match=true;break;} // on recupere en i le drone correspondant à id - } - if(!match){ - var k=0; - if(insert){ // on insert au milieu - k=i; - planes.splice(i,0,new Array()); - markers.splice(i,0,null); - markers_color.splice(i,0,null); - // on insere l'aircraft dan sla liste deroulante - //see http://www.mredkj.com/tutorials/tutorial005.html - var elOptNew = document.createElement('option'); - elOptNew.text = event.get('dbName') - var elOptOld = aircraftList.options[i]; - try { - aircraftList.add(elOptNew, elOptOld); // standards compliant; doesn't work in IE - } - catch(ex) { - aircraftList.add(elOptNew, i); // IE only - } - }else{ // on met à la fin du tableau - k=planes.length; - planes[k] = new Array(); - markers[k]= null; // inutile - markers_color[k]=null; - aircraftList.options[k]=new Option(event.get('dbName')); - } - droneStateDieEvent[k] = -1; // init un timeout vide - // - planes[k]["id"]=id; - planes[k]["name"] =event.get('dbName'); - planes[k]["lat"] = event.get('dbLatitude'); - planes[k]["lon"] = event.get('dbLongitude'); - planes[k]["heading"]= event.get('dbCourse'); - // maj des param pour selected acrf - planes[k]["speed"]= event.get('dbSpeed'); - planes[k]["altitude"]= event.get('dbAmsl'); - planes[k]["vspeed"]= event.get('dbVert_speed'); - planes[k]["height"]= event.get('dbAgl'); - planes[k]["battery"]= event.get('dbStat_battery'); - planes[k]["GPS"]= event.get('dbStat_gps'); - planes[k]["activeBlock"]= event.get('dbActive_block'); - planes[k]["engine"]= event.get('dbEngine_status'); - planes[k]["setting_id"]= event.get('dbId_Setting'); - planes[k]["setting_value"]= event.get('dbSetting_Value'); - planes[k]["drone_color"]= event.get('drone_color'); - // gere si le drone peut etre controlé ou non - if ((usr_right=="admin")||((usr_right=="user")&&(drone_ctl[event.get('dbName')]!=null))){ - planes[k]["rights"]= 1; - } - else - {planes[k]["rights"]=0;} - - var icon; - if (planes[k]["heading"]>=338 || planes[i]["heading"]< 23){ - icon = plane_icons[0]; - }else if (planes[k]["heading"]>=23 && planes[i]["heading"]<68){ - icon = plane_icons[1]; - }else if (planes[k]["heading"]>=68 && planes[i]["heading"]<113){ - icon = plane_icons[2]; - }else if (planes[k]["heading"]>=113 && planes[i]["heading"]<158){ - icon = plane_icons[3]; - }else if (planes[k]["heading"]>=158 && planes[i]["heading"]<203){ - icon = plane_icons[4]; - }else if (planes[k]["heading"]>=203 && planes[i]["heading"]<248){ - icon = plane_icons[5]; - }else if (planes[k]["heading"]>=248 && planes[i]["heading"]<293){ - icon = plane_icons[6]; - }else if (planes[k]["heading"]>=293 && planes[i]["heading"]<337){ - icon = plane_icons[7]; - } - //A marker is created and added on the map - var pos = new GLatLng(planes[k]["lat"],planes[k]["lon"]); - markers[k]=createMarker(pos,planes[k]["name"],icon); - markers_color[k] = GPolygon.Circle(pos,diametre_drone_balise,"#000000",1,1,planes[i]["drone_color"],0.5) - map.addOverlay(markers[k]); - map.addOverlay(markers_color[k]); - droneStateDataEvent[k] = setTimeout("nodataEventCallBack("+id+")",dataEventTimeoutTime); - } - else // l event envoyé correspond à un drone deja dans le tableau - { - if (droneStateDataEvent[i]!=-1) {clearTimeout(droneStateDataEvent[i]);} - var heading_changed; - //Update of the planes array - planes[i]["lat"] = event.get('dbLatitude'); - planes[i]["lon"] = event.get('dbLongitude'); - // maj des param pour selected acrf - planes[i]["speed"]= event.get('dbSpeed'); - planes[i]["altitude"]= event.get('dbAmsl'); - planes[i]["vspeed"]= event.get('dbVert_speed'); - planes[i]["height"]= event.get('dbAgl'); - planes[i]["battery"]= event.get('dbStat_battery'); - planes[i]["GPS"]= event.get('dbStat_gps'); - planes[i]["activeBlock"]= event.get('dbActive_block'); - planes[i]["engine"]= event.get('dbEngine_status'); - planes[i]["setting_id"]= event.get('dbId_Setting'); - planes[i]["setting_value"]= event.get('dbSetting_Value'); - planes[i]["drone_color"]= event.get('drone_color'); - // - var new_heading = event.get('dbCourse'); - var old_heading = planes[i]["heading"]; - //Update of the icons if the heading has changed - if (Math.abs(new_heading-old_heading)>2){ - var image; - if (new_heading>=338 || new_heading< 23){ - image = plane_icons[0].image; - }else if (new_heading>=23 && new_heading<68){ - image = plane_icons[1].image; - }else if (new_heading>=68 && new_heading<113){ - image = plane_icons[2].image; - }else if (new_heading>=113 && new_heading<158){ - image = plane_icons[3].image; - }else if (new_heading>=158 && new_heading<203){ - image = plane_icons[4].image; - }else if (new_heading>=203 && new_heading<248){ - image = plane_icons[5].image; - }else if (new_heading>=248 && new_heading<293){ - image = plane_icons[6].image; - }else if (new_heading>=293 && new_heading<337){ - image = plane_icons[7].image; - } - markers[i].setImage(image); - } - planes[i]["heading"] = new_heading; - //Setting the marker to its new position - var new_pos = new GLatLng(planes[i]["lat"],planes[i]["lon"]); - markers[i].setLatLng(new_pos); - //see http://econym.org.uk/gmap/eshapes.htm - map.removeOverlay(markers_color[i]); - markers_color[i] = GPolygon.Circle(new_pos,diametre_drone_balise,"#000000",1,1,planes[i]["drone_color"],0.5); - map.addOverlay(markers_color[i]); - droneStateDataEvent[i] = setTimeout("nodataEventCallBack("+id+")",dataEventTimeoutTime); - } - nb_planes=planes.length; - - document.getElementById("aircraftList").options.length=planes.length; - if (tracking&&nb_planes!=0){//If tracking is activated, the map is centered on the aircraft - var zoom = map.getZoom(); - var plane_number = aircraftList.selectedIndex; - map.setCenter(new GLatLng(planes[plane_number]["lat"],planes[plane_number]["lon"]),zoom); - } - - if (noPlaneBefore==true){ - noPlaneBefore=false;// !!! interruption possible - active_block_id=planes[0]["activeBlock"]; - aircraftList.options[0].selected=true; - selected_plane = planes[0]["name"]; - selected_plane_id = planes[0]["id"]; - DOMImplementation("upload/"+planes[0]["id"]+"/flight_plan.xml",fplDisplay); - DOMImplementation("upload/"+planes[0]["id"]+"/settings.xml",settingsDisplay); - } - selected_plane_update(selected_plane_id); - } - - -/* ******************** affichage log ******************* */ - -var coloryellow = true; -function addMsgLog(msg) -{ - var element = document.getElementById("info"); - var newinfodiv = document.createElement("div"); - var newinfotxt = document.createTextNode(msg); - if (coloryellow) {newinfodiv.style.background = '#FFE4B5';coloryellow=false;} - else {newinfodiv.style.background = '#D2B48C';coloryellow=true;} - newinfodiv.appendChild(newinfotxt); - element.appendChild(newinfodiv); -} -/* ******************** Initialization of the page ******************* */ - -/* Initialization of the page : map, markers, aircraft list... */ - - - function initialize() { - - if (GBrowserIsCompatible()) { - // initialize_planes_data(); - initialize_display(); - initialize_push(); - map = new GMap2(document.getElementById("map_canvas"));//Map creation - map.setMapType(G_HYBRID_MAP); - var point= new GLatLng(43.46223, 1.27289); - map.setCenter(point,15);//Center the map on a temporary point - map.setUIToDefault(); - // - GEvent.addListener(map, "zoomend", function(oldlevel,newlevel) { - var d = newlevel-oldlevel; - if (d<0) { - diametre_drone_balise=diametre_drone_balise*(-2*d); - } - else - { - diametre_drone_balise=diametre_drone_balise/(2*d); - } - }); - }else{ - alert("Your browser is not compatible with Google Maps !"); - } - } - - - -/* Updating of the selected aircraft flight parameters */ -// recherche la place de l'avion dans le tableau - function seekIndex(plane_id) - { - var i = 0; - var trouve = false; - var res=-1; - while ((ilat y->lon !'); - x = parseFloat(childXML.getAttribute("x")); - y = parseFloat(childXML.getAttribute("y")); - lat=xMetersToDegrees(x,lat0); - lon=yMetersToDegrees(y,lat,lon0); - } - else - { - lat=parseFloat(childXML.getAttribute("lat")); - lon=parseFloat(childXML.getAttribute("long")); - } - var right=planes[selected_index]["rights"]; - waypoints[index_wpt]["marker"]=null; - - if (right==1){ - waypoints[index_wpt]["marker"]=createDraggableMarker(new GLatLng(lat,lon),nameWpt,wpt_icon,index_wpt, true); - }else { - waypoints[index_wpt]["marker"]=createDraggableMarker(new GLatLng(lat,lon),nameWpt,wpt_icon,index_wpt, false); - } - map.addOverlay(waypoints[index_wpt]["marker"]); - - var alt=false; - if (childXML.getAttribute("alt")!=null){ - alt=childXML.getAttribute("alt"); - waypoints[index_wpt]["alt"]=parseFloat(childXML.getAttribute("alt")); - } - var node_url=""; - if (right==1){ - node_url = "javascript:moveWpt("+selected_index+",'"+nameWpt+"',"+lat+","+lon+","+alt+",false,"+(index_wpt)+")"; - } - ///// - index_wpt++; - var newindex = index++; - fpl_tree.add(newindex,index_pere,nameWpt,node_url); - for(var k =0;k< nbr_attrib;k++){ - var newindex_attrib_name = index++; - var newindex_attrib_value = index++; - fpl_tree.add(newindex_attrib_name,newindex,childXML.attributes[k].nodeName); - fpl_tree.add(newindex_attrib_value,newindex_attrib_name,childXML.attributes[k].nodeValue); - //txt = txt + childXML.attributes[k].nodeName + "=" + childXML.attributes[k].nodeValue +" "; - } - } - } - else if (childXML.nodeName=="block") - { var node_url="";var txt_block_name=""; - if(childXML.attributes!=null){ - var block_name=childXML.getAttribute("name");//.replace(/ /g, '_'); - blocks[index_block]=new Array(); - blocks[index_block]["name"]=block_name; - if (active_block_id==index_block){ - active_block_name=block_name; - txt_block_name = ""+block_name+""; - } - else - { - txt_block_name = block_name; - } - var right=planes[selected_index]["rights"]; - - if (right==1){ - node_url="javascript:activateBlock("+selected_index+",'"+block_name+"',"+index_block+")"; - } - index_block++; - var txt = txt_block_name+ " : "; - var nbr_attrib = childXML.attributes.length; - for(var k =0;k< nbr_attrib;k++){ - if (childXML.attributes[k].nodeName!="name"){ - var newindex_attrib_name = index++; - var newindex_attrib_value = index++; - txt = txt + childXML.attributes[k].nodeName + "=" + childXML.attributes[k].nodeValue +" "; - } - } - } - var newindex = index++; - fpl_tree.add(newindex,index_pere,txt,node_url); - } - // recursion - if(childXML.hasChildNodes()) { - var nodes=childXML.childNodes.length; - for(var i=0; i90.0)||(l<-90.0)||isNaN(new_lat)) { - alert('wrong format for a latitude... should be within [-90:+90]'); - return; - } - new_lon=prompt("longitude=",mylon); - if ((new_lon==null)){ - return; - } - l = parseFloat(new_lon); - if ((l>180.0)||(l<-180.0)||isNaN(new_lon)) { - alert('wrong format for a longitude... should be within [-180:+180]'); - return; - } - if (alt){ - new_alt=prompt("altitude=",alt); - if ((new_alt==null)){ - return; - } - l = parseFloat(new_alt); - if ((l<=0.0)||isNaN(new_alt)) { - alert('wrong format for an altitude... should be positive'); - return; - } - } - // - old_lat = waypoints[idwpt]["lat"]; - old_lon = waypoints[idwpt]["lon"]; - }else{ - new_lat=mylat; - new_lon=mylon; - } - - - //Ajax request to edit the flight plan xml file - var xhr = getXMLHttpRequest(); - xhr.onreadystatechange = function() { - if (xhr.readyState == 4 && xhr.status == 200) { - // maj de l'affichage fpl - var xmlResponse = xhr.responseXML.documentElement; - var rep = xmlResponse.getElementsByTagName("waypoint_to_move")[0]; - var idwpt_requested = parseInt(rep.getAttribute("idwpt"))-1;// cf waypoint fictif ivy - var acid_requested = parseInt(rep.getAttribute("acid")); - var lat_requested = parseFloat(rep.getAttribute("newlat")); - var lon_requested = parseFloat(rep.getAttribute("newlon")); - var was_dragged = rep.getAttribute("dragged"); - var name_drone = planes[seekIndex(acid_requested)]["name"]; - // on ne met à jour visuellement que si le focus est sur le drone selecté - if (acid_requested==selected_plane_id){ - // mettre le waypoint dans un etat intermediaire - // en attendant l'accuse de reception - var right=planes[selected_index]["rights"]; - var marker_tmp; - if (right==1){ - marker_tmp=createDraggableMarker(new GLatLng(old_lat,old_lon),waypoints[idwpt_requested]["name"],wpt_icon,idwpt_requested, true); - }else { - marker_tmp=createDraggableMarker(new GLatLng(old_lat,old_lon),waypoints[idwpt_requested]["name"],wpt_icon,idwpt_requested, false); - } - var name_wpt = waypoints[idwpt_requested]["name"]; - var timer=setTimeout("callback_waypoint("+acid_requested+","+idwpt_requested+")",order_response_timeout); - waypoint_modif[idwpt_requested] = new createWaypoint(acid_requested,idwpt_requested,name_wpt,marker_tmp,timer); - // on efface le marker courant - // meme si elle a ete deplacé par drag & drop - // on cree un marker non draggable avec une icone temporaire - map.removeOverlay(waypoints[idwpt_requested]["marker"]); - waypoints[idwpt_requested]["marker"] = createMarker(new GLatLng(lat_requested,lon_requested),name_wpt,iconMarkerTemp); - if (waypoints[idwpt_requested]["marker"]!=null) map.addOverlay(waypoints[idwpt_requested]["marker"]); - else alert('echec creation wpt tmp'); - addMsgLog("waypoint "+ name_wpt +" for drone " + name_drone +" will be moved"); - } - else - { - addMsgLog("waypoint "+ idwpt_requested +" for drone " + name_drone +" will be moved"); - } - - } - }; - xhr.open("POST",ajax_url,true); - xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - // on informe les autres clients de ne pas modifier le waypoint en cours (via pushlet) - p_publish('/client_action', 'login',usr_login,'action', 'lock', 'type_obj', 'waypoint', 'id_obj',idwpt,'webiddrone',selected_plane_id); - // on passe en parametre le index_wpt+1 car dans paparazzi il y a un wpt predefini a zero - - if(alt!=false){ - xhr.send("order=fpl_update&wpt_name="+name+"&aircraft_id=" +selected_plane_id+"&wpt_id="+(idwpt+1)+"&new_lat="+new_lat+"&new_lon="+new_lon+"&new_alt="+new_alt+"&dragged="+dragged+"&new_alt_for_fpl=1"); - //alert("wptid="+i+" lat="+new_lat+"lon="+new_lon+"alt="+new_alt); - }else{ - var alti=document.getElementById("altitude");var h=parseFloat(alti.innerHTML); - xhr.send("order=fpl_update&wpt_name="+name+"&aircraft_id=" +selected_plane_id+"&wpt_id="+(idwpt+1)+"&new_lat="+new_lat+"&new_lon="+new_lon+"&new_alt="+parseFloat(alti.innerHTML)+"&dragged="+dragged+"&new_alt_for_fpl=0"); - //alert("wptid="+i+" lat="+new_lat+"lon="+new_lon+"alt="+h); - } -} - - -/* ******** Activate a flight plan block ******** */ - - - - function activateBlock(ac_webid,blockname,block_id){ - // verifie qu'il n'y pas pas un verrou sur le block posé par un autre client - var k=0; - var trouve = false; - while ((!trouve)&&(k= parseFloat(min)) ){ - correct=true; - var xhr = getXMLHttpRequest(); - xhr.onreadystatechange = function() { - if (xhr.readyState == 4 && xhr.status == 200) { - var xmlResponse = xhr.responseXML.documentElement; - var rep = xmlResponse.getElementsByTagName("setting_to_change")[0]; - var idsetting_requested = parseInt(rep.getAttribute("setting_id")); - var acid_requested = parseInt(rep.getAttribute("acid")); - var name_drone = planes[seekIndex(acid_requested)]["name"]; - addMsgLog("request change setting "+ idsetting_requested +" for drone " + name_drone +" has been sent"); - // mise en place d'un timer d'accusé reception - if(acid_requested==planes[selected_index]["id"]){ - setting_change_timeout=setTimeout("callback_setting("+acid_requested+","+idsetting_requested+")",order_response_timeout); - setting_to_change_id = idsetting_requested; - } - } - }; - xhr.open("POST",ajax_url,true); - xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - //Send the parameters to the php page : - xhr.send("order=modif_setting&aircraft_id=" +selected_plane_id+"&setting_id="+idsetting+"&value="+new_value); - - }else{ - new_value=prompt("Wrong value, please enter a value between "+min+" and "+max+" with a step of "+step+" :"); - if (new_value==null){return;} - } - } - } - - function changeSetting2(idsetting,new_value){ - - var xhr = getXMLHttpRequest(); - xhr.onreadystatechange = function() { - if (xhr.readyState == 4 && xhr.status == 200) { - var xmlResponse = xhr.responseXML.documentElement; - var rep = xmlResponse.getElementsByTagName("setting_to_change")[0]; - var idsetting_requested = parseInt(rep.getAttribute("setting_id")); - var acid_requested = parseInt(rep.getAttribute("acid")); - var name_drone = planes[seekIndex(acid_requested)]["name"]; - addMsgLog("request change setting "+ idsetting_requested +" for drone " + name_drone +" has been sent"); - // mise en place d'un timer d'accusé reception - if(acid_requested==planes[selected_index]["id"]){ - setting_change_timeout=setTimeout("callback_setting("+acid_requested+","+idsetting_requested+")",order_response_timeout); - setting_to_change_id = idsetting_requested; - } - } - }; - // on informe les autres clients de ne pas modifier le setting en cours (via pushlet) - p_publish('/client_action', 'login',usr_login,'action', 'lock', 'type_obj', 'setting', 'id_obj',idsetting,'webiddrone',selected_plane_id); - // - xhr.open("POST",ajax_url,true); - xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - //Send the parameters to the servlet : - xhr.send("order=modif_setting&aircraft_id=" +selected_plane_id+"&setting_id="+idsetting+"&value="+new_value); - - } - -/* ************************* handle event orders from server ********************************************* */ - - function orderprocessing_waypoint(event){ - - var acft_id = parseInt(event.get('aircraftId')); - var wpt_id = parseInt(event.get('waypointId'))-1; // cf indentation des waypoint sous ivy - var lat = event.get('latitude'); - var lon = event.get('longitude'); - var alt = event.get('altitude'); - var name=name_from_id(acft_id); - if ((wpt_id>=0)&&(acft_id==selected_plane_id)) { - if (waypoint_modif[wpt_id]!=null) - { - addMsgLog('waypoint ' + wpt_id+' for drone '+name+ ' has been moved to '+lat+"//"+lon+' !'); - clearTimeout(waypoint_modif[wpt_id].timer) - waypoint_modif[wpt_id] = null; - DOMImplementation("upload/"+planes[selected_index]["id"]+"/flight_plan.xml",fplDisplay); - // inform other web client that waypoint can be changed - p_publish('/client_action', 'login',usr_login,'action', 'unlock', 'type_obj', 'waypoint', 'id_obj',wpt_id,'webiddrone',acft_id); - } - } - //document.getElementById("info").innerHTML='waypoint' + wpt_id+' for drone '+name+ ' has been moved !'; - //addMsgLog('waypoint' + wpt_id+' for drone '+name+ ' has been moved !'); - //alert('
waypoint' + wpt_id+' for drone '+name+ ' has been moved !'); - } - - function orderprocessing_jump2block(event) { - var acft_id = event.get('aircraftId'); - var current_block_id = event.get('currentBlockId'); - if (acft_id==selected_plane_id){ - /// maj de l'affichage fpl - var name_block=blocks[current_block_id]["name"]; - var name_drone=name_from_id(acft_id); - clearTimeout(block_jump_timeout); - active_block_id = current_block_id; - active_block_name =name_block; - // inform other web client that block can be changed - p_publish('/client_action', 'login',usr_login,'action', 'unlock', 'type_obj', 'block', 'id_obj',current_block_id,'webiddrone',acft_id); - addMsgLog('drone '+ name_drone + ' has jump to block '+ name_block +' !'); - DOMImplementation("upload/"+planes[selected_index]["id"]+"/flight_plan.xml",fplDisplay); - } - } - - function orderprocessing_setting(event) { - var acft_id = event.get('aircraftId'); - var setting_id = parseInt(event.get('settingId')); - var value = event.get('settingValue'); - if ((acft_id==selected_plane_id)&&(setting_to_change_id==setting_id)){ - clearTimeout(setting_change_timeout); - setting_to_change_id = -1; // reset - var name=name_from_id(acft_id); - //DOMImplementation("upload/"+planes[selected_index]["id"]+"/settings.xml",settingsDisplay); - selected_plane_update(acft_id); - addMsgLog('setting ' + setting_id +' for drone '+ name + ' has been changed to value '+ value +' !'); - // inform other web client that block can be changed - p_publish('/client_action', 'login',usr_login,'action', 'unlock', 'type_obj', 'setting', 'id_obj',setting_id,'webiddrone',acft_id); - } - } - - - function orderprocessing_planedie(event){ - var acft_id = event.get('aircraftId'); - var order_string = event.get('order'); - var name=name_from_id(acft_id); - //document.getElementById('info').innerHTML='drone ' + name+' is not alive !'; - addMsgLog('drone ' + name+' is not alive !'); - var drone_index = seekIndex(acft_id); - if(drone_index!=-1) - { - addMsgLog('drone ' + name+' will be removed in 10 seconds !'); - droneStateDieEvent[drone_index] = setTimeout("droneDieCallback("+acft_id+")", dieEventTimeoutTime); - // on grise l'aircraft sur l'interface - } - } - - function orderprocessing_planeressurect(event){ - var acft_id = event.get('aircraftId'); - var order_string = event.get('order'); - //document.getElementById('info').innerHTML='drone ' +name+' has been resurrected !'; - addMsgLog('drone ' +acft_id+' has been resurrected !'); - var drone_index = seekIndex(acft_id); - if(drone_index!=-1) - { - clearTimeout ( droneStateDieEvent[drone_index] ); - // on remet l'aircraft en couleur - } - } - - function orderprocessing_newplane(event){ - var acft_id = event.get('aircraftId'); - var order_string = event.get('order'); - var name= event.get('aircraftName'); - //document.getElementById('info').innerHTML='drone ' +name+' has been connected !'; - addMsgLog('drone ' +name+' has been connected !'); - } - - - function orderprocessing_planekilled(event){ - var acft_id = event.get('aircraftId'); - var name=name_from_id(acft_id); - addMsgLog("drone " + name + " deconnection caused by death of ivy bus..."); - //document.getElementById('info').innerHTML="drone " + name + " deconnection caused by death of ivy bus..."; - // remove drone...markers.... - removeDroneDisplay(acft_id); - } - - function orderprocessing_csv_settings(event){ - var acft_id = event.get('aircraftId'); - var csv = event.get('csv'); - var index_drone = seekIndex(acft_id); - var name=name_from_id(acft_id); - if (index_drone!=-1) { - planes[index_drone]["csv"]= csv; - //addMsgLog("settings updated for drone " + name); - if(index_drone==selected_index) - { - DOMImplementation("upload/"+planes[selected_index]["id"]+"/settings.xml",settingsDisplay); - } - } - } - - function orderprocessing_chat(event){ - } - - function createLock(id_drone,typ_obj,id_obj,login){ - this.id_drone = id_drone; - this.type_object = typ_obj; - this.id_object = id_obj; - this.request_login = login; - this.lockmsg = function() - {return ("user "+this.request_login+ " has locked "+this.type_object +" " +this.id_object);} - this.unlockmsg = function() - {return ("user "+this.request_login+ " has unlocked "+this.type_object +" " +this.id_object);} - } - - var external_waypoint_lock = new Array(); - var external_block_lock = new Array(); - var external_setting_lock = new Array(); - // set or remove a lock to prevent user to change sthg taht is to be changed by another user - function orderprocessing_client_action(event){ - var rqst_login = event.get('login'); - var rqst_action = event.get('action'); - var rqst_obj_type = event.get('type_obj'); - var rqst_obj_id = event.get('id_obj'); - var rqst_id_drone = event.get('webiddrone'); - if (rqst_action=='lock'){ - var lock_obj = new createLock(rqst_id_drone,rqst_obj_type,rqst_obj_id,rqst_login); - if (rqst_obj_type=='waypoint') {external_waypoint_lock.push(lock_obj);} - else if (rqst_obj_type=='block') {external_block_lock.push(lock_obj);} - else if (rqst_obj_type=='setting') {external_setting_lock.push(lock_obj);} - addMsgLog(lock_obj.lockmsg()); - } - else if (rqst_action =='unlock'){ - var trouve = false; - var cur_id_obj=-1; - var i=0; - if (rqst_obj_type=='waypoint') - { - while((!trouve)&&(i - - - - - - - -
- -
- -
-
-
-
- - -
-
-
-
-
-
-

- -
-

-
-
-
-
-
loading...
-
-
- -
-loading... -
- - - -
-
Flight Parameters
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
altitude (m)0
height0 m
battery level0V
speed0 km/h
GPS statusOFF
vertical speed0 m/s
engine power0%
-
- - - - -
-
- -
-
-
-
-
    -
-
-
-
-
- -
-
no news..
-
- - - -
- - - - - -<% - out.println(""); -%> - - -<%-- --%> - - \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/META-INF/MANIFEST.MF b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/META-INF/MANIFEST.MF deleted file mode 100755 index 254272e1c0..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/classes/pushlet.properties b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/classes/pushlet.properties deleted file mode 100755 index ba656e138f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/classes/pushlet.properties +++ /dev/null @@ -1,128 +0,0 @@ -# -# Pushlet configuration. -# Place this file in the CLASSPATH (e.g. WEB-INF/classes) or directly under WEB-INF. -# -# $Id: pushlet.properties,v 1.13 2007/12/07 12:57:40 justb Exp $ -# - -# -# -# -config.version=1.0.2 - -# -# CLASS FACTORY SPECIFICATION -# -# Change these if you want to override any of the core classes -# within the Pushlet framework with your own custom classes. -# -# Examples: -# - custom SessionManager for authorisation -# - maintain lists of active subjects (topics) -# - send events on subscription -# - plug in custom logging like log4j -# Note that you must maintain the semantics of each class ! -# Below are the default properties for the core classes. -controller.class=nl.justobjects.pushlet.core.Controller -dispatcher.class=nl.justobjects.pushlet.core.Dispatcher -logger.class=nl.justobjects.pushlet.util.Log4jLogger -# logger.class=nl.justobjects.pushlet.util.DefaultLogger -sessionmanager.class=nl.justobjects.pushlet.core.SessionManager -session.class=nl.justobjects.pushlet.core.Session -subscriber.class=nl.justobjects.pushlet.core.Subscriber -subscription.class=nl.justobjects.pushlet.core.Subscription - -# sessionmanager.maxsessions=200 - -# -# DISPATCHER -# - - -# TODO: allow properties to be maintained in -# a user dir -# config.redirect=/etc/pushlet.properties - -# -# LOGGING -# - -# log level (trace(6) debug(5) info (4), warn(3), error(2), fatal(1)) -# default is info(4) -log.level=4 - -# -# LOCAL EVENT SOURCES -# - -# should local sources be loaded ? -sources.activate=true - -# -# SESSION -# - - -# algoritm to generate session key: -# values: "randomstring" (default) or "uuid". -# session.id.generation=uuid -session.id.generation=randomstring - -# length of generated session key when using "randomstring" generation -session.id.size=10 - -# Overall session lease time in minutes -# Mainly used for clients that do not perform -# listening, e.g. when publishing only. -session.timeout.mins=5 - -# -# EVENT QUEUE -# -# Properties for per-client data event queue - -# Size for -queue.size=24 -queue.read.timeout.millis=20000 -queue.write.timeout.millis=20 - -# -# LISTENING MODE -# - -# You may force all clients to use pull mode -# for scalability -listen.force.pull.all=false - -# -# Comma-separated list of User Agent substrings. -# Force these browsers to use pull mode, since they -# don't support JS streaming, matching is done using -# String.indexOf() with lowercased agent strings -# use multiple criteria with &. -# -listen.force.pull.agents=safari - -# -# PULL MODE -# - -# time server should wait on refresing pull client -pull.refresh.timeout.millis=45000 - -# minimum/maximum wait time client should wait before refreshing -# server provides a random time between these values -pull.refresh.wait.min.millis=2000 -pull.refresh.wait.max.millis=6000 - -# -# POLL MODE -# - -# time server should wait on refresing poll client -poll.refresh.timeout.millis=60000 - -# minimum/maximum wait time client should wait before refreshing -# server provides a random time between these values -poll.refresh.wait.min.millis=6000 -poll.refresh.wait.max.millis=10000 diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/classes/sources.properties b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/classes/sources.properties deleted file mode 100755 index e8aeb36a43..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/classes/sources.properties +++ /dev/null @@ -1,28 +0,0 @@ -# -# Properties file for EventSource objects to be instantiated. -# -# Place this file in the CLASSPATH (e.g. WEB-INF/classes) or directly under WEB-INF. -# -# $Id: sources.properties,v 1.2 2007/11/10 14:12:16 justb Exp $ -# -# Each EventSource is defined as = -# 1. should be unique within this file but may be any name -# 2. is the full class name -# -# -# Define Pull Sources here. These classes must be derived from -# nl.justobjects.pushlet.core.EventPullSource -# Inner classes are separated with a $ sign from the outer class. -#source1=nl.justobjects.pushlet.test.TestEventPullSources$TemperatureEventPullSource -#source2=nl.justobjects.pushlet.test.TestEventPullSources$SystemStatusEventPullSource -#source3=nl.justobjects.pushlet.test.TestEventPullSources$PushletStatusEventPullSource -#source4=nl.justobjects.pushlet.test.TestEventPullSources$AEXStocksEventPullSource -#source5=nl.justobjects.pushlet.test.TestEventPullSources$WebPresentationEventPullSource -#source6=nl.justobjects.pushlet.test.TestEventPullSources$PingEventPullSource - -source1=pow.webserver.Serveur$IvyEventSource - -# TO BE DONE IN NEXT VERSION -# define Push Sources here. These must implement the interface -# nl.justobjects.pushlet.core.EventSource - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-codec-1.4.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-codec-1.4.jar deleted file mode 100755 index 458d432da8..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-codec-1.4.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar deleted file mode 100755 index aa209b3887..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-httpclient-3.1.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-httpclient-3.1.jar deleted file mode 100755 index 7c59774aed..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-httpclient-3.1.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-io-1.4.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-io-1.4.jar deleted file mode 100755 index 133dc6cb35..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-io-1.4.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-logging-1.1.1.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-logging-1.1.1.jar deleted file mode 100755 index 8758a96b70..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/commons-logging-1.1.1.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/jdom.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/jdom.jar deleted file mode 100755 index 65a1b3f737..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/jdom.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/log4j-1.2.16.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/log4j-1.2.16.jar deleted file mode 100755 index 3f9d847618..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/log4j-1.2.16.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/mysql-connector-java-5.1.12-bin.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/mysql-connector-java-5.1.12-bin.jar deleted file mode 100755 index af5847eed4..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/mysql-connector-java-5.1.12-bin.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/pushlet.jar b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/pushlet.jar deleted file mode 100755 index 6dc1c22e21..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/lib/pushlet.jar and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/web.xml b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/web.xml deleted file mode 100755 index 16b18bbc06..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/WEB-INF/web.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - ServletPow - - index.html - index.htm - index.jsp - default.html - default.htm - default.jsp - - - - Greeting - Greeting - pow.webserver.Greeting - - - Greeting - /Greeting.srv - - - - Pushlet - Pushlet - nl.justobjects.pushlet.servlet.Pushlet - 1 - - - Pushlet - /pushlet.srv - - - - Ivy2TomcatHttpServer - Ivy2TomcatHttpServer - pow.webserver.Ivy2TomcatHttpServer - 1 - - - Ivy2TomcatHttpServer - /Ivy2TomcatHttpServer.srv - - - - ajaxRqst - ajaxRqst - pow.webserver.AjaxRqst - - - ajaxRqst - /ajaxRqst.srv - - \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/admin.jsp b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/admin.jsp deleted file mode 100755 index 77c8c2fa9c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/admin.jsp +++ /dev/null @@ -1,790 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> -<%@page import="java.util.*,pow.webserver.UserTab,pow.webserver.User,javax.xml.parsers.*, org.w3c.dom.*,org.xml.sax.*,java.io.*" %> -<% -// recuperation des données sur le serveur - String default_folder = this.getServletContext().getRealPath(""); - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl"); - Iterator itr=logTab.getLoginIterator(); - // - UserTab logIvyTab = UserTab.unserialize(default_folder + "/conf/"+"userIvyTable.tbl"); - Iterator itrIvy=logIvyTab.getLoginIterator(); - // lecture liste des noms de drones ds immat.xml - DocumentBuilderFactory fabrique = DocumentBuilderFactory.newInstance(); - // création d'un constructeur de documents - DocumentBuilder constructeur = fabrique.newDocumentBuilder(); - // lecture du contenu d'un fichier XML avec DOM - File xml = new File(default_folder + "/conf/"+"immat.xml"); - Document document = constructeur.parse(xml); - - -%> - - - - - - - -Administration page - - - - - - - - - - - - - - - -
-
-
- -
-
-
Select an item - - - - - - - - -
- -
-
-
-
- - - - - - - - - - - -
-
-
-
-
- Add or Remove a name among drones which may be controlled by users - - - - - - -
- -
-
-
-
-
-
-
-
-
- Add or Remove an Ivy User - - - - - - -
- -
-
-
-
- - -
- -
-
- - \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/conf/immat.xml b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/conf/immat.xml deleted file mode 100755 index 42965d30c1..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/conf/immat.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/conf/pow_conf.xml b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/conf/pow_conf.xml deleted file mode 100755 index 947a6b35b7..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/conf/pow_conf.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 8535 - 8536 - 1024 - 10000 - pow_sql - truesilentpow_user - pwdpow_user - admin - admin@pow.fr - - 1200000 - - 60000 - - -10000 - -5000 - -30000 - 30000 - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/help.jsp b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/help.jsp deleted file mode 100755 index cc8eedffa0..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/help.jsp +++ /dev/null @@ -1,58 +0,0 @@ -<%@page import="pow.webserver.Conf" %> - - - - - - Welcome to Paparazzi On the Web - - - - - - - - - -

Welcome on Paparazzi On the Web help page.

-

This page is here to help you to use the Paparazzi On the Web (POW) application. POW is a part of Paparazzi which is a open-project of civil UAV control. With Paparazzi On the Web, you are able to observe and eventually control the UAVs of the system Paparazzi thanks to a browser with your internet connexion. To learn more about Paparazzi project, click here.

-

Paparazzi On the Web is optimised for Firefox browser. If you want to have a better performance, you can dowload Firefox here.

-

Start page

-

If you have a login and a password on Paparazzi On the Web, you can use them to enter the application. Else, click on enter as a guest.

- -

Main page

-

You are now on Paparazzi On the Web main page. You can see several boxes. We will describe all those boxes and show you the interactions you can have with them.

- -

Choose an aircraft

-

Here you can select the aircraft you want to observe or control. Click on the arrow to see the list of the aircrafts that are available. Click on the aircraft you want to interacte with.

-

You can also choose to activate or desactivate tracking. When tracking is activated, the map is always centered on the selected aircraft.

- - - -

The map

-

On the map, you can see all the aircrafts that are available. If tracking is activated, the map will be centered on the selected aircraft. There are also red lozenges which are the waypoints of the selected UAV. If you are autentified on Paparazzi On the Web and if your profile gives you the authorization, you can move those waypoints with drag and drop.

- -

The flight plan

-

Through this box, you can obtain some informations on the flight plan that is followed by the selected plane. If you move your cursor on the informations tab, you obtain informations on the flightplan. If you put your cursor on the "active block" tab, you can see the list of the flight plan blocks that the plane can follow. The active block is in red. If you are authentified and if you have the authorization, you can change the active block by clicking on its name. The waypoints tab gives you informations on the different waypoints. If you are authentified and if you have the authorization, you can move those waypoints by clicking on "move waypoint". In this case, a new windows is openned where you indicate where you want to move the waypoint. -You can also move a waypoint by dragging the icon on the map to its new position.

- -

The flight parameters

-

This box displays the flight parameters of the selected aircraft. When a value is out of its normal range, it becomes red.

- -

The settings

-

In this box you can, if you are allowed to control the selected aircraft, you change some settings of this aircraft by clicking on the name of the setting.

- -

Any problem ?

-

If you have any display problem, such as a ghost aircraft icon, or an aircraft that is not displayed in the aircrafts list, you might resolve it by reloading the page by pressing F5 key. -For any other problem, please inform -<% -out.print("the administrator"); %>.

-Click here to return to the homepage. - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/idError.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/idError.html deleted file mode 100755 index a15edb3f6d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/idError.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Welcome to Paparazzi On the Web - - - - - -

Sorry, an error occured during your identification. Click here to return on the homepage.

- - \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/base.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/base.gif deleted file mode 100755 index 9ac0b117b0..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/base.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/cd.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/cd.gif deleted file mode 100755 index 7503819404..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/cd.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/empty.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/empty.gif deleted file mode 100755 index b5cf52378f..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/empty.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/folder.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/folder.gif deleted file mode 100755 index eb129763dc..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/folder.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/folderopen.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/folderopen.gif deleted file mode 100755 index c5c31102d5..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/folderopen.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/globe.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/globe.gif deleted file mode 100755 index 57123d0e69..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/globe.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/imgfolder.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/imgfolder.gif deleted file mode 100755 index e6d880347f..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/imgfolder.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/join.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/join.gif deleted file mode 100755 index 34dd47610a..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/join.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/joinbottom.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/joinbottom.gif deleted file mode 100755 index 48b81c80a9..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/joinbottom.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/line.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/line.gif deleted file mode 100755 index 1a259eea00..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/line.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/minus.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/minus.gif deleted file mode 100755 index 3d212a97ae..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/minus.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/minusbottom.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/minusbottom.gif deleted file mode 100755 index dc3198be27..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/minusbottom.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/musicfolder.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/musicfolder.gif deleted file mode 100755 index f620789feb..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/musicfolder.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/nolines_minus.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/nolines_minus.gif deleted file mode 100755 index 2592ac20f3..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/nolines_minus.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/nolines_plus.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/nolines_plus.gif deleted file mode 100755 index f258ce211a..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/nolines_plus.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/page.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/page.gif deleted file mode 100755 index 42d7318c5d..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/page.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/plus.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/plus.gif deleted file mode 100755 index b2c997233b..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/plus.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/plusbottom.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/plusbottom.gif deleted file mode 100755 index b5671d891a..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/plusbottom.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/question.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/question.gif deleted file mode 100755 index dd4e685078..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/question.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/trash.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/trash.gif deleted file mode 100755 index cfa0f000e1..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/img/trash.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/index.jsp b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/index.jsp deleted file mode 100755 index aad5c605b5..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/index.jsp +++ /dev/null @@ -1,69 +0,0 @@ - - - - - Welcome to Paparazzi On the Web - - - - - - - - - - - -

Welcome to Paparazzi On The Web !

- -

- -

-
-
-

Login :

-

Password :

- -
-

- - -
-

-
-

or

- -

-

- -
-

-help ? - - \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/DOMImplementation.js b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/DOMImplementation.js deleted file mode 100755 index 75c17e11d6..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/DOMImplementation.js +++ /dev/null @@ -1,24 +0,0 @@ -function DOMImplementation(sUrl, fCallback) { - var dom; - if(window.ActiveXObject) { - dom = new ActiveXObject("Microsoft.XMLDOM"); - dom.onreadystatechange = function() { - if(dom.readyState == 4) { - //alert("win "+sUrl+" loaded"); - fCallback(dom); - } - }; - } - else if(document.implementation && document.implementation.createDocument) { - dom = document.implementation.createDocument("", "", null); - dom.onload = function() { - //alert("other "+sUrl+" loaded"); - fCallback(dom); - } - } - else { - alert("Votre navigateur ne gère pas l'importation de fichiers XML"); - return; - } - dom.load(sUrl); -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/XHR_object.js b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/XHR_object.js deleted file mode 100755 index 8f3f022733..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/XHR_object.js +++ /dev/null @@ -1,20 +0,0 @@ -function getXMLHttpRequest() { - var xhr = null; - - if (window.XMLHttpRequest || window.ActiveXObject) { - if (window.ActiveXObject) { - try { - xhr = new ActiveXObject("Msxml2.XMLHTTP"); - } catch(e) { - xhr = new ActiveXObject("Microsoft.XMLHTTP"); - } - } else { - xhr = new XMLHttpRequest(); - } - } else { - alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest..."); - return null; - } - - return xhr; -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/browserdetect.js b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/browserdetect.js deleted file mode 100755 index a8674db57f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/browserdetect.js +++ /dev/null @@ -1,97 +0,0 @@ -// Browser Detect Lite v2.1.4 -// http://www.dithered.com/javascript/browser_detect/index.html -// modified by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM) - - -function BrowserDetectLite() { - var ua = navigator.userAgent.toLowerCase(); - - // browser name - this.isGecko = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1); - this.isMozilla = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length); - this.isNS = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) ); - this.isIE = ( (ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) ); - this.isSafari = (ua.indexOf('safari') != - 1); - this.isOpera = (ua.indexOf('opera') != -1); - this.isKonqueror = (ua.indexOf('konqueror') != -1 && !this.isSafari); - this.isIcab = (ua.indexOf('icab') != -1); - this.isAol = (ua.indexOf('aol') != -1); - - // spoofing and compatible browsers - this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE); - this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla); - - // browser version - this.versionMinor = parseFloat(navigator.appVersion); - - // correct version number - if (this.isNS && this.isGecko) { - this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) ); - } - else if (this.isIE && this.versionMinor >= 4) { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) ); - } - else if (this.isMozilla) { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ); - } - else if (this.isSafari) { - this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) ); - } - else if (this.isOpera) { - if (ua.indexOf('opera/') != -1) { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) ); - } - else { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) ); - } - } - else if (this.isKonqueror) { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) ); - } - else if (this.isIcab) { - if (ua.indexOf('icab/') != -1) { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) ); - } - else { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) ); - } - } - - this.versionMajor = parseInt(this.versionMinor); - this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 ); - - // dom support - this.isDOM1 = (document.getElementById); - this.isDOM2Event = (document.addEventListener && document.removeEventListener); - - // css compatibility mode - this.mode = document.compatMode ? document.compatMode : 'BackCompat'; - - // platform - this.isWin = (ua.indexOf('win') != -1); - this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) ); - this.isMac = (ua.indexOf('mac') != -1); - this.isUnix = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1) - this.isLinux = (ua.indexOf('linux') != -1); - - // specific browser shortcuts - this.isNS4x = (this.isNS && this.versionMajor == 4); - this.isNS40x = (this.isNS4x && this.versionMinor < 4.5); - this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7); - this.isNS4up = (this.isNS && this.versionMinor >= 4); - this.isNS6x = (this.isNS && this.versionMajor == 6); - this.isNS6up = (this.isNS && this.versionMajor >= 6); - this.isNS7x = (this.isNS && this.versionMajor == 7); - this.isNS7up = (this.isNS && this.versionMajor >= 7); - - this.isIE4x = (this.isIE && this.versionMajor == 4); - this.isIE4up = (this.isIE && this.versionMajor >= 4); - this.isIE5x = (this.isIE && this.versionMajor == 5); - this.isIE55 = (this.isIE && this.versionMinor == 5.5); - this.isIE5up = (this.isIE && this.versionMajor >= 5); - this.isIE6x = (this.isIE && this.versionMajor == 6); - this.isIE6up = (this.isIE && this.versionMajor >= 6); - - this.isIE4xMac = (this.isIE4x && this.isMac); -} -var browser = new BrowserDetectLite(); diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/curvycorners.js b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/curvycorners.js deleted file mode 100755 index 511c78dd9d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/curvycorners.js +++ /dev/null @@ -1 +0,0 @@ -function browserdetect(){var A=navigator.userAgent.toLowerCase();this.isIE=A.indexOf("msie")>-1;this.ieVer=this.isIE?/msie\s(\d\.\d)/.exec(A)[1]:0;this.isMoz=A.indexOf("firefox")!=-1;this.isSafari=A.indexOf("safari")!=-1;this.quirksMode=this.isIE&&(!document.compatMode||document.compatMode.indexOf("BackCompat")>-1);this.isOp="opera" in window;this.isWebKit=A.indexOf("webkit")!=-1;if(this.isIE){this.get_style=function(D,F){if(!(F in D.currentStyle)){return""}var C=/^([\d.]+)(\w*)/.exec(D.currentStyle[F]);if(!C){return D.currentStyle[F]}if(C[1]==0){return"0"}if(C[2]&&C[2]!=="px"){var B=D.style.left;var E=D.runtimeStyle.left;D.runtimeStyle.left=D.currentStyle.left;D.style.left=C[1]+C[2];C[0]=D.style.pixelLeft;D.style.left=B;D.runtimeStyle.left=E}return C[0]}}else{this.get_style=function(B,C){C=C.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return document.defaultView.getComputedStyle(B,"").getPropertyValue(C)}}}var curvyBrowser=new browserdetect;if(curvyBrowser.isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}function curvyCnrSpec(A){this.selectorText=A;this.tlR=this.trR=this.blR=this.brR=0;this.tlu=this.tru=this.blu=this.bru="";this.antiAlias=true}curvyCnrSpec.prototype.setcorner=function(B,C,A,D){if(!B){this.tlR=this.trR=this.blR=this.brR=parseInt(A);this.tlu=this.tru=this.blu=this.bru=D}else{propname=B.charAt(0)+C.charAt(0);this[propname+"R"]=parseInt(A);this[propname+"u"]=D}};curvyCnrSpec.prototype.get=function(D){if(/^(t|b)(l|r)(R|u)$/.test(D)){return this[D]}if(/^(t|b)(l|r)Ru$/.test(D)){var C=D.charAt(0)+D.charAt(1);return this[C+"R"]+this[C+"u"]}if(/^(t|b)Ru?$/.test(D)){var B=D.charAt(0);B+=this[B+"lR"]>this[B+"rR"]?"l":"r";var A=this[B+"R"];if(D.length===3&&D.charAt(2)==="u"){A+=this[B="u"]}return A}throw new Error("Don't recognize property "+D)};curvyCnrSpec.prototype.radiusdiff=function(A){if(A!=="t"&&A!=="b"){throw new Error("Param must be 't' or 'b'")}return Math.abs(this[A+"lR"]-this[A+"rR"])};curvyCnrSpec.prototype.setfrom=function(A){this.tlu=this.tru=this.blu=this.bru="px";if("tl" in A){this.tlR=A.tl.radius}if("tr" in A){this.trR=A.tr.radius}if("bl" in A){this.blR=A.bl.radius}if("br" in A){this.brR=A.br.radius}if("antiAlias" in A){this.antiAlias=A.antiAlias}};curvyCnrSpec.prototype.cloneOn=function(G){var E=["tl","tr","bl","br"];var H=0;var C,A;for(C in E){if(!isNaN(C)){A=this[E[C]+"u"];if(A!==""&&A!=="px"){H=new curvyCnrSpec;break}}}if(!H){H=this}else{var B,D,F=curvyBrowser.get_style(G,"left");for(C in E){if(!isNaN(C)){B=E[C];A=this[B+"u"];D=this[B+"R"];if(A!=="px"){var F=G.style.left;G.style.left=D+A;D=G.style.pixelLeft;G.style.left=F}H[B+"R"]=D;H[B+"u"]="px"}}G.style.left=F}return H};curvyCnrSpec.prototype.radiusSum=function(A){if(A!=="t"&&A!=="b"){throw new Error("Param must be 't' or 'b'")}return this[A+"lR"]+this[A+"rR"]};curvyCnrSpec.prototype.radiusCount=function(A){var B=0;if(this[A+"lR"]){++B}if(this[A+"rR"]){++B}return B};curvyCnrSpec.prototype.cornerNames=function(){var A=[];if(this.tlR){A.push("tl")}if(this.trR){A.push("tr")}if(this.blR){A.push("bl")}if(this.brR){A.push("br")}return A};function operasheet(C){var A=document.styleSheets.item(C).ownerNode.text;A=A.replace(/\/\*(\n|\r|.)*?\*\//g,"");var D=new RegExp("^s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}","mg");var G;this.rules=[];while((G=D.exec(A))!==null){var F=new RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g");var E,B=new curvyCnrSpec(G[1]);while((E=F.exec(G[2]))!==null){if(E[1]!=="z-"){B.setcorner(E[3],E[4],E[5],E[6])}}this.rules.push(B)}}operasheet.contains_border_radius=function(A){return/border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(A).ownerNode.text)};function curvyCorners(){var G,D,E,B,J;if(typeof arguments[0]!=="object"){throw curvyCorners.newError("First parameter of curvyCorners() must be an object.")}if(arguments[0] instanceof curvyCnrSpec){B=arguments[0];if(!B.selectorText&&typeof arguments[1]==="string"){B.selectorText=arguments[1]}}else{if(typeof arguments[1]!=="object"&&typeof arguments[1]!=="string"){throw curvyCorners.newError("Second parameter of curvyCorners() must be an object or a class name.")}D=arguments[1];if(typeof D!=="string"){D=""}if(D!==""&&D.charAt(0)!=="."&&"autoPad" in arguments[0]){D="."+D}B=new curvyCnrSpec(D);B.setfrom(arguments[0])}if(B.selectorText){J=0;var I=B.selectorText.replace(/\s+$/,"").split(/,\s*/);E=new Array;function A(M){var L=M.split("#");return(L.length===2?"#":"")+L.pop()}for(G=0;G7?curvyBrowser.get_style(this.box,"filter"):null;var H=this.spec.get("tR");var M=this.spec.get("bR");var W=function(f){if(typeof f==="number"){return f}if(typeof f!=="string"){throw new Error("unexpected styleToNPx type "+typeof f)}var d=/^[-\d.]([a-z]+)$/.exec(f);if(d&&d[1]!="px"){throw new Error("Unexpected unit "+d[1])}if(isNaN(f=parseInt(f))){f=0}return f};var T=function(d){return d<=0?"0":d+"px"};try{this.borderWidth=W(b);this.borderWidthB=W(J);this.borderWidthL=W(D);this.borderWidthR=W(B);this.boxColour=curvyObject.format_colour(E);this.topPadding=W(Z);this.bottomPadding=W(c);this.leftPadding=W(Q);this.rightPadding=W(a);this.boxWidth=K;this.boxHeight=this.box.clientHeight;this.borderColour=curvyObject.format_colour(I);this.borderColourB=curvyObject.format_colour(G);this.borderColourL=curvyObject.format_colour(A);this.borderString=this.borderWidth+"px solid "+this.borderColour;this.borderStringB=this.borderWidthB+"px solid "+this.borderColourB;this.backgroundImage=((C!="none")?C:"");this.backgroundRepeat=Y}catch(X){throw this.newError("getMessage" in X?X.getMessage():X.message)}var F=this.boxHeight;var V=K;if(curvyBrowser.isOp){R=W(R);P=W(P);if(R){var N=V+this.borderWidthL+this.borderWidthR;if(R>N){R=N}R=(N/R*100)+"%"}if(P){var N=F+this.borderWidth+this.borderWidthB;if(P>N){P=N}P=(N/P*100)+"%"}}if(curvyBrowser.quirksMode){}else{this.boxWidth-=this.leftPadding+this.rightPadding;this.boxHeight-=this.topPadding+this.bottomPadding}this.contentContainer=document.createElement("div");if(filter){this.contentContainer.style.filter=filter}while(this.box.firstChild){this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild))}if(O!="absolute"){this.box.style.position="relative"}this.box.style.padding="0";this.box.style.border=this.box.style.backgroundImage="none";this.box.style.backgroundColor="transparent";this.box.style.width=(V+this.borderWidthL+this.borderWidthR)+"px";this.box.style.height=(F+this.borderWidth+this.borderWidthB)+"px";var L=document.createElement("div");L.style.position="absolute";if(filter){L.style.filter=filter}if(curvyBrowser.quirksMode){L.style.width=(V+this.borderWidthL+this.borderWidthR)+"px"}else{L.style.width=V+"px"}L.style.height=T(F+this.borderWidth+this.borderWidthB-H-M);L.style.padding="0";L.style.top=H+"px";L.style.left="0";if(this.borderWidthL){L.style.borderLeft=this.borderWidthL+"px solid "+this.borderColourL}if(this.borderWidth&&!H){L.style.borderTop=this.borderWidth+"px solid "+this.borderColour}if(this.borderWidthR){L.style.borderRight=this.borderWidthR+"px solid "+this.borderColourL}if(this.borderWidthB&&!M){L.style.borderBottom=this.borderWidthB+"px solid "+this.borderColourB}L.style.backgroundColor=E;L.style.backgroundImage=this.backgroundImage;L.style.backgroundRepeat=this.backgroundRepeat;this.shell=this.box.appendChild(L);K=curvyBrowser.get_style(this.shell,"width");if(K===""||K==="auto"||K.indexOf("%")!==-1){throw this.newError("Shell width is "+K)}this.boxWidth=(K!=""&&K!="auto"&&K.indexOf("%")==-1)?parseInt(K):this.shell.clientWidth;this.applyCorners=function(){if(this.backgroundObject){var w=function(AO,i,t){if(AO===0){return 0}var k;if(AO==="right"||AO==="bottom"){return t-i}if(AO==="center"){return(t-i)/2}if(AO.indexOf("%")>0){return(t-i)*100/parseInt(AO)}return W(AO)};this.backgroundPosX=w(R,this.backgroundObject.width,V);this.backgroundPosY=w(P,this.backgroundObject.height,F)}else{if(this.backgroundImage){this.backgroundPosX=W(R);this.backgroundPosY=W(P)}}if(H){v=document.createElement("div");v.style.width=this.boxWidth+"px";v.style.fontSize="1px";v.style.overflow="hidden";v.style.position="absolute";v.style.paddingLeft=this.borderWidth+"px";v.style.paddingRight=this.borderWidth+"px";v.style.height=H+"px";v.style.top=-H+"px";v.style.left=-this.borderWidthL+"px";this.topContainer=this.shell.appendChild(v)}if(M){var v=document.createElement("div");v.style.width=this.boxWidth+"px";v.style.fontSize="1px";v.style.overflow="hidden";v.style.position="absolute";v.style.paddingLeft=this.borderWidthB+"px";v.style.paddingRight=this.borderWidthB+"px";v.style.height=M+"px";v.style.bottom=-M+"px";v.style.left=-this.borderWidthL+"px";this.bottomContainer=this.shell.appendChild(v)}var AG=this.spec.cornerNames();for(var AK in AG){if(!isNaN(AK)){var AC=AG[AK];var AD=this.spec[AC+"R"];var AE,AH,j,AF;if(AC=="tr"||AC=="tl"){AE=this.borderWidth;AH=this.borderColour;AF=this.borderWidth}else{AE=this.borderWidthB;AH=this.borderColourB;AF=this.borderWidthB}j=AD-AF;var u=document.createElement("div");u.style.height=this.spec.get(AC+"Ru");u.style.width=this.spec.get(AC+"Ru");u.style.position="absolute";u.style.fontSize="1px";u.style.overflow="hidden";var r,q,p;var n=filter?parseInt(/alpha\(opacity.(\d+)\)/.exec(filter)[1]):100;for(r=0;r=j)?-1:Math.floor(Math.sqrt(Math.pow(j,2)-Math.pow(r+1,2)))-1;if(j!=AD){var h=(r>=j)?-1:Math.ceil(Math.sqrt(Math.pow(j,2)-Math.pow(r,2)));var f=(r+1>=AD)?-1:Math.floor(Math.sqrt(Math.pow(AD,2)-Math.pow((r+1),2)))-1}var d=(r>=AD)?-1:Math.ceil(Math.sqrt(Math.pow(AD,2)-Math.pow(r,2)));if(m>-1){this.drawPixel(r,0,this.boxColour,n,(m+1),u,true,AD)}if(j!=AD){if(this.spec.antiAlias){for(q=m+1;q=30,AD)}else{if(this.boxColour!=="transparent"){var AB=curvyObject.BlendColour(this.boxColour,AH,curvyObject.pixelFraction(r,q,j));this.drawPixel(r,q,AB,n,1,u,false,AD)}else{this.drawPixel(r,q,AH,n>>1,1,u,false,AD)}}}if(f>=h){if(h==-1){h=0}this.drawPixel(r,h,AH,n,(f-h+1),u,false,0)}p=AH;q=f}else{if(f>m){this.drawPixel(r,(m+1),AH,n,(f-m),u,false,0)}}}else{p=this.boxColour;q=m}if(this.spec.antiAlias){while(++q>>4]+""+A[B&15]};curvyObject.BlendColour=function(L,J,G){if(L==="transparent"||J==="transparent"){throw this.newError("Cannot blend with transparent")}if(L.charAt(0)!=="#"){L=curvyObject.format_colour(L)}if(J.charAt(0)!=="#"){J=curvyObject.format_colour(J)}var D=parseInt(L.substr(1,2),16);var K=parseInt(L.substr(3,2),16);var F=parseInt(L.substr(5,2),16);var C=parseInt(J.substr(1,2),16);var I=parseInt(J.substr(3,2),16);var E=parseInt(J.substr(5,2),16);if(G>1||G<0){G=1}var H=Math.round((D*G)+(C*(1-G)));if(H>255){H=255}if(H<0){H=0}var B=Math.round((K*G)+(I*(1-G)));if(B>255){B=255}if(B<0){B=0}var A=Math.round((F*G)+(E*(1-G)));if(A>255){A=255}if(A<0){A=0}return"#"+curvyObject.IntToHex(H)+curvyObject.IntToHex(B)+curvyObject.IntToHex(A)};curvyObject.pixelFraction=function(H,G,A){var J;var E=A*A;var B=new Array(2);var F=new Array(2);var I=0;var C="";var D=Math.sqrt(E-Math.pow(H,2));if(D>=G&&D<(G+1)){C="Left";B[I]=0;F[I]=D-G;++I}D=Math.sqrt(E-Math.pow(G+1,2));if(D>=H&&D<(H+1)){C+="Top";B[I]=D-H;F[I]=1;++I}D=Math.sqrt(E-Math.pow(H+1,2));if(D>=G&&D<(G+1)){C+="Right";B[I]=1;F[I]=D-G;++I}D=Math.sqrt(E-Math.pow(G,2));if(D>=H&&D<(H+1)){C+="Bottom";B[I]=D-H;F[I]=0}switch(C){case"LeftRight":J=Math.min(F[0],F[1])+((Math.max(F[0],F[1])-Math.min(F[0],F[1]))/2);break;case"TopRight":J=1-(((1-B[0])*(1-F[1]))/2);break;case"TopBottom":J=Math.min(B[0],B[1])+((Math.max(B[0],B[1])-Math.min(B[0],B[1]))/2);break;case"LeftBottom":J=F[0]*B[1]/2;break;default:J=1}return J};curvyObject.rgb2Array=function(A){var B=A.substring(4,A.indexOf(")"));return B.split(", ")};curvyObject.rgb2Hex=function(B){try{var C=curvyObject.rgb2Array(B);var G=parseInt(C[0]);var E=parseInt(C[1]);var A=parseInt(C[2]);var D="#"+curvyObject.IntToHex(G)+curvyObject.IntToHex(E)+curvyObject.IntToHex(A)}catch(F){var H="getMessage" in F?F.getMessage():F.message;throw new Error("Error ("+H+") converting RGB value to Hex in rgb2Hex")}return D};curvyObject.setOpacity=function(F,C){C=(C==100)?99.999:C;if(curvyBrowser.isSafari&&F.tagName!="IFRAME"){var B=curvyObject.rgb2Array(F.style.backgroundColor);var E=parseInt(B[0]);var D=parseInt(B[1]);var A=parseInt(B[2]);F.style.backgroundColor="rgba("+E+", "+D+", "+A+", "+C/100+")"}else{if(typeof F.style.opacity!=="undefined"){F.style.opacity=C/100}else{if(typeof F.style.MozOpacity!=="undefined"){F.style.MozOpacity=C/100}else{if(typeof F.style.filter!="undefined"){F.style.filter="alpha(opacity="+C+")"}else{if(typeof F.style.KHTMLOpacity!="undefined"){F.style.KHTMLOpacity=C/100}}}}}};function addEvent(D,C,B,A){if(D.addEventListener){D.addEventListener(C,B,A);return true}if(D.attachEvent){return D.attachEvent("on"+C,B)}D["on"+C]=B;return false}curvyObject.getComputedColour=function(E){var F=document.createElement("DIV");F.style.backgroundColor=E;document.body.appendChild(F);if(window.getComputedStyle){var D=document.defaultView.getComputedStyle(F,null).getPropertyValue("background-color");F.parentNode.removeChild(F);if(D.substr(0,3)==="rgb"){D=curvyObject.rgb2Hex(D)}return D}else{var A=document.body.createTextRange();A.moveToElementText(F);A.execCommand("ForeColor",false,E);var B=A.queryCommandValue("ForeColor");var C="rgb("+(B&255)+", "+((B&65280)>>8)+", "+((B&16711680)>>16)+")";F.parentNode.removeChild(F);A=null;return curvyObject.rgb2Hex(C)}};curvyObject.format_colour=function(A){if(A!=""&&A!="transparent"){if(A.substr(0,3)==="rgb"){A=curvyObject.rgb2Hex(A)}else{if(A.charAt(0)!=="#"){A=curvyObject.getComputedColour(A)}else{if(A.length===4){A="#"+A.charAt(1)+A.charAt(1)+A.charAt(2)+A.charAt(2)+A.charAt(3)+A.charAt(3)}}}}return A};curvyCorners.getElementsByClass=function(H,F){var E=new Array;if(F===undefined){F=document}H=H.split(".");var A="*";if(H.length===1){A=H[0];H=false}else{if(H[0]){A=H[0]}H=H[1]}var D,C,B;if(A.charAt(0)==="#"){C=document.getElementById(A.substr(1));if(C){E.push(C)}}else{C=F.getElementsByTagName(A);B=C.length;if(H){var G=new RegExp("(^|\\s)"+H+"(\\s|$)");for(D=0;D6){var H=J["-webkit-border-radius"]||0;var K=J["-webkit-border-top-right-radius"]||0;var F=J["-webkit-border-top-left-radius"]||0;var G=J["-webkit-border-bottom-right-radius"]||0;var M=J["-webkit-border-bottom-left-radius"]||0}else{var H=J["webkit-border-radius"]||0;var K=J["webkit-border-top-right-radius"]||0;var F=J["webkit-border-top-left-radius"]||0;var G=J["webkit-border-bottom-right-radius"]||0;var M=J["webkit-border-bottom-left-radius"]||0}if(H||F||K||G||M){var I=new curvyCnrSpec(L.selectorText);if(H){I.setcorner(null,null,parseInt(H),B(H))}else{if(K){I.setcorner("t","r",parseInt(K),B(K))}if(F){I.setcorner("t","l",parseInt(F),B(F))}if(M){I.setcorner("b","l",parseInt(M),B(M))}if(G){I.setcorner("b","r",parseInt(G),B(G))}}curvyCorners(I)}}for(E=0;E'; - } - if (node.url) { - str += ''; - str += node.name; - if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += ''; - str += ''; - if (node._hc) { - str += '
'; - str += this.addNode(node); - str += '
'; - } - this.aIndent.pop(); - return str; -}; - -// Adds the empty and line icons -dTree.prototype.indent = function(node, nodeId) { - var str = ''; - if (this.root.id != node.pid) { - for (var n=0; n'; - (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1); - if (node._hc) { - str += ''; - } else str += ''; - } - return str; -}; - -// Checks if a node has any children and if it is the last sibling -dTree.prototype.setCS = function(node) { - var lastId; - for (var n=0; n)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, -Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& -(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, -a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== -"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, -function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; -var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, -parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= -false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= -s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, -applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; -else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, -a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== -w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, -cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= -c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); -a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, -function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); -k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), -C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= -e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& -f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; -if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", -e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, -"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, -d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, -e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); -t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| -g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, -CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, -g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, -text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, -setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= -h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== -"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, -h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& -q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; -if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); -(function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: -function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= -{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== -"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", -d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? -a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== -1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, -""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); -return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", -""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= -c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? -c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= -function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= -Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, -"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= -a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= -a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== -"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, -serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), -function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, -global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& -e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? -"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== -false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= -false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", -c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| -d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); -g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== -1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== -"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; -if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== -"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| -c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; -this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= -this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, -e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; -a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); -c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, -d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- -f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": -"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in -e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/jquery-ui-1.8.2.custom.min.js b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/jquery-ui-1.8.2.custom.min.js deleted file mode 100755 index c11e844f9b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/jquery-ui-1.8.2.custom.min.js +++ /dev/null @@ -1,1012 +0,0 @@ -/*! - * jQuery UI 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - */ -(function(c){c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.2",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=0)&&c(a).is(":focusable")}})}})(jQuery); -;/*! - * jQuery UI Widget 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Widget - */ -(function(b){var j=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return j.call(b(this),a,c)})};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend({},c.options);b[e][a].prototype= -b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==undefined){h=i;return false}}):this.each(function(){var g= -b.data(this,a);if(g){d&&g.option(d);g._init()}else b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create(); -this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===undefined)return this.options[a];d={};d[a]=c}b.each(d,function(f, -h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a= -b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery); -;/*! - * jQuery UI Mouse 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Mouse - * - * Depends: - * jquery.ui.widget.js - */ -(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&& -this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault(); -return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&& -this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX- -a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -;/* - * jQuery UI Position 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Position - */ -(function(c){c.ui=c.ui||{};var m=/left|center|right/,n=/top|center|bottom/,p=c.fn.position,q=c.fn.offset;c.fn.position=function(a){if(!a||!a.of)return p.apply(this,arguments);a=c.extend({},a);var b=c(a.of),d=(a.collision||"flip").split(" "),e=a.offset?a.offset.split(" "):[0,0],g,h,i;if(a.of.nodeType===9){g=b.width();h=b.height();i={top:0,left:0}}else if(a.of.scrollTo&&a.of.document){g=b.width();h=b.height();i={top:b.scrollTop(),left:b.scrollLeft()}}else if(a.of.preventDefault){a.at="left top";g=h= -0;i={top:a.of.pageY,left:a.of.pageX}}else{g=b.outerWidth();h=b.outerHeight();i=b.offset()}c.each(["my","at"],function(){var f=(a[this]||"").split(" ");if(f.length===1)f=m.test(f[0])?f.concat(["center"]):n.test(f[0])?["center"].concat(f):["center","center"];f[0]=m.test(f[0])?f[0]:"center";f[1]=n.test(f[1])?f[1]:"center";a[this]=f});if(d.length===1)d[1]=d[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(a.at[0]==="right")i.left+=g;else if(a.at[0]==="center")i.left+= -g/2;if(a.at[1]==="bottom")i.top+=h;else if(a.at[1]==="center")i.top+=h/2;i.left+=e[0];i.top+=e[1];return this.each(function(){var f=c(this),k=f.outerWidth(),l=f.outerHeight(),j=c.extend({},i);if(a.my[0]==="right")j.left-=k;else if(a.my[0]==="center")j.left-=k/2;if(a.my[1]==="bottom")j.top-=l;else if(a.my[1]==="center")j.top-=l/2;j.left=parseInt(j.left);j.top=parseInt(j.top);c.each(["left","top"],function(o,r){c.ui.position[d[o]]&&c.ui.position[d[o]][r](j,{targetWidth:g,targetHeight:h,elemWidth:k, -elemHeight:l,offset:e,my:a.my,at:a.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(j,{using:a.using}))})};c.ui.position={fit:{left:function(a,b){var d=c(window);b=a.left+b.elemWidth-d.width()-d.scrollLeft();a.left=b>0?a.left-b:Math.max(0,a.left)},top:function(a,b){var d=c(window);b=a.top+b.elemHeight-d.height()-d.scrollTop();a.top=b>0?a.top-b:Math.max(0,a.top)}},flip:{left:function(a,b){if(b.at[0]!=="center"){var d=c(window);d=a.left+b.elemWidth-d.width()-d.scrollLeft();var e=b.my[0]==="left"? --b.elemWidth:b.my[0]==="right"?b.elemWidth:0,g=-2*b.offset[0];a.left+=a.left<0?e+b.targetWidth+g:d>0?e-b.targetWidth+g:0}},top:function(a,b){if(b.at[1]!=="center"){var d=c(window);d=a.top+b.elemHeight-d.height()-d.scrollTop();var e=b.my[1]==="top"?-b.elemHeight:b.my[1]==="bottom"?b.elemHeight:0,g=b.at[1]==="top"?b.targetHeight:-b.targetHeight,h=-2*b.offset[1];a.top+=a.top<0?e+b.targetHeight+h:d>0?e+g+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(a,b){if(/static/.test(c.curCSS(a,"position")))a.style.position= -"relative";var d=c(a),e=d.offset(),g=parseInt(c.curCSS(a,"top",true),10)||0,h=parseInt(c.curCSS(a,"left",true),10)||0;e={top:b.top-e.top+g,left:b.left-e.left+h};"using"in b?b.using.call(a,e):d.css(e)};c.fn.offset=function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(){c.offset.setOffset(this,a)});return q.call(this)}}})(jQuery); -;/* - * jQuery UI Draggable 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= -this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- -this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); -d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| -this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element, -b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== -a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| -0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], -this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- -(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== -"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&& -a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"), -10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], -this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft(): -f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options; -if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!= -"HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>=i&& -e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), -top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= -this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!d(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", -nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var e=0;e');/sw|se|ne|nw/.test(g)&&f.css({zIndex:++a.zIndex});"se"==g&&f.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[g]=".ui-resizable-"+g;this.element.append(f)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== -String)this.handles[i]=d(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=d(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}d(this.handles[i])}};this._renderAxis(this.element);this._handles=d(".ui-resizable-handle",this.element).disableSelection(); -this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();d(this.element).addClass("ui-resizable-autohide").hover(function(){d(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){d(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){d(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; -if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(d(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), -e=this.element;this.resizing=true;this.documentScroll={top:d(document).scrollTop(),left:d(document).scrollLeft()};if(e.is(".ui-draggable")||/absolute/.test(e.css("position")))e.css({position:"absolute",top:c.top,left:c.left});d.browser.opera&&/relative/.test(e.css("position"))&&e.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var g=m(this.helper.css("top"));if(a.containment){c+=d(a.containment).scrollLeft()||0;g+=d(a.containment).scrollTop()||0}this.offset= -this.helper.offset();this.position={left:c,top:g};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:c,top:g};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: -this.originalSize.width/this.originalSize.height||1;a=d(".ui-resizable-"+this.axis).css("cursor");d("body").css("cursor",a=="auto"?this.axis+"-resize":a);e.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,e=this._change[this.axis];if(!e)return false;c=e.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", -b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var e=this._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName);e=g&&d.ui.hasScroll(e[0],"left")?0:c.sizeDiff.height; -g={width:c.size.width-(g?0:c.sizeDiff.width),height:c.size.height-e};e=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var f=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(d.extend(g,{top:f,left:e}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}d("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop", -b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,e=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(e=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(e=="nw"){b.top= -a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,e=k(b.width)&&a.maxWidth&&a.maxWidthb.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(f)b.width=a.minWidth;if(h)b.height=a.minHeight;if(e)b.width=a.maxWidth;if(g)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height, -l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(f&&l)b.left=i-a.minWidth;if(e&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(g&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=d.browser.msie&&d.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+ -a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return d.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return d.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return d.extend(this._change.n.apply(this, -arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return d.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){d.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});d.extend(d.ui.resizable, -{version:"1.8.2"});d.ui.plugin.add("resizable","alsoResize",{start:function(){var b=d(this).data("resizable").options,a=function(c){d(c).each(function(){d(this).data("resizable-alsoresize",{width:parseInt(d(this).width(),10),height:parseInt(d(this).height(),10),left:parseInt(d(this).css("left"),10),top:parseInt(d(this).css("top"),10)})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else d.each(b.alsoResize,function(c){a(c)}); -else a(b.alsoResize)},resize:function(){var b=d(this).data("resizable"),a=b.options,c=b.originalSize,e=b.originalPosition,g={height:b.size.height-c.height||0,width:b.size.width-c.width||0,top:b.position.top-e.top||0,left:b.position.left-e.left||0},f=function(h,i){d(h).each(function(){var j=d(this),l=d(this).data("resizable-alsoresize"),p={};d.each((i&&i.length?i:["width","height","top","left"])||["width","height","top","left"],function(n,o){if((n=(l[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(/relative/.test(j.css("position"))&& -d.browser.opera){b._revertToRelativePosition=true;j.css({position:"absolute",top:"auto",left:"auto"})}j.css(p)})};typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?d.each(a.alsoResize,function(h,i){f(h,i)}):f(a.alsoResize)},stop:function(){var b=d(this).data("resizable");if(b._revertToRelativePosition&&d.browser.opera){b._revertToRelativePosition=false;el.css({position:"relative"})}d(this).removeData("resizable-alsoresize-start")}});d.ui.plugin.add("resizable","animate",{stop:function(b){var a= -d(this).data("resizable"),c=a.options,e=a._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName),f=g&&d.ui.hasScroll(e[0],"left")?0:a.sizeDiff.height;g={width:a.size.width-(g?0:a.sizeDiff.width),height:a.size.height-f};f=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(d.extend(g,h&&f?{top:h,left:f}:{}),{duration:c.animateDuration,easing:c.animateEasing, -step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};e&&e.length&&d(e[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});d.ui.plugin.add("resizable","containment",{start:function(){var b=d(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof d?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= -d(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:d(document),left:0,top:0,width:d(document).width(),height:d(document).height()||document.body.parentNode.scrollHeight}}else{var e=d(a),g=[];d(["Top","Right","Left","Bottom"]).each(function(i,j){g[i]=m(e.css("padding"+j))});b.containerOffset=e.offset();b.containerPosition=e.position();b.containerSize={height:e.innerHeight()-g[3],width:e.innerWidth()-g[1]};c=b.containerOffset; -var f=b.containerSize.height,h=b.containerSize.width;h=d.ui.hasScroll(a,"left")?a.scrollWidth:h;f=d.ui.hasScroll(a)?a.scrollHeight:f;b.parentData={element:a,left:c.left,top:c.top,width:h,height:f}}}},resize:function(b){var a=d(this).data("resizable"),c=a.options,e=a.containerOffset,g=a.position;b=a._aspectRatio||b.shiftKey;var f={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))f=e;if(g.left<(a._helper?e.left:0)){a.size.width+=a._helper?a.position.left-e.left: -a.position.left-f.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?e.left:0}if(g.top<(a._helper?e.top:0)){a.size.height+=a._helper?a.position.top-e.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?e.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-f.left:a.offset.left-f.left)+a.sizeDiff.width);e=Math.abs((a._helper?a.offset.top-f.top:a.offset.top- -e.top)+a.sizeDiff.height);g=a.containerElement.get(0)==a.element.parent().get(0);f=/relative|absolute/.test(a.containerElement.css("position"));if(g&&f)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(e+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-e;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=d(this).data("resizable"),a=b.options,c=b.containerOffset,e=b.containerPosition, -g=b.containerElement,f=d(b.helper),h=f.offset(),i=f.outerWidth()-b.sizeDiff.width;f=f.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(g.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:i,height:f});b._helper&&!a.animate&&/static/.test(g.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:i,height:f})}});d.ui.plugin.add("resizable","ghost",{start:function(){var b=d(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, -display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=d(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=d(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});d.ui.plugin.add("resizable","grid",{resize:function(){var b= -d(this).data("resizable"),a=b.options,c=b.size,e=b.originalSize,g=b.originalPosition,f=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-e.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-e.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(f)){b.size.width=e.width+h;b.size.height=e.height+a}else if(/^(ne)$/.test(f)){b.size.width=e.width+h;b.size.height=e.height+a;b.position.top=g.top-a}else{if(/^(sw)$/.test(f)){b.size.width=e.width+h;b.size.height= -e.height+a}else{b.size.width=e.width+h;b.size.height=e.height+a;b.position.top=g.top-a}b.position.left=g.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); -; -/* - * jQuery UI Selectable 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Selectables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function($) { - -$.widget("ui.selectable", $.ui.mouse, { - options: { - appendTo: 'body', - autoRefresh: true, - distance: 0, - filter: '*', - tolerance: 'touch' - }, - _create: function() { - var self = this; - - this.element.addClass("ui-selectable"); - - this.dragged = false; - - // cache selectee children based on filter - var selectees; - this.refresh = function() { - selectees = $(self.options.filter, self.element[0]); - selectees.each(function() { - var $this = $(this); - var pos = $this.offset(); - $.data(this, "selectable-item", { - element: this, - $element: $this, - left: pos.left, - top: pos.top, - right: pos.left + $this.outerWidth(), - bottom: pos.top + $this.outerHeight(), - startselected: false, - selected: $this.hasClass('ui-selected'), - selecting: $this.hasClass('ui-selecting'), - unselecting: $this.hasClass('ui-unselecting') - }); - }); - }; - this.refresh(); - - this.selectees = selectees.addClass("ui-selectee"); - - this._mouseInit(); - - this.helper = $("
"); - }, - - destroy: function() { - this.selectees - .removeClass("ui-selectee") - .removeData("selectable-item"); - this.element - .removeClass("ui-selectable ui-selectable-disabled") - .removeData("selectable") - .unbind(".selectable"); - this._mouseDestroy(); - - return this; - }, - - _mouseStart: function(event) { - var self = this; - - this.opos = [event.pageX, event.pageY]; - - if (this.options.disabled) - return; - - var options = this.options; - - this.selectees = $(options.filter, this.element[0]); - - this._trigger("start", event); - - $(options.appendTo).append(this.helper); - // position helper (lasso) - this.helper.css({ - "z-index": 100, - "position": "absolute", - "left": event.clientX, - "top": event.clientY, - "width": 0, - "height": 0 - }); - - if (options.autoRefresh) { - this.refresh(); - } - - this.selectees.filter('.ui-selected').each(function() { - var selectee = $.data(this, "selectable-item"); - selectee.startselected = true; - if (!event.metaKey) { - selectee.$element.removeClass('ui-selected'); - selectee.selected = false; - selectee.$element.addClass('ui-unselecting'); - selectee.unselecting = true; - // selectable UNSELECTING callback - self._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - }); - - $(event.target).parents().andSelf().each(function() { - var selectee = $.data(this, "selectable-item"); - if (selectee) { - var doSelect = !event.metaKey || !selectee.$element.hasClass('ui-selected'); - selectee.$element - .removeClass(doSelect ? "ui-unselecting" : "ui-selected") - .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); - selectee.unselecting = !doSelect; - selectee.selecting = doSelect; - selectee.selected = doSelect; - // selectable (UN)SELECTING callback - if (doSelect) { - self._trigger("selecting", event, { - selecting: selectee.element - }); - } else { - self._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - return false; - } - }); - - }, - - _mouseDrag: function(event) { - var self = this; - this.dragged = true; - - if (this.options.disabled) - return; - - var options = this.options; - - var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; - if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } - if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } - this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); - - this.selectees.each(function() { - var selectee = $.data(this, "selectable-item"); - //prevent helper from being selected if appendTo: selectable - if (!selectee || selectee.element == self.element[0]) - return; - var hit = false; - if (options.tolerance == 'touch') { - hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); - } else if (options.tolerance == 'fit') { - hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); - } - - if (hit) { - // SELECT - if (selectee.selected) { - selectee.$element.removeClass('ui-selected'); - selectee.selected = false; - } - if (selectee.unselecting) { - selectee.$element.removeClass('ui-unselecting'); - selectee.unselecting = false; - } - if (!selectee.selecting) { - selectee.$element.addClass('ui-selecting'); - selectee.selecting = true; - // selectable SELECTING callback - self._trigger("selecting", event, { - selecting: selectee.element - }); - } - } else { - // UNSELECT - if (selectee.selecting) { - if (event.metaKey && selectee.startselected) { - selectee.$element.removeClass('ui-selecting'); - selectee.selecting = false; - selectee.$element.addClass('ui-selected'); - selectee.selected = true; - } else { - selectee.$element.removeClass('ui-selecting'); - selectee.selecting = false; - if (selectee.startselected) { - selectee.$element.addClass('ui-unselecting'); - selectee.unselecting = true; - } - // selectable UNSELECTING callback - self._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - } - if (selectee.selected) { - if (!event.metaKey && !selectee.startselected) { - selectee.$element.removeClass('ui-selected'); - selectee.selected = false; - - selectee.$element.addClass('ui-unselecting'); - selectee.unselecting = true; - // selectable UNSELECTING callback - self._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - } - } - }); - - return false; - }, - - _mouseStop: function(event) { - var self = this; - - this.dragged = false; - - var options = this.options; - - $('.ui-unselecting', this.element[0]).each(function() { - var selectee = $.data(this, "selectable-item"); - selectee.$element.removeClass('ui-unselecting'); - selectee.unselecting = false; - selectee.startselected = false; - self._trigger("unselected", event, { - unselected: selectee.element - }); - }); - $('.ui-selecting', this.element[0]).each(function() { - var selectee = $.data(this, "selectable-item"); - selectee.$element.removeClass('ui-selecting').addClass('ui-selected'); - selectee.selecting = false; - selectee.selected = true; - selectee.startselected = true; - self._trigger("selected", event, { - selected: selectee.element - }); - }); - this._trigger("stop", event); - - this.helper.remove(); - - return false; - } - -}); - -$.extend($.ui.selectable, { - version: "1.8.2" -}); - -})(jQuery); -(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), -selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, -c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting"); -b.unselecting=true;f._trigger("unselecting",c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f= -this;this.dragged=true;if(!this.options.disabled){var d=this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, -arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= -c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, -{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); -if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", -a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); -if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, -c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== -document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate", -null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem): -d(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c}, -_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a= -this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)? -h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"), -b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)? -i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement, -c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height= -this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()- -parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0], -this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b= -1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update", -g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity", -this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},_create:function(){var a=this.options,b=this;this.running=0;this.element.addClass("ui-accordion ui-widget ui-helper-reset"); -this.element.children("li").addClass("ui-accordion-li-fix");this.headers=this.element.find(a.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); -if(a.navigation){var d=this.element.find("a").filter(a.navigationFilter);if(d.length){var f=d.closest(".ui-accordion-header");this.active=f.length?f:d.closest(".ui-accordion-content").prev()}}this.active=this._findActive(this.active||a.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");this._createIcons();this.resize();this.element.attr("role","tablist");this.headers.attr("role", -"tab").bind("keydown",function(g){return b._keydown(g)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();this.active.length?this.active.attr("aria-expanded","true").attr("tabIndex","0"):this.headers.eq(0).attr("tabIndex","0");c.browser.safari||this.headers.find("a").attr("tabIndex","-1");a.event&&this.headers.bind(a.event+".accordion",function(g){b._clickHandler.call(b,g,this);g.preventDefault()})},_createIcons:function(){var a= -this.options;if(a.icons){c("").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion"); -this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex");this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(a.autoHeight||a.fillHeight)b.css("height", -"");return this},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();b&&this._createIcons()}},_keydown:function(a){var b=c.ui.keyCode;if(!(this.options.disabled||a.altKey||a.ctrlKey)){var d=this.headers.length,f=this.headers.index(a.target),g=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:g=this.headers[(f+1)%d];break;case b.LEFT:case b.UP:g=this.headers[(f-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target}, -a.target);a.preventDefault()}if(g){c(a.target).attr("tabIndex","-1");c(g).attr("tabIndex","0");g.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0, -b-c(this).innerHeight()+c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a=="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d= -this.options;if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]==this.active[0];d.active=d.collapsible&&b?false:c(".ui-accordion-header",this.element).index(a);if(!(this.running||!d.collapsible&&b)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected); -a.next().addClass("ui-accordion-content-active")}e=a.next();f=this.active.next();g={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):e,oldContent:f};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(e,f,g,b,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); -this.active.next().addClass("ui-accordion-content-active");var f=this.active.next(),g={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:f},e=this.active=c([]);this._toggle(e,f,g)}},_toggle:function(a,b,d,f,g){var e=this.options,k=this;this.toShow=a;this.toHide=b;this.data=d;var i=function(){if(k)return k._completed.apply(k,arguments)};this._trigger("changestart",null,this.data);this.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:c([]), -toHide:b,complete:i,down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:i,down:g,autoHeight:e.autoHeight||e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=c.ui.accordion.animations;var h=e.duration,j=e.animated;if(j&&!f[j]&&!c.easing[j])j="slide";f[j]||(f[j]=function(l){this.slide(l,{easing:j, -duration:h||700})});f[j](d)}else{if(e.collapsible&&f)a.toggle();else{b.hide();a.show()}i(true)}b.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();a.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(a){var b=this.options;this.running=a?0:--this.running;if(!this.running){b.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion, -{version:"1.8.2",animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),f=0,g={},e={},k;b=a.toShow;k=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(i,h){e[h]="hide";i=(""+c.css(a.toShow[0], -h)).match(/^([\d+-.]+)(.*)$/);g[h]={value:i[1],unit:i[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(e,{step:function(i,h){if(h.prop=="height")f=h.end-h.start===0?0:(h.now-h.start)/(h.end-h.start);a.toShow[0].style[h.prop]=f*g[h.prop].value+g[h.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css("width",k);a.toShow.css({overflow:d});a.complete()}})}else a.toHide.animate({height:"hide"}, -a);else a.toShow.animate({height:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); -;/* - * jQuery UI Autocomplete 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Autocomplete - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.position.js - */ -(function(e){e.widget("ui.autocomplete",{options:{minLength:1,delay:300},_create:function(){var a=this,c=this.element[0].ownerDocument;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(d){var b=e.ui.keyCode;switch(d.keyCode){case b.PAGE_UP:a._move("previousPage",d);break;case b.PAGE_DOWN:a._move("nextPage",d);break;case b.UP:a._move("previous",d);d.preventDefault(); -break;case b.DOWN:a._move("next",d);d.preventDefault();break;case b.ENTER:case b.NUMPAD_ENTER:a.menu.active&&d.preventDefault();case b.TAB:if(!a.menu.active)return;a.menu.select(d);break;case b.ESCAPE:a.element.val(a.term);a.close(d);break;case b.LEFT:case b.RIGHT:case b.SHIFT:case b.CONTROL:case b.ALT:case b.COMMAND:case b.COMMAND_RIGHT:case b.INSERT:case b.CAPS_LOCK:case b.END:case b.HOME:break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){a.search(null,d)},a.options.delay); -break}}).bind("focus.autocomplete",function(){a.selectedItem=null;a.previous=a.element.val()}).bind("blur.autocomplete",function(d){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(d);a._change(d)},150)});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=e("
    ").addClass("ui-autocomplete").appendTo("body",c).mousedown(function(){setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(d,b){b=b.item.data("item.autocomplete"); -false!==a._trigger("focus",null,{item:b})&&/^key/.test(d.originalEvent.type)&&a.element.val(b.value)},selected:function(d,b){b=b.item.data("item.autocomplete");false!==a._trigger("select",d,{item:b})&&a.element.val(b.value);a.close(d);d=a.previous;if(a.element[0]!==c.activeElement){a.element.focus();a.previous=d}a.selectedItem=b},blur:function(){a.menu.element.is(":visible")&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");e.fn.bgiframe&&this.menu.element.bgiframe()}, -destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();e.Widget.prototype.destroy.call(this)},_setOption:function(a){e.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource()},_initSource:function(){var a,c;if(e.isArray(this.options.source)){a=this.options.source;this.source=function(d,b){b(e.ui.autocomplete.filter(a,d.term))}}else if(typeof this.options.source=== -"string"){c=this.options.source;this.source=function(d,b){e.getJSON(c,d,b)}}else this.source=this.options.source},search:function(a,c){a=a!=null?a:this.element.val();if(a.length").data("item.autocomplete", -c).append(""+c.label+"").appendTo(a)},_move:function(a,c){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](c);else this.search(null,c)},widget:function(){return this.menu.element}});e.extend(e.ui.autocomplete,{escapeRegex:function(a){return a.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")},filter:function(a,c){var d=new RegExp(e.ui.autocomplete.escapeRegex(c), -"i");return e.grep(a,function(b){return d.test(b.label||b.value||b)})}})})(jQuery); -(function(e){e.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(e(c.target).closest(".ui-menu-item a").length){c.preventDefault();a.select(c)}});this.refresh()},refresh:function(){var a=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", --1).mouseenter(function(c){a.activate(c,e(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,c){this.deactivate();if(this.hasScroll()){var d=c.offset().top-this.element.offset().top,b=this.element.attr("scrollTop"),f=this.element.height();if(d<0)this.element.attr("scrollTop",b+d);else d>f&&this.element.attr("scrollTop",b+d-f+c.height())}this.active=c.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:c})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); -this._trigger("blur");this.active=null}},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prev().length},last:function(){return this.active&&!this.active.next().length},move:function(a,c,d){if(this.active){a=this.active[a+"All"](".ui-menu-item").eq(0);a.length?this.activate(d,a):this.activate(d,this.element.children(c))}else this.activate(d,this.element.children(c))},nextPage:function(a){if(this.hasScroll())if(!this.active|| -this.last())this.activate(a,this.element.children(":first"));else{var c=this.active.offset().top,d=this.element.height(),b=this.element.children("li").filter(function(){var f=e(this).offset().top-c-d+e(this).height();return f<10&&f>-10});b.length||(b=this.element.children(":last"));this.activate(a,b)}else this.activate(a,this.element.children(!this.active||this.last()?":first":":last"))},previousPage:function(a){if(this.hasScroll())if(!this.active||this.first())this.activate(a,this.element.children(":last")); -else{var c=this.active.offset().top,d=this.element.height();result=this.element.children("li").filter(function(){var b=e(this).offset().top-c+d-e(this).height();return b<10&&b>-10});result.length||(result=this.element.children(":first"));this.activate(a,result)}else this.activate(a,this.element.children(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()
    ").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary;if(d.primary||d.secondary){b.addClass("ui-button-text-icon"+(e?"s":""));d.primary&&b.prepend("");d.secondary&&b.append("");if(!this.options.text){b.addClass(e?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon"); -this.hasTitle||b.attr("title",c)}}else b.addClass("ui-button-text-only")}}});a.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init()},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()}, -destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery); -;/* - * jQuery UI Dialog 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Dialog - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.button.js - * jquery.ui.draggable.js - * jquery.ui.mouse.js - * jquery.ui.position.js - * jquery.ui.resizable.js - */ -(function(c){c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");var a=this,b=a.options,d=b.title||a.originalTitle||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ -b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), -h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id", -e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); -a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== -b.uiDialog[0])d=Math.max(d,c(this).css("z-index"))});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index", -c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;d.next().length&&d.appendTo("body");a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== -f[0]&&e.shiftKey){g.focus(1);return false}}});c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();a._trigger("open");a._isOpen=true;return a}},_createButtons:function(a){var b=this,d=false,e=c("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a, -function(g,f){g=c('').text(g).click(function(){f.apply(b.element[0],arguments)}).appendTo(e);c.fn.button&&g.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging"); -b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,originalSize:f.originalSize,position:f.position,size:f.size}}a=a===undefined?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position"); -a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop", -f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0];a=a||c.ui.dialog.prototype.options.position;if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(e,g){if(+b[e]===b[e]){d[e]=b[e];b[e]= -g}})}else if(typeof a==="object"){if("left"in a){b[0]="left";d[0]=a.left}else if("right"in a){b[0]="right";d[0]=-a.right}if("top"in a){b[1]="top";d[1]=a.top}else if("bottom"in a){b[1]="bottom";d[1]=-a.bottom}}(a=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position({my:b.join(" "),at:b.join(" "),offset:d.join(" "),of:window,collision:"fit",using:function(e){var g=c(this).css(e).offset().top;g<0&&c(this).css("top",e.top-g)}});a||this.uiDialog.hide()},_setOption:function(a, -b){var d=this,e=d.uiDialog,g=e.is(":data(resizable)"),f=false;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled");break;case "draggable":b?d._makeDraggable():e.draggable("destroy");break; -case "height":f=true;break;case "maxHeight":g&&e.resizable("option","maxHeight",b);f=true;break;case "maxWidth":g&&e.resizable("option","maxWidth",b);f=true;break;case "minHeight":g&&e.resizable("option","minHeight",b);f=true;break;case "minWidth":g&&e.resizable("option","minWidth",b);f=true;break;case "position":d._position(b);break;case "resizable":g&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title", -d.uiDialogTitlebar).html(""+(b||" "));break;case "width":f=true;break}c.Widget.prototype._setOption.apply(d,arguments);f&&d._size()},_size:function(){var a=this.options,b;this.element.css({width:"auto",minHeight:0,height:0});b=this.uiDialog.css({height:"auto",width:a.width}).height();this.element.css(a.height==="auto"?{minHeight:Math.max(a.minHeight-b,0),height:"auto"}:{minHeight:0,height:Math.max(a.height-b,0)}).show();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight", -this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.2",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&& -c(document).bind(c.ui.dialog.overlay.events,function(d){return c(d.target).zIndex()>=c.ui.dialog.overlay.maxZ})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("
    ").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&& -b.bgiframe();this.instances.push(b);return b},destroy:function(a){this.oldInstances.push(this.instances.splice(c.inArray(a,this.instances),1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var b=0;c.each(this.instances,function(){b=Math.max(b,this.css("z-index"))});this.maxZ=b},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight, -document.body.offsetHeight);return a");if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}else this.range=d("
    ");this.range.appendTo(this.element).addClass("ui-slider-range");if(b.range==="min"||b.range==="max")this.range.addClass("ui-slider-range-"+b.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("").appendTo(this.element).addClass("ui-slider-handle"); -if(b.values&&b.values.length)for(;d(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur(); -else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),g,h,i;if(!a.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e= -false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");g=a._start(c,f);if(g===false)return}break}i=a.options.step;g=a.options.values&&a.options.values.length?(h=a.values(f)):(h=a.value());switch(c.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(g+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(g-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(g=== -a._valueMax())return;h=a._trimAlignValue(g+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(g===a._valueMin())return;h=a._trimAlignValue(g-i);break}a._slide(c,f,h);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(c,e);a._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); -this._mouseDestroy();return this},_mouseCapture:function(a){var b=this.options,c,e,f,g,h,i;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c={x:a.pageX,y:a.pageY};e=this._normValueFromMouse(c);f=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(j){var k=Math.abs(e-h.values(j));if(f>k){f=k;g=d(this);i=j}});if(b.range===true&&this.values(1)===b.min){i+=1;g=d(this.handles[i])}if(this._start(a, -i)===false)return false;this._mouseSliding=true;h._handleIndex=i;g.addClass("ui-state-active").focus();b=g.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-g.width()/2,top:a.pageY-b.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};e=this._normValueFromMouse(c);this._slide(a,i,e);return this._animateOff=true},_mouseStart:function(){return true}, -_mouseDrag:function(a){var b=this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b; -if(this.orientation==="horizontal"){b=this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value= -this.values(b);c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var e;if(this.options.values&&this.options.values.length){e=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>e||b===1&&c1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;fthis._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=a%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a= -this.options.range,b=this.options,c=this,e=!this._animateOff?b.animate:false,f,g={},h,i,j,k;if(this.options.values&&this.options.values.length)this.handles.each(function(l){f=(c.values(l)-c._valueMin())/(c._valueMax()-c._valueMin())*100;g[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](g,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(l===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},b.animate);if(l===1)c.range[e?"animate":"css"]({width:f- -h+"%"},{queue:false,duration:b.animate})}else{if(l===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},b.animate);if(l===1)c.range[e?"animate":"css"]({height:f-h+"%"},{queue:false,duration:b.animate})}h=f});else{i=this.value();j=this._valueMin();k=this._valueMax();f=k!==j?(i-j)/(k-j)*100:0;g[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](g,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"}, -b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.2"})})(jQuery); -;/* - * jQuery UI Tabs 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(d){function s(){return++u}function v(){return++w}var u=0,w=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:'
  • #{label}
  • '},_create:function(){this._tabify(true)},_setOption:function(c,e){if(c=="selected")this.options.collapsible&& -e==this.options.selected||this.select(e);else{this.options[c]=e;this._tabify()}},_tabId:function(c){return c.title&&c.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+s()},_sanitizeSelector:function(c){return c.replace(/:/g,"\\:")},_cookie:function(){var c=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+v());return d.cookie.apply(null,[c].concat(d.makeArray(arguments)))},_ui:function(c,e){return{tab:c,panel:e,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var c= -d(this);c.html(c.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function e(g,f){g.css({display:""});!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}this.list=this.element.find("ol,ul").eq(0);this.lis=d("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);var a=this,b=this.options,h=/^#.+/;this.anchors.each(function(g,f){var j=d(f).attr("href"),l=j.split("#")[0],p;if(l&&(l===location.toString().split("#")[0]|| -(p=d("base")[0])&&l===p.href)){j=f.hash;f.href=j}if(h.test(j))a.panels=a.panels.add(a._sanitizeSelector(j));else if(j!="#"){d.data(f,"href.tabs",j);d.data(f,"load.tabs",j.replace(/#.*$/,""));j=a._tabId(f);f.href="#"+j;f=d("#"+j);if(!f.length){f=d(b.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else b.disabled.push(g)});if(c){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(b.selected===undefined){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){b.selected=g;return false}});if(typeof b.selected!="number"&&b.cookie)b.selected=parseInt(a._cookie(),10);if(typeof b.selected!="number"&&this.lis.filter(".ui-tabs-selected").length)b.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));b.selected=b.selected||(this.lis.length?0:-1)}else if(b.selected===null)b.selected=-1;b.selected=b.selected>=0&&this.anchors[b.selected]||b.selected<0?b.selected:0;b.disabled=d.unique(b.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(b.selected,b.disabled)!=-1&&b.disabled.splice(d.inArray(b.selected,b.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(b.selected>=0&&this.anchors.length){this.panels.eq(b.selected).removeClass("ui-tabs-hide");this.lis.eq(b.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[b.selected],a.panels[b.selected]))});this.load(b.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else b.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));this.element[b.collapsible?"addClass": -"removeClass"]("ui-tabs-collapsible");b.cookie&&this._cookie(b.selected,b.cookie);c=0;for(var i;i=this.lis[c];c++)d(i)[d.inArray(c,b.disabled)!=-1&&!d(i).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");b.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(b.event!="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+g)};this.lis.bind("mouseover.tabs", -function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(b.fx)if(d.isArray(b.fx)){m=b.fx[0];o=b.fx[1]}else m=o=b.fx;var q=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",function(){e(f,o);a._trigger("show", -null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},r=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};this.anchors.bind(b.event+".tabs", -function(){var g=this,f=d(this).closest("li"),j=a.panels.filter(":not(.ui-tabs-hide)"),l=d(a._sanitizeSelector(this.hash));if(f.hasClass("ui-tabs-selected")&&!b.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}b.selected=a.anchors.index(this);a.abort();if(b.collapsible)if(f.hasClass("ui-tabs-selected")){b.selected=-1;b.cookie&&a._cookie(b.selected,b.cookie);a.element.queue("tabs",function(){r(g, -j)}).dequeue("tabs");this.blur();return false}else if(!j.length){b.cookie&&a._cookie(b.selected,b.cookie);a.element.queue("tabs",function(){q(g,l)});a.load(a.anchors.index(this));this.blur();return false}b.cookie&&a._cookie(b.selected,b.cookie);if(l.length){j.length&&a.element.queue("tabs",function(){r(g,j)});a.element.queue("tabs",function(){q(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";d.browser.msie&&this.blur()});this.anchors.bind("click.tabs", -function(){return false})},destroy:function(){var c=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(b,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this, -"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});c.cookie&&this._cookie(null,c.cookie);return this},add:function(c,e,a){if(a===undefined)a=this.anchors.length;var b=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,e));c=!c.indexOf("#")?c.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs", -true);var i=d("#"+c);i.length||(i=d(h.panelTemplate).attr("id",c).data("destroy.tabs",true));i.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);i.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);i.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");i.removeClass("ui-tabs-hide"); -this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(c){var e=this.options,a=this.lis.eq(c).remove(),b=this.panels.eq(c).remove();if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(c+(c+1=c?--h:h});this._tabify();this._trigger("remove", -null,this._ui(a.find("a")[0],b[0]));return this},enable:function(c){var e=this.options;if(d.inArray(c,e.disabled)!=-1){this.lis.eq(c).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=c});this._trigger("enable",null,this._ui(this.anchors[c],this.panels[c]));return this}},disable:function(c){var e=this.options;if(c!=e.selected){this.lis.eq(c).addClass("ui-state-disabled");e.disabled.push(c);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}return this}, -select:function(c){if(typeof c=="string")c=this.anchors.index(this.anchors.filter("[href$="+c+"]"));else if(c===null)c=-1;if(c==-1&&this.options.collapsible)c=this.options.selected;this.anchors.eq(c).trigger(this.options.event+".tabs");return this},load:function(c){var e=this,a=this.options,b=this.anchors.eq(c)[0],h=d.data(b,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(b,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(c).addClass("ui-state-processing"); -if(a.spinner){var i=d("span",b);i.data("label.tabs",i.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){d(e._sanitizeSelector(b.hash)).html(k);e._cleanup();a.cache&&d.data(b,"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[c],e.panels[c]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[c],e.panels[c]));try{a.ajaxOptions.error(k,n,c,b)}catch(m){}}}));e.element.dequeue("tabs");return this}}, -abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(c,e){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.2"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(c,e){var a=this,b=this.options,h=a._rotate||(a._rotate= -function(i){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=b.selected;a.select(++k')}function E(a,b){d.extend(a, -b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.2"}});var y=(new Date).getTime();d.extend(J.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]= -f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('
    ')}}, -_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&& -b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f== -""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a, -c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b), -true);this._updateDatepicker(b);this._updateAlternate(b)}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{});b=b&&b.constructor== -Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]); -d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}}, -_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b= -d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false; -for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target|| -a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a); -d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&& -d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=d.datepicker._getBorders(b.dpDiv);b.dpDiv.find("iframe.ui-datepicker-cover").css({left:-i[0],top:-i[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f, -h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover"); -this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover"); -this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);var e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"); -a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus()},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(), -k=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>k&&k>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"]; -a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val(): -"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&& -!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth; -b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){a=this._getInst(d(a)[0]); -a.input&&a._selectingMonthYear&&!d.browser.msie&&a.input.focus();a._selectingMonthYear=!a._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a, -"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")|| -this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null; -for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,k=c=-1,l=-1,u=-1,j=false,o=function(p){(p=z+1-1){k=1;l=u;do{e=this._getDaysInMonth(c,k-1);if(l<=e)break;k++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c, -k-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=k||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c? -c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=j+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear|| -a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),k=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay? -new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),j=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=j&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-k,1)),this._getFormatConfig(a)); -n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m, -g+k,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";k=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&& -a.currentDay?u:b;k=!h?k:this.formatDate(k,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
    '+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
    ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;k=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),w=this._get(a,"showOtherMonths"),G=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var K=this._getDefaultDate(a),H="",C=0;C1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='
    '+(/all|left/.test(t)&&C==0?c? -f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,j,o,C>0||D>0,z,v)+'
    ';var A=k?'":"";for(t=0;t<7;t++){var q=(t+h)%7;A+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}x+=A+"";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, -A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var N=0;N";var O=!k?"":'";for(t=0;t<7;t++){var F=p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,I=B&&!G||!F[0]||j&&qo;O+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=O+""}g++;if(g>11){g=0;m++}x+="
    '+this._get(a,"weekHeader")+"
    '+this._get(a,"calculateWeek")(q)+""+(B&&!w?" ":I?''+q.getDate()+ -"":''+q.getDate()+"")+"
    "+(l?""+(i[0]>0&&D==i[1]-1?'
    ':""):"");L+=x}H+=L}H+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'': -"");a._keyEvent=false;return H},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var k=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),j='
    ',o="";if(h||!k)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(j+=o+(h||!(k&&l)?" ":""));if(h||!l)j+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b, -i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(j+='"}j+=this._get(a,"yearSuffix");if(u)j+=(h||!(k&&l)?" ":"")+o;j+="
    ";return j},_adjustInstDate:function(a,b,c){var e= -a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, -"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); -c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, -"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= -function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)); -return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new J;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.2";window["DP_jQuery_"+y]=d})(jQuery); -;/* - * jQuery UI Progressbar 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(b){b.widget("ui.progressbar",{options:{value:0},_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=b("
    ").appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); -this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===undefined)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){switch(a){case "value":this.options.value=c;this._refreshValue();this._trigger("change");break}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;if(athis._valueMax())a=this._valueMax();return a}, -_valueMin:function(){return 0},_valueMax:function(){return 100},_refreshValue:function(){var a=this.value();this.valueDiv[a===this._valueMax()?"addClass":"removeClass"]("ui-corner-right").width(a+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.2"})})(jQuery); -;/* - * jQuery UI Effects 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/ - */ -jQuery.effects||function(f){function k(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], -16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return l.transparent;return l[f.trim(c).toLowerCase()]}function q(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return k(b)}function m(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, -a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function n(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in r||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function s(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function j(c,a,b,d){if(typeof c=="object"){d= -a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(f.isFunction(b)){d=b;b=null}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:f.fx.speeds[b]||f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=q(b.elem,a);b.end=k(b.end);b.colorInit= -true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var l={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189, -183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255, -165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},o=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){var e=f(this),g=e.attr("style")||" ",h=n(m.call(this)),p,t=e.attr("className");f.each(o,function(u, -i){c[i]&&e[i+"Class"](c[i])});p=n(m.call(this));e.attr("className",t);e.animate(s(h,p),a,b,function(){f.each(o,function(u,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a? -f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===undefined?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.2",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"}); -c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=j.apply(this,arguments);a={options:a[1],duration:a[2],callback:a[3]};var b=f.effects[c];return b&&!f.fx.off?b.call(this,a):this},_show:f.fn.show,show:function(c){if(!c|| -typeof c=="number"||f.fx.speeds[c])return this._show.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(!c||typeof c=="number"||f.fx.speeds[c])return this._hide.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||typeof c=="boolean"||f.isFunction(c))return this.__toggle.apply(this, -arguments);else{var a=j.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c, -a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+ -b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2, -10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)* -a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ -e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); -;/* - * jQuery UI Effects Fold 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * jquery.effects.core.js - */ -(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","left"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],10)/100* -f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); -;/* - * jQuery UI Effects Highlight 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * jquery.effects.core.js - */ -(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& -this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); -;/* - * jQuery UI Effects Pulsate 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * jquery.effects.core.js - */ -(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); -b.dequeue()})})}})(jQuery); -; \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/menu1.js b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/menu1.js deleted file mode 100755 index 74abcbc61a..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/menu1.js +++ /dev/null @@ -1,155 +0,0 @@ -/* -Author : bieler batiste -Company : doSimple : http://www.dosimple.ch -send me a mail for more informations : faden@PASDEPOURRIELaltern.org - remove ( PASDEPOURRIEL ) - -Short javascript function to create and handle a CSS navigation menu - -Copyright (C) 2004 Bieler Batiste - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library 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 -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -// the timeout for the menu -var timeout = 100; - -// not very clean but simple -// the function can be run in the HTML for faster display -// window.onload=initMenu; - -// creat timeout variables for list item -// it's for avoid some warning with IE -for( var i = 0; i < 100; i++ ) -{ - eval("var timeoutli" + i + " = false;"); -} - -// this fonction apply the CSS style and the event -function initMenu() -{ - // a test to avoid some browser like IE4, Opera 6, and IE Mac - if ( browser.isDOM1 - && !( browser.isMac && browser.isIE ) - && !( browser.isOpera && browser.versionMajor < 7 ) - && !( browser.isIE && browser.versionMajor < 5 ) ) - { - // get some element - var menu = document.getElementById('menu'); // the root element - var lis = menu.getElementsByTagName('li'); // all the li - - // change the class name of the menu, - // it's usefull for compatibility with old browser - menu.className='menu'; - // i am searching for ul element in li element - for ( var i=0; i 0 ) - { - // improve IE key navigation - if ( browser.isIE ) - { - addAnEvent(lis.item(i),'keyup',show); - } - // link events to list item - addAnEvent(lis.item(i),'mouseover',show); - addAnEvent(lis.item(i),'mouseout',timeoutHide); - addAnEvent(lis.item(i),'blur',timeoutHide); - addAnEvent(lis.item(i),'focus',show); - - // add an id to list item - lis.item(i).setAttribute( 'id', "li"+i ); - } - } - } -} - - - - -function addAnEvent( target, eventName, functionName ) -{ - // apply the method to IE - if ( browser.isIE ) - { - //attachEvent dont work properly with this - eval('target.on'+eventName+'=functionName'); - } - // apply the method to DOM compliant browsers - else - { - target.addEventListener( eventName , functionName , true ); // true is important for Opera7 - } -} - -// hide the first ul element of the current element -function timeoutHide() -{ - // start the timeout - eval( "timeout" + this.id + " = window.setTimeout('hideUlUnder( \"" + this.id + "\" )', " + timeout + " );"); -} - -// hide the ul elements under the element identified by id -function hideUlUnder( id ) -{ - document.getElementById(id).getElementsByTagName('ul')[0].style['visibility'] = 'hidden'; -} - -// show the first ul element found under this element -function show() -{ - // show the sub menu - this.getElementsByTagName('ul')[0].style['visibility'] = 'visible'; - var currentNode=this; - while(currentNode) - { - if( currentNode.nodeName=='LI') - { - // currentNode.getElementsByTagName('a')[0].className = 'linkOver'; - } - currentNode=currentNode.parentNode; - } - // clear the timeout - eval ( "clearTimeout( timeout"+ this.id +");" ); - hideAllOthersUls( this ); -} - -// hide all ul on the same level of this list item -function hideAllOthersUls( currentLi ) -{ - var lis = currentLi.parentNode; - for ( var i=0; i 0 ) - { - if ( browser.isIE ) - { - addAnEvent(lis2.item(i),'keyup',show); - } - - addAnEvent(lis2.item(i),'mouseover',show); - addAnEvent(lis2.item(i),'mouseout',timeoutHide); - addAnEvent(lis2.item(i),'blur',timeoutHide); - addAnEvent(lis2.item(i),'focus',show); - - lis2.item(i).setAttribute( 'id', "li2"+i ); - } - } - } -} - - - -function addAnEvent( target, eventName, functionName ) -{ - if ( browser.isIE ) - { - eval('target.on'+eventName+'=functionName'); - } - else - { - target.addEventListener( eventName , functionName , true ); - } -} - -function timeoutHide() -{ - eval( "timeout" + this.id + " = window.setTimeout('hideUlUnder( \"" + this.id + "\" )', " + timeout + " );"); -} - -// hide the ul elements under the element identified by id -function hideUlUnder( id ) -{ - document.getElementById(id).getElementsByTagName('ul')[0].style['visibility'] = 'hidden'; -} - -// show the first ul element found under this element -function show() -{ - // show the sub menu - this.getElementsByTagName('ul')[0].style['visibility'] = 'visible'; - var currentNode=this; - while(currentNode) - { - if( currentNode.nodeName=='LI') - { - // currentNode.getElementsByTagName('a')[0].className = 'linkOver'; - } - currentNode=currentNode.parentNode; - } - // clear the timeout - eval ( "clearTimeout( timeout"+ this.id +");" ); - hideAllOthersUls( this ); -} - -// hide all ul on the same level of this list item -function hideAllOthersUls( currentLi ) -{ - var lis = currentLi.parentNode; - for ( var i=0; i -1, - Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1, - MobileSafari: /Apple.*Mobile.*Safari/.test(ua) - } - })(), - - BrowserFeatures: { - XPath: !!document.evaluate, - SelectorsAPI: !!document.querySelector, - ElementExtensions: (function() { - var constructor = window.Element || window.HTMLElement; - return !!(constructor && constructor.prototype); - })(), - SpecificElementExtensions: (function() { - if (typeof window.HTMLDivElement !== 'undefined') - return true; - - var div = document.createElement('div'); - var form = document.createElement('form'); - var isSupported = false; - - if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) { - isSupported = true; - } - - div = form = null; - - return isSupported; - })() - }, - - ScriptFragment: ']*>([\\S\\s]*?)<\/script>', - JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, - - emptyFunction: function() { }, - K: function(x) { return x } -}; - -if (Prototype.Browser.MobileSafari) - Prototype.BrowserFeatures.SpecificElementExtensions = false; - - -var Abstract = { }; - - -var Try = { - these: function() { - var returnValue; - - for (var i = 0, length = arguments.length; i < length; i++) { - var lambda = arguments[i]; - try { - returnValue = lambda(); - break; - } catch (e) { } - } - - return returnValue; - } -}; - -/* Based on Alex Arnell's inheritance implementation. */ - -var Class = (function() { - function subclass() {}; - function create() { - var parent = null, properties = $A(arguments); - if (Object.isFunction(properties[0])) - parent = properties.shift(); - - function klass() { - this.initialize.apply(this, arguments); - } - - Object.extend(klass, Class.Methods); - klass.superclass = parent; - klass.subclasses = []; - - if (parent) { - subclass.prototype = parent.prototype; - klass.prototype = new subclass; - parent.subclasses.push(klass); - } - - for (var i = 0; i < properties.length; i++) - klass.addMethods(properties[i]); - - if (!klass.prototype.initialize) - klass.prototype.initialize = Prototype.emptyFunction; - - klass.prototype.constructor = klass; - return klass; - } - - function addMethods(source) { - var ancestor = this.superclass && this.superclass.prototype; - var properties = Object.keys(source); - - if (!Object.keys({ toString: true }).length) { - if (source.toString != Object.prototype.toString) - properties.push("toString"); - if (source.valueOf != Object.prototype.valueOf) - properties.push("valueOf"); - } - - for (var i = 0, length = properties.length; i < length; i++) { - var property = properties[i], value = source[property]; - if (ancestor && Object.isFunction(value) && - value.argumentNames().first() == "$super") { - var method = value; - value = (function(m) { - return function() { return ancestor[m].apply(this, arguments); }; - })(property).wrap(method); - - value.valueOf = method.valueOf.bind(method); - value.toString = method.toString.bind(method); - } - this.prototype[property] = value; - } - - return this; - } - - return { - create: create, - Methods: { - addMethods: addMethods - } - }; -})(); -(function() { - - var _toString = Object.prototype.toString; - - function extend(destination, source) { - for (var property in source) - destination[property] = source[property]; - return destination; - } - - function inspect(object) { - try { - if (isUndefined(object)) return 'undefined'; - if (object === null) return 'null'; - return object.inspect ? object.inspect() : String(object); - } catch (e) { - if (e instanceof RangeError) return '...'; - throw e; - } - } - - function toJSON(object) { - var type = typeof object; - switch (type) { - case 'undefined': - case 'function': - case 'unknown': return; - case 'boolean': return object.toString(); - } - - if (object === null) return 'null'; - if (object.toJSON) return object.toJSON(); - if (isElement(object)) return; - - var results = []; - for (var property in object) { - var value = toJSON(object[property]); - if (!isUndefined(value)) - results.push(property.toJSON() + ': ' + value); - } - - return '{' + results.join(', ') + '}'; - } - - function toQueryString(object) { - return $H(object).toQueryString(); - } - - function toHTML(object) { - return object && object.toHTML ? object.toHTML() : String.interpret(object); - } - - function keys(object) { - var results = []; - for (var property in object) - results.push(property); - return results; - } - - function values(object) { - var results = []; - for (var property in object) - results.push(object[property]); - return results; - } - - function clone(object) { - return extend({ }, object); - } - - function isElement(object) { - return !!(object && object.nodeType == 1); - } - - function isArray(object) { - return _toString.call(object) == "[object Array]"; - } - - - function isHash(object) { - return object instanceof Hash; - } - - function isFunction(object) { - return typeof object === "function"; - } - - function isString(object) { - return _toString.call(object) == "[object String]"; - } - - function isNumber(object) { - return _toString.call(object) == "[object Number]"; - } - - function isUndefined(object) { - return typeof object === "undefined"; - } - - extend(Object, { - extend: extend, - inspect: inspect, - toJSON: toJSON, - toQueryString: toQueryString, - toHTML: toHTML, - keys: keys, - values: values, - clone: clone, - isElement: isElement, - isArray: isArray, - isHash: isHash, - isFunction: isFunction, - isString: isString, - isNumber: isNumber, - isUndefined: isUndefined - }); -})(); -Object.extend(Function.prototype, (function() { - var slice = Array.prototype.slice; - - function update(array, args) { - var arrayLength = array.length, length = args.length; - while (length--) array[arrayLength + length] = args[length]; - return array; - } - - function merge(array, args) { - array = slice.call(array, 0); - return update(array, args); - } - - function argumentNames() { - var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1] - .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '') - .replace(/\s+/g, '').split(','); - return names.length == 1 && !names[0] ? [] : names; - } - - function bind(context) { - if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; - var __method = this, args = slice.call(arguments, 1); - return function() { - var a = merge(args, arguments); - return __method.apply(context, a); - } - } - - function bindAsEventListener(context) { - var __method = this, args = slice.call(arguments, 1); - return function(event) { - var a = update([event || window.event], args); - return __method.apply(context, a); - } - } - - function curry() { - if (!arguments.length) return this; - var __method = this, args = slice.call(arguments, 0); - return function() { - var a = merge(args, arguments); - return __method.apply(this, a); - } - } - - function delay(timeout) { - var __method = this, args = slice.call(arguments, 1); - timeout = timeout * 1000 - return window.setTimeout(function() { - return __method.apply(__method, args); - }, timeout); - } - - function defer() { - var args = update([0.01], arguments); - return this.delay.apply(this, args); - } - - function wrap(wrapper) { - var __method = this; - return function() { - var a = update([__method.bind(this)], arguments); - return wrapper.apply(this, a); - } - } - - function methodize() { - if (this._methodized) return this._methodized; - var __method = this; - return this._methodized = function() { - var a = update([this], arguments); - return __method.apply(null, a); - }; - } - - return { - argumentNames: argumentNames, - bind: bind, - bindAsEventListener: bindAsEventListener, - curry: curry, - delay: delay, - defer: defer, - wrap: wrap, - methodize: methodize - } -})()); - - -Date.prototype.toJSON = function() { - return '"' + this.getUTCFullYear() + '-' + - (this.getUTCMonth() + 1).toPaddedString(2) + '-' + - this.getUTCDate().toPaddedString(2) + 'T' + - this.getUTCHours().toPaddedString(2) + ':' + - this.getUTCMinutes().toPaddedString(2) + ':' + - this.getUTCSeconds().toPaddedString(2) + 'Z"'; -}; - - -RegExp.prototype.match = RegExp.prototype.test; - -RegExp.escape = function(str) { - return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); -}; -var PeriodicalExecuter = Class.create({ - initialize: function(callback, frequency) { - this.callback = callback; - this.frequency = frequency; - this.currentlyExecuting = false; - - this.registerCallback(); - }, - - registerCallback: function() { - this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); - }, - - execute: function() { - this.callback(this); - }, - - stop: function() { - if (!this.timer) return; - clearInterval(this.timer); - this.timer = null; - }, - - onTimerEvent: function() { - if (!this.currentlyExecuting) { - try { - this.currentlyExecuting = true; - this.execute(); - this.currentlyExecuting = false; - } catch(e) { - this.currentlyExecuting = false; - throw e; - } - } - } -}); -Object.extend(String, { - interpret: function(value) { - return value == null ? '' : String(value); - }, - specialChar: { - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '\\': '\\\\' - } -}); - -Object.extend(String.prototype, (function() { - - function prepareReplacement(replacement) { - if (Object.isFunction(replacement)) return replacement; - var template = new Template(replacement); - return function(match) { return template.evaluate(match) }; - } - - function gsub(pattern, replacement) { - var result = '', source = this, match; - replacement = prepareReplacement(replacement); - - if (Object.isString(pattern)) - pattern = RegExp.escape(pattern); - - if (!(pattern.length || pattern.source)) { - replacement = replacement(''); - return replacement + source.split('').join(replacement) + replacement; - } - - while (source.length > 0) { - if (match = source.match(pattern)) { - result += source.slice(0, match.index); - result += String.interpret(replacement(match)); - source = source.slice(match.index + match[0].length); - } else { - result += source, source = ''; - } - } - return result; - } - - function sub(pattern, replacement, count) { - replacement = prepareReplacement(replacement); - count = Object.isUndefined(count) ? 1 : count; - - return this.gsub(pattern, function(match) { - if (--count < 0) return match[0]; - return replacement(match); - }); - } - - function scan(pattern, iterator) { - this.gsub(pattern, iterator); - return String(this); - } - - function truncate(length, truncation) { - length = length || 30; - truncation = Object.isUndefined(truncation) ? '...' : truncation; - return this.length > length ? - this.slice(0, length - truncation.length) + truncation : String(this); - } - - function strip() { - return this.replace(/^\s+/, '').replace(/\s+$/, ''); - } - - function stripTags() { - return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, ''); - } - - function stripScripts() { - return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); - } - - function extractScripts() { - var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); - var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); - return (this.match(matchAll) || []).map(function(scriptTag) { - return (scriptTag.match(matchOne) || ['', ''])[1]; - }); - } - - function evalScripts() { - return this.extractScripts().map(function(script) { return eval(script) }); - } - - function escapeHTML() { - return this.replace(/&/g,'&').replace(//g,'>'); - } - - function unescapeHTML() { - return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&'); - } - - - function toQueryParams(separator) { - var match = this.strip().match(/([^?#]*)(#.*)?$/); - if (!match) return { }; - - return match[1].split(separator || '&').inject({ }, function(hash, pair) { - if ((pair = pair.split('='))[0]) { - var key = decodeURIComponent(pair.shift()); - var value = pair.length > 1 ? pair.join('=') : pair[0]; - if (value != undefined) value = decodeURIComponent(value); - - if (key in hash) { - if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; - hash[key].push(value); - } - else hash[key] = value; - } - return hash; - }); - } - - function toArray() { - return this.split(''); - } - - function succ() { - return this.slice(0, this.length - 1) + - String.fromCharCode(this.charCodeAt(this.length - 1) + 1); - } - - function times(count) { - return count < 1 ? '' : new Array(count + 1).join(this); - } - - function camelize() { - var parts = this.split('-'), len = parts.length; - if (len == 1) return parts[0]; - - var camelized = this.charAt(0) == '-' - ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) - : parts[0]; - - for (var i = 1; i < len; i++) - camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); - - return camelized; - } - - function capitalize() { - return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); - } - - function underscore() { - return this.replace(/::/g, '/') - .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') - .replace(/([a-z\d])([A-Z])/g, '$1_$2') - .replace(/-/g, '_') - .toLowerCase(); - } - - function dasherize() { - return this.replace(/_/g, '-'); - } - - function inspect(useDoubleQuotes) { - var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) { - if (character in String.specialChar) { - return String.specialChar[character]; - } - return '\\u00' + character.charCodeAt().toPaddedString(2, 16); - }); - if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; - return "'" + escapedString.replace(/'/g, '\\\'') + "'"; - } - - function toJSON() { - return this.inspect(true); - } - - function unfilterJSON(filter) { - return this.replace(filter || Prototype.JSONFilter, '$1'); - } - - function isJSON() { - var str = this; - if (str.blank()) return false; - str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); - return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); - } - - function evalJSON(sanitize) { - var json = this.unfilterJSON(); - try { - if (!sanitize || json.isJSON()) return eval('(' + json + ')'); - } catch (e) { } - throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); - } - - function include(pattern) { - return this.indexOf(pattern) > -1; - } - - function startsWith(pattern) { - return this.indexOf(pattern) === 0; - } - - function endsWith(pattern) { - var d = this.length - pattern.length; - return d >= 0 && this.lastIndexOf(pattern) === d; - } - - function empty() { - return this == ''; - } - - function blank() { - return /^\s*$/.test(this); - } - - function interpolate(object, pattern) { - return new Template(this, pattern).evaluate(object); - } - - return { - gsub: gsub, - sub: sub, - scan: scan, - truncate: truncate, - strip: String.prototype.trim ? String.prototype.trim : strip, - stripTags: stripTags, - stripScripts: stripScripts, - extractScripts: extractScripts, - evalScripts: evalScripts, - escapeHTML: escapeHTML, - unescapeHTML: unescapeHTML, - toQueryParams: toQueryParams, - parseQuery: toQueryParams, - toArray: toArray, - succ: succ, - times: times, - camelize: camelize, - capitalize: capitalize, - underscore: underscore, - dasherize: dasherize, - inspect: inspect, - toJSON: toJSON, - unfilterJSON: unfilterJSON, - isJSON: isJSON, - evalJSON: evalJSON, - include: include, - startsWith: startsWith, - endsWith: endsWith, - empty: empty, - blank: blank, - interpolate: interpolate - }; -})()); - -var Template = Class.create({ - initialize: function(template, pattern) { - this.template = template.toString(); - this.pattern = pattern || Template.Pattern; - }, - - evaluate: function(object) { - if (object && Object.isFunction(object.toTemplateReplacements)) - object = object.toTemplateReplacements(); - - return this.template.gsub(this.pattern, function(match) { - if (object == null) return (match[1] + ''); - - var before = match[1] || ''; - if (before == '\\') return match[2]; - - var ctx = object, expr = match[3]; - var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; - match = pattern.exec(expr); - if (match == null) return before; - - while (match != null) { - var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1]; - ctx = ctx[comp]; - if (null == ctx || '' == match[3]) break; - expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); - match = pattern.exec(expr); - } - - return before + String.interpret(ctx); - }); - } -}); -Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; - -var $break = { }; - -var Enumerable = (function() { - function each(iterator, context) { - var index = 0; - try { - this._each(function(value) { - iterator.call(context, value, index++); - }); - } catch (e) { - if (e != $break) throw e; - } - return this; - } - - function eachSlice(number, iterator, context) { - var index = -number, slices = [], array = this.toArray(); - if (number < 1) return array; - while ((index += number) < array.length) - slices.push(array.slice(index, index+number)); - return slices.collect(iterator, context); - } - - function all(iterator, context) { - iterator = iterator || Prototype.K; - var result = true; - this.each(function(value, index) { - result = result && !!iterator.call(context, value, index); - if (!result) throw $break; - }); - return result; - } - - function any(iterator, context) { - iterator = iterator || Prototype.K; - var result = false; - this.each(function(value, index) { - if (result = !!iterator.call(context, value, index)) - throw $break; - }); - return result; - } - - function collect(iterator, context) { - iterator = iterator || Prototype.K; - var results = []; - this.each(function(value, index) { - results.push(iterator.call(context, value, index)); - }); - return results; - } - - function detect(iterator, context) { - var result; - this.each(function(value, index) { - if (iterator.call(context, value, index)) { - result = value; - throw $break; - } - }); - return result; - } - - function findAll(iterator, context) { - var results = []; - this.each(function(value, index) { - if (iterator.call(context, value, index)) - results.push(value); - }); - return results; - } - - function grep(filter, iterator, context) { - iterator = iterator || Prototype.K; - var results = []; - - if (Object.isString(filter)) - filter = new RegExp(RegExp.escape(filter)); - - this.each(function(value, index) { - if (filter.match(value)) - results.push(iterator.call(context, value, index)); - }); - return results; - } - - function include(object) { - if (Object.isFunction(this.indexOf)) - if (this.indexOf(object) != -1) return true; - - var found = false; - this.each(function(value) { - if (value == object) { - found = true; - throw $break; - } - }); - return found; - } - - function inGroupsOf(number, fillWith) { - fillWith = Object.isUndefined(fillWith) ? null : fillWith; - return this.eachSlice(number, function(slice) { - while(slice.length < number) slice.push(fillWith); - return slice; - }); - } - - function inject(memo, iterator, context) { - this.each(function(value, index) { - memo = iterator.call(context, memo, value, index); - }); - return memo; - } - - function invoke(method) { - var args = $A(arguments).slice(1); - return this.map(function(value) { - return value[method].apply(value, args); - }); - } - - function max(iterator, context) { - iterator = iterator || Prototype.K; - var result; - this.each(function(value, index) { - value = iterator.call(context, value, index); - if (result == null || value >= result) - result = value; - }); - return result; - } - - function min(iterator, context) { - iterator = iterator || Prototype.K; - var result; - this.each(function(value, index) { - value = iterator.call(context, value, index); - if (result == null || value < result) - result = value; - }); - return result; - } - - function partition(iterator, context) { - iterator = iterator || Prototype.K; - var trues = [], falses = []; - this.each(function(value, index) { - (iterator.call(context, value, index) ? - trues : falses).push(value); - }); - return [trues, falses]; - } - - function pluck(property) { - var results = []; - this.each(function(value) { - results.push(value[property]); - }); - return results; - } - - function reject(iterator, context) { - var results = []; - this.each(function(value, index) { - if (!iterator.call(context, value, index)) - results.push(value); - }); - return results; - } - - function sortBy(iterator, context) { - return this.map(function(value, index) { - return { - value: value, - criteria: iterator.call(context, value, index) - }; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }).pluck('value'); - } - - function toArray() { - return this.map(); - } - - function zip() { - var iterator = Prototype.K, args = $A(arguments); - if (Object.isFunction(args.last())) - iterator = args.pop(); - - var collections = [this].concat(args).map($A); - return this.map(function(value, index) { - return iterator(collections.pluck(index)); - }); - } - - function size() { - return this.toArray().length; - } - - function inspect() { - return '#'; - } - - - - - - - - - - return { - each: each, - eachSlice: eachSlice, - all: all, - every: all, - any: any, - some: any, - collect: collect, - map: collect, - detect: detect, - findAll: findAll, - select: findAll, - filter: findAll, - grep: grep, - include: include, - member: include, - inGroupsOf: inGroupsOf, - inject: inject, - invoke: invoke, - max: max, - min: min, - partition: partition, - pluck: pluck, - reject: reject, - sortBy: sortBy, - toArray: toArray, - entries: toArray, - zip: zip, - size: size, - inspect: inspect, - find: detect - }; -})(); -function $A(iterable) { - if (!iterable) return []; - if ('toArray' in Object(iterable)) return iterable.toArray(); - var length = iterable.length || 0, results = new Array(length); - while (length--) results[length] = iterable[length]; - return results; -} - -function $w(string) { - if (!Object.isString(string)) return []; - string = string.strip(); - return string ? string.split(/\s+/) : []; -} - -Array.from = $A; - - -(function() { - var arrayProto = Array.prototype, - slice = arrayProto.slice, - _each = arrayProto.forEach; // use native browser JS 1.6 implementation if available - - function each(iterator) { - for (var i = 0, length = this.length; i < length; i++) - iterator(this[i]); - } - if (!_each) _each = each; - - function clear() { - this.length = 0; - return this; - } - - function first() { - return this[0]; - } - - function last() { - return this[this.length - 1]; - } - - function compact() { - return this.select(function(value) { - return value != null; - }); - } - - function flatten() { - return this.inject([], function(array, value) { - if (Object.isArray(value)) - return array.concat(value.flatten()); - array.push(value); - return array; - }); - } - - function without() { - var values = slice.call(arguments, 0); - return this.select(function(value) { - return !values.include(value); - }); - } - - function reverse(inline) { - return (inline !== false ? this : this.toArray())._reverse(); - } - - function uniq(sorted) { - return this.inject([], function(array, value, index) { - if (0 == index || (sorted ? array.last() != value : !array.include(value))) - array.push(value); - return array; - }); - } - - function intersect(array) { - return this.uniq().findAll(function(item) { - return array.detect(function(value) { return item === value }); - }); - } - - - function clone() { - return slice.call(this, 0); - } - - function size() { - return this.length; - } - - function inspect() { - return '[' + this.map(Object.inspect).join(', ') + ']'; - } - - function toJSON() { - var results = []; - this.each(function(object) { - var value = Object.toJSON(object); - if (!Object.isUndefined(value)) results.push(value); - }); - return '[' + results.join(', ') + ']'; - } - - function indexOf(item, i) { - i || (i = 0); - var length = this.length; - if (i < 0) i = length + i; - for (; i < length; i++) - if (this[i] === item) return i; - return -1; - } - - function lastIndexOf(item, i) { - i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; - var n = this.slice(0, i).reverse().indexOf(item); - return (n < 0) ? n : i - n - 1; - } - - function concat() { - var array = slice.call(this, 0), item; - for (var i = 0, length = arguments.length; i < length; i++) { - item = arguments[i]; - if (Object.isArray(item) && !('callee' in item)) { - for (var j = 0, arrayLength = item.length; j < arrayLength; j++) - array.push(item[j]); - } else { - array.push(item); - } - } - return array; - } - - Object.extend(arrayProto, Enumerable); - - if (!arrayProto._reverse) - arrayProto._reverse = arrayProto.reverse; - - Object.extend(arrayProto, { - _each: _each, - clear: clear, - first: first, - last: last, - compact: compact, - flatten: flatten, - without: without, - reverse: reverse, - uniq: uniq, - intersect: intersect, - clone: clone, - toArray: clone, - size: size, - inspect: inspect, - toJSON: toJSON - }); - - var CONCAT_ARGUMENTS_BUGGY = (function() { - return [].concat(arguments)[0][0] !== 1; - })(1,2) - - if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat; - - if (!arrayProto.indexOf) arrayProto.indexOf = indexOf; - if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf; -})(); -function $H(object) { - return new Hash(object); -}; - -var Hash = Class.create(Enumerable, (function() { - function initialize(object) { - this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); - } - - function _each(iterator) { - for (var key in this._object) { - var value = this._object[key], pair = [key, value]; - pair.key = key; - pair.value = value; - iterator(pair); - } - } - - function set(key, value) { - return this._object[key] = value; - } - - function get(key) { - if (this._object[key] !== Object.prototype[key]) - return this._object[key]; - } - - function unset(key) { - var value = this._object[key]; - delete this._object[key]; - return value; - } - - function toObject() { - return Object.clone(this._object); - } - - function keys() { - return this.pluck('key'); - } - - function values() { - return this.pluck('value'); - } - - function index(value) { - var match = this.detect(function(pair) { - return pair.value === value; - }); - return match && match.key; - } - - function merge(object) { - return this.clone().update(object); - } - - function update(object) { - return new Hash(object).inject(this, function(result, pair) { - result.set(pair.key, pair.value); - return result; - }); - } - - function toQueryPair(key, value) { - if (Object.isUndefined(value)) return key; - return key + '=' + encodeURIComponent(String.interpret(value)); - } - - function toQueryString() { - return this.inject([], function(results, pair) { - var key = encodeURIComponent(pair.key), values = pair.value; - - if (values && typeof values == 'object') { - if (Object.isArray(values)) - return results.concat(values.map(toQueryPair.curry(key))); - } else results.push(toQueryPair(key, values)); - return results; - }).join('&'); - } - - function inspect() { - return '#'; - } - - function toJSON() { - return Object.toJSON(this.toObject()); - } - - function clone() { - return new Hash(this); - } - - return { - initialize: initialize, - _each: _each, - set: set, - get: get, - unset: unset, - toObject: toObject, - toTemplateReplacements: toObject, - keys: keys, - values: values, - index: index, - merge: merge, - update: update, - toQueryString: toQueryString, - inspect: inspect, - toJSON: toJSON, - clone: clone - }; -})()); - -Hash.from = $H; -Object.extend(Number.prototype, (function() { - function toColorPart() { - return this.toPaddedString(2, 16); - } - - function succ() { - return this + 1; - } - - function times(iterator, context) { - $R(0, this, true).each(iterator, context); - return this; - } - - function toPaddedString(length, radix) { - var string = this.toString(radix || 10); - return '0'.times(length - string.length) + string; - } - - function toJSON() { - return isFinite(this) ? this.toString() : 'null'; - } - - function abs() { - return Math.abs(this); - } - - function round() { - return Math.round(this); - } - - function ceil() { - return Math.ceil(this); - } - - function floor() { - return Math.floor(this); - } - - return { - toColorPart: toColorPart, - succ: succ, - times: times, - toPaddedString: toPaddedString, - toJSON: toJSON, - abs: abs, - round: round, - ceil: ceil, - floor: floor - }; -})()); - -function $R(start, end, exclusive) { - return new ObjectRange(start, end, exclusive); -} - -var ObjectRange = Class.create(Enumerable, (function() { - function initialize(start, end, exclusive) { - this.start = start; - this.end = end; - this.exclusive = exclusive; - } - - function _each(iterator) { - var value = this.start; - while (this.include(value)) { - iterator(value); - value = value.succ(); - } - } - - function include(value) { - if (value < this.start) - return false; - if (this.exclusive) - return value < this.end; - return value <= this.end; - } - - return { - initialize: initialize, - _each: _each, - include: include - }; -})()); - - - -var Ajax = { - getTransport: function() { - return Try.these( - function() {return new XMLHttpRequest()}, - function() {return new ActiveXObject('Msxml2.XMLHTTP')}, - function() {return new ActiveXObject('Microsoft.XMLHTTP')} - ) || false; - }, - - activeRequestCount: 0 -}; - -Ajax.Responders = { - responders: [], - - _each: function(iterator) { - this.responders._each(iterator); - }, - - register: function(responder) { - if (!this.include(responder)) - this.responders.push(responder); - }, - - unregister: function(responder) { - this.responders = this.responders.without(responder); - }, - - dispatch: function(callback, request, transport, json) { - this.each(function(responder) { - if (Object.isFunction(responder[callback])) { - try { - responder[callback].apply(responder, [request, transport, json]); - } catch (e) { } - } - }); - } -}; - -Object.extend(Ajax.Responders, Enumerable); - -Ajax.Responders.register({ - onCreate: function() { Ajax.activeRequestCount++ }, - onComplete: function() { Ajax.activeRequestCount-- } -}); -Ajax.Base = Class.create({ - initialize: function(options) { - this.options = { - method: 'post', - asynchronous: true, - contentType: 'application/x-www-form-urlencoded', - encoding: 'UTF-8', - parameters: '', - evalJSON: true, - evalJS: true - }; - Object.extend(this.options, options || { }); - - this.options.method = this.options.method.toLowerCase(); - - if (Object.isString(this.options.parameters)) - this.options.parameters = this.options.parameters.toQueryParams(); - else if (Object.isHash(this.options.parameters)) - this.options.parameters = this.options.parameters.toObject(); - } -}); -Ajax.Request = Class.create(Ajax.Base, { - _complete: false, - - initialize: function($super, url, options) { - $super(options); - this.transport = Ajax.getTransport(); - this.request(url); - }, - - request: function(url) { - this.url = url; - this.method = this.options.method; - var params = Object.clone(this.options.parameters); - - if (!['get', 'post'].include(this.method)) { - params['_method'] = this.method; - this.method = 'post'; - } - - this.parameters = params; - - if (params = Object.toQueryString(params)) { - if (this.method == 'get') - this.url += (this.url.include('?') ? '&' : '?') + params; - else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) - params += '&_='; - } - - try { - var response = new Ajax.Response(this); - if (this.options.onCreate) this.options.onCreate(response); - Ajax.Responders.dispatch('onCreate', this, response); - - this.transport.open(this.method.toUpperCase(), this.url, - this.options.asynchronous); - - if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); - - this.transport.onreadystatechange = this.onStateChange.bind(this); - this.setRequestHeaders(); - - this.body = this.method == 'post' ? (this.options.postBody || params) : null; - this.transport.send(this.body); - - /* Force Firefox to handle ready state 4 for synchronous requests */ - if (!this.options.asynchronous && this.transport.overrideMimeType) - this.onStateChange(); - - } - catch (e) { - this.dispatchException(e); - } - }, - - onStateChange: function() { - var readyState = this.transport.readyState; - if (readyState > 1 && !((readyState == 4) && this._complete)) - this.respondToReadyState(this.transport.readyState); - }, - - setRequestHeaders: function() { - var headers = { - 'X-Requested-With': 'XMLHttpRequest', - 'X-Prototype-Version': Prototype.Version, - 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' - }; - - if (this.method == 'post') { - headers['Content-type'] = this.options.contentType + - (this.options.encoding ? '; charset=' + this.options.encoding : ''); - - /* Force "Connection: close" for older Mozilla browsers to work - * around a bug where XMLHttpRequest sends an incorrect - * Content-length header. See Mozilla Bugzilla #246651. - */ - if (this.transport.overrideMimeType && - (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) - headers['Connection'] = 'close'; - } - - if (typeof this.options.requestHeaders == 'object') { - var extras = this.options.requestHeaders; - - if (Object.isFunction(extras.push)) - for (var i = 0, length = extras.length; i < length; i += 2) - headers[extras[i]] = extras[i+1]; - else - $H(extras).each(function(pair) { headers[pair.key] = pair.value }); - } - - for (var name in headers) - this.transport.setRequestHeader(name, headers[name]); - }, - - success: function() { - var status = this.getStatus(); - return !status || (status >= 200 && status < 300); - }, - - getStatus: function() { - try { - return this.transport.status || 0; - } catch (e) { return 0 } - }, - - respondToReadyState: function(readyState) { - var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); - - if (state == 'Complete') { - try { - this._complete = true; - (this.options['on' + response.status] - || this.options['on' + (this.success() ? 'Success' : 'Failure')] - || Prototype.emptyFunction)(response, response.headerJSON); - } catch (e) { - this.dispatchException(e); - } - - var contentType = response.getHeader('Content-type'); - if (this.options.evalJS == 'force' - || (this.options.evalJS && this.isSameOrigin() && contentType - && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) - this.evalResponse(); - } - - try { - (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); - Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); - } catch (e) { - this.dispatchException(e); - } - - if (state == 'Complete') { - this.transport.onreadystatechange = Prototype.emptyFunction; - } - }, - - isSameOrigin: function() { - var m = this.url.match(/^\s*https?:\/\/[^\/]*/); - return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({ - protocol: location.protocol, - domain: document.domain, - port: location.port ? ':' + location.port : '' - })); - }, - - getHeader: function(name) { - try { - return this.transport.getResponseHeader(name) || null; - } catch (e) { return null; } - }, - - evalResponse: function() { - try { - return eval((this.transport.responseText || '').unfilterJSON()); - } catch (e) { - this.dispatchException(e); - } - }, - - dispatchException: function(exception) { - (this.options.onException || Prototype.emptyFunction)(this, exception); - Ajax.Responders.dispatch('onException', this, exception); - } -}); - -Ajax.Request.Events = - ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; - - - - - - - - -Ajax.Response = Class.create({ - initialize: function(request){ - this.request = request; - var transport = this.transport = request.transport, - readyState = this.readyState = transport.readyState; - - if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { - this.status = this.getStatus(); - this.statusText = this.getStatusText(); - this.responseText = String.interpret(transport.responseText); - this.headerJSON = this._getHeaderJSON(); - } - - if(readyState == 4) { - var xml = transport.responseXML; - this.responseXML = Object.isUndefined(xml) ? null : xml; - this.responseJSON = this._getResponseJSON(); - } - }, - - status: 0, - - statusText: '', - - getStatus: Ajax.Request.prototype.getStatus, - - getStatusText: function() { - try { - return this.transport.statusText || ''; - } catch (e) { return '' } - }, - - getHeader: Ajax.Request.prototype.getHeader, - - getAllHeaders: function() { - try { - return this.getAllResponseHeaders(); - } catch (e) { return null } - }, - - getResponseHeader: function(name) { - return this.transport.getResponseHeader(name); - }, - - getAllResponseHeaders: function() { - return this.transport.getAllResponseHeaders(); - }, - - _getHeaderJSON: function() { - var json = this.getHeader('X-JSON'); - if (!json) return null; - json = decodeURIComponent(escape(json)); - try { - return json.evalJSON(this.request.options.sanitizeJSON || - !this.request.isSameOrigin()); - } catch (e) { - this.request.dispatchException(e); - } - }, - - _getResponseJSON: function() { - var options = this.request.options; - if (!options.evalJSON || (options.evalJSON != 'force' && - !(this.getHeader('Content-type') || '').include('application/json')) || - this.responseText.blank()) - return null; - try { - return this.responseText.evalJSON(options.sanitizeJSON || - !this.request.isSameOrigin()); - } catch (e) { - this.request.dispatchException(e); - } - } -}); - -Ajax.Updater = Class.create(Ajax.Request, { - initialize: function($super, container, url, options) { - this.container = { - success: (container.success || container), - failure: (container.failure || (container.success ? null : container)) - }; - - options = Object.clone(options); - var onComplete = options.onComplete; - options.onComplete = (function(response, json) { - this.updateContent(response.responseText); - if (Object.isFunction(onComplete)) onComplete(response, json); - }).bind(this); - - $super(url, options); - }, - - updateContent: function(responseText) { - var receiver = this.container[this.success() ? 'success' : 'failure'], - options = this.options; - - if (!options.evalScripts) responseText = responseText.stripScripts(); - - if (receiver = $(receiver)) { - if (options.insertion) { - if (Object.isString(options.insertion)) { - var insertion = { }; insertion[options.insertion] = responseText; - receiver.insert(insertion); - } - else options.insertion(receiver, responseText); - } - else receiver.update(responseText); - } - } -}); - -Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { - initialize: function($super, container, url, options) { - $super(options); - this.onComplete = this.options.onComplete; - - this.frequency = (this.options.frequency || 2); - this.decay = (this.options.decay || 1); - - this.updater = { }; - this.container = container; - this.url = url; - - this.start(); - }, - - start: function() { - this.options.onComplete = this.updateComplete.bind(this); - this.onTimerEvent(); - }, - - stop: function() { - this.updater.options.onComplete = undefined; - clearTimeout(this.timer); - (this.onComplete || Prototype.emptyFunction).apply(this, arguments); - }, - - updateComplete: function(response) { - if (this.options.decay) { - this.decay = (response.responseText == this.lastText ? - this.decay * this.options.decay : 1); - - this.lastText = response.responseText; - } - this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); - }, - - onTimerEvent: function() { - this.updater = new Ajax.Updater(this.container, this.url, this.options); - } -}); - - - -function $(element) { - if (arguments.length > 1) { - for (var i = 0, elements = [], length = arguments.length; i < length; i++) - elements.push($(arguments[i])); - return elements; - } - if (Object.isString(element)) - element = document.getElementById(element); - return Element.extend(element); -} - -if (Prototype.BrowserFeatures.XPath) { - document._getElementsByXPath = function(expression, parentElement) { - var results = []; - var query = document.evaluate(expression, $(parentElement) || document, - null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - for (var i = 0, length = query.snapshotLength; i < length; i++) - results.push(Element.extend(query.snapshotItem(i))); - return results; - }; -} - -/*--------------------------------------------------------------------------*/ - -if (!window.Node) var Node = { }; - -if (!Node.ELEMENT_NODE) { - Object.extend(Node, { - ELEMENT_NODE: 1, - ATTRIBUTE_NODE: 2, - TEXT_NODE: 3, - CDATA_SECTION_NODE: 4, - ENTITY_REFERENCE_NODE: 5, - ENTITY_NODE: 6, - PROCESSING_INSTRUCTION_NODE: 7, - COMMENT_NODE: 8, - DOCUMENT_NODE: 9, - DOCUMENT_TYPE_NODE: 10, - DOCUMENT_FRAGMENT_NODE: 11, - NOTATION_NODE: 12 - }); -} - - -(function(global) { - - var SETATTRIBUTE_IGNORES_NAME = (function(){ - var elForm = document.createElement("form"); - var elInput = document.createElement("input"); - var root = document.documentElement; - elInput.setAttribute("name", "test"); - elForm.appendChild(elInput); - root.appendChild(elForm); - var isBuggy = elForm.elements - ? (typeof elForm.elements.test == "undefined") - : null; - root.removeChild(elForm); - elForm = elInput = null; - return isBuggy; - })(); - - var element = global.Element; - global.Element = function(tagName, attributes) { - attributes = attributes || { }; - tagName = tagName.toLowerCase(); - var cache = Element.cache; - if (SETATTRIBUTE_IGNORES_NAME && attributes.name) { - tagName = '<' + tagName + ' name="' + attributes.name + '">'; - delete attributes.name; - return Element.writeAttribute(document.createElement(tagName), attributes); - } - if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); - return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); - }; - Object.extend(global.Element, element || { }); - if (element) global.Element.prototype = element.prototype; -})(this); - -Element.cache = { }; -Element.idCounter = 1; - -Element.Methods = { - visible: function(element) { - return $(element).style.display != 'none'; - }, - - toggle: function(element) { - element = $(element); - Element[Element.visible(element) ? 'hide' : 'show'](element); - return element; - }, - - - hide: function(element) { - element = $(element); - element.style.display = 'none'; - return element; - }, - - show: function(element) { - element = $(element); - element.style.display = ''; - return element; - }, - - remove: function(element) { - element = $(element); - element.parentNode.removeChild(element); - return element; - }, - - update: (function(){ - - var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){ - var el = document.createElement("select"), - isBuggy = true; - el.innerHTML = ""; - if (el.options && el.options[0]) { - isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION"; - } - el = null; - return isBuggy; - })(); - - var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){ - try { - var el = document.createElement("table"); - if (el && el.tBodies) { - el.innerHTML = "test"; - var isBuggy = typeof el.tBodies[0] == "undefined"; - el = null; - return isBuggy; - } - } catch (e) { - return true; - } - })(); - - var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () { - var s = document.createElement("script"), - isBuggy = false; - try { - s.appendChild(document.createTextNode("")); - isBuggy = !s.firstChild || - s.firstChild && s.firstChild.nodeType !== 3; - } catch (e) { - isBuggy = true; - } - s = null; - return isBuggy; - })(); - - function update(element, content) { - element = $(element); - - if (content && content.toElement) - content = content.toElement(); - - if (Object.isElement(content)) - return element.update().insert(content); - - content = Object.toHTML(content); - - var tagName = element.tagName.toUpperCase(); - - if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) { - element.text = content; - return element; - } - - if (SELECT_ELEMENT_INNERHTML_BUGGY || TABLE_ELEMENT_INNERHTML_BUGGY) { - if (tagName in Element._insertionTranslations.tags) { - while (element.firstChild) { - element.removeChild(element.firstChild); - } - Element._getContentFromAnonymousElement(tagName, content.stripScripts()) - .each(function(node) { - element.appendChild(node) - }); - } - else { - element.innerHTML = content.stripScripts(); - } - } - else { - element.innerHTML = content.stripScripts(); - } - - content.evalScripts.bind(content).defer(); - return element; - } - - return update; - })(), - - replace: function(element, content) { - element = $(element); - if (content && content.toElement) content = content.toElement(); - else if (!Object.isElement(content)) { - content = Object.toHTML(content); - var range = element.ownerDocument.createRange(); - range.selectNode(element); - content.evalScripts.bind(content).defer(); - content = range.createContextualFragment(content.stripScripts()); - } - element.parentNode.replaceChild(content, element); - return element; - }, - - insert: function(element, insertions) { - element = $(element); - - if (Object.isString(insertions) || Object.isNumber(insertions) || - Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) - insertions = {bottom:insertions}; - - var content, insert, tagName, childNodes; - - for (var position in insertions) { - content = insertions[position]; - position = position.toLowerCase(); - insert = Element._insertionTranslations[position]; - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) { - insert(element, content); - continue; - } - - content = Object.toHTML(content); - - tagName = ((position == 'before' || position == 'after') - ? element.parentNode : element).tagName.toUpperCase(); - - childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); - - if (position == 'top' || position == 'after') childNodes.reverse(); - childNodes.each(insert.curry(element)); - - content.evalScripts.bind(content).defer(); - } - - return element; - }, - - wrap: function(element, wrapper, attributes) { - element = $(element); - if (Object.isElement(wrapper)) - $(wrapper).writeAttribute(attributes || { }); - else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); - else wrapper = new Element('div', wrapper); - if (element.parentNode) - element.parentNode.replaceChild(wrapper, element); - wrapper.appendChild(element); - return wrapper; - }, - - inspect: function(element) { - element = $(element); - var result = '<' + element.tagName.toLowerCase(); - $H({'id': 'id', 'className': 'class'}).each(function(pair) { - var property = pair.first(), attribute = pair.last(); - var value = (element[property] || '').toString(); - if (value) result += ' ' + attribute + '=' + value.inspect(true); - }); - return result + '>'; - }, - - recursivelyCollect: function(element, property) { - element = $(element); - var elements = []; - while (element = element[property]) - if (element.nodeType == 1) - elements.push(Element.extend(element)); - return elements; - }, - - ancestors: function(element) { - return Element.recursivelyCollect(element, 'parentNode'); - }, - - descendants: function(element) { - return Element.select(element, "*"); - }, - - firstDescendant: function(element) { - element = $(element).firstChild; - while (element && element.nodeType != 1) element = element.nextSibling; - return $(element); - }, - - immediateDescendants: function(element) { - if (!(element = $(element).firstChild)) return []; - while (element && element.nodeType != 1) element = element.nextSibling; - if (element) return [element].concat($(element).nextSiblings()); - return []; - }, - - previousSiblings: function(element) { - return Element.recursivelyCollect(element, 'previousSibling'); - }, - - nextSiblings: function(element) { - return Element.recursivelyCollect(element, 'nextSibling'); - }, - - siblings: function(element) { - element = $(element); - return Element.previousSiblings(element).reverse() - .concat(Element.nextSiblings(element)); - }, - - match: function(element, selector) { - if (Object.isString(selector)) - selector = new Selector(selector); - return selector.match($(element)); - }, - - up: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(element.parentNode); - var ancestors = Element.ancestors(element); - return Object.isNumber(expression) ? ancestors[expression] : - Selector.findElement(ancestors, expression, index); - }, - - down: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return Element.firstDescendant(element); - return Object.isNumber(expression) ? Element.descendants(element)[expression] : - Element.select(element, expression)[index || 0]; - }, - - previous: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element)); - var previousSiblings = Element.previousSiblings(element); - return Object.isNumber(expression) ? previousSiblings[expression] : - Selector.findElement(previousSiblings, expression, index); - }, - - next: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element)); - var nextSiblings = Element.nextSiblings(element); - return Object.isNumber(expression) ? nextSiblings[expression] : - Selector.findElement(nextSiblings, expression, index); - }, - - - select: function(element) { - var args = Array.prototype.slice.call(arguments, 1); - return Selector.findChildElements(element, args); - }, - - adjacent: function(element) { - var args = Array.prototype.slice.call(arguments, 1); - return Selector.findChildElements(element.parentNode, args).without(element); - }, - - identify: function(element) { - element = $(element); - var id = Element.readAttribute(element, 'id'); - if (id) return id; - do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id)); - Element.writeAttribute(element, 'id', id); - return id; - }, - - readAttribute: function(element, name) { - element = $(element); - if (Prototype.Browser.IE) { - var t = Element._attributeTranslations.read; - if (t.values[name]) return t.values[name](element, name); - if (t.names[name]) name = t.names[name]; - if (name.include(':')) { - return (!element.attributes || !element.attributes[name]) ? null : - element.attributes[name].value; - } - } - return element.getAttribute(name); - }, - - writeAttribute: function(element, name, value) { - element = $(element); - var attributes = { }, t = Element._attributeTranslations.write; - - if (typeof name == 'object') attributes = name; - else attributes[name] = Object.isUndefined(value) ? true : value; - - for (var attr in attributes) { - name = t.names[attr] || attr; - value = attributes[attr]; - if (t.values[attr]) name = t.values[attr](element, value); - if (value === false || value === null) - element.removeAttribute(name); - else if (value === true) - element.setAttribute(name, name); - else element.setAttribute(name, value); - } - return element; - }, - - getHeight: function(element) { - return Element.getDimensions(element).height; - }, - - getWidth: function(element) { - return Element.getDimensions(element).width; - }, - - classNames: function(element) { - return new Element.ClassNames(element); - }, - - hasClassName: function(element, className) { - if (!(element = $(element))) return; - var elementClassName = element.className; - return (elementClassName.length > 0 && (elementClassName == className || - new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); - }, - - addClassName: function(element, className) { - if (!(element = $(element))) return; - if (!Element.hasClassName(element, className)) - element.className += (element.className ? ' ' : '') + className; - return element; - }, - - removeClassName: function(element, className) { - if (!(element = $(element))) return; - element.className = element.className.replace( - new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); - return element; - }, - - toggleClassName: function(element, className) { - if (!(element = $(element))) return; - return Element[Element.hasClassName(element, className) ? - 'removeClassName' : 'addClassName'](element, className); - }, - - cleanWhitespace: function(element) { - element = $(element); - var node = element.firstChild; - while (node) { - var nextNode = node.nextSibling; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) - element.removeChild(node); - node = nextNode; - } - return element; - }, - - empty: function(element) { - return $(element).innerHTML.blank(); - }, - - descendantOf: function(element, ancestor) { - element = $(element), ancestor = $(ancestor); - - if (element.compareDocumentPosition) - return (element.compareDocumentPosition(ancestor) & 8) === 8; - - if (ancestor.contains) - return ancestor.contains(element) && ancestor !== element; - - while (element = element.parentNode) - if (element == ancestor) return true; - - return false; - }, - - scrollTo: function(element) { - element = $(element); - var pos = Element.cumulativeOffset(element); - window.scrollTo(pos[0], pos[1]); - return element; - }, - - getStyle: function(element, style) { - element = $(element); - style = style == 'float' ? 'cssFloat' : style.camelize(); - var value = element.style[style]; - if (!value || value == 'auto') { - var css = document.defaultView.getComputedStyle(element, null); - value = css ? css[style] : null; - } - if (style == 'opacity') return value ? parseFloat(value) : 1.0; - return value == 'auto' ? null : value; - }, - - getOpacity: function(element) { - return $(element).getStyle('opacity'); - }, - - setStyle: function(element, styles) { - element = $(element); - var elementStyle = element.style, match; - if (Object.isString(styles)) { - element.style.cssText += ';' + styles; - return styles.include('opacity') ? - element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; - } - for (var property in styles) - if (property == 'opacity') element.setOpacity(styles[property]); - else - elementStyle[(property == 'float' || property == 'cssFloat') ? - (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : - property] = styles[property]; - - return element; - }, - - setOpacity: function(element, value) { - element = $(element); - element.style.opacity = (value == 1 || value === '') ? '' : - (value < 0.00001) ? 0 : value; - return element; - }, - - getDimensions: function(element) { - element = $(element); - var display = Element.getStyle(element, 'display'); - if (display != 'none' && display != null) // Safari bug - return {width: element.offsetWidth, height: element.offsetHeight}; - - var els = element.style; - var originalVisibility = els.visibility; - var originalPosition = els.position; - var originalDisplay = els.display; - els.visibility = 'hidden'; - if (originalPosition != 'fixed') // Switching fixed to absolute causes issues in Safari - els.position = 'absolute'; - els.display = 'block'; - var originalWidth = element.clientWidth; - var originalHeight = element.clientHeight; - els.display = originalDisplay; - els.position = originalPosition; - els.visibility = originalVisibility; - return {width: originalWidth, height: originalHeight}; - }, - - makePositioned: function(element) { - element = $(element); - var pos = Element.getStyle(element, 'position'); - if (pos == 'static' || !pos) { - element._madePositioned = true; - element.style.position = 'relative'; - if (Prototype.Browser.Opera) { - element.style.top = 0; - element.style.left = 0; - } - } - return element; - }, - - undoPositioned: function(element) { - element = $(element); - if (element._madePositioned) { - element._madePositioned = undefined; - element.style.position = - element.style.top = - element.style.left = - element.style.bottom = - element.style.right = ''; - } - return element; - }, - - makeClipping: function(element) { - element = $(element); - if (element._overflow) return element; - element._overflow = Element.getStyle(element, 'overflow') || 'auto'; - if (element._overflow !== 'hidden') - element.style.overflow = 'hidden'; - return element; - }, - - undoClipping: function(element) { - element = $(element); - if (!element._overflow) return element; - element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; - element._overflow = null; - return element; - }, - - cumulativeOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - positionedOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - if (element) { - if (element.tagName.toUpperCase() == 'BODY') break; - var p = Element.getStyle(element, 'position'); - if (p !== 'static') break; - } - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - absolutize: function(element) { - element = $(element); - if (Element.getStyle(element, 'position') == 'absolute') return element; - - var offsets = Element.positionedOffset(element); - var top = offsets[1]; - var left = offsets[0]; - var width = element.clientWidth; - var height = element.clientHeight; - - element._originalLeft = left - parseFloat(element.style.left || 0); - element._originalTop = top - parseFloat(element.style.top || 0); - element._originalWidth = element.style.width; - element._originalHeight = element.style.height; - - element.style.position = 'absolute'; - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.width = width + 'px'; - element.style.height = height + 'px'; - return element; - }, - - relativize: function(element) { - element = $(element); - if (Element.getStyle(element, 'position') == 'relative') return element; - - element.style.position = 'relative'; - var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); - var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); - - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.height = element._originalHeight; - element.style.width = element._originalWidth; - return element; - }, - - cumulativeScrollOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.scrollTop || 0; - valueL += element.scrollLeft || 0; - element = element.parentNode; - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - getOffsetParent: function(element) { - if (element.offsetParent) return $(element.offsetParent); - if (element == document.body) return $(element); - - while ((element = element.parentNode) && element != document.body) - if (Element.getStyle(element, 'position') != 'static') - return $(element); - - return $(document.body); - }, - - viewportOffset: function(forElement) { - var valueT = 0, valueL = 0; - - var element = forElement; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - - if (element.offsetParent == document.body && - Element.getStyle(element, 'position') == 'absolute') break; - - } while (element = element.offsetParent); - - element = forElement; - do { - if (!Prototype.Browser.Opera || (element.tagName && (element.tagName.toUpperCase() == 'BODY'))) { - valueT -= element.scrollTop || 0; - valueL -= element.scrollLeft || 0; - } - } while (element = element.parentNode); - - return Element._returnOffset(valueL, valueT); - }, - - clonePosition: function(element, source) { - var options = Object.extend({ - setLeft: true, - setTop: true, - setWidth: true, - setHeight: true, - offsetTop: 0, - offsetLeft: 0 - }, arguments[2] || { }); - - source = $(source); - var p = Element.viewportOffset(source); - - element = $(element); - var delta = [0, 0]; - var parent = null; - if (Element.getStyle(element, 'position') == 'absolute') { - parent = Element.getOffsetParent(element); - delta = Element.viewportOffset(parent); - } - - if (parent == document.body) { - delta[0] -= document.body.offsetLeft; - delta[1] -= document.body.offsetTop; - } - - if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; - if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; - if (options.setWidth) element.style.width = source.offsetWidth + 'px'; - if (options.setHeight) element.style.height = source.offsetHeight + 'px'; - return element; - } -}; - -Object.extend(Element.Methods, { - getElementsBySelector: Element.Methods.select, - - childElements: Element.Methods.immediateDescendants -}); - -Element._attributeTranslations = { - write: { - names: { - className: 'class', - htmlFor: 'for' - }, - values: { } - } -}; - -if (Prototype.Browser.Opera) { - Element.Methods.getStyle = Element.Methods.getStyle.wrap( - function(proceed, element, style) { - switch (style) { - case 'left': case 'top': case 'right': case 'bottom': - if (proceed(element, 'position') === 'static') return null; - case 'height': case 'width': - if (!Element.visible(element)) return null; - - var dim = parseInt(proceed(element, style), 10); - - if (dim !== element['offset' + style.capitalize()]) - return dim + 'px'; - - var properties; - if (style === 'height') { - properties = ['border-top-width', 'padding-top', - 'padding-bottom', 'border-bottom-width']; - } - else { - properties = ['border-left-width', 'padding-left', - 'padding-right', 'border-right-width']; - } - return properties.inject(dim, function(memo, property) { - var val = proceed(element, property); - return val === null ? memo : memo - parseInt(val, 10); - }) + 'px'; - default: return proceed(element, style); - } - } - ); - - Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( - function(proceed, element, attribute) { - if (attribute === 'title') return element.title; - return proceed(element, attribute); - } - ); -} - -else if (Prototype.Browser.IE) { - Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap( - function(proceed, element) { - element = $(element); - try { element.offsetParent } - catch(e) { return $(document.body) } - var position = element.getStyle('position'); - if (position !== 'static') return proceed(element); - element.setStyle({ position: 'relative' }); - var value = proceed(element); - element.setStyle({ position: position }); - return value; - } - ); - - $w('positionedOffset viewportOffset').each(function(method) { - Element.Methods[method] = Element.Methods[method].wrap( - function(proceed, element) { - element = $(element); - try { element.offsetParent } - catch(e) { return Element._returnOffset(0,0) } - var position = element.getStyle('position'); - if (position !== 'static') return proceed(element); - var offsetParent = element.getOffsetParent(); - if (offsetParent && offsetParent.getStyle('position') === 'fixed') - offsetParent.setStyle({ zoom: 1 }); - element.setStyle({ position: 'relative' }); - var value = proceed(element); - element.setStyle({ position: position }); - return value; - } - ); - }); - - Element.Methods.cumulativeOffset = Element.Methods.cumulativeOffset.wrap( - function(proceed, element) { - try { element.offsetParent } - catch(e) { return Element._returnOffset(0,0) } - return proceed(element); - } - ); - - Element.Methods.getStyle = function(element, style) { - element = $(element); - style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); - var value = element.style[style]; - if (!value && element.currentStyle) value = element.currentStyle[style]; - - if (style == 'opacity') { - if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) - if (value[1]) return parseFloat(value[1]) / 100; - return 1.0; - } - - if (value == 'auto') { - if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) - return element['offset' + style.capitalize()] + 'px'; - return null; - } - return value; - }; - - Element.Methods.setOpacity = function(element, value) { - function stripAlpha(filter){ - return filter.replace(/alpha\([^\)]*\)/gi,''); - } - element = $(element); - var currentStyle = element.currentStyle; - if ((currentStyle && !currentStyle.hasLayout) || - (!currentStyle && element.style.zoom == 'normal')) - element.style.zoom = 1; - - var filter = element.getStyle('filter'), style = element.style; - if (value == 1 || value === '') { - (filter = stripAlpha(filter)) ? - style.filter = filter : style.removeAttribute('filter'); - return element; - } else if (value < 0.00001) value = 0; - style.filter = stripAlpha(filter) + - 'alpha(opacity=' + (value * 100) + ')'; - return element; - }; - - Element._attributeTranslations = (function(){ - - var classProp = 'className'; - var forProp = 'for'; - - var el = document.createElement('div'); - - el.setAttribute(classProp, 'x'); - - if (el.className !== 'x') { - el.setAttribute('class', 'x'); - if (el.className === 'x') { - classProp = 'class'; - } - } - el = null; - - el = document.createElement('label'); - el.setAttribute(forProp, 'x'); - if (el.htmlFor !== 'x') { - el.setAttribute('htmlFor', 'x'); - if (el.htmlFor === 'x') { - forProp = 'htmlFor'; - } - } - el = null; - - return { - read: { - names: { - 'class': classProp, - 'className': classProp, - 'for': forProp, - 'htmlFor': forProp - }, - values: { - _getAttr: function(element, attribute) { - return element.getAttribute(attribute); - }, - _getAttr2: function(element, attribute) { - return element.getAttribute(attribute, 2); - }, - _getAttrNode: function(element, attribute) { - var node = element.getAttributeNode(attribute); - return node ? node.value : ""; - }, - _getEv: (function(){ - - var el = document.createElement('div'); - el.onclick = Prototype.emptyFunction; - var value = el.getAttribute('onclick'); - var f; - - if (String(value).indexOf('{') > -1) { - f = function(element, attribute) { - attribute = element.getAttribute(attribute); - if (!attribute) return null; - attribute = attribute.toString(); - attribute = attribute.split('{')[1]; - attribute = attribute.split('}')[0]; - return attribute.strip(); - }; - } - else if (value === '') { - f = function(element, attribute) { - attribute = element.getAttribute(attribute); - if (!attribute) return null; - return attribute.strip(); - }; - } - el = null; - return f; - })(), - _flag: function(element, attribute) { - return $(element).hasAttribute(attribute) ? attribute : null; - }, - style: function(element) { - return element.style.cssText.toLowerCase(); - }, - title: function(element) { - return element.title; - } - } - } - } - })(); - - Element._attributeTranslations.write = { - names: Object.extend({ - cellpadding: 'cellPadding', - cellspacing: 'cellSpacing' - }, Element._attributeTranslations.read.names), - values: { - checked: function(element, value) { - element.checked = !!value; - }, - - style: function(element, value) { - element.style.cssText = value ? value : ''; - } - } - }; - - Element._attributeTranslations.has = {}; - - $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + - 'encType maxLength readOnly longDesc frameBorder').each(function(attr) { - Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; - Element._attributeTranslations.has[attr.toLowerCase()] = attr; - }); - - (function(v) { - Object.extend(v, { - href: v._getAttr2, - src: v._getAttr2, - type: v._getAttr, - action: v._getAttrNode, - disabled: v._flag, - checked: v._flag, - readonly: v._flag, - multiple: v._flag, - onload: v._getEv, - onunload: v._getEv, - onclick: v._getEv, - ondblclick: v._getEv, - onmousedown: v._getEv, - onmouseup: v._getEv, - onmouseover: v._getEv, - onmousemove: v._getEv, - onmouseout: v._getEv, - onfocus: v._getEv, - onblur: v._getEv, - onkeypress: v._getEv, - onkeydown: v._getEv, - onkeyup: v._getEv, - onsubmit: v._getEv, - onreset: v._getEv, - onselect: v._getEv, - onchange: v._getEv - }); - })(Element._attributeTranslations.read.values); - - if (Prototype.BrowserFeatures.ElementExtensions) { - (function() { - function _descendants(element) { - var nodes = element.getElementsByTagName('*'), results = []; - for (var i = 0, node; node = nodes[i]; i++) - if (node.tagName !== "!") // Filter out comment nodes. - results.push(node); - return results; - } - - Element.Methods.down = function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return element.firstDescendant(); - return Object.isNumber(expression) ? _descendants(element)[expression] : - Element.select(element, expression)[index || 0]; - } - })(); - } - -} - -else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { - Element.Methods.setOpacity = function(element, value) { - element = $(element); - element.style.opacity = (value == 1) ? 0.999999 : - (value === '') ? '' : (value < 0.00001) ? 0 : value; - return element; - }; -} - -else if (Prototype.Browser.WebKit) { - Element.Methods.setOpacity = function(element, value) { - element = $(element); - element.style.opacity = (value == 1 || value === '') ? '' : - (value < 0.00001) ? 0 : value; - - if (value == 1) - if(element.tagName.toUpperCase() == 'IMG' && element.width) { - element.width++; element.width--; - } else try { - var n = document.createTextNode(' '); - element.appendChild(n); - element.removeChild(n); - } catch (e) { } - - return element; - }; - - Element.Methods.cumulativeOffset = function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - if (element.offsetParent == document.body) - if (Element.getStyle(element, 'position') == 'absolute') break; - - element = element.offsetParent; - } while (element); - - return Element._returnOffset(valueL, valueT); - }; -} - -if ('outerHTML' in document.documentElement) { - Element.Methods.replace = function(element, content) { - element = $(element); - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) { - element.parentNode.replaceChild(content, element); - return element; - } - - content = Object.toHTML(content); - var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); - - if (Element._insertionTranslations.tags[tagName]) { - var nextSibling = element.next(); - var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); - parent.removeChild(element); - if (nextSibling) - fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); - else - fragments.each(function(node) { parent.appendChild(node) }); - } - else element.outerHTML = content.stripScripts(); - - content.evalScripts.bind(content).defer(); - return element; - }; -} - -Element._returnOffset = function(l, t) { - var result = [l, t]; - result.left = l; - result.top = t; - return result; -}; - -Element._getContentFromAnonymousElement = function(tagName, html) { - var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; - if (t) { - div.innerHTML = t[0] + html + t[1]; - t[2].times(function() { div = div.firstChild }); - } else div.innerHTML = html; - return $A(div.childNodes); -}; - -Element._insertionTranslations = { - before: function(element, node) { - element.parentNode.insertBefore(node, element); - }, - top: function(element, node) { - element.insertBefore(node, element.firstChild); - }, - bottom: function(element, node) { - element.appendChild(node); - }, - after: function(element, node) { - element.parentNode.insertBefore(node, element.nextSibling); - }, - tags: { - TABLE: ['', '
    ', 1], - TBODY: ['', '
    ', 2], - TR: ['', '
    ', 3], - TD: ['
    ', '
    ', 4], - SELECT: ['', 1] - } -}; - -(function() { - var tags = Element._insertionTranslations.tags; - Object.extend(tags, { - THEAD: tags.TBODY, - TFOOT: tags.TBODY, - TH: tags.TD - }); -})(); - -Element.Methods.Simulated = { - hasAttribute: function(element, attribute) { - attribute = Element._attributeTranslations.has[attribute] || attribute; - var node = $(element).getAttributeNode(attribute); - return !!(node && node.specified); - } -}; - -Element.Methods.ByTag = { }; - -Object.extend(Element, Element.Methods); - -(function(div) { - - if (!Prototype.BrowserFeatures.ElementExtensions && div['__proto__']) { - window.HTMLElement = { }; - window.HTMLElement.prototype = div['__proto__']; - Prototype.BrowserFeatures.ElementExtensions = true; - } - - div = null; - -})(document.createElement('div')) - -Element.extend = (function() { - - function checkDeficiency(tagName) { - if (typeof window.Element != 'undefined') { - var proto = window.Element.prototype; - if (proto) { - var id = '_' + (Math.random()+'').slice(2); - var el = document.createElement(tagName); - proto[id] = 'x'; - var isBuggy = (el[id] !== 'x'); - delete proto[id]; - el = null; - return isBuggy; - } - } - return false; - } - - function extendElementWith(element, methods) { - for (var property in methods) { - var value = methods[property]; - if (Object.isFunction(value) && !(property in element)) - element[property] = value.methodize(); - } - } - - var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkDeficiency('object'); - - if (Prototype.BrowserFeatures.SpecificElementExtensions) { - if (HTMLOBJECTELEMENT_PROTOTYPE_BUGGY) { - return function(element) { - if (element && typeof element._extendedByPrototype == 'undefined') { - var t = element.tagName; - if (t && (/^(?:object|applet|embed)$/i.test(t))) { - extendElementWith(element, Element.Methods); - extendElementWith(element, Element.Methods.Simulated); - extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]); - } - } - return element; - } - } - return Prototype.K; - } - - var Methods = { }, ByTag = Element.Methods.ByTag; - - var extend = Object.extend(function(element) { - if (!element || typeof element._extendedByPrototype != 'undefined' || - element.nodeType != 1 || element == window) return element; - - var methods = Object.clone(Methods), - tagName = element.tagName.toUpperCase(); - - if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); - - extendElementWith(element, methods); - - element._extendedByPrototype = Prototype.emptyFunction; - return element; - - }, { - refresh: function() { - if (!Prototype.BrowserFeatures.ElementExtensions) { - Object.extend(Methods, Element.Methods); - Object.extend(Methods, Element.Methods.Simulated); - } - } - }); - - extend.refresh(); - return extend; -})(); - -Element.hasAttribute = function(element, attribute) { - if (element.hasAttribute) return element.hasAttribute(attribute); - return Element.Methods.Simulated.hasAttribute(element, attribute); -}; - -Element.addMethods = function(methods) { - var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; - - if (!methods) { - Object.extend(Form, Form.Methods); - Object.extend(Form.Element, Form.Element.Methods); - Object.extend(Element.Methods.ByTag, { - "FORM": Object.clone(Form.Methods), - "INPUT": Object.clone(Form.Element.Methods), - "SELECT": Object.clone(Form.Element.Methods), - "TEXTAREA": Object.clone(Form.Element.Methods) - }); - } - - if (arguments.length == 2) { - var tagName = methods; - methods = arguments[1]; - } - - if (!tagName) Object.extend(Element.Methods, methods || { }); - else { - if (Object.isArray(tagName)) tagName.each(extend); - else extend(tagName); - } - - function extend(tagName) { - tagName = tagName.toUpperCase(); - if (!Element.Methods.ByTag[tagName]) - Element.Methods.ByTag[tagName] = { }; - Object.extend(Element.Methods.ByTag[tagName], methods); - } - - function copy(methods, destination, onlyIfAbsent) { - onlyIfAbsent = onlyIfAbsent || false; - for (var property in methods) { - var value = methods[property]; - if (!Object.isFunction(value)) continue; - if (!onlyIfAbsent || !(property in destination)) - destination[property] = value.methodize(); - } - } - - function findDOMClass(tagName) { - var klass; - var trans = { - "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", - "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", - "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", - "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", - "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": - "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": - "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": - "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": - "FrameSet", "IFRAME": "IFrame" - }; - if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; - if (window[klass]) return window[klass]; - klass = 'HTML' + tagName + 'Element'; - if (window[klass]) return window[klass]; - klass = 'HTML' + tagName.capitalize() + 'Element'; - if (window[klass]) return window[klass]; - - var element = document.createElement(tagName); - var proto = element['__proto__'] || element.constructor.prototype; - element = null; - return proto; - } - - var elementPrototype = window.HTMLElement ? HTMLElement.prototype : - Element.prototype; - - if (F.ElementExtensions) { - copy(Element.Methods, elementPrototype); - copy(Element.Methods.Simulated, elementPrototype, true); - } - - if (F.SpecificElementExtensions) { - for (var tag in Element.Methods.ByTag) { - var klass = findDOMClass(tag); - if (Object.isUndefined(klass)) continue; - copy(T[tag], klass.prototype); - } - } - - Object.extend(Element, Element.Methods); - delete Element.ByTag; - - if (Element.extend.refresh) Element.extend.refresh(); - Element.cache = { }; -}; - - -document.viewport = { - - getDimensions: function() { - return { width: this.getWidth(), height: this.getHeight() }; - }, - - getScrollOffsets: function() { - return Element._returnOffset( - window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, - window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); - } -}; - -(function(viewport) { - var B = Prototype.Browser, doc = document, element, property = {}; - - function getRootElement() { - if (B.WebKit && !doc.evaluate) - return document; - - if (B.Opera && window.parseFloat(window.opera.version()) < 9.5) - return document.body; - - return document.documentElement; - } - - function define(D) { - if (!element) element = getRootElement(); - - property[D] = 'client' + D; - - viewport['get' + D] = function() { return element[property[D]] }; - return viewport['get' + D](); - } - - viewport.getWidth = define.curry('Width'); - - viewport.getHeight = define.curry('Height'); -})(document.viewport); - - -Element.Storage = { - UID: 1 -}; - -Element.addMethods({ - getStorage: function(element) { - if (!(element = $(element))) return; - - var uid; - if (element === window) { - uid = 0; - } else { - if (typeof element._prototypeUID === "undefined") - element._prototypeUID = [Element.Storage.UID++]; - uid = element._prototypeUID[0]; - } - - if (!Element.Storage[uid]) - Element.Storage[uid] = $H(); - - return Element.Storage[uid]; - }, - - store: function(element, key, value) { - if (!(element = $(element))) return; - - if (arguments.length === 2) { - Element.getStorage(element).update(key); - } else { - Element.getStorage(element).set(key, value); - } - - return element; - }, - - retrieve: function(element, key, defaultValue) { - if (!(element = $(element))) return; - var hash = Element.getStorage(element), value = hash.get(key); - - if (Object.isUndefined(value)) { - hash.set(key, defaultValue); - value = defaultValue; - } - - return value; - }, - - clone: function(element, deep) { - if (!(element = $(element))) return; - var clone = element.cloneNode(deep); - clone._prototypeUID = void 0; - if (deep) { - var descendants = Element.select(clone, '*'), - i = descendants.length; - while (i--) { - descendants[i]._prototypeUID = void 0; - } - } - return Element.extend(clone); - } -}); -/* Portions of the Selector class are derived from Jack Slocum's DomQuery, - * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style - * license. Please see http://www.yui-ext.com/ for more information. */ - -var Selector = Class.create({ - initialize: function(expression) { - this.expression = expression.strip(); - - if (this.shouldUseSelectorsAPI()) { - this.mode = 'selectorsAPI'; - } else if (this.shouldUseXPath()) { - this.mode = 'xpath'; - this.compileXPathMatcher(); - } else { - this.mode = "normal"; - this.compileMatcher(); - } - - }, - - shouldUseXPath: (function() { - - var IS_DESCENDANT_SELECTOR_BUGGY = (function(){ - var isBuggy = false; - if (document.evaluate && window.XPathResult) { - var el = document.createElement('div'); - el.innerHTML = '
    '; - - var xpath = ".//*[local-name()='ul' or local-name()='UL']" + - "//*[local-name()='li' or local-name()='LI']"; - - var result = document.evaluate(xpath, el, null, - XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - - isBuggy = (result.snapshotLength !== 2); - el = null; - } - return isBuggy; - })(); - - return function() { - if (!Prototype.BrowserFeatures.XPath) return false; - - var e = this.expression; - - if (Prototype.Browser.WebKit && - (e.include("-of-type") || e.include(":empty"))) - return false; - - if ((/(\[[\w-]*?:|:checked)/).test(e)) - return false; - - if (IS_DESCENDANT_SELECTOR_BUGGY) return false; - - return true; - } - - })(), - - shouldUseSelectorsAPI: function() { - if (!Prototype.BrowserFeatures.SelectorsAPI) return false; - - if (Selector.CASE_INSENSITIVE_CLASS_NAMES) return false; - - if (!Selector._div) Selector._div = new Element('div'); - - try { - Selector._div.querySelector(this.expression); - } catch(e) { - return false; - } - - return true; - }, - - compileMatcher: function() { - var e = this.expression, ps = Selector.patterns, h = Selector.handlers, - c = Selector.criteria, le, p, m, len = ps.length, name; - - if (Selector._cache[e]) { - this.matcher = Selector._cache[e]; - return; - } - - this.matcher = ["this.matcher = function(root) {", - "var r = root, h = Selector.handlers, c = false, n;"]; - - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i = 0; i"; - } -}); - -if (Prototype.BrowserFeatures.SelectorsAPI && - document.compatMode === 'BackCompat') { - Selector.CASE_INSENSITIVE_CLASS_NAMES = (function(){ - var div = document.createElement('div'), - span = document.createElement('span'); - - div.id = "prototype_test_id"; - span.className = 'Test'; - div.appendChild(span); - var isIgnored = (div.querySelector('#prototype_test_id .test') !== null); - div = span = null; - return isIgnored; - })(); -} - -Object.extend(Selector, { - _cache: { }, - - xpath: { - descendant: "//*", - child: "/*", - adjacent: "/following-sibling::*[1]", - laterSibling: '/following-sibling::*', - tagName: function(m) { - if (m[1] == '*') return ''; - return "[local-name()='" + m[1].toLowerCase() + - "' or local-name()='" + m[1].toUpperCase() + "']"; - }, - className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", - id: "[@id='#{1}']", - attrPresence: function(m) { - m[1] = m[1].toLowerCase(); - return new Template("[@#{1}]").evaluate(m); - }, - attr: function(m) { - m[1] = m[1].toLowerCase(); - m[3] = m[5] || m[6]; - return new Template(Selector.xpath.operators[m[2]]).evaluate(m); - }, - pseudo: function(m) { - var h = Selector.xpath.pseudos[m[1]]; - if (!h) return ''; - if (Object.isFunction(h)) return h(m); - return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); - }, - operators: { - '=': "[@#{1}='#{3}']", - '!=': "[@#{1}!='#{3}']", - '^=': "[starts-with(@#{1}, '#{3}')]", - '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']", - '*=': "[contains(@#{1}, '#{3}')]", - '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", - '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" - }, - pseudos: { - 'first-child': '[not(preceding-sibling::*)]', - 'last-child': '[not(following-sibling::*)]', - 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', - 'empty': "[count(*) = 0 and (count(text()) = 0)]", - 'checked': "[@checked]", - 'disabled': "[(@disabled) and (@type!='hidden')]", - 'enabled': "[not(@disabled) and (@type!='hidden')]", - 'not': function(m) { - var e = m[6], p = Selector.patterns, - x = Selector.xpath, le, v, len = p.length, name; - - var exclusion = []; - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i = 0; i= 0)]"; - return new Template(predicate).evaluate({ - fragment: fragment, a: a, b: b }); - } - } - } - }, - - criteria: { - tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', - className: 'n = h.className(n, r, "#{1}", c); c = false;', - id: 'n = h.id(n, r, "#{1}", c); c = false;', - attrPresence: 'n = h.attrPresence(n, r, "#{1}", c); c = false;', - attr: function(m) { - m[3] = (m[5] || m[6]); - return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m); - }, - pseudo: function(m) { - if (m[6]) m[6] = m[6].replace(/"/g, '\\"'); - return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m); - }, - descendant: 'c = "descendant";', - child: 'c = "child";', - adjacent: 'c = "adjacent";', - laterSibling: 'c = "laterSibling";' - }, - - patterns: [ - { name: 'laterSibling', re: /^\s*~\s*/ }, - { name: 'child', re: /^\s*>\s*/ }, - { name: 'adjacent', re: /^\s*\+\s*/ }, - { name: 'descendant', re: /^\s/ }, - - { name: 'tagName', re: /^\s*(\*|[\w\-]+)(\b|$)?/ }, - { name: 'id', re: /^#([\w\-\*]+)(\b|$)/ }, - { name: 'className', re: /^\.([\w\-\*]+)(\b|$)/ }, - { name: 'pseudo', re: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/ }, - { name: 'attrPresence', re: /^\[((?:[\w-]+:)?[\w-]+)\]/ }, - { name: 'attr', re: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ } - ], - - assertions: { - tagName: function(element, matches) { - return matches[1].toUpperCase() == element.tagName.toUpperCase(); - }, - - className: function(element, matches) { - return Element.hasClassName(element, matches[1]); - }, - - id: function(element, matches) { - return element.id === matches[1]; - }, - - attrPresence: function(element, matches) { - return Element.hasAttribute(element, matches[1]); - }, - - attr: function(element, matches) { - var nodeValue = Element.readAttribute(element, matches[1]); - return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]); - } - }, - - handlers: { - concat: function(a, b) { - for (var i = 0, node; node = b[i]; i++) - a.push(node); - return a; - }, - - mark: function(nodes) { - var _true = Prototype.emptyFunction; - for (var i = 0, node; node = nodes[i]; i++) - node._countedByPrototype = _true; - return nodes; - }, - - unmark: (function(){ - - var PROPERTIES_ATTRIBUTES_MAP = (function(){ - var el = document.createElement('div'), - isBuggy = false, - propName = '_countedByPrototype', - value = 'x' - el[propName] = value; - isBuggy = (el.getAttribute(propName) === value); - el = null; - return isBuggy; - })(); - - return PROPERTIES_ATTRIBUTES_MAP ? - function(nodes) { - for (var i = 0, node; node = nodes[i]; i++) - node.removeAttribute('_countedByPrototype'); - return nodes; - } : - function(nodes) { - for (var i = 0, node; node = nodes[i]; i++) - node._countedByPrototype = void 0; - return nodes; - } - })(), - - index: function(parentNode, reverse, ofType) { - parentNode._countedByPrototype = Prototype.emptyFunction; - if (reverse) { - for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { - var node = nodes[i]; - if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; - } - } else { - for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) - if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; - } - }, - - unique: function(nodes) { - if (nodes.length == 0) return nodes; - var results = [], n; - for (var i = 0, l = nodes.length; i < l; i++) - if (typeof (n = nodes[i])._countedByPrototype == 'undefined') { - n._countedByPrototype = Prototype.emptyFunction; - results.push(Element.extend(n)); - } - return Selector.handlers.unmark(results); - }, - - descendant: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - h.concat(results, node.getElementsByTagName('*')); - return results; - }, - - child: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) { - for (var j = 0, child; child = node.childNodes[j]; j++) - if (child.nodeType == 1 && child.tagName != '!') results.push(child); - } - return results; - }, - - adjacent: function(nodes) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - var next = this.nextElementSibling(node); - if (next) results.push(next); - } - return results; - }, - - laterSibling: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - h.concat(results, Element.nextSiblings(node)); - return results; - }, - - nextElementSibling: function(node) { - while (node = node.nextSibling) - if (node.nodeType == 1) return node; - return null; - }, - - previousElementSibling: function(node) { - while (node = node.previousSibling) - if (node.nodeType == 1) return node; - return null; - }, - - tagName: function(nodes, root, tagName, combinator) { - var uTagName = tagName.toUpperCase(); - var results = [], h = Selector.handlers; - if (nodes) { - if (combinator) { - if (combinator == "descendant") { - for (var i = 0, node; node = nodes[i]; i++) - h.concat(results, node.getElementsByTagName(tagName)); - return results; - } else nodes = this[combinator](nodes); - if (tagName == "*") return nodes; - } - for (var i = 0, node; node = nodes[i]; i++) - if (node.tagName.toUpperCase() === uTagName) results.push(node); - return results; - } else return root.getElementsByTagName(tagName); - }, - - id: function(nodes, root, id, combinator) { - var targetNode = $(id), h = Selector.handlers; - - if (root == document) { - if (!targetNode) return []; - if (!nodes) return [targetNode]; - } else { - if (!root.sourceIndex || root.sourceIndex < 1) { - var nodes = root.getElementsByTagName('*'); - for (var j = 0, node; node = nodes[j]; j++) { - if (node.id === id) return [node]; - } - } - } - - if (nodes) { - if (combinator) { - if (combinator == 'child') { - for (var i = 0, node; node = nodes[i]; i++) - if (targetNode.parentNode == node) return [targetNode]; - } else if (combinator == 'descendant') { - for (var i = 0, node; node = nodes[i]; i++) - if (Element.descendantOf(targetNode, node)) return [targetNode]; - } else if (combinator == 'adjacent') { - for (var i = 0, node; node = nodes[i]; i++) - if (Selector.handlers.previousElementSibling(targetNode) == node) - return [targetNode]; - } else nodes = h[combinator](nodes); - } - for (var i = 0, node; node = nodes[i]; i++) - if (node == targetNode) return [targetNode]; - return []; - } - return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : []; - }, - - className: function(nodes, root, className, combinator) { - if (nodes && combinator) nodes = this[combinator](nodes); - return Selector.handlers.byClassName(nodes, root, className); - }, - - byClassName: function(nodes, root, className) { - if (!nodes) nodes = Selector.handlers.descendant([root]); - var needle = ' ' + className + ' '; - for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) { - nodeClassName = node.className; - if (nodeClassName.length == 0) continue; - if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle)) - results.push(node); - } - return results; - }, - - attrPresence: function(nodes, root, attr, combinator) { - if (!nodes) nodes = root.getElementsByTagName("*"); - if (nodes && combinator) nodes = this[combinator](nodes); - var results = []; - for (var i = 0, node; node = nodes[i]; i++) - if (Element.hasAttribute(node, attr)) results.push(node); - return results; - }, - - attr: function(nodes, root, attr, value, operator, combinator) { - if (!nodes) nodes = root.getElementsByTagName("*"); - if (nodes && combinator) nodes = this[combinator](nodes); - var handler = Selector.operators[operator], results = []; - for (var i = 0, node; node = nodes[i]; i++) { - var nodeValue = Element.readAttribute(node, attr); - if (nodeValue === null) continue; - if (handler(nodeValue, value)) results.push(node); - } - return results; - }, - - pseudo: function(nodes, name, value, root, combinator) { - if (nodes && combinator) nodes = this[combinator](nodes); - if (!nodes) nodes = root.getElementsByTagName("*"); - return Selector.pseudos[name](nodes, value, root); - } - }, - - pseudos: { - 'first-child': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - if (Selector.handlers.previousElementSibling(node)) continue; - results.push(node); - } - return results; - }, - 'last-child': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - if (Selector.handlers.nextElementSibling(node)) continue; - results.push(node); - } - return results; - }, - 'only-child': function(nodes, value, root) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) - results.push(node); - return results; - }, - 'nth-child': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root); - }, - 'nth-last-child': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, true); - }, - 'nth-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, false, true); - }, - 'nth-last-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, true, true); - }, - 'first-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, "1", root, false, true); - }, - 'last-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, "1", root, true, true); - }, - 'only-of-type': function(nodes, formula, root) { - var p = Selector.pseudos; - return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); - }, - - getIndices: function(a, b, total) { - if (a == 0) return b > 0 ? [b] : []; - return $R(1, total).inject([], function(memo, i) { - if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i); - return memo; - }); - }, - - nth: function(nodes, formula, root, reverse, ofType) { - if (nodes.length == 0) return []; - if (formula == 'even') formula = '2n+0'; - if (formula == 'odd') formula = '2n+1'; - var h = Selector.handlers, results = [], indexed = [], m; - h.mark(nodes); - for (var i = 0, node; node = nodes[i]; i++) { - if (!node.parentNode._countedByPrototype) { - h.index(node.parentNode, reverse, ofType); - indexed.push(node.parentNode); - } - } - if (formula.match(/^\d+$/)) { // just a number - formula = Number(formula); - for (var i = 0, node; node = nodes[i]; i++) - if (node.nodeIndex == formula) results.push(node); - } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b - if (m[1] == "-") m[1] = -1; - var a = m[1] ? Number(m[1]) : 1; - var b = m[2] ? Number(m[2]) : 0; - var indices = Selector.pseudos.getIndices(a, b, nodes.length); - for (var i = 0, node, l = indices.length; node = nodes[i]; i++) { - for (var j = 0; j < l; j++) - if (node.nodeIndex == indices[j]) results.push(node); - } - } - h.unmark(nodes); - h.unmark(indexed); - return results; - }, - - 'empty': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - if (node.tagName == '!' || node.firstChild) continue; - results.push(node); - } - return results; - }, - - 'not': function(nodes, selector, root) { - var h = Selector.handlers, selectorType, m; - var exclusions = new Selector(selector).findElements(root); - h.mark(exclusions); - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node._countedByPrototype) results.push(node); - h.unmark(exclusions); - return results; - }, - - 'enabled': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node.disabled && (!node.type || node.type !== 'hidden')) - results.push(node); - return results; - }, - - 'disabled': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (node.disabled) results.push(node); - return results; - }, - - 'checked': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (node.checked) results.push(node); - return results; - } - }, - - operators: { - '=': function(nv, v) { return nv == v; }, - '!=': function(nv, v) { return nv != v; }, - '^=': function(nv, v) { return nv == v || nv && nv.startsWith(v); }, - '$=': function(nv, v) { return nv == v || nv && nv.endsWith(v); }, - '*=': function(nv, v) { return nv == v || nv && nv.include(v); }, - '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, - '|=': function(nv, v) { return ('-' + (nv || "").toUpperCase() + - '-').include('-' + (v || "").toUpperCase() + '-'); } - }, - - split: function(expression) { - var expressions = []; - expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { - expressions.push(m[1].strip()); - }); - return expressions; - }, - - matchElements: function(elements, expression) { - var matches = $$(expression), h = Selector.handlers; - h.mark(matches); - for (var i = 0, results = [], element; element = elements[i]; i++) - if (element._countedByPrototype) results.push(element); - h.unmark(matches); - return results; - }, - - findElement: function(elements, expression, index) { - if (Object.isNumber(expression)) { - index = expression; expression = false; - } - return Selector.matchElements(elements, expression || '*')[index || 0]; - }, - - findChildElements: function(element, expressions) { - expressions = Selector.split(expressions.join(',')); - var results = [], h = Selector.handlers; - for (var i = 0, l = expressions.length, selector; i < l; i++) { - selector = new Selector(expressions[i].strip()); - h.concat(results, selector.findElements(element)); - } - return (l > 1) ? h.unique(results) : results; - } -}); - -if (Prototype.Browser.IE) { - Object.extend(Selector.handlers, { - concat: function(a, b) { - for (var i = 0, node; node = b[i]; i++) - if (node.tagName !== "!") a.push(node); - return a; - } - }); -} - -function $$() { - return Selector.findChildElements(document, $A(arguments)); -} - -var Form = { - reset: function(form) { - form = $(form); - form.reset(); - return form; - }, - - serializeElements: function(elements, options) { - if (typeof options != 'object') options = { hash: !!options }; - else if (Object.isUndefined(options.hash)) options.hash = true; - var key, value, submitted = false, submit = options.submit; - - var data = elements.inject({ }, function(result, element) { - if (!element.disabled && element.name) { - key = element.name; value = $(element).getValue(); - if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && - submit !== false && (!submit || key == submit) && (submitted = true)))) { - if (key in result) { - if (!Object.isArray(result[key])) result[key] = [result[key]]; - result[key].push(value); - } - else result[key] = value; - } - } - return result; - }); - - return options.hash ? data : Object.toQueryString(data); - } -}; - -Form.Methods = { - serialize: function(form, options) { - return Form.serializeElements(Form.getElements(form), options); - }, - - getElements: function(form) { - var elements = $(form).getElementsByTagName('*'), - element, - arr = [ ], - serializers = Form.Element.Serializers; - for (var i = 0; element = elements[i]; i++) { - arr.push(element); - } - return arr.inject([], function(elements, child) { - if (serializers[child.tagName.toLowerCase()]) - elements.push(Element.extend(child)); - return elements; - }) - }, - - getInputs: function(form, typeName, name) { - form = $(form); - var inputs = form.getElementsByTagName('input'); - - if (!typeName && !name) return $A(inputs).map(Element.extend); - - for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { - var input = inputs[i]; - if ((typeName && input.type != typeName) || (name && input.name != name)) - continue; - matchingInputs.push(Element.extend(input)); - } - - return matchingInputs; - }, - - disable: function(form) { - form = $(form); - Form.getElements(form).invoke('disable'); - return form; - }, - - enable: function(form) { - form = $(form); - Form.getElements(form).invoke('enable'); - return form; - }, - - findFirstElement: function(form) { - var elements = $(form).getElements().findAll(function(element) { - return 'hidden' != element.type && !element.disabled; - }); - var firstByIndex = elements.findAll(function(element) { - return element.hasAttribute('tabIndex') && element.tabIndex >= 0; - }).sortBy(function(element) { return element.tabIndex }).first(); - - return firstByIndex ? firstByIndex : elements.find(function(element) { - return /^(?:input|select|textarea)$/i.test(element.tagName); - }); - }, - - focusFirstElement: function(form) { - form = $(form); - form.findFirstElement().activate(); - return form; - }, - - request: function(form, options) { - form = $(form), options = Object.clone(options || { }); - - var params = options.parameters, action = form.readAttribute('action') || ''; - if (action.blank()) action = window.location.href; - options.parameters = form.serialize(true); - - if (params) { - if (Object.isString(params)) params = params.toQueryParams(); - Object.extend(options.parameters, params); - } - - if (form.hasAttribute('method') && !options.method) - options.method = form.method; - - return new Ajax.Request(action, options); - } -}; - -/*--------------------------------------------------------------------------*/ - - -Form.Element = { - focus: function(element) { - $(element).focus(); - return element; - }, - - select: function(element) { - $(element).select(); - return element; - } -}; - -Form.Element.Methods = { - - serialize: function(element) { - element = $(element); - if (!element.disabled && element.name) { - var value = element.getValue(); - if (value != undefined) { - var pair = { }; - pair[element.name] = value; - return Object.toQueryString(pair); - } - } - return ''; - }, - - getValue: function(element) { - element = $(element); - var method = element.tagName.toLowerCase(); - return Form.Element.Serializers[method](element); - }, - - setValue: function(element, value) { - element = $(element); - var method = element.tagName.toLowerCase(); - Form.Element.Serializers[method](element, value); - return element; - }, - - clear: function(element) { - $(element).value = ''; - return element; - }, - - present: function(element) { - return $(element).value != ''; - }, - - activate: function(element) { - element = $(element); - try { - element.focus(); - if (element.select && (element.tagName.toLowerCase() != 'input' || - !(/^(?:button|reset|submit)$/i.test(element.type)))) - element.select(); - } catch (e) { } - return element; - }, - - disable: function(element) { - element = $(element); - element.disabled = true; - return element; - }, - - enable: function(element) { - element = $(element); - element.disabled = false; - return element; - } -}; - -/*--------------------------------------------------------------------------*/ - -var Field = Form.Element; - -var $F = Form.Element.Methods.getValue; - -/*--------------------------------------------------------------------------*/ - -Form.Element.Serializers = { - input: function(element, value) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - return Form.Element.Serializers.inputSelector(element, value); - default: - return Form.Element.Serializers.textarea(element, value); - } - }, - - inputSelector: function(element, value) { - if (Object.isUndefined(value)) return element.checked ? element.value : null; - else element.checked = !!value; - }, - - textarea: function(element, value) { - if (Object.isUndefined(value)) return element.value; - else element.value = value; - }, - - select: function(element, value) { - if (Object.isUndefined(value)) - return this[element.type == 'select-one' ? - 'selectOne' : 'selectMany'](element); - else { - var opt, currentValue, single = !Object.isArray(value); - for (var i = 0, length = element.length; i < length; i++) { - opt = element.options[i]; - currentValue = this.optionValue(opt); - if (single) { - if (currentValue == value) { - opt.selected = true; - return; - } - } - else opt.selected = value.include(currentValue); - } - } - }, - - selectOne: function(element) { - var index = element.selectedIndex; - return index >= 0 ? this.optionValue(element.options[index]) : null; - }, - - selectMany: function(element) { - var values, length = element.length; - if (!length) return null; - - for (var i = 0, values = []; i < length; i++) { - var opt = element.options[i]; - if (opt.selected) values.push(this.optionValue(opt)); - } - return values; - }, - - optionValue: function(opt) { - return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; - } -}; - -/*--------------------------------------------------------------------------*/ - - -Abstract.TimedObserver = Class.create(PeriodicalExecuter, { - initialize: function($super, element, frequency, callback) { - $super(callback, frequency); - this.element = $(element); - this.lastValue = this.getValue(); - }, - - execute: function() { - var value = this.getValue(); - if (Object.isString(this.lastValue) && Object.isString(value) ? - this.lastValue != value : String(this.lastValue) != String(value)) { - this.callback(this.element, value); - this.lastValue = value; - } - } -}); - -Form.Element.Observer = Class.create(Abstract.TimedObserver, { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.Observer = Class.create(Abstract.TimedObserver, { - getValue: function() { - return Form.serialize(this.element); - } -}); - -/*--------------------------------------------------------------------------*/ - -Abstract.EventObserver = Class.create({ - initialize: function(element, callback) { - this.element = $(element); - this.callback = callback; - - this.lastValue = this.getValue(); - if (this.element.tagName.toLowerCase() == 'form') - this.registerFormCallbacks(); - else - this.registerCallback(this.element); - }, - - onElementEvent: function() { - var value = this.getValue(); - if (this.lastValue != value) { - this.callback(this.element, value); - this.lastValue = value; - } - }, - - registerFormCallbacks: function() { - Form.getElements(this.element).each(this.registerCallback, this); - }, - - registerCallback: function(element) { - if (element.type) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - Event.observe(element, 'click', this.onElementEvent.bind(this)); - break; - default: - Event.observe(element, 'change', this.onElementEvent.bind(this)); - break; - } - } - } -}); - -Form.Element.EventObserver = Class.create(Abstract.EventObserver, { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.EventObserver = Class.create(Abstract.EventObserver, { - getValue: function() { - return Form.serialize(this.element); - } -}); -(function() { - - var Event = { - KEY_BACKSPACE: 8, - KEY_TAB: 9, - KEY_RETURN: 13, - KEY_ESC: 27, - KEY_LEFT: 37, - KEY_UP: 38, - KEY_RIGHT: 39, - KEY_DOWN: 40, - KEY_DELETE: 46, - KEY_HOME: 36, - KEY_END: 35, - KEY_PAGEUP: 33, - KEY_PAGEDOWN: 34, - KEY_INSERT: 45, - - cache: {} - }; - - var docEl = document.documentElement; - var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl - && 'onmouseleave' in docEl; - - var _isButton; - if (Prototype.Browser.IE) { - var buttonMap = { 0: 1, 1: 4, 2: 2 }; - _isButton = function(event, code) { - return event.button === buttonMap[code]; - }; - } else if (Prototype.Browser.WebKit) { - _isButton = function(event, code) { - switch (code) { - case 0: return event.which == 1 && !event.metaKey; - case 1: return event.which == 1 && event.metaKey; - default: return false; - } - }; - } else { - _isButton = function(event, code) { - return event.which ? (event.which === code + 1) : (event.button === code); - }; - } - - function isLeftClick(event) { return _isButton(event, 0) } - - function isMiddleClick(event) { return _isButton(event, 1) } - - function isRightClick(event) { return _isButton(event, 2) } - - function element(event) { - event = Event.extend(event); - - var node = event.target, type = event.type, - currentTarget = event.currentTarget; - - if (currentTarget && currentTarget.tagName) { - if (type === 'load' || type === 'error' || - (type === 'click' && currentTarget.tagName.toLowerCase() === 'input' - && currentTarget.type === 'radio')) - node = currentTarget; - } - - if (node.nodeType == Node.TEXT_NODE) - node = node.parentNode; - - return Element.extend(node); - } - - function findElement(event, expression) { - var element = Event.element(event); - if (!expression) return element; - var elements = [element].concat(element.ancestors()); - return Selector.findElement(elements, expression, 0); - } - - function pointer(event) { - return { x: pointerX(event), y: pointerY(event) }; - } - - function pointerX(event) { - var docElement = document.documentElement, - body = document.body || { scrollLeft: 0 }; - - return event.pageX || (event.clientX + - (docElement.scrollLeft || body.scrollLeft) - - (docElement.clientLeft || 0)); - } - - function pointerY(event) { - var docElement = document.documentElement, - body = document.body || { scrollTop: 0 }; - - return event.pageY || (event.clientY + - (docElement.scrollTop || body.scrollTop) - - (docElement.clientTop || 0)); - } - - - function stop(event) { - Event.extend(event); - event.preventDefault(); - event.stopPropagation(); - - event.stopped = true; - } - - Event.Methods = { - isLeftClick: isLeftClick, - isMiddleClick: isMiddleClick, - isRightClick: isRightClick, - - element: element, - findElement: findElement, - - pointer: pointer, - pointerX: pointerX, - pointerY: pointerY, - - stop: stop - }; - - - var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { - m[name] = Event.Methods[name].methodize(); - return m; - }); - - if (Prototype.Browser.IE) { - function _relatedTarget(event) { - var element; - switch (event.type) { - case 'mouseover': element = event.fromElement; break; - case 'mouseout': element = event.toElement; break; - default: return null; - } - return Element.extend(element); - } - - Object.extend(methods, { - stopPropagation: function() { this.cancelBubble = true }, - preventDefault: function() { this.returnValue = false }, - inspect: function() { return '[object Event]' } - }); - - Event.extend = function(event, element) { - if (!event) return false; - if (event._extendedByPrototype) return event; - - event._extendedByPrototype = Prototype.emptyFunction; - var pointer = Event.pointer(event); - - Object.extend(event, { - target: event.srcElement || element, - relatedTarget: _relatedTarget(event), - pageX: pointer.x, - pageY: pointer.y - }); - - return Object.extend(event, methods); - }; - } else { - Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__; - Object.extend(Event.prototype, methods); - Event.extend = Prototype.K; - } - - function _createResponder(element, eventName, handler) { - var registry = Element.retrieve(element, 'prototype_event_registry'); - - if (Object.isUndefined(registry)) { - CACHE.push(element); - registry = Element.retrieve(element, 'prototype_event_registry', $H()); - } - - var respondersForEvent = registry.get(eventName); - if (Object.isUndefined(respondersForEvent)) { - respondersForEvent = []; - registry.set(eventName, respondersForEvent); - } - - if (respondersForEvent.pluck('handler').include(handler)) return false; - - var responder; - if (eventName.include(":")) { - responder = function(event) { - if (Object.isUndefined(event.eventName)) - return false; - - if (event.eventName !== eventName) - return false; - - Event.extend(event, element); - handler.call(element, event); - }; - } else { - if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED && - (eventName === "mouseenter" || eventName === "mouseleave")) { - if (eventName === "mouseenter" || eventName === "mouseleave") { - responder = function(event) { - Event.extend(event, element); - - var parent = event.relatedTarget; - while (parent && parent !== element) { - try { parent = parent.parentNode; } - catch(e) { parent = element; } - } - - if (parent === element) return; - - handler.call(element, event); - }; - } - } else { - responder = function(event) { - Event.extend(event, element); - handler.call(element, event); - }; - } - } - - responder.handler = handler; - respondersForEvent.push(responder); - return responder; - } - - function _destroyCache() { - for (var i = 0, length = CACHE.length; i < length; i++) { - Event.stopObserving(CACHE[i]); - CACHE[i] = null; - } - } - - var CACHE = []; - - if (Prototype.Browser.IE) - window.attachEvent('onunload', _destroyCache); - - if (Prototype.Browser.WebKit) - window.addEventListener('unload', Prototype.emptyFunction, false); - - - var _getDOMEventName = Prototype.K; - - if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) { - _getDOMEventName = function(eventName) { - var translations = { mouseenter: "mouseover", mouseleave: "mouseout" }; - return eventName in translations ? translations[eventName] : eventName; - }; - } - - function observe(element, eventName, handler) { - element = $(element); - - var responder = _createResponder(element, eventName, handler); - - if (!responder) return element; - - if (eventName.include(':')) { - if (element.addEventListener) - element.addEventListener("dataavailable", responder, false); - else { - element.attachEvent("ondataavailable", responder); - element.attachEvent("onfilterchange", responder); - } - } else { - var actualEventName = _getDOMEventName(eventName); - - if (element.addEventListener) - element.addEventListener(actualEventName, responder, false); - else - element.attachEvent("on" + actualEventName, responder); - } - - return element; - } - - function stopObserving(element, eventName, handler) { - element = $(element); - - var registry = Element.retrieve(element, 'prototype_event_registry'); - - if (Object.isUndefined(registry)) return element; - - if (eventName && !handler) { - var responders = registry.get(eventName); - - if (Object.isUndefined(responders)) return element; - - responders.each( function(r) { - Element.stopObserving(element, eventName, r.handler); - }); - return element; - } else if (!eventName) { - registry.each( function(pair) { - var eventName = pair.key, responders = pair.value; - - responders.each( function(r) { - Element.stopObserving(element, eventName, r.handler); - }); - }); - return element; - } - - var responders = registry.get(eventName); - - if (!responders) return; - - var responder = responders.find( function(r) { return r.handler === handler; }); - if (!responder) return element; - - var actualEventName = _getDOMEventName(eventName); - - if (eventName.include(':')) { - if (element.removeEventListener) - element.removeEventListener("dataavailable", responder, false); - else { - element.detachEvent("ondataavailable", responder); - element.detachEvent("onfilterchange", responder); - } - } else { - if (element.removeEventListener) - element.removeEventListener(actualEventName, responder, false); - else - element.detachEvent('on' + actualEventName, responder); - } - - registry.set(eventName, responders.without(responder)); - - return element; - } - - function fire(element, eventName, memo, bubble) { - element = $(element); - - if (Object.isUndefined(bubble)) - bubble = true; - - if (element == document && document.createEvent && !element.dispatchEvent) - element = document.documentElement; - - var event; - if (document.createEvent) { - event = document.createEvent('HTMLEvents'); - event.initEvent('dataavailable', true, true); - } else { - event = document.createEventObject(); - event.eventType = bubble ? 'ondataavailable' : 'onfilterchange'; - } - - event.eventName = eventName; - event.memo = memo || { }; - - if (document.createEvent) - element.dispatchEvent(event); - else - element.fireEvent(event.eventType, event); - - return Event.extend(event); - } - - - Object.extend(Event, Event.Methods); - - Object.extend(Event, { - fire: fire, - observe: observe, - stopObserving: stopObserving - }); - - Element.addMethods({ - fire: fire, - - observe: observe, - - stopObserving: stopObserving - }); - - Object.extend(document, { - fire: fire.methodize(), - - observe: observe.methodize(), - - stopObserving: stopObserving.methodize(), - - loaded: false - }); - - if (window.Event) Object.extend(window.Event, Event); - else window.Event = Event; -})(); - -(function() { - /* Support for the DOMContentLoaded event is based on work by Dan Webb, - Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */ - - var timer; - - function fireContentLoadedEvent() { - if (document.loaded) return; - if (timer) window.clearTimeout(timer); - document.loaded = true; - document.fire('dom:loaded'); - } - - function checkReadyState() { - if (document.readyState === 'complete') { - document.stopObserving('readystatechange', checkReadyState); - fireContentLoadedEvent(); - } - } - - function pollDoScroll() { - try { document.documentElement.doScroll('left'); } - catch(e) { - timer = pollDoScroll.defer(); - return; - } - fireContentLoadedEvent(); - } - - if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false); - } else { - document.observe('readystatechange', checkReadyState); - if (window == top) - timer = pollDoScroll.defer(); - } - - Event.observe(window, 'load', fireContentLoadedEvent); -})(); - -Element.addMethods(); - -/*------------------------------- DEPRECATED -------------------------------*/ - -Hash.toQueryString = Object.toQueryString; - -var Toggle = { display: Element.toggle }; - -Element.Methods.childOf = Element.Methods.descendantOf; - -var Insertion = { - Before: function(element, content) { - return Element.insert(element, {before:content}); - }, - - Top: function(element, content) { - return Element.insert(element, {top:content}); - }, - - Bottom: function(element, content) { - return Element.insert(element, {bottom:content}); - }, - - After: function(element, content) { - return Element.insert(element, {after:content}); - } -}; - -var $continue = new Error('"throw $continue" is deprecated, use "return" instead'); - -var Position = { - includeScrollOffsets: false, - - prepare: function() { - this.deltaX = window.pageXOffset - || document.documentElement.scrollLeft - || document.body.scrollLeft - || 0; - this.deltaY = window.pageYOffset - || document.documentElement.scrollTop - || document.body.scrollTop - || 0; - }, - - within: function(element, x, y) { - if (this.includeScrollOffsets) - return this.withinIncludingScrolloffsets(element, x, y); - this.xcomp = x; - this.ycomp = y; - this.offset = Element.cumulativeOffset(element); - - return (y >= this.offset[1] && - y < this.offset[1] + element.offsetHeight && - x >= this.offset[0] && - x < this.offset[0] + element.offsetWidth); - }, - - withinIncludingScrolloffsets: function(element, x, y) { - var offsetcache = Element.cumulativeScrollOffset(element); - - this.xcomp = x + offsetcache[0] - this.deltaX; - this.ycomp = y + offsetcache[1] - this.deltaY; - this.offset = Element.cumulativeOffset(element); - - return (this.ycomp >= this.offset[1] && - this.ycomp < this.offset[1] + element.offsetHeight && - this.xcomp >= this.offset[0] && - this.xcomp < this.offset[0] + element.offsetWidth); - }, - - overlap: function(mode, element) { - if (!mode) return 0; - if (mode == 'vertical') - return ((this.offset[1] + element.offsetHeight) - this.ycomp) / - element.offsetHeight; - if (mode == 'horizontal') - return ((this.offset[0] + element.offsetWidth) - this.xcomp) / - element.offsetWidth; - }, - - - cumulativeOffset: Element.Methods.cumulativeOffset, - - positionedOffset: Element.Methods.positionedOffset, - - absolutize: function(element) { - Position.prepare(); - return Element.absolutize(element); - }, - - relativize: function(element) { - Position.prepare(); - return Element.relativize(element); - }, - - realOffset: Element.Methods.cumulativeScrollOffset, - - offsetParent: Element.Methods.getOffsetParent, - - page: Element.Methods.viewportOffset, - - clone: function(source, target, options) { - options = options || { }; - return Element.clonePosition(target, source, options); - } -}; - -/*--------------------------------------------------------------------------*/ - -if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){ - function iter(name) { - return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]"; - } - - instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ? - function(element, className) { - className = className.toString().strip(); - var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className); - return cond ? document._getElementsByXPath('.//*' + cond, element) : []; - } : function(element, className) { - className = className.toString().strip(); - var elements = [], classNames = (/\s/.test(className) ? $w(className) : null); - if (!classNames && !className) return elements; - - var nodes = $(element).getElementsByTagName('*'); - className = ' ' + className + ' '; - - for (var i = 0, child, cn; child = nodes[i]; i++) { - if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) || - (classNames && classNames.all(function(name) { - return !name.toString().blank() && cn.include(' ' + name + ' '); - })))) - elements.push(Element.extend(child)); - } - return elements; - }; - - return function(className, parentElement) { - return $(parentElement || document.body).getElementsByClassName(className); - }; -}(Element.Methods); - -/*--------------------------------------------------------------------------*/ - -Element.ClassNames = Class.create(); -Element.ClassNames.prototype = { - initialize: function(element) { - this.element = $(element); - }, - - _each: function(iterator) { - this.element.className.split(/\s+/).select(function(name) { - return name.length > 0; - })._each(iterator); - }, - - set: function(className) { - this.element.className = className; - }, - - add: function(classNameToAdd) { - if (this.include(classNameToAdd)) return; - this.set($A(this).concat(classNameToAdd).join(' ')); - }, - - remove: function(classNameToRemove) { - if (!this.include(classNameToRemove)) return; - this.set($A(this).without(classNameToRemove).join(' ')); - }, - - toString: function() { - return $A(this).join(' '); - } -}; - -Object.extend(Element.ClassNames.prototype, Enumerable); - -/*--------------------------------------------------------------------------*/ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/tabber.js b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/tabber.js deleted file mode 100755 index 9700c97a81..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/js/tabber.js +++ /dev/null @@ -1,536 +0,0 @@ -/*================================================== - $Id: tabber.js,v 1.9 2006/04/27 20:51:51 pat Exp $ - tabber.js by Patrick Fitzgerald pat@barelyfitz.com - - Documentation can be found at the following URL: - http://www.barelyfitz.com/projects/tabber/ - - License (http://www.opensource.org/licenses/mit-license.php) - - Copyright (c) 2006 Patrick Fitzgerald - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ==================================================*/ - -function tabberObj(argsObj) -{ - var arg; /* name of an argument to override */ - - /* Element for the main tabber div. If you supply this in argsObj, - then the init() method will be called. - */ - this.div = null; - - /* Class of the main tabber div */ - this.classMain = "tabber"; - - /* Rename classMain to classMainLive after tabifying - (so a different style can be applied) - */ - this.classMainLive = "tabberlive"; - - /* Class of each DIV that contains a tab */ - this.classTab = "tabbertab"; - - /* Class to indicate which tab should be active on startup */ - this.classTabDefault = "tabbertabdefault"; - - /* Class for the navigation UL */ - this.classNav = "tabbernav"; - - /* When a tab is to be hidden, instead of setting display='none', we - set the class of the div to classTabHide. In your screen - stylesheet you should set classTabHide to display:none. In your - print stylesheet you should set display:block to ensure that all - the information is printed. - */ - this.classTabHide = "tabbertabhide"; - - /* Class to set the navigation LI when the tab is active, so you can - use a different style on the active tab. - */ - this.classNavActive = "tabberactive"; - - /* Elements that might contain the title for the tab, only used if a - title is not specified in the TITLE attribute of DIV classTab. - */ - this.titleElements = ['h2','h3','h4','h5','h6']; - - /* Should we strip out the HTML from the innerHTML of the title elements? - This should usually be true. - */ - this.titleElementsStripHTML = true; - - /* If the user specified the tab names using a TITLE attribute on - the DIV, then the browser will display a tooltip whenever the - mouse is over the DIV. To prevent this tooltip, we can remove the - TITLE attribute after getting the tab name. - */ - this.removeTitle = true; - - /* If you want to add an id to each link set this to true */ - this.addLinkId = false; - - /* If addIds==true, then you can set a format for the ids. - will be replaced with the id of the main tabber div. - will be replaced with the tab number - (tab numbers starting at zero) - will be replaced with the tab number - (tab numbers starting at one) - will be replaced by the tab title - (with all non-alphanumeric characters removed) - */ - this.linkIdFormat = 'nav'; - - /* You can override the defaults listed above by passing in an object: - var mytab = new tabber({property:value,property:value}); - */ - for (arg in argsObj) { this[arg] = argsObj[arg]; } - - /* Create regular expressions for the class names; Note: if you - change the class names after a new object is created you must - also change these regular expressions. - */ - this.REclassMain = new RegExp('\\b' + this.classMain + '\\b', 'gi'); - this.REclassMainLive = new RegExp('\\b' + this.classMainLive + '\\b', 'gi'); - this.REclassTab = new RegExp('\\b' + this.classTab + '\\b', 'gi'); - this.REclassTabDefault = new RegExp('\\b' + this.classTabDefault + '\\b', 'gi'); - this.REclassTabHide = new RegExp('\\b' + this.classTabHide + '\\b', 'gi'); - - /* Array of objects holding info about each tab */ - this.tabs = new Array(); - - /* If the main tabber div was specified, call init() now */ - if (this.div) { - - this.init(this.div); - - /* We don't need the main div anymore, and to prevent a memory leak - in IE, we must remove the circular reference between the div - and the tabber object. */ - this.div = null; - } -} - - -/*-------------------------------------------------- - Methods for tabberObj - --------------------------------------------------*/ - - -tabberObj.prototype.init = function(e) -{ - /* Set up the tabber interface. - - e = element (the main containing div) - - Example: - init(document.getElementById('mytabberdiv')) - */ - - var - childNodes, /* child nodes of the tabber div */ - i, i2, /* loop indices */ - t, /* object to store info about a single tab */ - defaultTab=0, /* which tab to select by default */ - DOM_ul, /* tabbernav list */ - DOM_li, /* tabbernav list item */ - DOM_a, /* tabbernav link */ - aId, /* A unique id for DOM_a */ - headingElement; /* searching for text to use in the tab */ - - /* Verify that the browser supports DOM scripting */ - if (!document.getElementsByTagName) { return false; } - - /* If the main DIV has an ID then save it. */ - if (e.id) { - this.id = e.id; - } - - /* Clear the tabs array (but it should normally be empty) */ - this.tabs.length = 0; - - /* Loop through an array of all the child nodes within our tabber element. */ - childNodes = e.childNodes; - for(i=0; i < childNodes.length; i++) { - - /* Find the nodes where class="tabbertab" */ - if(childNodes[i].className && - childNodes[i].className.match(this.REclassTab)) { - - /* Create a new object to save info about this tab */ - t = new Object(); - - /* Save a pointer to the div for this tab */ - t.div = childNodes[i]; - - /* Add the new object to the array of tabs */ - this.tabs[this.tabs.length] = t; - - /* If the class name contains classTabDefault, - then select this tab by default. - */ - if (childNodes[i].className.match(this.REclassTabDefault)) { - defaultTab = this.tabs.length-1; - } - } - } - - /* Create a new UL list to hold the tab headings */ - DOM_ul = document.createElement("ul"); - DOM_ul.className = this.classNav; - - /* Loop through each tab we found */ - for (i=0; i < this.tabs.length; i++) { - - t = this.tabs[i]; - - /* Get the label to use for this tab: - From the title attribute on the DIV, - Or from one of the this.titleElements[] elements, - Or use an automatically generated number. - */ - t.headingText = t.div.title; - - /* Remove the title attribute to prevent a tooltip from appearing */ - if (this.removeTitle) { t.div.title = ''; } - - if (!t.headingText) { - - /* Title was not defined in the title of the DIV, - So try to get the title from an element within the DIV. - Go through the list of elements in this.titleElements - (typically heading elements ['h2','h3','h4']) - */ - for (i2=0; i2/gi," "); - t.headingText = t.headingText.replace(/<[^>]+>/g,""); - } - break; - } - } - } - - if (!t.headingText) { - /* Title was not found (or is blank) so automatically generate a - number for the tab. - */ - t.headingText = i + 1; - } - - /* Create a list element for the tab */ - DOM_li = document.createElement("li"); - - /* Save a reference to this list item so we can later change it to - the "active" class */ - t.li = DOM_li; - - /* Create a link to activate the tab */ - DOM_a = document.createElement("a"); - DOM_a.appendChild(document.createTextNode(t.headingText)); - DOM_a.href = "javascript:void(null);"; - DOM_a.title = t.headingText; - DOM_a.onclick = this.navClick; - - /* Add some properties to the link so we can identify which tab - was clicked. Later the navClick method will need this. - */ - DOM_a.tabber = this; - DOM_a.tabberIndex = i; - - /* Do we need to add an id to DOM_a? */ - if (this.addLinkId && this.linkIdFormat) { - - /* Determine the id name */ - aId = this.linkIdFormat; - aId = aId.replace(//gi, this.id); - aId = aId.replace(//gi, i); - aId = aId.replace(//gi, i+1); - aId = aId.replace(//gi, t.headingText.replace(/[^a-zA-Z0-9\-]/gi, '')); - - DOM_a.id = aId; - } - - /* Add the link to the list element */ - DOM_li.appendChild(DOM_a); - - /* Add the list element to the list */ - DOM_ul.appendChild(DOM_li); - } - - /* Add the UL list to the beginning of the tabber div */ - e.insertBefore(DOM_ul, e.firstChild); - - /* Make the tabber div "live" so different CSS can be applied */ - e.className = e.className.replace(this.REclassMain, this.classMainLive); - - /* Activate the default tab, and do not call the onclick handler */ - this.tabShow(defaultTab); - - /* If the user specified an onLoad function, call it now. */ - if (typeof this.onLoad == 'function') { - this.onLoad({tabber:this}); - } - - return this; -}; - - -tabberObj.prototype.navClick = function(event) -{ - /* This method should only be called by the onClick event of an - element, in which case we will determine which tab was clicked by - examining a property that we previously attached to the - element. - - Since this was triggered from an onClick event, the variable - "this" refers to the element that triggered the onClick - event (and not to the tabberObj). - - When tabberObj was initialized, we added some extra properties - to the element, for the purpose of retrieving them now. Get - the tabberObj object, plus the tab number that was clicked. - */ - - var - rVal, /* Return value from the user onclick function */ - a, /* element that triggered the onclick event */ - self, /* the tabber object */ - tabberIndex, /* index of the tab that triggered the event */ - onClickArgs; /* args to send the onclick function */ - - a = this; - if (!a.tabber) { return false; } - - self = a.tabber; - tabberIndex = a.tabberIndex; - - /* Remove focus from the link because it looks ugly. - I don't know if this is a good idea... - */ - a.blur(); - - /* If the user specified an onClick function, call it now. - If the function returns false then do not continue. - */ - if (typeof self.onClick == 'function') { - - onClickArgs = {'tabber':self, 'index':tabberIndex, 'event':event}; - - /* IE uses a different way to access the event object */ - if (!event) { onClickArgs.event = window.event; } - - rVal = self.onClick(onClickArgs); - if (rVal === false) { return false; } - } - - self.tabShow(tabberIndex); - - return false; -}; - - -tabberObj.prototype.tabHideAll = function() -{ - var i; /* counter */ - - /* Hide all tabs and make all navigation links inactive */ - for (i = 0; i < this.tabs.length; i++) { - this.tabHide(i); - } -}; - - -tabberObj.prototype.tabHide = function(tabberIndex) -{ - var div; - - if (!this.tabs[tabberIndex]) { return false; } - - /* Hide a single tab and make its navigation link inactive */ - div = this.tabs[tabberIndex].div; - - /* Hide the tab contents by adding classTabHide to the div */ - if (!div.className.match(this.REclassTabHide)) { - div.className += ' ' + this.classTabHide; - } - this.navClearActive(tabberIndex); - - return this; -}; - - -tabberObj.prototype.tabShow = function(tabberIndex) -{ - /* Show the tabberIndex tab and hide all the other tabs */ - - var div; - - if (!this.tabs[tabberIndex]) { return false; } - - /* Hide all the tabs first */ - this.tabHideAll(); - - /* Get the div that holds this tab */ - div = this.tabs[tabberIndex].div; - - /* Remove classTabHide from the div */ - div.className = div.className.replace(this.REclassTabHide, ''); - - /* Mark this tab navigation link as "active" */ - this.navSetActive(tabberIndex); - - /* If the user specified an onTabDisplay function, call it now. */ - if (typeof this.onTabDisplay == 'function') { - this.onTabDisplay({'tabber':this, 'index':tabberIndex}); - } - - return this; -}; - -tabberObj.prototype.navSetActive = function(tabberIndex) -{ - /* Note: this method does *not* enforce the rule - that only one nav item can be active at a time. - */ - - /* Set classNavActive for the navigation list item */ - this.tabs[tabberIndex].li.className = this.classNavActive; - - return this; -}; - - -tabberObj.prototype.navClearActive = function(tabberIndex) -{ - /* Note: this method does *not* enforce the rule - that one nav should always be active. - */ - - /* Remove classNavActive from the navigation list item */ - this.tabs[tabberIndex].li.className = ''; - - return this; -}; - - -/*==================================================*/ - - -function tabberAutomatic(tabberArgs) -{ - /* This function finds all DIV elements in the document where - class=tabber.classMain, then converts them to use the tabber - interface. - - tabberArgs = an object to send to "new tabber()" - */ - var - tempObj, /* Temporary tabber object */ - divs, /* Array of all divs on the page */ - i; /* Loop index */ - - if (!tabberArgs) { tabberArgs = {}; } - - /* Create a tabber object so we can get the value of classMain */ - tempObj = new tabberObj(tabberArgs); - - /* Find all DIV elements in the document that have class=tabber */ - - /* First get an array of all DIV elements and loop through them */ - divs = document.getElementsByTagName("div"); - for (i=0; i < divs.length; i++) { - - /* Is this DIV the correct class? */ - if (divs[i].className && - divs[i].className.match(tempObj.REclassMain)) { - - /* Now tabify the DIV */ - tabberArgs.div = divs[i]; - divs[i].tabber = new tabberObj(tabberArgs); - } - } - - return this; -} - - -/*==================================================*/ - - -function tabberAutomaticOnLoad(tabberArgs) -{ - /* This function adds tabberAutomatic to the window.onload event, - so it will run after the document has finished loading. - */ - var oldOnLoad; - - if (!tabberArgs) { tabberArgs = {}; } - - /* Taken from: http://simon.incutio.com/archive/2004/05/26/addLoadEvent */ - - oldOnLoad = window.onload; - if (typeof window.onload != 'function') { - window.onload = function() { - tabberAutomatic(tabberArgs); - - }; - } else { - window.onload = function() { - oldOnLoad(); - tabberAutomatic(tabberArgs); - - }; - } -} - - -/*==================================================*/ -function init_tabs(){ - if (typeof tabberOptions == 'undefined') { - tabberAutomatic({}); - } - else - {if (!tabberOptions['manualStartup']) { - tabberAutomatic(tabberOptions); - } - } -} - -function init_autotabber(){ -/* Run tabberAutomaticOnload() unless the "manualStartup" option was specified */ - - if (typeof tabberOptions == 'undefined') { - - tabberAutomaticOnLoad(); - - } else { - - if (!tabberOptions['manualStartup']) { - tabberAutomaticOnLoad(tabberOptions); - } - - } -} \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/lib/js-pushlet-client.js b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/lib/js-pushlet-client.js deleted file mode 100755 index 8a0739d9ca..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/lib/js-pushlet-client.js +++ /dev/null @@ -1,612 +0,0 @@ -/* - * Pushlet JS client library. - * NOTE: this should replace the js-pushlet-client.jsp file - * (since we can figure out pushletWebRoot from within JS) - * - * $Id: js-pushlet-client.js,v 1.2 2007/11/10 14:17:18 justb Exp $ - */ -var flag = false; -var pushletWebRoot = null; -var pushletURI; -var pushletNetURI; -var sessionId = null; -var controlQueue = new Queue(20); -var statusMsg = 'null'; -var statusChanged = false; -var statusChar = '|'; -var pushletNet; -var listenMode = null; -var listenSubject = null; - -// Initialize various URLs -_initURIs(); - -/************ Public application functions ******************/ - -// Embed pushlet frame in page -function p_embed(thePushletWebRoot) { - if (thePushletWebRoot) { - // Use this when webapp is not in same server e.g. with virtual hosts - pushletWebRoot = thePushletWebRoot; - _initURIs(); - } -//alert(pushletNetURI+""); - p_debug(flag, "p_embed", 'write ' + pushletLayer); - var pushletLayer = ''; - - self.document.write(pushletLayer); - _setStatus('initializing...'); - _showStatus(); - _waitForPushletFrame(); -} - -// Join the pushlet server -function p_join() { - // Ignore (for now) if already joined - if (sessionId != null) { - return; - } - - _setStatus('connecting...'); - p_debug(flag, "p_join", 'joining..'); - - - // Check if pushlet frame is loaded - if (pushletNet) { - // Pushlet iframe is ready for calls - pushletNet.setControlURI(pushletURI + '?p_event=join'); - } else { - - // Pushlet net iframe not loaded: continue waiting - setTimeout("p_join()", 100); - } -} - -// Create data event channel with the server -function p_listen(subject, mode) { - // Optional initial subject to subscribe to - if (subject) { - // Remember - listenSubject = subject; - } - - // Optional mode (stream, pull, poll) i.s.o. default - if (mode) { - // Remember - listenMode = mode; - } - - // Loop forever as long not joined - if (sessionId) { - // ok we have joined - - // Create event URI for listen - var uri = pushletURI + '?p_id=' + sessionId + '&p_event=listen'; - - // Optional subject to subscribe to - if (listenSubject) { - uri = uri + '&p_subject=' + listenSubject; - } - - // Optional mode (stream, pull, poll) i.s.o. default - if (listenMode) { - uri = uri + '&p_mode=' + listenMode; - } - - pushletNet.listen(uri); - return; - } - - // No join ack (sessionId) yet: wait until received - setTimeout("p_listen()", 100); - -} - -// Shorthand: Join the pushlet server and start listening immediately -function p_join_listen(subject, mode) { - p_join(); - p_listen(subject, mode); -} - -// Leave the pushlet server -function p_leave() { - // Ignore (for now) if already left - if (sessionId == null) { - return; - } - - var uri = pushletURI + '?p_event=leave'; - p_debug(flag, 'p_leave', 'leave uri=' + uri); - _sendControlURI(uri); -} - - -// Send heartbeat event; callback is onHeartbeatAck() -function p_heartbeat() { - var uri = pushletURI + '?p_event=hb'; - p_debug(flag, 'p_heartbeat'); - _sendControlURI(uri); -} - -// Publish to a subject -function p_publish(subject, nvPairs) { - if (!subject) { - return false; - } - - var uri = pushletURI + '?p_event=publish&p_subject=' + subject; - - var args = p_publish.arguments; - - // Put the arguments' name/value pairs in the URI - for (var i = 1; i < args.length; i++) { - uri = uri + '&' + args[i] + '=' + args[++i]; - } - - p_debug(false, 'p_publish', 'publish uri=' + uri); - _sendControlURI(uri); -} - -// Subscribe to a subject with optional label -function p_subscribe(subject, label) { - var uri = pushletURI + '?p_event=subscribe&p_subject=' + subject; - if (label) { - uri = uri + '&p_label=' + label; - } - - p_debug(flag, 'p_subscribe', 'subscribe uri=' + uri); - _sendControlURI(uri); -} - - // Unsubscribe from a subject -function p_unsubscribe(subscriptionId) { - var uri = pushletURI + '?p_event=unsubscribe'; - - if (subscriptionId) { - uri = uri + '&p_sid=' + subscriptionId; - } - - p_debug(flag, 'p_unsubscribe', 'unsubscribe uri=' + uri); - _sendControlURI(uri); -} - - -// Get webroot for this webapp -function p_getWebRoot() { - return pushletWebRoot; -} - -// Get pushlet session id -function p_getSessionId() { - return sessionId; -} - -// Show debug window -function p_setDebug(aFlag) { - flag = aFlag; - p_setNetDebug(aFlag); -} - -// Show network debug window -function p_setNetDebug(aFlag) { - pushletNet.p_setDebug(aFlag); -} - -/************ Private functions ******************/ - -/** CALLBACKS FROM pushletFrame ***/ - -// Generic callback from server; this function is called from within the -// Pushlet subscriber frame (see frames below). -function _push(args) { - // Create a PushletEvent object from the arguments passed in - // push.arguments is event data coming from the Server - var event = new PushletEvent(args); - - p_debug(flag, '_push() from server: ', event.toString()); - - // Do action based on event type - var eventType = event.getEvent(); - - if (eventType == 'data') { - _setStatus('data'); - _doCallback(event, window.onData); - } else if (eventType == 'join-ack') { - sessionId = event.get('p_id'); - _setStatus('connected'); - _doCallback(event, window.onJoinAck); - } else if (eventType == 'listen-ack') { - _setStatus('listening'); - _doCallback(event, window.onListenAck); - - // Send empty heartbeat event. This - // silences many busy browser windows. - // At least in Moz and IE. - p_heartbeat(); - } else if (eventType == 'hb') { - _setStatus('heartbeat'); - _doCallback(event, window.onHeartbeat); - } else if (eventType == 'hb-ack') { - _doCallback(event, window.onHeartbeatAck); - } else if (eventType == 'leave-ack') { - sessionId = null; - _setStatus('disconnected'); - _doCallback(event, window.onLeaveAck); - } else if (eventType == 'refresh-ack') { - _doCallback(event, window.onRefreshAck); - } else if (eventType == 'subscribe-ack') { - _setStatus('subscribed to ' + event.get('p_subject')); - _doCallback(event, window.onSubscribeAck); - } else if (eventType == 'unsubscribe-ack') { - _setStatus('unsubscribed'); - _doCallback(event, window.onUnsubscribeAck); - } else if (eventType == 'abort') { - _setStatus('abort'); - _doCallback(event, window.onAbort); - } else if (eventType.match(/nack$/)) { - _setStatus('error response: ' + event.get('p_reason')); - _doCallback(event, window.onNack); - } -} - -function getWebRoot() { - /** Return directory of this relative to document URL. */ - if (pushletWebRoot != null) { - return pushletWebRoot; - } - //derive the baseDir value by looking for the script tag that loaded this file - var head = document.getElementsByTagName('head')[0]; - var nodes = head.childNodes; - for (var i = 0; i < nodes.length; ++i) { - var src = nodes.item(i).src; - if (src) { - var index = src.indexOf("lib/js-pushlet-client.js"); - if (index >= 0) { - pushletWebRoot = src.substring(0, index); - break; - } - } - } - return pushletWebRoot; -} - -function _initURIs() { - pushletURI = getWebRoot() + 'pushlet.srv'; - pushletNetURI = getWebRoot() + 'lib/js-pushlet-net.html'; - //alert(pushletURI); -// alert(pushletNetURI); -} - -function _showStatus() { - // To show progress - if (statusChanged == true) { - if (statusChar == '|') statusChar = '/'; - else if (statusChar == '/') statusChar = '--'; - else if (statusChar == '--') statusChar = '\\'; - else statusChar = '|'; - statusChanged = false; - } - - window.defaultStatus = statusMsg; - window.status = statusMsg + ' ' + statusChar; - timeout = window.setTimeout('_showStatus()', 400); -} - -function _setStatus(status) { - statusMsg = "pushlet - " + status; - statusChanged = true; -} - -function _onUnload() { - p_debug(true, "pushlet-lib", "_onUnload() called"); -} - -function _onBeforeUnload() { - p_debug(true, "pushlet-lib", "_onBeforeUnload() called"); -} - -function _onStop() { - p_debug(true, "pushlet-lib", "_onStop() called"); -} - -function _doCallback(event, cbFunction) { - // Do specific callback function if provided by client - if (cbFunction) { - // Do specific callback like onData(), onJoinAck() etc. - cbFunction(event); - } else if (window.onEvent) { - // general callback onEvent() provided to catch all events - onEvent(event); - } -} - -/** CALLS TO pushletFrame ***/ - - -function _sendControlURI(uri) { - if (controlQueue.isFull()) { - // TODO divert to errpage - alert('serious problem: control queue is full'); - // no sense going on - return; - } - - if (sessionId == null) { - controlQueue.enqueue(uri); - _processControlQueue(); - return; - } - - // All clear to send immediately ? - if (controlQueue.isEmpty()) { - if (pushletNet.isControlReady()) { - // Ok send direct - uri = uri + '&p_id=' + sessionId; - pushletNet.setControlURI(uri); - } else { - controlQueue.enqueue(uri); - } - } else { - // Queue not empty - controlQueue.enqueue(uri); - } - - if (!controlQueue.isEmpty()) { - _processControlQueue(); - } -} - -function _processControlQueue() { - if (controlQueue.isEmpty()) { - // all done - return; - } - - if (sessionId != null) { - // Dequeue next control URI if pushletFrame ready - if (pushletNet.isControlReady()) { - var uri = controlQueue.dequeue() + '&p_id=' + sessionId; - pushletNet.setControlURI(uri); - } - } - - // Loop forever as long queue is not empty - if (!controlQueue.isEmpty()) { - setTimeout("_processControlQueue()", 50); - } -} - - -function _waitForPushletFrame() { - // Loop forever as long net uri not ready - if (self.pushletFrame && self.pushletFrame.isLoaded && self.pushletFrame.isLoaded()) { - _setStatus('loaded pushlet frame...'); - - pushletNet = self.pushletFrame; - return; - } - - _setStatus('pushlet frame not ready'); - setTimeout("_waitForPushletFrame()", 20); -} - -/************** Util classes *******************************/ - -/** NV pair object */ -function NameValuePair(name, value) { - this.name = name; - this.value = value; -} - -/** Simple Map object to store array of name/value pairs */ -function Map() { - // Data members - this.index = 0; - this.map = new Array(); - - // Function members - this.get = MapGet; - this.put = MapPut; - this.toString = MapToString; - this.toTable = MapToTable; -} - -/** get() */ -function MapGet(name) { - for (var i = 0; i < this.index; i++) { - if (this.map[i].name == name) { - return this.map[i].value; - } - } - return ''; -} - -/** put() */ -function MapPut(name, value) { - this.map[this.index++] = new NameValuePair(name, value); -} - -/** To HTML string */ -function MapToString() { - var res = ''; - - for (var i = 0; i < this.index; i++) { - res = res + this.map[i].name + '=' + this.map[i].value + '\n'; - } - return res; -} - -/** To HTML table */ -function MapToTable() { - var res = ''; - var styleDiv = '
    ' - - for (var i = 0; i < this.index; i++) { - res = res + '
    '; - } - res += '
    ' + styleDiv + this.map[i].name + '' + styleDiv + this.map[i].value + '
    ' - return res; -} - -/** Simple FIFO Queue class */ -function Queue(aCapacity) { - // Data members - this.capacity = aCapacity; - this.size = 0; - this.arr = new Array(); - this.front = 0; - this.rear = 0; - - // Function members - this.dequeue = QueueDequeue; - this.enqueue = QueueEnqueue; - this.next = QueueNext; - this.isFull = QueueIsFull; - this.isEmpty = QueueIsEmpty; -} - -/** enqueue() */ -function QueueEnqueue(item) { - if (this.isFull()) { - alert('queue full !!'); - return; - } - - this.arr[this.rear] = item; - this.rear = this.next(this.rear); - this.size++; -} - -/** dequeue() */ -function QueueDequeue(name) { - if (this.isEmpty()) { - alert('queue empty !!'); - return; - } - var temp = this.arr[this.front]; - this.arr[this.front] = null; - this.front = this.next(this.front); - this.size--; - return temp; -} - -/** Circular counter. */ -function QueueNext(index) { - return (index + 1 < this.capacity ? index + 1 : 0); -} - -function QueueIsFull() { - return this.size == this.capacity; -} - -function QueueIsEmpty() { - return this.size == 0; -} - -/* Class to represent nl.justobjects.pushlet.Event in JavaScript. - Arguments are an array where args[i] is name and args[i+1] is value -*/ -function PushletEvent(args) { - // Member variable setup; the Map stores the N/V pairs - this.map = new Map(); - - // Member function setup - this.getSubject = PushletEventGetSubject - this.getEvent = PushletEventGetEvent - this.put = PushletEventPut - this.get = PushletEventGet - this.toString = PushletEventToString - this.toTable = PushletEventToTable - - // Put the arguments' name/value pairs in the Map - for (var i = 0; i < args.length; i++) { - this.put(args[i], args[++i]); - } -} - -// Get the subject attribute -function PushletEventGetSubject() { - return this.map.get('p_subject') -} - -// Get the subject attribute -function PushletEventGetEvent() { - return this.map.get('p_event') -} - -// Get event attribute -function PushletEventGet(name) { - return this.map.get(name) -} - -// Put event attribute -function PushletEventPut(name, value) { - return this.map.put(name, value) -} - -function PushletEventToString() { - return this.map.toString(); -} - -// Convert content to HTML TABLE -function PushletEventToTable() { - return this.map.toTable(); -} - -/*************** Debug utility *******************************/ -var timestamp = 0 -var debugWindow = null -var messages = new Array() -var messagesIndex = 0 - -/** Send debug messages to a (D)HTML window. */ -function p_debug(flag, label, value) { - - // Only print if the flag is set - if (!flag) { - return; - } - - var funcName = "none"; - - // Fetch JS function name if any - if (p_debug.caller) { - funcName = p_debug.caller.toString() - funcName = funcName.substring(9, funcName.indexOf(")") + 1) - } - - // Create message - var msg = "-" + funcName + ": " + label + "=" + value - - // Add optional timestamp - var now = new Date() - var elapsed = now - timestamp - if (elapsed < 10000) { - msg += " (" + elapsed + " msec)" - } - - timestamp = now - - // Show. - - if ((debugWindow == null) || debugWindow.closed) { - debugWindow = window.open("", "p_debugWin", "toolbar=no,scrollbars=yes,resizable=yes,width=600,height=400"); - } - - // Add message to current list - messages[messagesIndex++] = msg - - // Write doc header - debugWindow.document.writeln('Pushlet Debug Window'); - - // Write the messages - for (var i = 0; i < messagesIndex; i++) { - debugWindow.document.writeln('
    ' + i + ': ' + messages[i] + '
    '); - } - - // Write doc footer and close - debugWindow.document.writeln(''); - debugWindow.document.close(); - debugWindow.focus(); - -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/lib/js-pushlet-net.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/lib/js-pushlet-net.html deleted file mode 100755 index fceafc90b2..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/lib/js-pushlet-net.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - Pushlet Networking Component - - - - - - - - - - - - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/logOut.jsp b/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/logOut.jsp deleted file mode 100755 index 49ec9f46f0..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/WebContent/logOut.jsp +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - Log Out - - - - - - - - - - <%-- desabonnement du pushlet--%> -
    -Bye bye <% out.println(session.getAttribute("login")); %> !
    -Thank you for using Paparazzi On the Web !
    - -<% -session.removeAttribute("login"); -session.removeAttribute("rights"); -session.invalidate(); -%> - -

    -Click here to go to the Paparazzi project homepage.
    -Click here to return to the Paparazzi On the Web homepage. -

    -
    - - \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/Version.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/Version.class deleted file mode 100755 index a0d3e54309..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/Version.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClient$DataEventListener.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClient$DataEventListener.class deleted file mode 100755 index f3ff29c730..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClient$DataEventListener.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClient$HTTPAuthenticateProxy.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClient$HTTPAuthenticateProxy.class deleted file mode 100755 index b4e6d3877d..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClient$HTTPAuthenticateProxy.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClient.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClient.class deleted file mode 100755 index 8995f5fe64..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClient.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClient.java.patch b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClient.java.patch deleted file mode 100755 index 63d660354d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClient.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- PushletClient.java 6 May 2005 20:08:20 -0000 1.16 -+++ PushletClient.java 28 Oct 2006 23:19:12 -0000 -@@ -142,7 +142,13 @@ - } - - dataEventListener = new DataEventListener(aListener, listenURL); -- dataEventListener.start(); -+ synchronized (dataEventListener) { -+ dataEventListener.start(); -+ try { -+ dataEventListener.wait(); -+ } catch (InterruptedException e) { -+ } -+ } - } - - /** Immediate listener. */ -@@ -354,6 +360,11 @@ - // Connect to server - reader = openURL(listenURL); - -+ synchronized (this) { -+ // Inform the calling thread we're ready to receive events. -+ this.notify(); -+ } -+ - // Get events while we're alive. - while (receiveThread != null && receiveThread.isAlive()) { - Event event = null; diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClientListener.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClientListener.class deleted file mode 100755 index f51394c738..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/client/PushletClientListener.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/BrowserAdapter.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/BrowserAdapter.class deleted file mode 100755 index 621934ecf5..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/BrowserAdapter.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/ClientAdapter.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/ClientAdapter.class deleted file mode 100755 index 2af4b37f0f..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/ClientAdapter.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Command.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Command.class deleted file mode 100755 index ff1e50ec20..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Command.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Config.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Config.class deleted file mode 100755 index e35454ab7a..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Config.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/ConfigDefs.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/ConfigDefs.class deleted file mode 100755 index 97abf75f59..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/ConfigDefs.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Controller.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Controller.class deleted file mode 100755 index 52d6182c72..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Controller.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Dispatcher$SessionManagerVisitor.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Dispatcher$SessionManagerVisitor.class deleted file mode 100755 index 67e2ff50a4..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Dispatcher$SessionManagerVisitor.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Dispatcher.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Dispatcher.class deleted file mode 100755 index 96a1e30460..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Dispatcher.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Event.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Event.class deleted file mode 100755 index 5f0a44f42b..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Event.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventParser.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventParser.class deleted file mode 100755 index ba24b91dc8..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventParser.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventPullSource.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventPullSource.class deleted file mode 100755 index 5035b8c3ac..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventPullSource.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventQueue.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventQueue.class deleted file mode 100755 index 5a683b561c..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventQueue.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventSource.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventSource.class deleted file mode 100755 index 82cb2a1788..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventSource.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventSourceManager.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventSourceManager.class deleted file mode 100755 index 5f3f210f67..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/EventSourceManager.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Protocol.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Protocol.class deleted file mode 100755 index 621230a85c..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Protocol.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/SerializedAdapter.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/SerializedAdapter.class deleted file mode 100755 index a9e20bd445..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/SerializedAdapter.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Session.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Session.class deleted file mode 100755 index aeaf500cd3..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Session.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/SessionManager$AgingTimerTask.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/SessionManager$AgingTimerTask.class deleted file mode 100755 index 32c0c5107d..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/SessionManager$AgingTimerTask.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/SessionManager.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/SessionManager.class deleted file mode 100755 index 20b1c938be..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/SessionManager.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Subscriber.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Subscriber.class deleted file mode 100755 index 86988f5c55..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Subscriber.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Subscription.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Subscription.class deleted file mode 100755 index 3757a3654e..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/Subscription.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/XMLAdapter.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/XMLAdapter.class deleted file mode 100755 index 5c9e098014..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/core/XMLAdapter.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/servlet/Pushlet.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/servlet/Pushlet.class deleted file mode 100755 index 8487dc070e..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/servlet/Pushlet.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/DefaultLogger.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/DefaultLogger.class deleted file mode 100755 index 88c9a8886e..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/DefaultLogger.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Log.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Log.class deleted file mode 100755 index ad1b9d2a01..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Log.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Log4jLogger.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Log4jLogger.class deleted file mode 100755 index fc7f3aad68..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Log4jLogger.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/PushletException.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/PushletException.class deleted file mode 100755 index 2de5da72f8..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/PushletException.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/PushletLogger.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/PushletLogger.class deleted file mode 100755 index d5223e244a..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/PushletLogger.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Rand.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Rand.class deleted file mode 100755 index e5ce60654c..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Rand.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Servlets.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Servlets.class deleted file mode 100755 index e7f6917dbd..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Servlets.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Sys.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Sys.class deleted file mode 100755 index 2ce439ec6c..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/nl/justobjects/pushlet/util/Sys.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/AES.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/AES.class deleted file mode 100755 index 3641ca5740..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/AES.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/InstallCert$SavingTrustManager.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/InstallCert$SavingTrustManager.class deleted file mode 100755 index 35373b7698..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/InstallCert$SavingTrustManager.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/InstallCert.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/InstallCert.class deleted file mode 100755 index 83b0761007..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/InstallCert.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/AcNetId.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/AcNetId.class deleted file mode 100755 index 4f1d6996c4..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/AcNetId.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/AcNetIdStorage$myListener.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/AcNetIdStorage$myListener.class deleted file mode 100755 index f7eca18ad0..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/AcNetIdStorage$myListener.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/AcNetIdStorage.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/AcNetIdStorage.class deleted file mode 100755 index e98ec79c90..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/AcNetIdStorage.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/AcStatus.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/AcStatus.class deleted file mode 100755 index 8d60963c98..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/AcStatus.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/BusIvy_.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/BusIvy_.class deleted file mode 100755 index 9956d0f89c..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/BusIvy_.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/HeartBeat.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/HeartBeat.class deleted file mode 100755 index 1ab04f5baf..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/HeartBeat.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$1.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$1.class deleted file mode 100755 index bd75882833..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$1.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$2.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$2.class deleted file mode 100755 index bf756b6a8b..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$2.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$3.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$3.class deleted file mode 100755 index 21de596c65..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$3.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$4.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$4.class deleted file mode 100755 index 6d13278297..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$4.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$5.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$5.class deleted file mode 100755 index 5fed7c428b..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$5.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$6.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$6.class deleted file mode 100755 index 6a7caf2a4a..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$6.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$7.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$7.class deleted file mode 100755 index 293ad9e246..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$7.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$8.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$8.class deleted file mode 100755 index d19d51ecc0..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$8.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$9.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$9.class deleted file mode 100755 index f4298fe102..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$9.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$aircraftIdSeeker.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$aircraftIdSeeker.class deleted file mode 100755 index 53b2abc7b9..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp$aircraftIdSeeker.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp.class deleted file mode 100755 index 5fe7d5716d..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2Udp.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2UdpWriting.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2UdpWriting.class deleted file mode 100755 index faee86c6eb..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/Ivy2UdpWriting.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyConnectionExeption.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyConnectionExeption.class deleted file mode 100755 index 628a3506e8..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyConnectionExeption.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$1.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$1.class deleted file mode 100755 index 5d4418e8c2..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$1.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$LogAction$1.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$LogAction$1.class deleted file mode 100755 index 7639106504..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$LogAction$1.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$LogAction.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$LogAction.class deleted file mode 100755 index e32fd81757..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$LogAction.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$MoreAction$1.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$MoreAction$1.class deleted file mode 100755 index a7c7be2d80..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$MoreAction$1.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$MoreAction.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$MoreAction.class deleted file mode 100755 index 9182435d53..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$MoreAction.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$QuitAction$1.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$QuitAction$1.class deleted file mode 100755 index 295c9ea683..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$QuitAction$1.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$QuitAction.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$QuitAction.class deleted file mode 100755 index e7fdb66980..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$QuitAction.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$StopAction$1.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$StopAction$1.class deleted file mode 100755 index 3b3005bc0e..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$StopAction$1.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$StopAction.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$StopAction.class deleted file mode 100755 index 7be9b47844..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM$StopAction.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM.class deleted file mode 100755 index eb49810a41..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/IvyIHM.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/MsgFilter.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/MsgFilter.class deleted file mode 100755 index 2c01f717d5..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/MsgFilter.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/PowUrl.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/PowUrl.class deleted file mode 100755 index 5da2b22782..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/ivyclient/PowUrl.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/AjaxRqst.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/AjaxRqst.class deleted file mode 100755 index 2f89e040a8..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/AjaxRqst.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/AlreadyRegisteredUserException.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/AlreadyRegisteredUserException.class deleted file mode 100755 index 47a169bd8d..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/AlreadyRegisteredUserException.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Conf.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Conf.class deleted file mode 100755 index 751a7ee327..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Conf.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/DbMode.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/DbMode.class deleted file mode 100755 index f5fec1e67d..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/DbMode.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/DbOrder.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/DbOrder.class deleted file mode 100755 index eb8306de43..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/DbOrder.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Greeting.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Greeting.class deleted file mode 100755 index 500bb3832b..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Greeting.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/HeartBeat.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/HeartBeat.class deleted file mode 100755 index d6ad0e3c0a..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/HeartBeat.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Ivy2TomcatHttpServer.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Ivy2TomcatHttpServer.class deleted file mode 100755 index 2521a87855..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Ivy2TomcatHttpServer.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/IvyMsg.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/IvyMsg.class deleted file mode 100755 index d69238c5c2..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/IvyMsg.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Log.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Log.class deleted file mode 100755 index 5f5244715d..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Log.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Md5.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Md5.class deleted file mode 100755 index 8b3aab8117..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Md5.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Rights.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Rights.class deleted file mode 100755 index e85a2100d5..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Rights.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SGBDfeeder.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SGBDfeeder.class deleted file mode 100755 index 77905a764f..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SGBDfeeder.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities$FakeHostnameVerifier.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities$FakeHostnameVerifier.class deleted file mode 100755 index 7cde65baec..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities$FakeHostnameVerifier.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities$FakeX509TrustManager.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities$FakeX509TrustManager.class deleted file mode 100755 index 88bbfbfb07..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities$FakeX509TrustManager.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities$_FakeHostnameVerifier.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities$_FakeHostnameVerifier.class deleted file mode 100755 index 3ec530f905..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities$_FakeHostnameVerifier.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities$_FakeX509TrustManager.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities$_FakeX509TrustManager.class deleted file mode 100755 index e615069b24..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities$_FakeX509TrustManager.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities.class deleted file mode 100755 index e2a55f971b..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SSLUtilities.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Serveur$IvyEventSource.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Serveur$IvyEventSource.class deleted file mode 100755 index 98d7c88271..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Serveur$IvyEventSource.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Serveur.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Serveur.class deleted file mode 100755 index 469635515e..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/Serveur.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SessionIvy.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SessionIvy.class deleted file mode 100755 index aa940715c9..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/SessionIvy.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/StrictSSLProtocolSocketFactory.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/StrictSSLProtocolSocketFactory.class deleted file mode 100755 index 52de4ed471..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/StrictSSLProtocolSocketFactory.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/User.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/User.class deleted file mode 100755 index 6b13c3b025..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/User.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/UserTab.class b/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/UserTab.class deleted file mode 100755 index 34f1f5acd6..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/build/classes/pow/webserver/UserTab.class and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/allclasses-frame.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/allclasses-frame.html deleted file mode 100755 index abdf0c7e73..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/allclasses-frame.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - -All Classes - - - - - - - - - - - -All Classes -
    - - - - - -
    AcNetId -
    -AcNetIdStorage -
    -AcStatus -
    -AES -
    -AjaxRqst -
    -AlreadyRegisteredUserException -
    -BusIvy_ -
    -Conf -
    -DbMode -
    -DbOrder -
    -Greeting -
    -HeartBeat -
    -HeartBeat -
    -InstallCert -
    -Ivy2TomcatHttpServer -
    -Ivy2Udp -
    -Ivy2UdpWriting -
    -IvyConnectionExeption -
    -IvyIHM -
    -IvyMsg -
    -Log -
    -Md5 -
    -MsgFilter -
    -PowUrl -
    -Rights -
    -Serveur -
    -Serveur.IvyEventSource -
    -SessionIvy -
    -SGBDfeeder -
    -SSLUtilities -
    -SSLUtilities._FakeHostnameVerifier -
    -SSLUtilities._FakeX509TrustManager -
    -SSLUtilities.FakeHostnameVerifier -
    -SSLUtilities.FakeX509TrustManager -
    -StrictSSLProtocolSocketFactory -
    -User -
    -UserTab -
    -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/allclasses-noframe.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/allclasses-noframe.html deleted file mode 100755 index 476dda131a..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/allclasses-noframe.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - -All Classes - - - - - - - - - - - -All Classes -
    - - - - - -
    AcNetId -
    -AcNetIdStorage -
    -AcStatus -
    -AES -
    -AjaxRqst -
    -AlreadyRegisteredUserException -
    -BusIvy_ -
    -Conf -
    -DbMode -
    -DbOrder -
    -Greeting -
    -HeartBeat -
    -HeartBeat -
    -InstallCert -
    -Ivy2TomcatHttpServer -
    -Ivy2Udp -
    -Ivy2UdpWriting -
    -IvyConnectionExeption -
    -IvyIHM -
    -IvyMsg -
    -Log -
    -Md5 -
    -MsgFilter -
    -PowUrl -
    -Rights -
    -Serveur -
    -Serveur.IvyEventSource -
    -SessionIvy -
    -SGBDfeeder -
    -SSLUtilities -
    -SSLUtilities._FakeHostnameVerifier -
    -SSLUtilities._FakeX509TrustManager -
    -SSLUtilities.FakeHostnameVerifier -
    -SSLUtilities.FakeX509TrustManager -
    -StrictSSLProtocolSocketFactory -
    -User -
    -UserTab -
    -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/constant-values.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/constant-values.html deleted file mode 100755 index f51df7f84d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/constant-values.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - -Constant Field Values - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Constant Field Values

    -
    -
    -Contents
      -
    - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/deprecated-list.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/deprecated-list.html deleted file mode 100755 index d18bd5efe2..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/deprecated-list.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - -Deprecated List - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Deprecated API

    -
    -
    -Contents - - - - - - - - - - - - -
    -Deprecated Classes
    pow.webserver.SSLUtilities._FakeHostnameVerifier -
    -          see SSLUtilities.FakeHostnameVerifier. 
    pow.webserver.SSLUtilities._FakeX509TrustManager -
    -          see SSLUtilities.FakeX509TrustManager. 
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/help-doc.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/help-doc.html deleted file mode 100755 index 7880f61ecf..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/help-doc.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - -API Help - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -How This API Document Is Organized

    -
    -This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

    -Overview

    -
    - -

    -The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    -

    -Package

    -
    - -

    -Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

      -
    • Interfaces (italic)
    • Classes
    • Enums
    • Exceptions
    • Errors
    • Annotation Types
    -
    -

    -Class/Interface

    -
    - -

    -Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

      -
    • Class inheritance diagram
    • Direct Subclasses
    • All Known Subinterfaces
    • All Known Implementing Classes
    • Class/interface declaration
    • Class/interface description -

      -

    • Nested Class Summary
    • Field Summary
    • Constructor Summary
    • Method Summary -

      -

    • Field Detail
    • Constructor Detail
    • Method Detail
    -Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
    - -

    -Annotation Type

    -
    - -

    -Each annotation type has its own separate page with the following sections:

      -
    • Annotation Type declaration
    • Annotation Type description
    • Required Element Summary
    • Optional Element Summary
    • Element Detail
    -
    - -

    -Enum

    -
    - -

    -Each enum has its own separate page with the following sections:

      -
    • Enum declaration
    • Enum description
    • Enum Constant Summary
    • Enum Constant Detail
    -
    -

    -Use

    -
    -Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
    -

    -Tree (Class Hierarchy)

    -
    -There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
      -
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    -
    -

    -Deprecated API

    -
    -The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
    -

    -Index

    -
    -The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
    -

    -Prev/Next

    -These links take you to the next or previous class, interface, package, or related page.

    -Frames/No Frames

    -These links show and hide the HTML frames. All pages are available with or without frames. -

    -

    -Serialized Form

    -Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. -

    -

    -Constant Field Values

    -The Constant Field Values page lists the static final fields and their values. -

    - - -This help file applies to API documentation generated using the standard doclet. - -
    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-1.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-1.html deleted file mode 100755 index 4680a6329b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-1.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - -A-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -A

    -
    -
    AcNetId - Class in pow.ivyclient
    this object represents the data concerning a drone extracted from Ivy - A drone has two identities.
    AcNetId(int, String, String, String, String, String, int) - -Constructor for class pow.ivyclient.AcNetId -
      -
    AcNetId(int, String, String, String, String, String, String, int) - -Constructor for class pow.ivyclient.AcNetId -
      -
    AcNetIdStorage - Class in pow.ivyclient
    this structure memorize all the drone which exist on the ivy bus.
    AcNetIdStorage(int, Ivy, String, int, ConcurrentHashMap<String, AcStatus>) - -Constructor for class pow.ivyclient.AcNetIdStorage -
      -
    AcStatus - Enum in pow.ivyclient
    implements the life cycle of a drone when it is detected on the ivy bus.
    activate() - -Method in class pow.webserver.Serveur.IvyEventSource -
    Activate the event source. -
    addDrone(String) - -Method in class pow.webserver.User -
    add a drone name to the list of drones that the user can control -
    addDrones(int) - -Method in class pow.ivyclient.BusIvy_ -
    inform the bus that a new drone send information on this bus -
    adminLogin() - -Method in class pow.webserver.Conf -
      -
    AES - Class in pow
    implements AES encryption and decryption algorithms - see @link http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html - see @link http://stackoverflow.com/questions/992019/java-256bit-aes-encryption
    AES() - -Constructor for class pow.AES -
    construct a cipher with a generated 128 bits key -
    AES(String) - -Constructor for class pow.AES -
    construct a cipher from an user specified key -
    AES(byte[], byte[]) - -Constructor for class pow.AES -
    construct a cipher from a key and a parameter array - usefull to create a remote decryption cypher -
    AjaxRqst - Class in pow.webserver
    Servlet implementation class ajaxRqst - handles the different request from a web client which wants to give orders to a drone - and it handles administrator queries to manage users' profiles
    AjaxRqst() - -Constructor for class pow.webserver.AjaxRqst -
      -
    AlreadyRegisteredUserException - Exception in pow.webserver
    exception to inform that a user cannot be created in the users' file - because it exists yet
    AlreadyRegisteredUserException(User) - -Constructor for exception pow.webserver.AlreadyRegisteredUserException -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-10.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-10.html deleted file mode 100755 index a595140053..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-10.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - -L-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -L

    -
    -
    Log - Class in pow.webserver
    Handles the writing of a log in a file
    Log(String) - -Constructor for class pow.webserver.Log -
    create a log file into the log floder of the web application -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-11.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-11.html deleted file mode 100755 index 49bd54e8a3..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-11.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - -M-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -M

    -
    -
    mailAdmin() - -Method in class pow.webserver.Conf -
      -
    main(String[]) - -Static method in class pow.InstallCert -
      -
    main(String[]) - -Static method in class pow.ivyclient.IvyIHM -
    launch the interface to connect the ivy bus to POW server -
    main(String[]) - -Static method in class pow.webserver.Md5 -
    example -
    Md5 - Class in pow.webserver
    tool class to implemente MD5 encoding - ( found on the web )
    Md5() - -Constructor for class pow.webserver.Md5 -
      -
    MsgFilter - Class in pow.ivyclient
    this class filters the message, thanks to their hash code - it is used because Paparazzi send periodic messages that are often the same - so we filter them to lighten the server load and the bandwidth of the udp channel
    MsgFilter() - -Constructor for class pow.ivyclient.MsgFilter -
    create a message filter -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-12.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-12.html deleted file mode 100755 index d7e2f62774..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-12.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - -P-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -P

    -
    -
    passivate() - -Method in class pow.webserver.Serveur.IvyEventSource -
    Desactivate the event source. -
    portIvyToWeb() - -Method in class pow.webserver.Conf -
      -
    portWebToIvy() - -Method in class pow.webserver.Conf -
      -
    pow - package pow
     
    pow.ivyclient - package pow.ivyclient
     
    pow.webserver - package pow.webserver
     
    PowUrl - Class in pow.ivyclient
    object which store all information about the url to log on the server
    PowUrl(String, String, int, String, String) - -Constructor for class pow.ivyclient.PowUrl -
    create all the information requested to connect the ivy module to the server - when all parameters are correct can give an url like - https://paparazzi.fr/ServletPow/Login.srv -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-13.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-13.html deleted file mode 100755 index 55775ff8ae..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-13.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - -R-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -R

    -
    -
    receive(IvyClient, String[]) - -Method in class pow.ivyclient.Ivy2UdpWriting -
    This method implements the method receive of the bus Ivy class. -
    remove(String) - -Method in class pow.webserver.UserTab -
    remove the user with the spefied login -
    resetfilter() - -Method in class pow.ivyclient.MsgFilter -
    empty the filter -
    Rights - Enum in pow.webserver
    describe the different rights a web user can have
    run() - -Method in class pow.ivyclient.HeartBeat -
    send a periodic heartbeat message -
    run() - -Method in class pow.ivyclient.Ivy2Udp -
    listen the udp socket to get orders from web clients and send them to ivy -
    run() - -Method in class pow.ivyclient.IvyIHM -
    loop to perform a periodic check for automatic reconnection -
    run() - -Method in class pow.webserver.HeartBeat -
    send a periodic heartbeat message to every connected ivy bus -
    run() - -Method in class pow.webserver.Serveur.IvyEventSource -
    main loop : - listens to the udp channel - deciphers the udp message - checks if the sender is a new bus or not - send the message to database through a fifo - turns the ivy message into a pushlet event - send the event to web users - checks if there are some buses that doesn't send messages anymore - removes drone which belonged to dead buses -
    run() - -Method in class pow.webserver.SGBDfeeder -
    listens fifo queue and stores ivy messages in database - if the message has the DECONNECT type it also fills the end field corresponding - to this ivy session into the 'connexion' table -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-14.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-14.html deleted file mode 100755 index 150030e8dd..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-14.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - -S-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -S

    -
    -
    seek(String) - -Method in class pow.webserver.UserTab -
    return the user corresponding to the given login -
    seekAcNetId(String) - -Method in class pow.ivyclient.AcNetIdStorage -
    search the drone net id of a drone from its ivy id - if the drone is a new one, a new net id is requested to the server -
    send(int) - -Method in class pow.ivyclient.Ivy2Udp -
    This method send to the web server the datagram containing the informations - about the aircraft -
    send(int, String, String[]) - -Method in class pow.ivyclient.Ivy2Udp -
    This method send to the web server a specific order with parameters -
    send(int, String) - -Method in class pow.ivyclient.Ivy2Udp -
    This method send a particular message about an aircraft -
    serialize(String) - -Method in class pow.webserver.UserTab -
    Save the object in a file -
    Serveur - Class in pow.webserver
    Class which receive a datagramm from ivy bus via UDP - transforms it into a Pushlet event and send it to the Pushlet server - in order that it will be sent to web clients
    Serveur() - -Constructor for class pow.webserver.Serveur -
      -
    Serveur.IvyEventSource - Class in pow.webserver
     
    Serveur.IvyEventSource() - -Constructor for class pow.webserver.Serveur.IvyEventSource -
      -
    SessionIvy - Class in pow.webserver
    store information about a specific ivy bus which is connected - to the server
    SessionIvy(String, int, AES, InetAddress) - -Constructor for class pow.webserver.SessionIvy -
    create a session which store information about an ivy bus client connected to the server - main information are its net address to send him orders from web users - and drones which are connected to this ivy bus -
    setAddress(InetAddress) - -Method in class pow.ivyclient.BusIvy_ -
      -
    setBusIvy(BusIvy_) - -Method in class pow.webserver.SessionIvy -
    store the information of the ivy bus into the ivy session -
    setHostnameVerification(boolean) - -Method in class pow.webserver.StrictSSLProtocolSocketFactory -
    Set the host name verification flag. -
    setIvyInetAddress(InetAddress) - -Method in class pow.webserver.SessionIvy -
    set the ip adress of the ivy bus host -
    setNom(String) - -Method in class pow.webserver.User -
    specify the login of the user -
    setOrder(DbOrder) - -Method in class pow.webserver.IvyMsg -
    specify how to store the message in database -
    setPwd(String) - -Method in class pow.webserver.User -
    specify the user password, it's not stored in clear (md5 hash) -
    setReLogged(boolean) - -Method in class pow.ivyclient.IvyIHM -
    specify whether the module should reconnected or not -
    setRights(Rights) - -Method in class pow.webserver.User -
    specify the type of right granted to the user -
    setServletContext(ServletContext) - -Method in class pow.webserver.Serveur.IvyEventSource -
    method qui renseigne la source sur la servlet qui l'a appelé - modification de la librairie pushlet - Pushlet.java - EventSource.java - EventSourceManager.java -
    setStorage() - -Method in class pow.ivyclient.Ivy2Udp -
    initiate the object which allow to store information about drones -
    SGBDfeeder - Class in pow.webserver
    thread which waits for ivy messages sent by event source (serveur.java) - and stores them into a mysql database - the ivy messages are extracted from a blocking queue (fifo) - parameter of the database are extracted from conf file
    SGBDfeeder(String, String, String, DbMode) - -Constructor for class pow.webserver.SGBDfeeder -
    create a thread which fill the database with the message it extracts from the fifo -
    SSLUtilities - Class in pow.webserver
    This class provide various static methods that relax X509 certificate and - hostname verification while using the SSL over the HTTP protocol.
    SSLUtilities() - -Constructor for class pow.webserver.SSLUtilities -
      -
    SSLUtilities._FakeHostnameVerifier - Class in pow.webserver
    Deprecated. see SSLUtilities.FakeHostnameVerifier.
    SSLUtilities._FakeHostnameVerifier() - -Constructor for class pow.webserver.SSLUtilities._FakeHostnameVerifier -
    Deprecated.   -
    SSLUtilities._FakeX509TrustManager - Class in pow.webserver
    Deprecated. see SSLUtilities.FakeX509TrustManager.
    SSLUtilities._FakeX509TrustManager() - -Constructor for class pow.webserver.SSLUtilities._FakeX509TrustManager -
    Deprecated.   -
    SSLUtilities.FakeHostnameVerifier - Class in pow.webserver
    This class implements a fake hostname verificator, trusting any host - name.
    SSLUtilities.FakeHostnameVerifier() - -Constructor for class pow.webserver.SSLUtilities.FakeHostnameVerifier -
      -
    SSLUtilities.FakeX509TrustManager - Class in pow.webserver
    This class allow any X509 certificates to be used to authenticate the - remote side of a secure socket, including self-signed certificates.
    SSLUtilities.FakeX509TrustManager() - -Constructor for class pow.webserver.SSLUtilities.FakeX509TrustManager -
      -
    startHeartBeat() - -Method in class pow.ivyclient.Ivy2Udp -
    create a thread which send heart beat message to the server -
    stop() - -Method in class pow.webserver.Serveur.IvyEventSource -
    Desactivate the event source. -
    stop_thread() - -Method in class pow.ivyclient.HeartBeat -
    stop the heartbeat thread by ending the infinite loop -
    stop_thread() - -Method in class pow.ivyclient.Ivy2Udp -
    stop all the thread Ivy2Udp , HeartBeat and ivy2UdpWriting -
    stop_thread() - -Method in class pow.webserver.HeartBeat -
    stop the heartbeat process of the server -
    StrictSSLProtocolSocketFactory - Class in pow.webserver
    A SecureProtocolSocketFactory that uses JSSE to create - SSL sockets.
    StrictSSLProtocolSocketFactory(boolean) - -Constructor for class pow.webserver.StrictSSLProtocolSocketFactory -
    Constructor for StrictSSLProtocolSocketFactory. -
    StrictSSLProtocolSocketFactory() - -Constructor for class pow.webserver.StrictSSLProtocolSocketFactory -
    Constructor for StrictSSLProtocolSocketFactory. -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-15.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-15.html deleted file mode 100755 index 4136614ad0..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-15.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - -T-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -T

    -
    -
    toString() - -Method in class pow.ivyclient.AcNetId -
    return information about the drone in a string format -
    toString() - -Method in exception pow.ivyclient.IvyConnectionExeption -
    display the exception on stdout -
    toString() - -Method in exception pow.webserver.AlreadyRegisteredUserException -
      -
    trustAllHostnames() - -Static method in class pow.webserver.SSLUtilities -
    Set the default Hostname Verifier to an instance of a fake class that - trust all hostnames. -
    trustAllHttpsCertificates() - -Static method in class pow.webserver.SSLUtilities -
    Set the default X509 Trust Manager to an instance of a fake class that - trust all certificates, even the self-signed ones. -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-16.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-16.html deleted file mode 100755 index ba0352830c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-16.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - -U-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -U

    -
    -
    unserialize(String) - -Static method in class pow.webserver.UserTab -
    load the object from a file -
    updateTime() - -Method in class pow.ivyclient.BusIvy_ -
    update the 'inner clock' of the object when a message for this bus is detected - useful to know if the bus is still alive -
    uploadConfFile(AcNetId) - -Method in class pow.ivyclient.AcNetIdStorage -
    upload de fichier de conf sur le serveur - verifier que ca marche sur long fichier - si probleme changer avec : - factory.setSizeThreshold(yourMaxMemorySize); - factory.setRepository(yourTempDirectory); - upload.setSizeMax(yourMaxRequestSize); -
    User - Class in pow.webserver
    represents a ivy or a web user account - for the web user the account nest also the list of drones that the user can control - the list contains the ivy name of the drone (MJ5, TJ1...).
    User(String, String, Rights) - -Constructor for class pow.webserver.User -
    create a user account -
    UserTab - Class in pow.webserver
    User objects are stored in a UserTab object which can be serialized in a file on the server disk
    UserTab() - -Constructor for class pow.webserver.UserTab -
    create a empty list of users -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-17.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-17.html deleted file mode 100755 index e332ff12f2..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-17.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - -V-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -V

    -
    -
    valueOf(String) - -Static method in enum pow.ivyclient.AcStatus -
    Returns the enum constant of this type with the specified name. -
    valueOf(String) - -Static method in enum pow.webserver.DbMode -
    Returns the enum constant of this type with the specified name. -
    valueOf(String) - -Static method in enum pow.webserver.DbOrder -
    Returns the enum constant of this type with the specified name. -
    valueOf(String) - -Static method in enum pow.webserver.Rights -
    Returns the enum constant of this type with the specified name. -
    values() - -Static method in enum pow.ivyclient.AcStatus -
    Returns an array containing the constants of this enum type, in -the order they are declared. -
    values() - -Static method in enum pow.webserver.DbMode -
    Returns an array containing the constants of this enum type, in -the order they are declared. -
    values() - -Static method in enum pow.webserver.DbOrder -
    Returns an array containing the constants of this enum type, in -the order they are declared. -
    values() - -Static method in enum pow.webserver.Rights -
    Returns an array containing the constants of this enum type, in -the order they are declared. -
    verify(String, String) - -Method in class pow.webserver.SSLUtilities._FakeHostnameVerifier -
    Deprecated. Always return true, indicating that the host name is an - acceptable match with the server's authentication scheme. -
    verify(String, SSLSession) - -Method in class pow.webserver.SSLUtilities.FakeHostnameVerifier -
    Always return true, indicating that the host name is - an acceptable match with the server's authentication scheme. -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-18.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-18.html deleted file mode 100755 index 24b00d964c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-18.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - -W-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -W

    -
    -
    write(String) - -Method in class pow.webserver.Log -
    write a string in log file and on stdout -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-19.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-19.html deleted file mode 100755 index 71fb86119e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-19.html +++ /dev/null @@ -1,418 +0,0 @@ - - - - - - -S-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E F G H I J K L M N O P Q R S T U V W
    -

    -S

    -
    -
    seek(String) - -Method in class pow.webserver.UserTab -
    return the user corresponding to the given login -
    seekAcNetId(String) - -Method in class pow.ivyclient.AcNetIdStorage -
    search the drone net id of a drone from its ivy id - if the drone is a new one, a new net id is requested to the server -
    send(int) - -Method in class pow.ivyclient.Ivy2Udp -
    This method send to the web server the datagram containing the informations - about the aircraft -
    send(int, String, String[]) - -Method in class pow.ivyclient.Ivy2Udp -
    This method send to the web server a specific order with parameters -
    send(int, String) - -Method in class pow.ivyclient.Ivy2Udp -
    This method send a particular message about an aircraft -
    serialize(String) - -Method in class pow.webserver.UserTab -
    Save the object in a file -
    Serveur - Class in pow.webserver
    Class which receive a datagramm from ivy bus via UDP - transforms it into a Pushlet event and send it to the Pushlet server - in order that it will be sent to web clients
    Serveur() - -Constructor for class pow.webserver.Serveur -
      -
    Serveur.IvyEventSource - Class in pow.webserver
     
    Serveur.IvyEventSource() - -Constructor for class pow.webserver.Serveur.IvyEventSource -
      -
    Servlets - Class in nl.justobjects.pushlet.util
    Servlet utilities.
    Servlets() - -Constructor for class nl.justobjects.pushlet.util.Servlets -
      -
    session - -Variable in class nl.justobjects.pushlet.core.Command -
    Pushlet session. -
    Session - Class in nl.justobjects.pushlet.core
    Represents client pushlet session state.
    SESSION_CLASS - -Static variable in interface nl.justobjects.pushlet.core.ConfigDefs -
      -
    SESSION_ID_GENERATION - -Static variable in interface nl.justobjects.pushlet.core.ConfigDefs -
      -
    SESSION_ID_GENERATION_RANDOMSTRING - -Static variable in interface nl.justobjects.pushlet.core.ConfigDefs -
      -
    SESSION_ID_GENERATION_UUID - -Static variable in interface nl.justobjects.pushlet.core.ConfigDefs -
      -
    SESSION_ID_SIZE - -Static variable in interface nl.justobjects.pushlet.core.ConfigDefs -
    Session management. -
    SESSION_MANAGER_CLASS - -Static variable in interface nl.justobjects.pushlet.core.ConfigDefs -
      -
    SESSION_TIMEOUT_MINS - -Static variable in interface nl.justobjects.pushlet.core.ConfigDefs -
      -
    SessionIvy - Class in pow.webserver
    store information about a specific ivy bus which is connected - to the server
    SessionIvy(String, int, AES, InetAddress) - -Constructor for class pow.webserver.SessionIvy -
    create a session which store information about an ivy bus client connected to the server - main information are its net address to send him orders from web users - and drones which are connected to this ivy bus -
    SessionManager - Class in nl.justobjects.pushlet.core
    Manages lifecycle of Sessions.
    setAddress(InetAddress) - -Method in class pow.ivyclient.BusIvy_ -
      -
    setBusIvy(BusIvy_) - -Method in class pow.webserver.SessionIvy -
    store the information of the ivy bus into the ivy session -
    setDebug(boolean) - -Method in class nl.justobjects.pushlet.client.PushletClient -
      -
    setField(String, String) - -Method in class nl.justobjects.pushlet.core.Event -
      -
    setField(String, int) - -Method in class nl.justobjects.pushlet.core.Event -
      -
    setField(String, long) - -Method in class nl.justobjects.pushlet.core.Event -
      -
    setHostnameVerification(boolean) - -Method in class pow.webserver.StrictSSLProtocolSocketFactory -
    Set the host name verification flag. -
    setIvyInetAddress(InetAddress) - -Method in class pow.webserver.SessionIvy -
    set the ip adress of the ivy bus host -
    setLevel(int) - -Method in class nl.justobjects.pushlet.util.DefaultLogger -
    Set log level -
    setLevel(int) - -Static method in class nl.justobjects.pushlet.util.Log -
    Set log level -
    setLevel(int) - -Method in class nl.justobjects.pushlet.util.Log4jLogger -
      -
    setLevel(int) - -Method in interface nl.justobjects.pushlet.util.PushletLogger -
    Set log level -
    setMode(String) - -Method in class nl.justobjects.pushlet.core.Subscriber -
      -
    setNoCacheHeaders(HttpServletResponse) - -Static method in class nl.justobjects.pushlet.util.Servlets -
    Set HTTP headers to prevent caching. -
    setNom(String) - -Method in class pow.webserver.User -
    specify the login of the user -
    setOrder(DbOrder) - -Method in class pow.webserver.IvyMsg -
    specify how to store the message in database -
    setProxyOptions(String, String, String, String, String, String) - -Method in class nl.justobjects.pushlet.client.PushletClient -
    Set proxy options and optional proxy authentication. -
    setPwd(String) - -Method in class pow.webserver.User -
    specify the user password, it's not stored in clear (md5 hash) -
    setReLogged(boolean) - -Method in class pow.ivyclient.IvyIHM -
    specify whether the module should reconnected or not -
    setResponseEvent(Event) - -Method in class nl.justobjects.pushlet.core.Command -
    Set pushlet response event. -
    setRights(Rights) - -Method in class pow.webserver.User -
    specify the type of right granted to the user -
    setServletContext(ServletContext) - -Method in interface nl.justobjects.pushlet.core.EventSource -
      -
    setServletContext(ServletContext) - -Method in class pow.webserver.Serveur.IvyEventSource -
    method qui renseigne la source sur la servlet qui l'a appelé - modification de la librairie pushlet - Pushlet.java - EventSource.java - EventSourceManager.java -
    setStorage() - -Method in class pow.ivyclient.Ivy2Udp -
    initiate the object which allow to store information about drones -
    setUserAgent(String) - -Method in class nl.justobjects.pushlet.core.Session -
    Set client HTTP UserAgent. -
    SGBDfeeder - Class in pow.webserver
    thread which waits for ivy messages sent by event source (serveur.java) - and stores them into a mysql database - the ivy messages are extracted from a blocking queue (fifo) - parameter of the database are extracted from conf file
    SGBDfeeder(String, String, String, DbMode) - -Constructor for class pow.webserver.SGBDfeeder -
    create a thread which fill the database with the message it extracts from the fifo -
    SOFTWARE_VERSION - -Static variable in class nl.justobjects.pushlet.Version -
    Version info extracted from the .jar manifest file (see build.xml and build.properties). -
    SOURCES_ACTIVATE - -Static variable in interface nl.justobjects.pushlet.core.ConfigDefs -
      -
    SSLUtilities - Class in pow.webserver
    This class provide various static methods that relax X509 certificate and - hostname verification while using the SSL over the HTTP protocol.
    SSLUtilities() - -Constructor for class pow.webserver.SSLUtilities -
      -
    SSLUtilities._FakeHostnameVerifier - Class in pow.webserver
    Deprecated. see SSLUtilities.FakeHostnameVerifier.
    SSLUtilities._FakeHostnameVerifier() - -Constructor for class pow.webserver.SSLUtilities._FakeHostnameVerifier -
    Deprecated.   -
    SSLUtilities._FakeX509TrustManager - Class in pow.webserver
    Deprecated. see SSLUtilities.FakeX509TrustManager.
    SSLUtilities._FakeX509TrustManager() - -Constructor for class pow.webserver.SSLUtilities._FakeX509TrustManager -
    Deprecated.   -
    SSLUtilities.FakeHostnameVerifier - Class in pow.webserver
    This class implements a fake hostname verificator, trusting any host - name.
    SSLUtilities.FakeHostnameVerifier() - -Constructor for class pow.webserver.SSLUtilities.FakeHostnameVerifier -
      -
    SSLUtilities.FakeX509TrustManager - Class in pow.webserver
    This class allow any X509 certificates to be used to authenticate the - remote side of a secure socket, including self-signed certificates.
    SSLUtilities.FakeX509TrustManager() - -Constructor for class pow.webserver.SSLUtilities.FakeX509TrustManager -
      -
    start() - -Method in class nl.justobjects.pushlet.core.BrowserAdapter -
    Generic init. -
    start() - -Method in interface nl.justobjects.pushlet.core.ClientAdapter -
    Start event push. -
    start() - -Method in class nl.justobjects.pushlet.core.Dispatcher -
    Start Dispatcher. -
    start() - -Method in class nl.justobjects.pushlet.core.EventPullSource -
      -
    start(String, ServletContext) - -Static method in class nl.justobjects.pushlet.core.EventSourceManager -
    Initialize event sources from properties file. -
    start() - -Method in class nl.justobjects.pushlet.core.Session -
      -
    start() - -Method in class nl.justobjects.pushlet.core.SessionManager -
    Starts us. -
    start() - -Method in class nl.justobjects.pushlet.core.Subscriber -
      -
    START_DOCUMENT - -Static variable in class nl.justobjects.pushlet.core.BrowserAdapter -
      -
    startHeartBeat() - -Method in class pow.ivyclient.Ivy2Udp -
    create a thread which send heart beat message to the server -
    stop() - -Method in class nl.justobjects.pushlet.core.BrowserAdapter -
    End HTML page in client browser. -
    stop() - -Method in interface nl.justobjects.pushlet.core.ClientAdapter -
    Stop event push. -
    stop() - -Method in class nl.justobjects.pushlet.core.Dispatcher -
    Stop Dispatcher. -
    stop() - -Method in class nl.justobjects.pushlet.core.EventPullSource -
    Stop the event generator thread. -
    stop() - -Method in interface nl.justobjects.pushlet.core.EventSource -
    Halt the event source. -
    stop() - -Static method in class nl.justobjects.pushlet.core.EventSourceManager -
    Halt event sources. -
    stop() - -Method in class nl.justobjects.pushlet.core.Session -
      -
    stop() - -Method in class nl.justobjects.pushlet.core.SessionManager -
    Stopis us. -
    stop() - -Method in class nl.justobjects.pushlet.core.Subscriber -
      -
    stop() - -Method in class pow.webserver.Serveur.IvyEventSource -
    Desactivate the event source. -
    stop_thread() - -Method in class pow.ivyclient.HeartBeat -
    stop the heartbeat thread by ending the infinite loop -
    stop_thread() - -Method in class pow.ivyclient.Ivy2Udp -
    stop all the thread Ivy2Udp , HeartBeat and ivy2UdpWriting -
    stop_thread() - -Method in class pow.webserver.HeartBeat -
    stop the heartbeat process of the server -
    stopListen() - -Method in class nl.justobjects.pushlet.client.PushletClient -
    Stop the listener. -
    StrictSSLProtocolSocketFactory - Class in pow.webserver
    A SecureProtocolSocketFactory that uses JSSE to create - SSL sockets.
    StrictSSLProtocolSocketFactory(boolean) - -Constructor for class pow.webserver.StrictSSLProtocolSocketFactory -
    Constructor for StrictSSLProtocolSocketFactory. -
    StrictSSLProtocolSocketFactory() - -Constructor for class pow.webserver.StrictSSLProtocolSocketFactory -
    Constructor for StrictSSLProtocolSocketFactory. -
    SUBJECT_META - -Static variable in interface nl.justobjects.pushlet.core.Protocol -
      -
    SUBJECT_META_JOINS - -Static variable in interface nl.justobjects.pushlet.core.Protocol -
      -
    SUBJECT_META_SUBS - -Static variable in interface nl.justobjects.pushlet.core.Protocol -
      -
    SUBJECT_SEPARATOR - -Static variable in class nl.justobjects.pushlet.core.Subscription -
      -
    subscribe(String, String) - -Method in class nl.justobjects.pushlet.client.PushletClient -
    Subscribes, returning subscription id. -
    subscribe(String) - -Method in class nl.justobjects.pushlet.client.PushletClient -
    Subscribes, returning subscription id. -
    Subscriber - Class in nl.justobjects.pushlet.core
    Handles data channel between dispatcher and client.
    SUBSCRIBER_CLASS - -Static variable in interface nl.justobjects.pushlet.core.ConfigDefs -
      -
    Subscription - Class in nl.justobjects.pushlet.core
    Represents single subject subscription
    SUBSCRIPTION_CLASS - -Static variable in interface nl.justobjects.pushlet.core.ConfigDefs -
      -
    Sys - Class in nl.justobjects.pushlet.util
    Utilities that interact with the underlying OS/JVM.
    Sys() - -Constructor for class nl.justobjects.pushlet.util.Sys -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E F G H I J K L M N O P Q R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-2.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-2.html deleted file mode 100755 index ef7517cb32..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-2.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - -B-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -B

    -
    -
    bindMsg2Ivy() - -Method in class pow.ivyclient.Ivy2Udp -
    This method binds the object to some messages - of the bus Ivy. -
    BusIvy_ - Class in pow.ivyclient
    inner representation of an ivy bus - store the drones' information about the drones which belong to this ivy bus - store the IP adress of the machine where the ivy bus is working
    BusIvy_() - -Constructor for class pow.ivyclient.BusIvy_ -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-20.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-20.html deleted file mode 100755 index fa92eac20e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-20.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - -T-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E F G H I J K L M N O P Q R S T U V W
    -

    -T

    -
    -
    toQueryString() - -Method in class nl.justobjects.pushlet.core.Event -
    Convert to HTTP query string. -
    toString() - -Method in class nl.justobjects.pushlet.core.Controller -
      -
    toString() - -Method in class nl.justobjects.pushlet.core.Event -
      -
    toString() - -Method in class nl.justobjects.pushlet.core.Session -
      -
    toString() - -Method in class nl.justobjects.pushlet.core.Subscriber -
      -
    toString() - -Method in exception nl.justobjects.pushlet.util.PushletException -
      -
    toString() - -Method in class pow.ivyclient.AcNetId -
    return information about the drone in a string format -
    toString() - -Method in exception pow.ivyclient.IvyConnectionExeption -
    display the exception on stdout -
    toString() - -Method in exception pow.webserver.AlreadyRegisteredUserException -
      -
    toXML(boolean) - -Method in class nl.justobjects.pushlet.core.Event -
      -
    toXML() - -Method in class nl.justobjects.pushlet.core.Event -
      -
    trace(String) - -Method in class nl.justobjects.pushlet.util.DefaultLogger -
    Log message for trace level. -
    trace(String) - -Static method in class nl.justobjects.pushlet.util.Log -
    Log message for trace level. -
    trace(String) - -Method in class nl.justobjects.pushlet.util.Log4jLogger -
      -
    trace(String) - -Method in interface nl.justobjects.pushlet.util.PushletLogger -
    Log message for trace level. -
    trustAllHostnames() - -Static method in class pow.webserver.SSLUtilities -
    Set the default Hostname Verifier to an instance of a fake class that - trust all hostnames. -
    trustAllHttpsCertificates() - -Static method in class pow.webserver.SSLUtilities -
    Set the default X509 Trust Manager to an instance of a fake class that - trust all certificates, even the self-signed ones. -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E F G H I J K L M N O P Q R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-21.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-21.html deleted file mode 100755 index 2f01bc8594..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-21.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - -U-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E F G H I J K L M N O P Q R S T U V W
    -

    -U

    -
    -
    unicast(Event, String) - -Method in class nl.justobjects.pushlet.core.Dispatcher -
    Send event to specific subscriber. -
    unserialize(String) - -Static method in class pow.webserver.UserTab -
    load the object from a file -
    unsubscribe(String) - -Method in class nl.justobjects.pushlet.client.PushletClient -
    Unsubscribes with subscription id. -
    unsubscribe() - -Method in class nl.justobjects.pushlet.client.PushletClient -
    Unsubscribes from all subjects. -
    updateTime() - -Method in class pow.ivyclient.BusIvy_ -
    update the 'inner clock' of the object when a message for this bus is detected - useful to know if the bus is still alive -
    uploadConfFile(AcNetId) - -Method in class pow.ivyclient.AcNetIdStorage -
    upload de fichier de conf sur le serveur - verifier que ca marche sur long fichier - si probleme changer avec : - factory.setSizeThreshold(yourMaxMemorySize); - factory.setRepository(yourTempDirectory); - upload.setSizeMax(yourMaxRequestSize); -
    User - Class in pow.webserver
    represents a ivy or a web user account - for the web user the account nest also the list of drones that the user can control - the list contains the ivy name of the drone (MJ5, TJ1...).
    User(String, String, Rights) - -Constructor for class pow.webserver.User -
    create a user account -
    UserTab - Class in pow.webserver
    User objects are stored in a UserTab object which can be serialized in a file on the server disk
    UserTab() - -Constructor for class pow.webserver.UserTab -
    create a empty list of users -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E F G H I J K L M N O P Q R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-22.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-22.html deleted file mode 100755 index 1f47703d80..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-22.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - -V-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E F G H I J K L M N O P Q R S T U V W
    -

    -V

    -
    -
    valueOf(String) - -Static method in enum pow.ivyclient.AcStatus -
    Returns the enum constant of this type with the specified name. -
    valueOf(String) - -Static method in enum pow.webserver.DbMode -
    Returns the enum constant of this type with the specified name. -
    valueOf(String) - -Static method in enum pow.webserver.DbOrder -
    Returns the enum constant of this type with the specified name. -
    valueOf(String) - -Static method in enum pow.webserver.Rights -
    Returns the enum constant of this type with the specified name. -
    values() - -Static method in enum pow.ivyclient.AcStatus -
    Returns an array containing the constants of this enum type, in -the order they are declared. -
    values() - -Static method in enum pow.webserver.DbMode -
    Returns an array containing the constants of this enum type, in -the order they are declared. -
    values() - -Static method in enum pow.webserver.DbOrder -
    Returns an array containing the constants of this enum type, in -the order they are declared. -
    values() - -Static method in enum pow.webserver.Rights -
    Returns an array containing the constants of this enum type, in -the order they are declared. -
    verify(String, String) - -Method in class pow.webserver.SSLUtilities._FakeHostnameVerifier -
    Deprecated. Always return true, indicating that the host name is an - acceptable match with the server's authentication scheme. -
    verify(String, SSLSession) - -Method in class pow.webserver.SSLUtilities.FakeHostnameVerifier -
    Always return true, indicating that the host name is - an acceptable match with the server's authentication scheme. -
    Version - Class in nl.justobjects.pushlet
    Version info class.
    Version() - -Constructor for class nl.justobjects.pushlet.Version -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E F G H I J K L M N O P Q R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-23.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-23.html deleted file mode 100755 index 0fbdc3afaf..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-23.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - -W-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E F G H I J K L M N O P Q R S T U V W
    -

    -W

    -
    -
    warn(String) - -Method in class nl.justobjects.pushlet.core.Session -
    Exceptional print util. -
    warn(String) - -Method in class nl.justobjects.pushlet.util.DefaultLogger -
    Log message for warning level. -
    warn(String, Throwable) - -Method in class nl.justobjects.pushlet.util.DefaultLogger -
    Log message for warning level with exception. -
    warn(String) - -Static method in class nl.justobjects.pushlet.util.Log -
    Log message for warning level. -
    warn(String, Throwable) - -Static method in class nl.justobjects.pushlet.util.Log -
    Log message for warning level with exception. -
    warn(String) - -Method in class nl.justobjects.pushlet.util.Log4jLogger -
      -
    warn(String, Throwable) - -Method in class nl.justobjects.pushlet.util.Log4jLogger -
      -
    warn(String) - -Method in interface nl.justobjects.pushlet.util.PushletLogger -
    Log message for warning level. -
    warn(String, Throwable) - -Method in interface nl.justobjects.pushlet.util.PushletLogger -
    Log message for warning level with exception. -
    write(String) - -Method in class pow.webserver.Log -
    write a string in log file and on stdout -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E F G H I J K L M N O P Q R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-3.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-3.html deleted file mode 100755 index fb7a78756a..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-3.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - -C-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -C

    -
    -
    canControl(String) - -Method in class pow.webserver.User -
    inform whether the user can pilot a drone or not -
    checkClientTrusted(X509Certificate[], String) - -Method in class pow.webserver.SSLUtilities.FakeX509TrustManager -
    Always trust for client SSL chain peer certificate - chain with any authType authentication types. -
    checkServerTrusted(X509Certificate[], String) - -Method in class pow.webserver.SSLUtilities.FakeX509TrustManager -
    Always trust for server SSL chain peer certificate - chain with any authType exchange algorithm types. -
    checkUser(String, String) - -Method in class pow.webserver.UserTab -
    Check if the password of the user having the specified login is correct -
    clearListDrone() - -Method in class pow.webserver.User -
    reset the list of drone that the web user can control -
    Conf - Class in pow.webserver
    store useful data about the server configuration - and database connection by - reading a specific file place in the 'conf' folder of - the web application
    Conf(String, String) - -Constructor for class pow.webserver.Conf -
      -
    createSocket(String, int, InetAddress, int) - -Method in class pow.webserver.StrictSSLProtocolSocketFactory -
      -
    createSocket(String, int, InetAddress, int, HttpConnectionParams) - -Method in class pow.webserver.StrictSSLProtocolSocketFactory -
    Attempts to get a new socket connection to the given host within the given time limit. -
    createSocket(String, int) - -Method in class pow.webserver.StrictSSLProtocolSocketFactory -
      -
    createSocket(Socket, String, int, boolean) - -Method in class pow.webserver.StrictSSLProtocolSocketFactory -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-4.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-4.html deleted file mode 100755 index 75db18322f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-4.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - -D-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -D

    -
    -
    DbMode - Enum in pow.webserver
    specify how the database works
    DbOrder - Enum in pow.webserver
    represents 4 kind of message stored in database - CONNECT first connection of an ivy bus --> inform db - DECONNECT ivy bus deconnected --> inform db - ADD add message to db
    decrypt(byte[]) - -Method in class pow.AES -
    decrypt a byte array with AES algorithm - see @link org.apache.commons.codec.binary.Hex to convert byte Array into hexString -
    displayDrones() - -Method in class pow.ivyclient.BusIvy_ -
    display information on stdout about the drones present on the bus -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-5.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-5.html deleted file mode 100755 index 5d453456a1..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-5.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - -E-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -E

    -
    -
    encode(String) - -Static method in class pow.webserver.Md5 -
      -
    encrypt(byte[]) - -Method in class pow.AES -
    encrypt a byte array with AES algorithm -
    equals(Object) - -Method in class pow.webserver.StrictSSLProtocolSocketFactory -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-6.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-6.html deleted file mode 100755 index 4aa4bb7cdb..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-6.html +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - -G-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -G

    -
    -
    getAcceptedIssuers() - -Method in class pow.webserver.SSLUtilities._FakeX509TrustManager -
    Deprecated. Return an empty array of certificate authority certificates which - are trusted for authenticating peers. -
    getAcceptedIssuers() - -Method in class pow.webserver.SSLUtilities.FakeX509TrustManager -
    Return an empty array of certificate authority certificates which - are trusted for authenticating peers. -
    getAcIvyId(int) - -Method in class pow.ivyclient.AcNetIdStorage -
    do the link between the id of the drone on the web and is true id on its ivy bus -
    getAcNetId(String) - -Method in class pow.ivyclient.AcNetIdStorage -
    Return the identity object of the drone on the web -
    getAddress() - -Method in class pow.ivyclient.BusIvy_ -
    provides the IP adress of the host hosting the bus -
    getBusIvy() - -Method in class pow.webserver.SessionIvy -
      -
    getCipher() - -Method in class pow.webserver.SessionIvy -
      -
    getColor() - -Method in class pow.ivyclient.AcNetId -
    provides the color of the drone on the GCS view -
    getDataBaseName() - -Method in class pow.webserver.Conf -
      -
    getDataEventTimeoutTime() - -Method in class pow.webserver.Conf -
      -
    getDbMode() - -Method in class pow.webserver.Conf -
      -
    getDBPassword() - -Method in class pow.webserver.Conf -
      -
    getDBUserName() - -Method in class pow.webserver.Conf -
      -
    getDieEventTimeoutTime() - -Method in class pow.webserver.Conf -
      -
    getDrones() - -Method in class pow.ivyclient.BusIvy_ -
    get a array list containing the ivy id of the drones present on the bus -
    getHostnameVerification() - -Method in class pow.webserver.StrictSSLProtocolSocketFactory -
    Gets the status of the host name verification flag. -
    getIdOnIvy() - -Method in class pow.ivyclient.AcNetId -
    provides the id of the drone on the ivy bus -
    getIdOnWeb() - -Method in class pow.ivyclient.AcNetId -
    provides the id of the drone on the web -
    getItrUsr(String) - -Method in class pow.webserver.UserTab -
    return the list of all drone which may be controlled by the user -
    getIvyInetAddress() - -Method in class pow.webserver.SessionIvy -
      -
    getIvyMsg() - -Method in class pow.webserver.IvyMsg -
      -
    getIvyWebId() - -Method in class pow.ivyclient.Ivy2Udp -
    return the id of the bus for the server - this id is provided by the server and is unique -
    getKey() - -Method in class pow.AES -
    get the cipher key -
    getListDrone() - -Method in class pow.webserver.User -
    the list of drone that the web user can control -
    getLogin() - -Method in class pow.webserver.SessionIvy -
      -
    getLogin() - -Method in class pow.webserver.User -
      -
    getLoginIterator() - -Method in class pow.webserver.UserTab -
      -
    getName() - -Method in class pow.ivyclient.AcNetId -
    provides the name of the drone on the ivy bus -
    getNewDroneWebId(String) - -Method in class pow.ivyclient.AcNetIdStorage -
    ask a unique new web id to the server for a new drone detected on the ivy bus -
    getNumMsg() - -Method in class pow.webserver.IvyMsg -
      -
    getOrder() - -Method in class pow.webserver.IvyMsg -
      -
    getOrderResponseTimeout() - -Method in class pow.webserver.Conf -
      -
    getParamsEncrypt() - -Method in class pow.AES -
    get the init parameter of the cipher object in order to initialyse correctly a - remote cipher -
    getPassword() - -Method in class pow.webserver.User -
      -
    getPlnPath() - -Method in class pow.ivyclient.AcNetId -
    provides the path of the xml file (on the server) containing - the information of the flightplan of the drone - (waypoints and blocks of instructions) -
    getQueueFIFO() - -Method in class pow.webserver.SGBDfeeder -
      -
    getRights() - -Method in class pow.webserver.User -
      -
    getServerName() - -Method in class pow.ivyclient.PowUrl -
    provides the server name to which the module is connected -
    getSetItr() - -Method in class pow.webserver.User -
      -
    getSettingPath() - -Method in class pow.ivyclient.AcNetId -
    provides the path of the xml file (on the server) containing the settings - of the drone -
    getSocketTimeout() - -Method in class pow.webserver.Conf -
      -
    getStorage() - -Method in class pow.ivyclient.Ivy2Udp -
    provides the structure where data about the drone present on the ivy bus are stored -
    getTime2checkDeadBuses() - -Method in class pow.webserver.Conf -
      -
    getTime2resetFilter() - -Method in class pow.webserver.Conf -
      -
    getTimeMsg() - -Method in class pow.webserver.IvyMsg -
      -
    getTimeToSendValues() - -Method in class pow.webserver.Conf -
      -
    getUdpSize() - -Method in class pow.webserver.Conf -
      -
    getWebId() - -Method in class pow.ivyclient.Ivy2Udp -
    request a single id for the bus to the web server - method get - see @link http://hc.apache.org/httpclient-3.x/tutorial.html - see @link blogs.sun.com/gc/entry/unable_to_find_valid_certification - see @link http://blogs.sun.com/andreas/entry/no_more_unable_to_find -
    getWebId(String) - -Method in class pow.webserver.Ivy2TomcatHttpServer -
    contact database if any to have a new webid -
    getWebId() - -Method in class pow.webserver.IvyMsg -
      -
    getWebId() - -Method in class pow.webserver.SessionIvy -
      -
    getWebUrl() - -Method in class pow.ivyclient.PowUrl -
    provides the complete URL to log on the POW server -
    Greeting - Class in pow.webserver
    Servlet implementation class Greeting - Handles the connection request from a new web client - check the login's information and rights
    Greeting() - -Constructor for class pow.webserver.Greeting -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-7.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-7.html deleted file mode 100755 index 00c9ae97ef..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-7.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - -H-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -H

    -
    -
    hashCode() - -Method in class pow.webserver.StrictSSLProtocolSocketFactory -
      -
    HeartBeat - Class in pow.ivyclient
    thread which send a periodic message to a client or server to say that the connection - is still alive (period has to be less than the socket timeout of the the server)
    HeartBeat(AES, int, InetAddress, int, long) - -Constructor for class pow.ivyclient.HeartBeat -
    define the parameter of the heartbeat message -
    HeartBeat - Class in pow.webserver
     
    HeartBeat(ServletContext, int, int) - -Constructor for class pow.webserver.HeartBeat -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-8.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-8.html deleted file mode 100755 index 381dcb3fdc..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-8.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - -I-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -I

    -
    -
    init(ServletConfig) - -Method in class pow.webserver.AjaxRqst -
    init the servlet -
    init(ServletConfig) - -Method in class pow.webserver.Greeting -
      -
    init(ServletConfig) - -Method in class pow.webserver.Ivy2TomcatHttpServer -
      -
    insert(User) - -Method in class pow.webserver.UserTab -
    insert a user in the list -
    InstallCert - Class in pow
    query the server about its certificate and create a 'jssecacerts' file to copy - into /usr/lib/jvm/java-x-x/jre/lib/security - allow a java http client to connect to https server
    InstallCert() - -Constructor for class pow.InstallCert -
      -
    isAlive() - -Method in class pow.ivyclient.BusIvy_ -
    inform if the bus is alive -
    isClientTrusted(X509Certificate[]) - -Method in class pow.webserver.SSLUtilities._FakeX509TrustManager -
    Deprecated. Always return true, trusting for client SSL - chain peer certificate chain. -
    isInside(String) - -Method in class pow.webserver.UserTab -
    check if an user with this logging exists yet -
    isNew(String) - -Method in class pow.ivyclient.MsgFilter -
    inform whether the message is new or not -
    isOwnBy(int) - -Method in class pow.ivyclient.BusIvy_ -
    inform if a drone is present or not on the bus -
    IsPwdTrue(String) - -Method in class pow.webserver.User -
    check if the password given in argument corresponds to the password user -
    isServerTrusted(X509Certificate[]) - -Method in class pow.webserver.SSLUtilities._FakeX509TrustManager -
    Deprecated. Always return true, trusting for server SSL - chain peer certificate chain. -
    Ivy2TomcatHttpServer - Class in pow.webserver
    Handles the connection request from a new ivy bus - provide a unique id for the ivy bus - provide a unique id for each new drone on a ivy bus - handles the uploading of the configuration files for each new drone on a ivy bus
    Ivy2TomcatHttpServer() - -Constructor for class pow.webserver.Ivy2TomcatHttpServer -
      -
    Ivy2Udp - Class in pow.ivyclient
    It contact the server to get an identifier, some configuration parameter and - the key to encrypt and decrypt messages.
    Ivy2Udp(IvyIHM, PowUrl, String, String) - -Constructor for class pow.ivyclient.Ivy2Udp -
    create an object which listens on the local ivy bus and send messages to the server -
    Ivy2UdpWriting - Class in pow.ivyclient
    This class aims to give order to the drones according to the datagrams it - receive from the web
    IvyConnectionExeption - Exception in pow.ivyclient
     
    IvyConnectionExeption(String) - -Constructor for exception pow.ivyclient.IvyConnectionExeption -
    create an ivy exception with a particular message -
    IvyIHM - Class in pow.ivyclient
    represent the interface for a ivy user who wants to connect a bus ivy to - the web server
    IvyIHM() - -Constructor for class pow.ivyclient.IvyIHM -
    construct the interface -
    IvyMsg - Class in pow.webserver
    represents information which are sended by the source event to the database on the queue fifo
    IvyMsg(int, long, String, String, DbOrder) - -Constructor for class pow.webserver.IvyMsg -
      -
    IvyMsg(int, long, String, String) - -Constructor for class pow.webserver.IvyMsg -
      -
    IvyMsg(int) - -Constructor for class pow.webserver.IvyMsg -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-9.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-9.html deleted file mode 100755 index a1977be29b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index-files/index-9.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - -K-Index - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    -

    -K

    -
    -
    kill() - -Method in class pow.webserver.SGBDfeeder -
    stop the thread by ending run method - used caused Thread.stop is now deprecated -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -A B C D E G H I K L M P R S T U V W
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index.html deleted file mode 100755 index 3e4fc5343b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/index.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -Generated Documentation (Untitled) - - - - - - - - - - - -<H2> -Frame Alert</H2> - -<P> -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. -<BR> -Link to<A HREF="overview-summary.html">Non-frame version.</A> - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/Version.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/Version.html deleted file mode 100755 index b99c8fc894..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/Version.html +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - -Version - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet -
    -Class Version

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.Version
    -
    -
    -
    -
    public class Version
    extends java.lang.Object
    - - -

    -Version info class. - -

    Purpose

    - Extract version info from jar manifest file. -

    - -

    -

    -
    Version:
    -
    $Id: Version.java,v 1.4 2006/05/06 00:10:11 justb Exp $
    -
    Author:
    -
    Just van den Broecke
    -
    -
    - -

    - - - - - - - - - - - - - - - -
    -Field Summary
    -static java.lang.StringBUILD_DATE - -
    -           
    -static java.lang.StringSOFTWARE_VERSION - -
    -          Version info extracted from the .jar manifest file (see build.xml and build.properties).
    -  - - - - - - - - - - -
    -Constructor Summary
    Version() - -
    -           
    -  - - - - - - - -
    -Method Summary
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Field Detail
    - -

    -SOFTWARE_VERSION

    -
    -public static final java.lang.String SOFTWARE_VERSION
    -
    -
    Version info extracted from the .jar manifest file (see build.xml and build.properties). -

    -

    -
    -
    -
    - -

    -BUILD_DATE

    -
    -public static final java.lang.String BUILD_DATE
    -
    -
    -
    -
    - - - - - - - - -
    -Constructor Detail
    - -

    -Version

    -
    -public Version()
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/class-use/Version.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/class-use/Version.html deleted file mode 100755 index 3c6002aceb..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/class-use/Version.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.Version - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.Version

    -
    -No usage of nl.justobjects.pushlet.Version -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/PushletClient.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/PushletClient.html deleted file mode 100755 index 3a1bfe9e6f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/PushletClient.html +++ /dev/null @@ -1,696 +0,0 @@ - - - - - - -PushletClient - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.client -
    -Class PushletClient

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.client.PushletClient
    -
    -
    -
    All Implemented Interfaces:
    Protocol
    -
    -
    -
    -
    public class PushletClient
    extends java.lang.Object
    implements Protocol
    - - -

    -Client API for Java HTTP client applets or apps. -

    - Use this class within Java client applications or applets. - Implement a PushletClientListener to receive callbacks for - data-related Event objects pushed by the server. -

    - This class may also be used as a base class and be extended - for custom clients, hence the presence of many proteced methods. -

    - -

    -

    -
    Version:
    -
    $Id: PushletClient.java,v 1.19 2009/06/04 12:46:35 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    See Also:
    PushletClientListener, -nl.justobjects.pushlet.test.PushletApplet, -nl.justobjects.pushlet.test.PushletPingApplication
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.Protocol
    DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
    -  - - - - - - - - - - - - - -
    -Constructor Summary
    PushletClient(java.lang.String aPushletURL) - -
    -          Constructor with full pushlet URL.
    PushletClient(java.lang.String aHost, - int aPort) - -
    -          Constructor with host and port using default URI.
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidjoin() - -
    -          Join server, starts session.
    - voidjoinListen(PushletClientListener aListener, - java.lang.String aMode, - java.lang.String aSubject) - -
    -          Immediate listener: joins/subscribes and listens in one action.
    - voidleave() - -
    -          Leave server, stops session.
    - voidlisten(PushletClientListener aListener) - -
    -          Open data channel.
    - voidlisten(PushletClientListener aListener, - java.lang.String aMode) - -
    -          Open data channel in stream or push mode.
    - voidlisten(PushletClientListener aListener, - java.lang.String aMode, - java.lang.String aSubject) - -
    -          Open data channel in stream or push mode with a subject.
    - voidpublish(java.lang.String aSubject, - java.util.Map theAttributes) - -
    -          Publish an event through server.
    - voidsetDebug(boolean b) - -
    -           
    - voidsetProxyOptions(java.lang.String aProxyHost, - java.lang.String aProxyPort, - java.lang.String theNonProxyHosts, - java.lang.String aUserName, - java.lang.String aPassword, - java.lang.String anNTLMDomain) - -
    -          Set proxy options and optional proxy authentication.
    - voidstopListen() - -
    -          Stop the listener.
    - java.lang.Stringsubscribe(java.lang.String aSubject) - -
    -          Subscribes, returning subscription id.
    - java.lang.Stringsubscribe(java.lang.String aSubject, - java.lang.String aLabel) - -
    -          Subscribes, returning subscription id.
    - voidunsubscribe() - -
    -          Unsubscribes from all subjects.
    - voidunsubscribe(java.lang.String aSubscriptionId) - -
    -          Unsubscribes with subscription id.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -PushletClient

    -
    -public PushletClient(java.lang.String aPushletURL)
    -
    -
    Constructor with full pushlet URL. -

    -

    -
    - -

    -PushletClient

    -
    -public PushletClient(java.lang.String aHost,
    -                     int aPort)
    -
    -
    Constructor with host and port using default URI. -

    -

    - - - - - - - - -
    -Method Detail
    - -

    -setProxyOptions

    -
    -public void setProxyOptions(java.lang.String aProxyHost,
    -                            java.lang.String aProxyPort,
    -                            java.lang.String theNonProxyHosts,
    -                            java.lang.String aUserName,
    -                            java.lang.String aPassword,
    -                            java.lang.String anNTLMDomain)
    -
    -
    Set proxy options and optional proxy authentication. -

    - Contributed by Dele Olajide - See http://groups.yahoo.com/group/pushlet/message/634 -

    - Usage: - PushletClient pushletClient = new PushletClient("http:://www.domain.com/pushlet"); - pushletClient.setProxyOptions("proxy.bla.com", "8080", ....); -

    - use pushletClient further as normal -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -join

    -
    -public void join()
    -          throws PushletException
    -
    -
    Join server, starts session. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -leave

    -
    -public void leave()
    -           throws PushletException
    -
    -
    Leave server, stops session. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -listen

    -
    -public void listen(PushletClientListener aListener)
    -            throws PushletException
    -
    -
    Open data channel. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -listen

    -
    -public void listen(PushletClientListener aListener,
    -                   java.lang.String aMode)
    -            throws PushletException
    -
    -
    Open data channel in stream or push mode. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -listen

    -
    -public void listen(PushletClientListener aListener,
    -                   java.lang.String aMode,
    -                   java.lang.String aSubject)
    -            throws PushletException
    -
    -
    Open data channel in stream or push mode with a subject. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -joinListen

    -
    -public void joinListen(PushletClientListener aListener,
    -                       java.lang.String aMode,
    -                       java.lang.String aSubject)
    -                throws PushletException
    -
    -
    Immediate listener: joins/subscribes and listens in one action. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -publish

    -
    -public void publish(java.lang.String aSubject,
    -                    java.util.Map theAttributes)
    -             throws PushletException
    -
    -
    Publish an event through server. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -subscribe

    -
    -public java.lang.String subscribe(java.lang.String aSubject,
    -                                  java.lang.String aLabel)
    -                           throws PushletException
    -
    -
    Subscribes, returning subscription id. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -subscribe

    -
    -public java.lang.String subscribe(java.lang.String aSubject)
    -                           throws PushletException
    -
    -
    Subscribes, returning subscription id. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -unsubscribe

    -
    -public void unsubscribe(java.lang.String aSubscriptionId)
    -                 throws PushletException
    -
    -
    Unsubscribes with subscription id. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -unsubscribe

    -
    -public void unsubscribe()
    -                 throws PushletException
    -
    -
    Unsubscribes from all subjects. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -stopListen

    -
    -public void stopListen()
    -                throws PushletException
    -
    -
    Stop the listener. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -setDebug

    -
    -public void setDebug(boolean b)
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/PushletClientListener.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/PushletClientListener.html deleted file mode 100755 index dc0dc06a3d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/PushletClientListener.html +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - -PushletClientListener - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.client -
    -Interface PushletClientListener

    -
    -
    All Superinterfaces:
    Protocol
    -
    -
    -
    -
    public interface PushletClientListener
    extends Protocol
    - - -

    -Interface for listener of the PushletClient object. -

    - -

    -

    -
    Version:
    -
    $Id: PushletClientListener.java,v 1.5 2005/02/21 11:50:37 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.Protocol
    DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
    -  - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidonAbort(Event theEvent) - -
    -          Abort event from server.
    - voidonData(Event theEvent) - -
    -          Data event from server.
    - voidonError(java.lang.String message) - -
    -          Error occurred.
    - voidonHeartbeat(Event theEvent) - -
    -          Heartbeat event from server.
    -  -

    - - - - - - - - -
    -Method Detail
    - -

    -onAbort

    -
    -void onAbort(Event theEvent)
    -
    -
    Abort event from server. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -onData

    -
    -void onData(Event theEvent)
    -
    -
    Data event from server. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -onHeartbeat

    -
    -void onHeartbeat(Event theEvent)
    -
    -
    Heartbeat event from server. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -onError

    -
    -void onError(java.lang.String message)
    -
    -
    Error occurred. -

    -

    -
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/class-use/PushletClient.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/class-use/PushletClient.html deleted file mode 100755 index ee9de5ed2a..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/class-use/PushletClient.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.client.PushletClient - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.client.PushletClient

    -
    -No usage of nl.justobjects.pushlet.client.PushletClient -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/class-use/PushletClientListener.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/class-use/PushletClientListener.html deleted file mode 100755 index 54096cc2e6..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/class-use/PushletClientListener.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - -Uses of Interface nl.justobjects.pushlet.client.PushletClientListener - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Interface
    nl.justobjects.pushlet.client.PushletClientListener

    -
    - - - - - - - - - -
    -Packages that use PushletClientListener
    nl.justobjects.pushlet.client  
    -  -

    - - - - - -
    -Uses of PushletClientListener in nl.justobjects.pushlet.client
    -  -

    - - - - - - - - - - - - - - - - - - - - - -
    Methods in nl.justobjects.pushlet.client with parameters of type PushletClientListener
    - voidPushletClient.joinListen(PushletClientListener aListener, - java.lang.String aMode, - java.lang.String aSubject) - -
    -          Immediate listener: joins/subscribes and listens in one action.
    - voidPushletClient.listen(PushletClientListener aListener) - -
    -          Open data channel.
    - voidPushletClient.listen(PushletClientListener aListener, - java.lang.String aMode) - -
    -          Open data channel in stream or push mode.
    - voidPushletClient.listen(PushletClientListener aListener, - java.lang.String aMode, - java.lang.String aSubject) - -
    -          Open data channel in stream or push mode with a subject.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/package-frame.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/package-frame.html deleted file mode 100755 index 5e670aaa30..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/package-frame.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - -nl.justobjects.pushlet.client - - - - - - - - - - - -nl.justobjects.pushlet.client - - - - -
    -Interfaces  - -
    -PushletClientListener
    - - - - - - -
    -Classes  - -
    -PushletClient
    - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/package-summary.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/package-summary.html deleted file mode 100755 index c573989e6d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/package-summary.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - -nl.justobjects.pushlet.client - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -

    -Package nl.justobjects.pushlet.client -

    - - - - - - - - - -
    -Interface Summary
    PushletClientListenerInterface for listener of the PushletClient object.
    -  - -

    - - - - - - - - - -
    -Class Summary
    PushletClientClient API for Java HTTP client applets or apps.
    -  - -

    -

    -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/package-tree.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/package-tree.html deleted file mode 100755 index ac3b686de0..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/package-tree.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - -nl.justobjects.pushlet.client Class Hierarchy - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Hierarchy For Package nl.justobjects.pushlet.client -

    -
    -
    -
    Package Hierarchies:
    All Packages
    -
    -

    -Class Hierarchy -

    -
      -
    • java.lang.Object -
    -

    -Interface Hierarchy -

    - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/package-use.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/package-use.html deleted file mode 100755 index 090031e6d3..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/client/package-use.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - -Uses of Package nl.justobjects.pushlet.client - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Package
    nl.justobjects.pushlet.client

    -
    - - - - - - - - - -
    -Packages that use nl.justobjects.pushlet.client
    nl.justobjects.pushlet.client  
    -  -

    - - - - - - - - -
    -Classes in nl.justobjects.pushlet.client used by nl.justobjects.pushlet.client
    PushletClientListener - -
    -          Interface for listener of the PushletClient object.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/BrowserAdapter.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/BrowserAdapter.html deleted file mode 100755 index f258736f54..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/BrowserAdapter.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - -BrowserAdapter - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class BrowserAdapter

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.BrowserAdapter
    -
    -
    -
    All Implemented Interfaces:
    ClientAdapter, Protocol
    -
    -
    -
    -
    public class BrowserAdapter
    extends java.lang.Object
    implements ClientAdapter, Protocol
    - - -

    -Generic implementation of ClientAdapter for browser clients. -

    - -

    -

    -
    Version:
    -
    $Id: BrowserAdapter.java,v 1.6 2007/11/09 13:15:35 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - - - - - - - - - -
    -Field Summary
    -static java.lang.StringEND_DOCUMENT - -
    -           
    -static java.lang.StringSTART_DOCUMENT - -
    -           
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.Protocol
    DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
    -  - - - - - - - - - - -
    -Constructor Summary
    BrowserAdapter(javax.servlet.http.HttpServletResponse aServletResponse) - -
    -          Constructor.
    -  - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidpush(Event anEvent) - -
    -          Push Event to client.
    - voidstart() - -
    -          Generic init.
    - voidstop() - -
    -          End HTML page in client browser.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Field Detail
    - -

    -START_DOCUMENT

    -
    -public static final java.lang.String START_DOCUMENT
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -END_DOCUMENT

    -
    -public static final java.lang.String END_DOCUMENT
    -
    -
    -
    See Also:
    Constant Field Values
    -
    - - - - - - - - -
    -Constructor Detail
    - -

    -BrowserAdapter

    -
    -public BrowserAdapter(javax.servlet.http.HttpServletResponse aServletResponse)
    -
    -
    Constructor. -

    -

    - - - - - - - - -
    -Method Detail
    - -

    -start

    -
    -public void start()
    -           throws java.io.IOException
    -
    -
    Generic init. -

    -

    -
    Specified by:
    start in interface ClientAdapter
    -
    -
    - -
    Throws: -
    java.io.IOException
    -
    -
    -
    - -

    -push

    -
    -public void push(Event anEvent)
    -          throws java.io.IOException
    -
    -
    Push Event to client. -

    -

    -
    Specified by:
    push in interface ClientAdapter
    -
    -
    - -
    Throws: -
    java.io.IOException
    -
    -
    -
    - -

    -stop

    -
    -public void stop()
    -
    -
    End HTML page in client browser. -

    -

    -
    Specified by:
    stop in interface ClientAdapter
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/ClientAdapter.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/ClientAdapter.html deleted file mode 100755 index 201dafd676..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/ClientAdapter.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - -ClientAdapter - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Interface ClientAdapter

    -
    -
    All Known Implementing Classes:
    BrowserAdapter
    -
    -
    -
    -
    public interface ClientAdapter
    - - -

    -Adapter interface for encapsulation of specific HTTP clients. -

    - -

    -

    -
    Version:
    -
    $Id: ClientAdapter.java,v 1.8 2007/11/23 14:33:07 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidpush(Event anEvent) - -
    -          Push single Event to client.
    - voidstart() - -
    -          Start event push.
    - voidstop() - -
    -          Stop event push.
    -  -

    - - - - - - - - -
    -Method Detail
    - -

    -start

    -
    -void start()
    -           throws java.io.IOException
    -
    -
    Start event push. -

    -

    - -
    Throws: -
    java.io.IOException
    -
    -
    -
    - -

    -push

    -
    -void push(Event anEvent)
    -          throws java.io.IOException
    -
    -
    Push single Event to client. -

    -

    - -
    Throws: -
    java.io.IOException
    -
    -
    -
    - -

    -stop

    -
    -void stop()
    -          throws java.io.IOException
    -
    -
    Stop event push. -

    -

    - -
    Throws: -
    java.io.IOException
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Command.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Command.html deleted file mode 100755 index 73bea47fbe..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Command.html +++ /dev/null @@ -1,425 +0,0 @@ - - - - - - -Command - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class Command

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.Command
    -
    -
    -
    All Implemented Interfaces:
    Protocol
    -
    -
    -
    -
    public class Command
    extends java.lang.Object
    implements Protocol
    - - -

    -Wraps pushlet request/response data. -

    - -

    -

    -
    Version:
    -
    $Id: Command.java,v 1.4 2007/11/23 14:33:07 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - - - - - - - - - - - - - - - - - -
    -Field Summary
    - javax.servlet.http.HttpServletRequesthttpReq - -
    -          HTTP Servlet GET/POST request.
    - javax.servlet.http.HttpServletResponsehttpRsp - -
    -          HTTP Servlet GET/POST response.
    - EventreqEvent - -
    -          Pushlet request event.
    - Sessionsession - -
    -          Pushlet session.
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.Protocol
    DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
    -  - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    -static Commandcreate(Session aSession, - Event aReqEvent, - javax.servlet.http.HttpServletRequest aHTTPReq, - javax.servlet.http.HttpServletResponse aHTTPRsp) - -
    -          Create new Command object.
    - ClientAdaptergetClientAdapter() - -
    -          Get client adapter for request.
    - EventgetResponseEvent() - -
    -          Get pushlet response event.
    - voidsetResponseEvent(Event aResponseEvent) - -
    -          Set pushlet response event.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Field Detail
    - -

    -reqEvent

    -
    -public final Event reqEvent
    -
    -
    Pushlet request event. -

    -

    -
    -
    -
    - -

    -httpReq

    -
    -public final javax.servlet.http.HttpServletRequest httpReq
    -
    -
    HTTP Servlet GET/POST request. -

    -

    -
    -
    -
    - -

    -httpRsp

    -
    -public final javax.servlet.http.HttpServletResponse httpRsp
    -
    -
    HTTP Servlet GET/POST response. -

    -

    -
    -
    -
    - -

    -session

    -
    -public final Session session
    -
    -
    Pushlet session. -

    -

    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -create

    -
    -public static Command create(Session aSession,
    -                             Event aReqEvent,
    -                             javax.servlet.http.HttpServletRequest aHTTPReq,
    -                             javax.servlet.http.HttpServletResponse aHTTPRsp)
    -
    -
    Create new Command object. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -setResponseEvent

    -
    -public void setResponseEvent(Event aResponseEvent)
    -
    -
    Set pushlet response event. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getResponseEvent

    -
    -public Event getResponseEvent()
    -
    -
    Get pushlet response event. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getClientAdapter

    -
    -public ClientAdapter getClientAdapter()
    -                               throws PushletException
    -
    -
    Get client adapter for request. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Config.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Config.html deleted file mode 100755 index 107318ea00..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Config.html +++ /dev/null @@ -1,482 +0,0 @@ - - - - - - -Config - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class Config

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.Config
    -
    -
    -
    All Implemented Interfaces:
    ConfigDefs
    -
    -
    -
    -
    public class Config
    extends java.lang.Object
    implements ConfigDefs
    - - -

    -Loads and maintains overall configuration. -

    - -

    -

    -
    Version:
    -
    $Id: Config.java,v 1.5 2007/11/23 21:10:17 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.ConfigDefs
    CONTROLLER_CLASS, DISPATCHER_CLASS, LISTEN_FORCE_PULL_AGENTS, LISTEN_FORCE_PULL_ALL, LOG_LEVEL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, LOGGER_CLASS, POLL_REFRESH_TIMEOUT_MILLIS, POLL_REFRESH_WAIT_MAX_MILLIS, POLL_REFRESH_WAIT_MIN_MILLIS, PULL_REFRESH_TIMEOUT_MILLIS, PULL_REFRESH_WAIT_MAX_MILLIS, PULL_REFRESH_WAIT_MIN_MILLIS, QUEUE_READ_TIMEOUT_MILLIS, QUEUE_SIZE, QUEUE_WRITE_TIMEOUT_MILLIS, SESSION_CLASS, SESSION_ID_GENERATION, SESSION_ID_GENERATION_RANDOMSTRING, SESSION_ID_GENERATION_UUID, SESSION_ID_SIZE, SESSION_MANAGER_CLASS, SESSION_TIMEOUT_MINS, SOURCES_ACTIVATE, SUBSCRIBER_CLASS, SUBSCRIPTION_CLASS
    -  - - - - - - - - - - -
    -Constructor Summary
    Config() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    -static java.lang.ObjectcreateObject(java.lang.String aClassNameProp, - java.lang.String aDefault) - -
    -          Factory method: create object from property denoting class name.
    -static booleangetBoolProperty(java.lang.String aName) - -
    -           
    -static java.lang.ClassgetClass(java.lang.String aClassNameProp, - java.lang.String aDefault) - -
    -          Factory method: create object from property denoting class name.
    -static intgetIntProperty(java.lang.String aName) - -
    -           
    -static longgetLongProperty(java.lang.String aName) - -
    -           
    -static java.lang.StringgetProperty(java.lang.String aName) - -
    -           
    -static java.lang.StringgetProperty(java.lang.String aName, - java.lang.String aDefault) - -
    -           
    -static booleanhasProperty(java.lang.String aName) - -
    -           
    -static voidload(java.lang.String aDirPath) - -
    -          Initialize event sources from properties file.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Config

    -
    -public Config()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -createObject

    -
    -public static java.lang.Object createObject(java.lang.String aClassNameProp,
    -                                            java.lang.String aDefault)
    -                                     throws PushletException
    -
    -
    Factory method: create object from property denoting class name. -

    -

    -
    -
    -
    -
    Parameters:
    aClassNameProp - property name e.g. "session.class" -
    Returns:
    an instance of class denoted by property -
    Throws: -
    PushletException - when class cannot be instantiated
    -
    -
    -
    - -

    -getClass

    -
    -public static java.lang.Class getClass(java.lang.String aClassNameProp,
    -                                       java.lang.String aDefault)
    -                                throws PushletException
    -
    -
    Factory method: create object from property denoting class name. -

    -

    -
    -
    -
    -
    Parameters:
    aClassNameProp - property name e.g. "session.class" -
    Returns:
    a Class object denoted by property -
    Throws: -
    PushletException - when class cannot be instantiated
    -
    -
    -
    - -

    -load

    -
    -public static void load(java.lang.String aDirPath)
    -
    -
    Initialize event sources from properties file. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getProperty

    -
    -public static java.lang.String getProperty(java.lang.String aName,
    -                                           java.lang.String aDefault)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -getProperty

    -
    -public static java.lang.String getProperty(java.lang.String aName)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -getBoolProperty

    -
    -public static boolean getBoolProperty(java.lang.String aName)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -getIntProperty

    -
    -public static int getIntProperty(java.lang.String aName)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -getLongProperty

    -
    -public static long getLongProperty(java.lang.String aName)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -hasProperty

    -
    -public static boolean hasProperty(java.lang.String aName)
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/ConfigDefs.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/ConfigDefs.html deleted file mode 100755 index f6889854e5..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/ConfigDefs.html +++ /dev/null @@ -1,770 +0,0 @@ - - - - - - -ConfigDefs - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Interface ConfigDefs

    -
    -
    All Known Subinterfaces:
    PushletLogger
    -
    -
    -
    All Known Implementing Classes:
    Config, Controller, DefaultLogger, Dispatcher, Log, Log4jLogger, Session, SessionManager, Subscriber, Subscription
    -
    -
    -
    -
    public interface ConfigDefs
    - - -

    -Definition of config property strings. -

    - -

    -

    -
    Version:
    -
    $Id: ConfigDefs.java,v 1.9 2007/12/07 12:57:40 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Field Summary
    -static java.lang.StringCONTROLLER_CLASS - -
    -          Class factory definitions, used to insert your custom classes.
    -static java.lang.StringDISPATCHER_CLASS - -
    -           
    -static java.lang.StringLISTEN_FORCE_PULL_AGENTS - -
    -           
    -static java.lang.StringLISTEN_FORCE_PULL_ALL - -
    -          Listening modes.
    -static java.lang.StringLOG_LEVEL - -
    -          Logging
    -static intLOG_LEVEL_DEBUG - -
    -           
    -static intLOG_LEVEL_ERROR - -
    -           
    -static intLOG_LEVEL_FATAL - -
    -           
    -static intLOG_LEVEL_INFO - -
    -           
    -static intLOG_LEVEL_TRACE - -
    -           
    -static intLOG_LEVEL_WARN - -
    -           
    -static java.lang.StringLOGGER_CLASS - -
    -           
    -static java.lang.StringPOLL_REFRESH_TIMEOUT_MILLIS - -
    -           
    -static java.lang.StringPOLL_REFRESH_WAIT_MAX_MILLIS - -
    -           
    -static java.lang.StringPOLL_REFRESH_WAIT_MIN_MILLIS - -
    -           
    -static java.lang.StringPULL_REFRESH_TIMEOUT_MILLIS - -
    -           
    -static java.lang.StringPULL_REFRESH_WAIT_MAX_MILLIS - -
    -           
    -static java.lang.StringPULL_REFRESH_WAIT_MIN_MILLIS - -
    -           
    -static java.lang.StringQUEUE_READ_TIMEOUT_MILLIS - -
    -           
    -static java.lang.StringQUEUE_SIZE - -
    -          Queues
    -static java.lang.StringQUEUE_WRITE_TIMEOUT_MILLIS - -
    -           
    -static java.lang.StringSESSION_CLASS - -
    -           
    -static java.lang.StringSESSION_ID_GENERATION - -
    -           
    -static java.lang.StringSESSION_ID_GENERATION_RANDOMSTRING - -
    -           
    -static java.lang.StringSESSION_ID_GENERATION_UUID - -
    -           
    -static java.lang.StringSESSION_ID_SIZE - -
    -          Session management.
    -static java.lang.StringSESSION_MANAGER_CLASS - -
    -           
    -static java.lang.StringSESSION_TIMEOUT_MINS - -
    -           
    -static java.lang.StringSOURCES_ACTIVATE - -
    -           
    -static java.lang.StringSUBSCRIBER_CLASS - -
    -           
    -static java.lang.StringSUBSCRIPTION_CLASS - -
    -           
    -  -

    - - - - - - - - -
    -Field Detail
    - -

    -CONTROLLER_CLASS

    -
    -static final java.lang.String CONTROLLER_CLASS
    -
    -
    Class factory definitions, used to insert your custom classes. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -DISPATCHER_CLASS

    -
    -static final java.lang.String DISPATCHER_CLASS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -LOGGER_CLASS

    -
    -static final java.lang.String LOGGER_CLASS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SESSION_MANAGER_CLASS

    -
    -static final java.lang.String SESSION_MANAGER_CLASS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SESSION_CLASS

    -
    -static final java.lang.String SESSION_CLASS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SUBSCRIBER_CLASS

    -
    -static final java.lang.String SUBSCRIBER_CLASS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SUBSCRIPTION_CLASS

    -
    -static final java.lang.String SUBSCRIPTION_CLASS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SESSION_ID_SIZE

    -
    -static final java.lang.String SESSION_ID_SIZE
    -
    -
    Session management. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SESSION_ID_GENERATION

    -
    -static final java.lang.String SESSION_ID_GENERATION
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SESSION_ID_GENERATION_UUID

    -
    -static final java.lang.String SESSION_ID_GENERATION_UUID
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SESSION_ID_GENERATION_RANDOMSTRING

    -
    -static final java.lang.String SESSION_ID_GENERATION_RANDOMSTRING
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SESSION_TIMEOUT_MINS

    -
    -static final java.lang.String SESSION_TIMEOUT_MINS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SOURCES_ACTIVATE

    -
    -static final java.lang.String SOURCES_ACTIVATE
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -LOG_LEVEL

    -
    -static final java.lang.String LOG_LEVEL
    -
    -
    Logging -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -LOG_LEVEL_FATAL

    -
    -static final int LOG_LEVEL_FATAL
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -LOG_LEVEL_ERROR

    -
    -static final int LOG_LEVEL_ERROR
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -LOG_LEVEL_WARN

    -
    -static final int LOG_LEVEL_WARN
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -LOG_LEVEL_INFO

    -
    -static final int LOG_LEVEL_INFO
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -LOG_LEVEL_DEBUG

    -
    -static final int LOG_LEVEL_DEBUG
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -LOG_LEVEL_TRACE

    -
    -static final int LOG_LEVEL_TRACE
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -QUEUE_SIZE

    -
    -static final java.lang.String QUEUE_SIZE
    -
    -
    Queues -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -QUEUE_READ_TIMEOUT_MILLIS

    -
    -static final java.lang.String QUEUE_READ_TIMEOUT_MILLIS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -QUEUE_WRITE_TIMEOUT_MILLIS

    -
    -static final java.lang.String QUEUE_WRITE_TIMEOUT_MILLIS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -LISTEN_FORCE_PULL_ALL

    -
    -static final java.lang.String LISTEN_FORCE_PULL_ALL
    -
    -
    Listening modes. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -LISTEN_FORCE_PULL_AGENTS

    -
    -static final java.lang.String LISTEN_FORCE_PULL_AGENTS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -PULL_REFRESH_TIMEOUT_MILLIS

    -
    -static final java.lang.String PULL_REFRESH_TIMEOUT_MILLIS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -PULL_REFRESH_WAIT_MIN_MILLIS

    -
    -static final java.lang.String PULL_REFRESH_WAIT_MIN_MILLIS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -PULL_REFRESH_WAIT_MAX_MILLIS

    -
    -static final java.lang.String PULL_REFRESH_WAIT_MAX_MILLIS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -POLL_REFRESH_TIMEOUT_MILLIS

    -
    -static final java.lang.String POLL_REFRESH_TIMEOUT_MILLIS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -POLL_REFRESH_WAIT_MIN_MILLIS

    -
    -static final java.lang.String POLL_REFRESH_WAIT_MIN_MILLIS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -POLL_REFRESH_WAIT_MAX_MILLIS

    -
    -static final java.lang.String POLL_REFRESH_WAIT_MAX_MILLIS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Controller.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Controller.html deleted file mode 100755 index b6842eae9a..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Controller.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - - -Controller - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class Controller

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.Controller
    -
    -
    -
    All Implemented Interfaces:
    ConfigDefs, Protocol
    -
    -
    -
    -
    public class Controller
    extends java.lang.Object
    implements Protocol, ConfigDefs
    - - -

    -Handles servlet requests from client. -

    - -

    -

    -
    Version:
    -
    $Id: Controller.java,v 1.9 2007/11/23 14:33:07 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.Protocol
    DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.ConfigDefs
    CONTROLLER_CLASS, DISPATCHER_CLASS, LISTEN_FORCE_PULL_AGENTS, LISTEN_FORCE_PULL_ALL, LOG_LEVEL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, LOGGER_CLASS, POLL_REFRESH_TIMEOUT_MILLIS, POLL_REFRESH_WAIT_MAX_MILLIS, POLL_REFRESH_WAIT_MIN_MILLIS, PULL_REFRESH_TIMEOUT_MILLIS, PULL_REFRESH_WAIT_MAX_MILLIS, PULL_REFRESH_WAIT_MIN_MILLIS, QUEUE_READ_TIMEOUT_MILLIS, QUEUE_SIZE, QUEUE_WRITE_TIMEOUT_MILLIS, SESSION_CLASS, SESSION_ID_GENERATION, SESSION_ID_GENERATION_RANDOMSTRING, SESSION_ID_GENERATION_UUID, SESSION_ID_SIZE, SESSION_MANAGER_CLASS, SESSION_TIMEOUT_MINS, SOURCES_ACTIVATE, SUBSCRIBER_CLASS, SUBSCRIPTION_CLASS
    -  - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    -static Controllercreate(Session aSession) - -
    -          Create instance through factory method.
    - voiddoCommand(Command aCommand) - -
    -          Handle command.
    - SubscribergetSubscriber() - -
    -           
    - java.lang.StringtoString() - -
    -           
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    -  -

    - - - - - - - - -
    -Method Detail
    - -

    -create

    -
    -public static Controller create(Session aSession)
    -                         throws PushletException
    -
    -
    Create instance through factory method. -

    -

    -
    -
    -
    -
    Parameters:
    aSession - the parent Session -
    Returns:
    a Controller object (or derived) -
    Throws: -
    PushletException - exception, usually misconfiguration
    -
    -
    -
    - -

    -doCommand

    -
    -public void doCommand(Command aCommand)
    -
    -
    Handle command. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -toString

    -
    -public java.lang.String toString()
    -
    -
    -
    Overrides:
    toString in class java.lang.Object
    -
    -
    -
    -
    -
    -
    - -

    -getSubscriber

    -
    -public Subscriber getSubscriber()
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Dispatcher.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Dispatcher.html deleted file mode 100755 index 85c774ebbf..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Dispatcher.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - -Dispatcher - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class Dispatcher

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.Dispatcher
    -
    -
    -
    All Implemented Interfaces:
    ConfigDefs, Protocol
    -
    -
    -
    -
    public class Dispatcher
    extends java.lang.Object
    implements Protocol, ConfigDefs
    - - -

    -Routes Events to Subscribers. -

    - -

    -

    -
    Version:
    -
    $Id: Dispatcher.java,v 1.9 2007/12/04 13:55:53 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.Protocol
    DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.ConfigDefs
    CONTROLLER_CLASS, DISPATCHER_CLASS, LISTEN_FORCE_PULL_AGENTS, LISTEN_FORCE_PULL_ALL, LOG_LEVEL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, LOGGER_CLASS, POLL_REFRESH_TIMEOUT_MILLIS, POLL_REFRESH_WAIT_MAX_MILLIS, POLL_REFRESH_WAIT_MIN_MILLIS, PULL_REFRESH_TIMEOUT_MILLIS, PULL_REFRESH_WAIT_MAX_MILLIS, PULL_REFRESH_WAIT_MIN_MILLIS, QUEUE_READ_TIMEOUT_MILLIS, QUEUE_SIZE, QUEUE_WRITE_TIMEOUT_MILLIS, SESSION_CLASS, SESSION_ID_GENERATION, SESSION_ID_GENERATION_RANDOMSTRING, SESSION_ID_GENERATION_UUID, SESSION_ID_SIZE, SESSION_MANAGER_CLASS, SESSION_TIMEOUT_MINS, SOURCES_ACTIVATE, SUBSCRIBER_CLASS, SUBSCRIPTION_CLASS
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidbroadcast(Event anEvent) - -
    -          Send event to all subscribers.
    -static DispatchergetInstance() - -
    -          Singleton pattern: get single instance.
    - voidmulticast(Event anEvent) - -
    -          Send event to subscribers matching Event subject.
    - voidstart() - -
    -          Start Dispatcher.
    - voidstop() - -
    -          Stop Dispatcher.
    - voidunicast(Event event, - java.lang.String aSessionId) - -
    -          Send event to specific subscriber.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Method Detail
    - -

    -getInstance

    -
    -public static Dispatcher getInstance()
    -
    -
    Singleton pattern: get single instance. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -broadcast

    -
    -public void broadcast(Event anEvent)
    -
    -
    Send event to all subscribers. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -multicast

    -
    -public void multicast(Event anEvent)
    -
    -
    Send event to subscribers matching Event subject. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -unicast

    -
    -public void unicast(Event event,
    -                    java.lang.String aSessionId)
    -
    -
    Send event to specific subscriber. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -start

    -
    -public void start()
    -           throws PushletException
    -
    -
    Start Dispatcher. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -stop

    -
    -public void stop()
    -
    -
    Stop Dispatcher. -

    -

    -
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Event.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Event.html deleted file mode 100755 index 5bfc1a307f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Event.html +++ /dev/null @@ -1,638 +0,0 @@ - - - - - - -Event - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class Event

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.Event
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable, Protocol
    -
    -
    -
    -
    public class Event
    extends java.lang.Object
    implements Protocol, java.io.Serializable
    - - -

    -Represents the event data. -

    - -

    -

    -
    Version:
    -
    $Id: Event.java,v 1.13 2007/11/23 14:33:07 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    See Also:
    Serialized Form
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.Protocol
    DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
    -  - - - - - - - - - - - - - - - - -
    -Constructor Summary
    Event(java.util.Map theAttributes) - -
    -           
    Event(java.lang.String anEventType) - -
    -           
    Event(java.lang.String anEventType, - java.util.Map theAttributes) - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - java.lang.Objectclone() - -
    -           
    -static EventcreateDataEvent(java.lang.String aSubject) - -
    -           
    -static EventcreateDataEvent(java.lang.String aSubject, - java.util.Map theAttributes) - -
    -           
    - java.lang.StringgetEventType() - -
    -           
    - java.lang.StringgetField(java.lang.String name) - -
    -           
    - java.lang.StringgetField(java.lang.String name, - java.lang.String aDefault) - -
    -          Return field; if null return default.
    - java.util.IteratorgetFieldNames() - -
    -           
    - java.lang.StringgetSubject() - -
    -           
    - voidsetField(java.lang.String name, - int value) - -
    -           
    - voidsetField(java.lang.String name, - long value) - -
    -           
    - voidsetField(java.lang.String name, - java.lang.String value) - -
    -           
    - java.lang.StringtoQueryString() - -
    -          Convert to HTTP query string.
    - java.lang.StringtoString() - -
    -           
    - java.lang.StringtoXML() - -
    -           
    - java.lang.StringtoXML(boolean strict) - -
    -           
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Event

    -
    -public Event(java.lang.String anEventType)
    -
    -
    -
    - -

    -Event

    -
    -public Event(java.lang.String anEventType,
    -             java.util.Map theAttributes)
    -
    -
    -
    - -

    -Event

    -
    -public Event(java.util.Map theAttributes)
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -createDataEvent

    -
    -public static Event createDataEvent(java.lang.String aSubject)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -createDataEvent

    -
    -public static Event createDataEvent(java.lang.String aSubject,
    -                                    java.util.Map theAttributes)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -getEventType

    -
    -public java.lang.String getEventType()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -getSubject

    -
    -public java.lang.String getSubject()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -setField

    -
    -public void setField(java.lang.String name,
    -                     java.lang.String value)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -setField

    -
    -public void setField(java.lang.String name,
    -                     int value)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -setField

    -
    -public void setField(java.lang.String name,
    -                     long value)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -getField

    -
    -public java.lang.String getField(java.lang.String name)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -getField

    -
    -public java.lang.String getField(java.lang.String name,
    -                                 java.lang.String aDefault)
    -
    -
    Return field; if null return default. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getFieldNames

    -
    -public java.util.Iterator getFieldNames()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -toString

    -
    -public java.lang.String toString()
    -
    -
    -
    Overrides:
    toString in class java.lang.Object
    -
    -
    -
    -
    -
    -
    - -

    -toQueryString

    -
    -public java.lang.String toQueryString()
    -
    -
    Convert to HTTP query string. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -toXML

    -
    -public java.lang.String toXML(boolean strict)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -toXML

    -
    -public java.lang.String toXML()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -clone

    -
    -public java.lang.Object clone()
    -
    -
    -
    Overrides:
    clone in class java.lang.Object
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventParser.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventParser.html deleted file mode 100755 index c62654c513..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventParser.html +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - -EventParser - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class EventParser

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.EventParser
    -
    -
    -
    -
    public class EventParser
    extends java.lang.Object
    - - -

    -Parses XML into Event objects. -

    - -

    -

    -
    Version:
    -
    $Id: EventParser.java,v 1.3 2007/11/23 14:33:07 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    -static voidmain(java.lang.String[] args) - -
    -          Test method: use files to test.
    -static Eventparse(java.io.File aFile) - -
    -          Parse Event from a File.
    -static Eventparse(java.io.Reader aReader) - -
    -          Parse Event from input Reader.
    -static Eventparse(java.lang.String aString) - -
    -          Parse Event from a String.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Method Detail
    - -

    -parse

    -
    -public static Event parse(java.io.File aFile)
    -                   throws java.io.IOException
    -
    -
    Parse Event from a File. -

    -

    - -
    Throws: -
    java.io.IOException
    -
    -
    -
    - -

    -parse

    -
    -public static Event parse(java.io.Reader aReader)
    -                   throws java.io.IOException
    -
    -
    Parse Event from input Reader. -

    -

    - -
    Throws: -
    java.io.IOException
    -
    -
    -
    - -

    -parse

    -
    -public static Event parse(java.lang.String aString)
    -                   throws java.io.IOException
    -
    -
    Parse Event from a String. -

    -

    - -
    Throws: -
    java.io.IOException
    -
    -
    -
    - -

    -main

    -
    -public static void main(java.lang.String[] args)
    -
    -
    Test method: use files to test. -

    -

    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventPullSource.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventPullSource.html deleted file mode 100755 index ebaa4d6b4c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventPullSource.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - -EventPullSource - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class EventPullSource

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.EventPullSource
    -
    -
    -
    All Implemented Interfaces:
    java.lang.Runnable, EventSource
    -
    -
    -
    -
    public abstract class EventPullSource
    extends java.lang.Object
    implements EventSource, java.lang.Runnable
    - - -

    -ABC for specifc EventPullSources. -

    - -

    -


    - -

    - - - - - - - - - - - -
    -Constructor Summary
    EventPullSource() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidactivate() - -
    -          Activate the event generator thread.
    - booleanisAlive() - -
    -           
    - voidpassivate() - -
    -          Deactivate the event generator thread.
    - voidrun() - -
    -          Main loop: sleep, generate event and publish.
    - voidstart() - -
    -           
    - voidstop() - -
    -          Stop the event generator thread.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    - - - - - - - -
    Methods inherited from interface nl.justobjects.pushlet.core.EventSource
    setServletContext
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -EventPullSource

    -
    -public EventPullSource()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -start

    -
    -public void start()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -isAlive

    -
    -public boolean isAlive()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -stop

    -
    -public void stop()
    -
    -
    Stop the event generator thread. -

    -

    -
    Specified by:
    stop in interface EventSource
    -
    -
    -
    -
    -
    -
    - -

    -activate

    -
    -public void activate()
    -
    -
    Activate the event generator thread. -

    -

    -
    Specified by:
    activate in interface EventSource
    -
    -
    -
    -
    -
    -
    - -

    -passivate

    -
    -public void passivate()
    -
    -
    Deactivate the event generator thread. -

    -

    -
    Specified by:
    passivate in interface EventSource
    -
    -
    -
    -
    -
    -
    - -

    -run

    -
    -public void run()
    -
    -
    Main loop: sleep, generate event and publish. -

    -

    -
    Specified by:
    run in interface java.lang.Runnable
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventQueue.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventQueue.html deleted file mode 100755 index 1eada8010d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventQueue.html +++ /dev/null @@ -1,492 +0,0 @@ - - - - - - -EventQueue - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class EventQueue

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.EventQueue
    -
    -
    -
    -
    public class EventQueue
    extends java.lang.Object
    - - -

    -FIFO queue with guarded suspension. - Purpose
    -

    - Implementation
    - FIFO queue class implemented with circular array. The enQueue() and - deQueue() methods use guarded suspension according to a readers/writers - pattern, implemented with java.lang.Object.wait()/notify(). -

    - Examples
    -

    -
    -

    - -

    -

    -
    Version:
    -
    $Id: EventQueue.java,v 1.3 2007/11/23 14:33:07 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - - - - - - - - -
    -Constructor Summary
    EventQueue() - -
    -          Construct queue with default (8) capacity.
    EventQueue(int capacity) - -
    -          Construct queue with specified capacity.
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - EventdeQueue() - -
    -          Get head; if empty wait until something in queue.
    - EventdeQueue(long maxWaitTime) - -
    -          Get head; if empty wait for specified time at max.
    - Event[]deQueueAll(long maxWaitTime) - -
    -          Get all queued Events.
    - booleanenQueue(Event item) - -
    -          Put item in queue; waits() indefinitely if queue is full.
    - booleanenQueue(Event item, - long maxWaitTime) - -
    -          Put item in queue; if full wait maxtime.
    - intgetSize() - -
    -           
    - booleanisEmpty() - -
    -          Is the queue empty ?
    - booleanisFull() - -
    -          Is the queue full ?
    -static voidmain(java.lang.String[] args) - -
    -           
    -static voidp(java.lang.String s) - -
    -           
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -EventQueue

    -
    -public EventQueue()
    -
    -
    Construct queue with default (8) capacity. -

    -

    -
    - -

    -EventQueue

    -
    -public EventQueue(int capacity)
    -
    -
    Construct queue with specified capacity. -

    -

    - - - - - - - - -
    -Method Detail
    - -

    -enQueue

    -
    -public boolean enQueue(Event item)
    -                throws java.lang.InterruptedException
    -
    -
    Put item in queue; waits() indefinitely if queue is full. -

    -

    - -
    Throws: -
    java.lang.InterruptedException
    -
    -
    -
    - -

    -enQueue

    -
    -public boolean enQueue(Event item,
    -                       long maxWaitTime)
    -                throws java.lang.InterruptedException
    -
    -
    Put item in queue; if full wait maxtime. -

    -

    - -
    Throws: -
    java.lang.InterruptedException
    -
    -
    -
    - -

    -deQueue

    -
    -public Event deQueue()
    -              throws java.lang.InterruptedException
    -
    -
    Get head; if empty wait until something in queue. -

    -

    - -
    Throws: -
    java.lang.InterruptedException
    -
    -
    -
    - -

    -deQueue

    -
    -public Event deQueue(long maxWaitTime)
    -              throws java.lang.InterruptedException
    -
    -
    Get head; if empty wait for specified time at max. -

    -

    - -
    Throws: -
    java.lang.InterruptedException
    -
    -
    -
    - -

    -deQueueAll

    -
    -public Event[] deQueueAll(long maxWaitTime)
    -                   throws java.lang.InterruptedException
    -
    -
    Get all queued Events. -

    -

    - -
    Throws: -
    java.lang.InterruptedException
    -
    -
    -
    - -

    -getSize

    -
    -public int getSize()
    -
    -
    -
    -
    -
    -
    - -

    -isEmpty

    -
    -public boolean isEmpty()
    -
    -
    Is the queue empty ? -

    -

    -
    -
    -
    -
    - -

    -isFull

    -
    -public boolean isFull()
    -
    -
    Is the queue full ? -

    -

    -
    -
    -
    -
    - -

    -p

    -
    -public static void p(java.lang.String s)
    -
    -
    -
    -
    -
    -
    - -

    -main

    -
    -public static void main(java.lang.String[] args)
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventSource.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventSource.html deleted file mode 100755 index ecb763b418..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventSource.html +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - -EventSource - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Interface EventSource

    -
    -
    All Known Implementing Classes:
    EventPullSource, Serveur.IvyEventSource
    -
    -
    -
    -
    public interface EventSource
    - - -

    -Interface for specifc Event(Pull/Push)Sources. -

    - -

    -


    - -

    - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidactivate() - -
    -          Activate the event source.
    - voidpassivate() - -
    -          Deactivate the event source.
    - voidsetServletContext(javax.servlet.ServletContext srvCtxt) - -
    -           
    - voidstop() - -
    -          Halt the event source.
    -  -

    - - - - - - - - -
    -Method Detail
    - -

    -activate

    -
    -void activate()
    -
    -
    Activate the event source. -

    -

    -
    -
    -
    -
    - -

    -passivate

    -
    -void passivate()
    -
    -
    Deactivate the event source. -

    -

    -
    -
    -
    -
    - -

    -stop

    -
    -void stop()
    -
    -
    Halt the event source. -

    -

    -
    -
    -
    -
    - -

    -setServletContext

    -
    -void setServletContext(javax.servlet.ServletContext srvCtxt)
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventSourceManager.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventSourceManager.html deleted file mode 100755 index 248045a8a6..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/EventSourceManager.html +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - -EventSourceManager - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class EventSourceManager

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.EventSourceManager
    -
    -
    -
    -
    public class EventSourceManager
    extends java.lang.Object
    - - -

    -Maintains lifecycle of event sources. -

    - -

    -

    -
    Version:
    -
    $Id: EventSourceManager.java,v 1.14 2007/11/10 13:44:02 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    EventSourceManager() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    -static voidactivate() - -
    -          Activate all event sources.
    -static voidpassivate() - -
    -          Deactivate all event sources.
    -static voidstart(java.lang.String aDirPath, - javax.servlet.ServletContext srvCtxt) - -
    -          Initialize event sources from properties file.
    -static voidstop() - -
    -          Halt event sources.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -EventSourceManager

    -
    -public EventSourceManager()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -start

    -
    -public static void start(java.lang.String aDirPath,
    -                         javax.servlet.ServletContext srvCtxt)
    -
    -
    Initialize event sources from properties file. -

    -

    -
    -
    -
    -
    - -

    -activate

    -
    -public static void activate()
    -
    -
    Activate all event sources. -

    -

    -
    -
    -
    -
    - -

    -passivate

    -
    -public static void passivate()
    -
    -
    Deactivate all event sources. -

    -

    -
    -
    -
    -
    - -

    -stop

    -
    -public static void stop()
    -
    -
    Halt event sources. -

    -

    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Protocol.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Protocol.html deleted file mode 100755 index a335a5b6ef..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Protocol.html +++ /dev/null @@ -1,1112 +0,0 @@ - - - - - - -Protocol - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Interface Protocol

    -
    -
    All Known Subinterfaces:
    PushletClientListener
    -
    -
    -
    All Known Implementing Classes:
    BrowserAdapter, Command, Controller, Dispatcher, Event, Pushlet, PushletClient, Session, Subscriber
    -
    -
    -
    -
    public interface Protocol
    - - -

    -Constants for Pushlet protocols. -

    - -

    -

    -
    Version:
    -
    $Id: Protocol.java,v 1.15 2007/11/23 14:33:07 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Field Summary
    -static java.lang.StringDEFAULT_SERVLET_URI - -
    -          Default URI .
    -static java.lang.StringE_ABORT - -
    -          S-->C Client should abort, permanent error.
    -static java.lang.StringE_DATA - -
    -          S-->C Data.
    -static java.lang.StringE_HEARTBEAT - -
    -          S-->C or C-->S Heartbeat.
    -static java.lang.StringE_HEARTBEAT_ACK - -
    -          S-->C S-->C or C-->S Heartbeat confirmed.
    -static java.lang.StringE_JOIN - -
    -          C-->S Request to join server.
    -static java.lang.StringE_JOIN_ACK - -
    -          S-->C Acknowledgement of join.
    -static java.lang.StringE_JOIN_LISTEN - -
    -          C-->S Request to join server.
    -static java.lang.StringE_JOIN_LISTEN_ACK - -
    -          S-->C Acknowledgement of join.
    -static java.lang.StringE_LEAVE - -
    -          C-->S Client leaves server.
    -static java.lang.StringE_LEAVE_ACK - -
    -          S-->C Ack of leave.
    -static java.lang.StringE_LISTEN - -
    -          C-->S Client starts listening.
    -static java.lang.StringE_LISTEN_ACK - -
    -          S-->C Ack of listen.
    -static java.lang.StringE_NACK - -
    -          S-->C Client error response, transitional error.
    -static java.lang.StringE_PUBLISH - -
    -          C-->S Publish to subject.
    -static java.lang.StringE_PUBLISH_ACK - -
    -          S-->C Publish to subject acknowledge.
    -static java.lang.StringE_REFRESH - -
    -          S-->C or C-->S client refresh of data channel.
    -static java.lang.StringE_REFRESH_ACK - -
    -          S-->C client should refresh data channel.
    -static java.lang.StringE_SUBSCRIBE - -
    -          C-->S Subscribe to subject request.
    -static java.lang.StringE_SUBSCRIBE_ACK - -
    -          S-->C Subscribe to subject acknowledge.
    -static java.lang.StringE_UNSUBSCRIBE - -
    -          C-->S Unsubscribe from subject request.
    -static java.lang.StringE_UNSUBSCRIBE_ACK - -
    -          S--C Unsubscribe from subject acknowledge.
    -static java.lang.StringFORMAT_JAVASCRIPT - -
    -          JavaScript callback.
    -static java.lang.StringFORMAT_SERIALIZED_JAVA_OBJECT - -
    -          Java serialized object.
    -static java.lang.StringFORMAT_XML - -
    -          Stream of XML documents.
    -static java.lang.StringFORMAT_XML_STRICT - -
    -          Single XML document containing zero or more events.
    -static java.lang.StringMODE_POLL - -
    -           
    -static java.lang.StringMODE_PULL - -
    -           
    -static java.lang.StringMODE_STREAM - -
    -           
    -static java.lang.StringP_EVENT - -
    -          Event type (join, leave, data, subscribe etc) .
    -static java.lang.StringP_FORMAT - -
    -          Format to receive events
    -static java.lang.StringP_FROM - -
    -          Originator of Event.
    -static java.lang.StringP_ID - -
    -          Identifier for client instance within server.
    -static java.lang.StringP_MODE - -
    -          Protocol mode.
    -static java.lang.StringP_REASON - -
    -          Reason for errors.
    -static java.lang.StringP_SEQ - -
    -          Event sequence number, numbers per-client.
    -static java.lang.StringP_SUBJECT - -
    -          Subject (topic) of data event.
    -static java.lang.StringP_SUBSCRIPTION_ID - -
    -          Subscription id, identifies single subscription.
    -static java.lang.StringP_SUBSCRIPTION_LABEL - -
    -          Subscription label, may be used to return user-specific - token with a data event, e.g. the name of a function for a callback.
    -static java.lang.StringP_TIME - -
    -          Time in seconds since 1970
    -static java.lang.StringP_TO - -
    -          Addressee of Event, subject or client p_id.
    -static java.lang.StringP_URL - -
    -          URL attribute.
    -static java.lang.StringP_WAIT - -
    -          Wait attribute.
    -static java.lang.StringSUBJECT_META - -
    -           
    -static java.lang.StringSUBJECT_META_JOINS - -
    -           
    -static java.lang.StringSUBJECT_META_SUBS - -
    -           
    -  -

    - - - - - - - - -
    -Field Detail
    - -

    -DEFAULT_SERVLET_URI

    -
    -static final java.lang.String DEFAULT_SERVLET_URI
    -
    -
    Default URI . -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_EVENT

    -
    -static final java.lang.String P_EVENT
    -
    -
    Event type (join, leave, data, subscribe etc) . -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_TIME

    -
    -static final java.lang.String P_TIME
    -
    -
    Time in seconds since 1970 -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_SEQ

    -
    -static final java.lang.String P_SEQ
    -
    -
    Event sequence number, numbers per-client. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_SUBJECT

    -
    -static final java.lang.String P_SUBJECT
    -
    -
    Subject (topic) of data event. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_FROM

    -
    -static final java.lang.String P_FROM
    -
    -
    Originator of Event. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_TO

    -
    -static final java.lang.String P_TO
    -
    -
    Addressee of Event, subject or client p_id. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_ID

    -
    -static final java.lang.String P_ID
    -
    -
    Identifier for client instance within server. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_SUBSCRIPTION_ID

    -
    -static final java.lang.String P_SUBSCRIPTION_ID
    -
    -
    Subscription id, identifies single subscription. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_FORMAT

    -
    -static final java.lang.String P_FORMAT
    -
    -
    Format to receive events -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_MODE

    -
    -static final java.lang.String P_MODE
    -
    -
    Protocol mode. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_REASON

    -
    -static final java.lang.String P_REASON
    -
    -
    Reason for errors. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_URL

    -
    -static final java.lang.String P_URL
    -
    -
    URL attribute. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_WAIT

    -
    -static final java.lang.String P_WAIT
    -
    -
    Wait attribute. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -P_SUBSCRIPTION_LABEL

    -
    -static final java.lang.String P_SUBSCRIPTION_LABEL
    -
    -
    Subscription label, may be used to return user-specific - token with a data event, e.g. the name of a function for a callback. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_JOIN

    -
    -static final java.lang.String E_JOIN
    -
    -
    C-->S Request to join server. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_JOIN_ACK

    -
    -static final java.lang.String E_JOIN_ACK
    -
    -
    S-->C Acknowledgement of join. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_JOIN_LISTEN

    -
    -static final java.lang.String E_JOIN_LISTEN
    -
    -
    C-->S Request to join server. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_JOIN_LISTEN_ACK

    -
    -static final java.lang.String E_JOIN_LISTEN_ACK
    -
    -
    S-->C Acknowledgement of join. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_LISTEN

    -
    -static final java.lang.String E_LISTEN
    -
    -
    C-->S Client starts listening. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_LISTEN_ACK

    -
    -static final java.lang.String E_LISTEN_ACK
    -
    -
    S-->C Ack of listen. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_LEAVE

    -
    -static final java.lang.String E_LEAVE
    -
    -
    C-->S Client leaves server. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_LEAVE_ACK

    -
    -static final java.lang.String E_LEAVE_ACK
    -
    -
    S-->C Ack of leave. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_PUBLISH

    -
    -static final java.lang.String E_PUBLISH
    -
    -
    C-->S Publish to subject. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_PUBLISH_ACK

    -
    -static final java.lang.String E_PUBLISH_ACK
    -
    -
    S-->C Publish to subject acknowledge. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_SUBSCRIBE

    -
    -static final java.lang.String E_SUBSCRIBE
    -
    -
    C-->S Subscribe to subject request. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_SUBSCRIBE_ACK

    -
    -static final java.lang.String E_SUBSCRIBE_ACK
    -
    -
    S-->C Subscribe to subject acknowledge. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_UNSUBSCRIBE

    -
    -static final java.lang.String E_UNSUBSCRIBE
    -
    -
    C-->S Unsubscribe from subject request. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_UNSUBSCRIBE_ACK

    -
    -static final java.lang.String E_UNSUBSCRIBE_ACK
    -
    -
    S--C Unsubscribe from subject acknowledge. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_NACK

    -
    -static final java.lang.String E_NACK
    -
    -
    S-->C Client error response, transitional error. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_ABORT

    -
    -static final java.lang.String E_ABORT
    -
    -
    S-->C Client should abort, permanent error. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_DATA

    -
    -static final java.lang.String E_DATA
    -
    -
    S-->C Data. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_HEARTBEAT

    -
    -static final java.lang.String E_HEARTBEAT
    -
    -
    S-->C or C-->S Heartbeat. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_HEARTBEAT_ACK

    -
    -static final java.lang.String E_HEARTBEAT_ACK
    -
    -
    S-->C S-->C or C-->S Heartbeat confirmed. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_REFRESH

    -
    -static final java.lang.String E_REFRESH
    -
    -
    S-->C or C-->S client refresh of data channel. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -E_REFRESH_ACK

    -
    -static final java.lang.String E_REFRESH_ACK
    -
    -
    S-->C client should refresh data channel. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -FORMAT_JAVASCRIPT

    -
    -static final java.lang.String FORMAT_JAVASCRIPT
    -
    -
    JavaScript callback. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -FORMAT_SERIALIZED_JAVA_OBJECT

    -
    -static final java.lang.String FORMAT_SERIALIZED_JAVA_OBJECT
    -
    -
    Java serialized object. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -FORMAT_XML

    -
    -static final java.lang.String FORMAT_XML
    -
    -
    Stream of XML documents. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -FORMAT_XML_STRICT

    -
    -static final java.lang.String FORMAT_XML_STRICT
    -
    -
    Single XML document containing zero or more events. -

    -

    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -MODE_STREAM

    -
    -static final java.lang.String MODE_STREAM
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -MODE_PULL

    -
    -static final java.lang.String MODE_PULL
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -MODE_POLL

    -
    -static final java.lang.String MODE_POLL
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SUBJECT_META

    -
    -static final java.lang.String SUBJECT_META
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SUBJECT_META_SUBS

    -
    -static final java.lang.String SUBJECT_META_SUBS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SUBJECT_META_JOINS

    -
    -static final java.lang.String SUBJECT_META_JOINS
    -
    -
    -
    See Also:
    Constant Field Values
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Session.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Session.html deleted file mode 100755 index 2b1ba1363b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Session.html +++ /dev/null @@ -1,673 +0,0 @@ - - - - - - -Session - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class Session

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.Session
    -
    -
    -
    All Implemented Interfaces:
    ConfigDefs, Protocol
    -
    -
    -
    -
    public class Session
    extends java.lang.Object
    implements Protocol, ConfigDefs
    - - -

    -Represents client pushlet session state. -

    - -

    -

    -
    Version:
    -
    $Id: Session.java,v 1.8 2007/11/23 14:33:07 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - - - - - -
    -Field Summary
    -static java.lang.String[]FORCED_PULL_AGENTS - -
    -           
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.Protocol
    DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.ConfigDefs
    CONTROLLER_CLASS, DISPATCHER_CLASS, LISTEN_FORCE_PULL_AGENTS, LISTEN_FORCE_PULL_ALL, LOG_LEVEL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, LOGGER_CLASS, POLL_REFRESH_TIMEOUT_MILLIS, POLL_REFRESH_WAIT_MAX_MILLIS, POLL_REFRESH_WAIT_MIN_MILLIS, PULL_REFRESH_TIMEOUT_MILLIS, PULL_REFRESH_WAIT_MAX_MILLIS, PULL_REFRESH_WAIT_MIN_MILLIS, QUEUE_READ_TIMEOUT_MILLIS, QUEUE_SIZE, QUEUE_WRITE_TIMEOUT_MILLIS, SESSION_CLASS, SESSION_ID_GENERATION, SESSION_ID_GENERATION_RANDOMSTRING, SESSION_ID_GENERATION_UUID, SESSION_ID_SIZE, SESSION_MANAGER_CLASS, SESSION_TIMEOUT_MINS, SOURCES_ACTIVATE, SUBSCRIBER_CLASS, SUBSCRIPTION_CLASS
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidage(long aDeltaMillis) - -
    -          Decrease time to live.
    -static Sessioncreate(java.lang.String anId) - -
    -          Create instance through factory method.
    - voiddebug(java.lang.String s) - -
    -          Exceptional print util.
    - java.lang.StringgetAddress() - -
    -          Return (remote) Subscriber client's IP address.
    - ControllergetController() - -
    -          Return command controller.
    - java.lang.StringgetFormat() - -
    -          Return Event format to send to client.
    - java.lang.StringgetId() - -
    -          Return (remote) Subscriber client's unique id.
    - SubscribergetSubscriber() - -
    -          Return subscriber.
    - java.lang.StringgetUserAgent() - -
    -          Return remote HTTP User-Agent.
    - voidinfo(java.lang.String s) - -
    -          Info.
    - booleanisExpired() - -
    -          Has session timed out?
    - voidkick() - -
    -          Keep alive by resetting TTL.
    - voidsetUserAgent(java.lang.String aUserAgent) - -
    -          Set client HTTP UserAgent.
    - voidstart() - -
    -           
    - voidstop() - -
    -           
    - java.lang.StringtoString() - -
    -           
    - voidwarn(java.lang.String s) - -
    -          Exceptional print util.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    -  -

    - - - - - - - - -
    -Field Detail
    - -

    -FORCED_PULL_AGENTS

    -
    -public static java.lang.String[] FORCED_PULL_AGENTS
    -
    -
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -create

    -
    -public static Session create(java.lang.String anId)
    -                      throws PushletException
    -
    -
    Create instance through factory method. -

    -

    -
    -
    -
    -
    Parameters:
    anId - a session id -
    Returns:
    a Session object (or derived) -
    Throws: -
    PushletException - exception, usually misconfiguration
    -
    -
    -
    - -

    -getAddress

    -
    -public java.lang.String getAddress()
    -
    -
    Return (remote) Subscriber client's IP address. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getController

    -
    -public Controller getController()
    -
    -
    Return command controller. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getFormat

    -
    -public java.lang.String getFormat()
    -
    -
    Return Event format to send to client. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getId

    -
    -public java.lang.String getId()
    -
    -
    Return (remote) Subscriber client's unique id. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getSubscriber

    -
    -public Subscriber getSubscriber()
    -
    -
    Return subscriber. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getUserAgent

    -
    -public java.lang.String getUserAgent()
    -
    -
    Return remote HTTP User-Agent. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -setUserAgent

    -
    -public void setUserAgent(java.lang.String aUserAgent)
    -
    -
    Set client HTTP UserAgent. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -age

    -
    -public void age(long aDeltaMillis)
    -
    -
    Decrease time to live. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -isExpired

    -
    -public boolean isExpired()
    -
    -
    Has session timed out? -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -kick

    -
    -public void kick()
    -
    -
    Keep alive by resetting TTL. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -start

    -
    -public void start()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -stop

    -
    -public void stop()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -info

    -
    -public void info(java.lang.String s)
    -
    -
    Info. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -warn

    -
    -public void warn(java.lang.String s)
    -
    -
    Exceptional print util. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -debug

    -
    -public void debug(java.lang.String s)
    -
    -
    Exceptional print util. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -toString

    -
    -public java.lang.String toString()
    -
    -
    -
    Overrides:
    toString in class java.lang.Object
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/SessionManager.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/SessionManager.html deleted file mode 100755 index 9f0c7d945c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/SessionManager.html +++ /dev/null @@ -1,532 +0,0 @@ - - - - - - -SessionManager - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class SessionManager

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.SessionManager
    -
    -
    -
    All Implemented Interfaces:
    ConfigDefs
    -
    -
    -
    -
    public class SessionManager
    extends java.lang.Object
    implements ConfigDefs
    - - -

    -Manages lifecycle of Sessions. -

    - -

    -

    -
    Version:
    -
    $Id: SessionManager.java,v 1.12 2007/12/04 13:55:53 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.ConfigDefs
    CONTROLLER_CLASS, DISPATCHER_CLASS, LISTEN_FORCE_PULL_AGENTS, LISTEN_FORCE_PULL_ALL, LOG_LEVEL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, LOGGER_CLASS, POLL_REFRESH_TIMEOUT_MILLIS, POLL_REFRESH_WAIT_MAX_MILLIS, POLL_REFRESH_WAIT_MIN_MILLIS, PULL_REFRESH_TIMEOUT_MILLIS, PULL_REFRESH_WAIT_MAX_MILLIS, PULL_REFRESH_WAIT_MIN_MILLIS, QUEUE_READ_TIMEOUT_MILLIS, QUEUE_SIZE, QUEUE_WRITE_TIMEOUT_MILLIS, SESSION_CLASS, SESSION_ID_GENERATION, SESSION_ID_GENERATION_RANDOMSTRING, SESSION_ID_GENERATION_UUID, SESSION_ID_SIZE, SESSION_MANAGER_CLASS, SESSION_TIMEOUT_MINS, SOURCES_ACTIVATE, SUBSCRIBER_CLASS, SUBSCRIPTION_CLASS
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidaddSession(Session session) - -
    -          Add session.
    - voidapply(java.lang.Object visitor, - java.lang.reflect.Method method, - java.lang.Object[] args) - -
    -          Visitor pattern implementation for Session iteration.
    - SessioncreateSession(Event anEvent) - -
    -          Create new Session (but add later).
    -static SessionManagergetInstance() - -
    -          Singleton pattern: get single instance.
    - SessiongetSession(java.lang.String anId) - -
    -          Get Session by session id.
    - intgetSessionCount() - -
    -          Get number of listening Sessions.
    - Session[]getSessions() - -
    -          Get copy of listening Sessions.
    - java.lang.StringgetStatus() - -
    -          Get status info.
    - booleanhasSession(java.lang.String anId) - -
    -          Is Session present?.
    - SessionremoveSession(Session aSession) - -
    -          Register session for removal.
    - voidstart() - -
    -          Starts us.
    - voidstop() - -
    -          Stopis us.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Method Detail
    - -

    -apply

    -
    -public void apply(java.lang.Object visitor,
    -                  java.lang.reflect.Method method,
    -                  java.lang.Object[] args)
    -
    -
    Visitor pattern implementation for Session iteration. -

    - This method can be used to iterate over all Sessions in a threadsafe way. - See Dispatcher.multicast and broadcast methods for examples. -

    -

    -
    -
    -
    -
    Parameters:
    visitor - the object that should implement method parm
    method - the method to be called from visitor
    args - arguments to be passed in visit method, args[0] will always be Session object
    -
    -
    -
    - -

    -createSession

    -
    -public Session createSession(Event anEvent)
    -                      throws PushletException
    -
    -
    Create new Session (but add later). -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -getInstance

    -
    -public static SessionManager getInstance()
    -
    -
    Singleton pattern: get single instance. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getSession

    -
    -public Session getSession(java.lang.String anId)
    -
    -
    Get Session by session id. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getSessions

    -
    -public Session[] getSessions()
    -
    -
    Get copy of listening Sessions. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getSessionCount

    -
    -public int getSessionCount()
    -
    -
    Get number of listening Sessions. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getStatus

    -
    -public java.lang.String getStatus()
    -
    -
    Get status info. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -hasSession

    -
    -public boolean hasSession(java.lang.String anId)
    -
    -
    Is Session present?. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -addSession

    -
    -public void addSession(Session session)
    -
    -
    Add session. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -removeSession

    -
    -public Session removeSession(Session aSession)
    -
    -
    Register session for removal. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -start

    -
    -public void start()
    -           throws PushletException
    -
    -
    Starts us. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -stop

    -
    -public void stop()
    -
    -
    Stopis us. -

    -

    -
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Subscriber.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Subscriber.html deleted file mode 100755 index d94f64ef82..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Subscriber.html +++ /dev/null @@ -1,670 +0,0 @@ - - - - - - -Subscriber - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class Subscriber

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.Subscriber
    -
    -
    -
    All Implemented Interfaces:
    ConfigDefs, Protocol
    -
    -
    -
    -
    public class Subscriber
    extends java.lang.Object
    implements Protocol, ConfigDefs
    - - -

    -Handles data channel between dispatcher and client. -

    - -

    -

    -
    Version:
    -
    $Id: Subscriber.java,v 1.26 2007/11/23 14:33:07 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.Protocol
    DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.ConfigDefs
    CONTROLLER_CLASS, DISPATCHER_CLASS, LISTEN_FORCE_PULL_AGENTS, LISTEN_FORCE_PULL_ALL, LOG_LEVEL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, LOGGER_CLASS, POLL_REFRESH_TIMEOUT_MILLIS, POLL_REFRESH_WAIT_MAX_MILLIS, POLL_REFRESH_WAIT_MIN_MILLIS, PULL_REFRESH_TIMEOUT_MILLIS, PULL_REFRESH_WAIT_MAX_MILLIS, PULL_REFRESH_WAIT_MIN_MILLIS, QUEUE_READ_TIMEOUT_MILLIS, QUEUE_SIZE, QUEUE_WRITE_TIMEOUT_MILLIS, SESSION_CLASS, SESSION_ID_GENERATION, SESSION_ID_GENERATION_RANDOMSTRING, SESSION_ID_GENERATION_UUID, SESSION_ID_SIZE, SESSION_MANAGER_CLASS, SESSION_TIMEOUT_MINS, SOURCES_ACTIVATE, SUBSCRIBER_CLASS, SUBSCRIPTION_CLASS
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - SubscriptionaddSubscription(java.lang.String aSubject, - java.lang.String aLabel) - -
    -          Add a subscription.
    - voidbailout() - -
    -           
    -static Subscribercreate(Session aSession) - -
    -          Create instance through factory method.
    - voidfetchEvents(Command aCommand) - -
    -          Get events from queue and push to client.
    - java.lang.StringgetId() - -
    -          Get (session) id.
    - java.lang.StringgetMode() - -
    -           
    - longgetRefreshTimeMillis() - -
    -           
    - SessiongetSession() - -
    -          Return client session.
    - Subscription[]getSubscriptions() - -
    -          Return subscriptions.
    - booleanisActive() - -
    -          Are we still active to handle events.
    - Subscriptionmatch(Event event) - -
    -          Determine if we should receive event.
    - voidonEvent(Event theEvent) - -
    -          Event from Dispatcher: enqueue it.
    - SubscriptionremoveSubscription(java.lang.String aSubscriptionId) - -
    -          Remove a subscription.
    - voidremoveSubscriptions() - -
    -          Remove all subscriptions.
    - voidsetMode(java.lang.String aMode) - -
    -           
    - voidstart() - -
    -           
    - voidstop() - -
    -           
    - java.lang.StringtoString() - -
    -           
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    -  -

    - - - - - - - - -
    -Method Detail
    - -

    -create

    -
    -public static Subscriber create(Session aSession)
    -                         throws PushletException
    -
    -
    Create instance through factory method. -

    -

    -
    -
    -
    -
    Parameters:
    aSession - the parent Session -
    Returns:
    a Subscriber object (or derived) -
    Throws: -
    PushletException - exception, usually misconfiguration
    -
    -
    -
    - -

    -start

    -
    -public void start()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -stop

    -
    -public void stop()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -bailout

    -
    -public void bailout()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -isActive

    -
    -public boolean isActive()
    -
    -
    Are we still active to handle events. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getSession

    -
    -public Session getSession()
    -
    -
    Return client session. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getId

    -
    -public java.lang.String getId()
    -
    -
    Get (session) id. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getSubscriptions

    -
    -public Subscription[] getSubscriptions()
    -
    -
    Return subscriptions. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -addSubscription

    -
    -public Subscription addSubscription(java.lang.String aSubject,
    -                                    java.lang.String aLabel)
    -                             throws PushletException
    -
    -
    Add a subscription. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -removeSubscription

    -
    -public Subscription removeSubscription(java.lang.String aSubscriptionId)
    -
    -
    Remove a subscription. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -removeSubscriptions

    -
    -public void removeSubscriptions()
    -
    -
    Remove all subscriptions. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getMode

    -
    -public java.lang.String getMode()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -setMode

    -
    -public void setMode(java.lang.String aMode)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -getRefreshTimeMillis

    -
    -public long getRefreshTimeMillis()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -fetchEvents

    -
    -public void fetchEvents(Command aCommand)
    -                 throws PushletException
    -
    -
    Get events from queue and push to client. -

    -

    -
    -
    -
    - -
    Throws: -
    PushletException
    -
    -
    -
    - -

    -match

    -
    -public Subscription match(Event event)
    -
    -
    Determine if we should receive event. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -onEvent

    -
    -public void onEvent(Event theEvent)
    -
    -
    Event from Dispatcher: enqueue it. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -toString

    -
    -public java.lang.String toString()
    -
    -
    -
    Overrides:
    toString in class java.lang.Object
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Subscription.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Subscription.html deleted file mode 100755 index 02faa6ca52..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/Subscription.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - - - -Subscription - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.core -
    -Class Subscription

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.core.Subscription
    -
    -
    -
    All Implemented Interfaces:
    ConfigDefs
    -
    -
    -
    -
    public class Subscription
    extends java.lang.Object
    implements ConfigDefs
    - - -

    -Represents single subject subscription -

    - -

    -

    -
    Version:
    -
    $Id: Subscription.java,v 1.5 2007/11/23 14:33:07 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - - - - - - - - - -
    -Field Summary
    -static intID_SIZE - -
    -           
    -static java.lang.StringSUBJECT_SEPARATOR - -
    -           
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.ConfigDefs
    CONTROLLER_CLASS, DISPATCHER_CLASS, LISTEN_FORCE_PULL_AGENTS, LISTEN_FORCE_PULL_ALL, LOG_LEVEL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, LOGGER_CLASS, POLL_REFRESH_TIMEOUT_MILLIS, POLL_REFRESH_WAIT_MAX_MILLIS, POLL_REFRESH_WAIT_MIN_MILLIS, PULL_REFRESH_TIMEOUT_MILLIS, PULL_REFRESH_WAIT_MAX_MILLIS, PULL_REFRESH_WAIT_MIN_MILLIS, QUEUE_READ_TIMEOUT_MILLIS, QUEUE_SIZE, QUEUE_WRITE_TIMEOUT_MILLIS, SESSION_CLASS, SESSION_ID_GENERATION, SESSION_ID_GENERATION_RANDOMSTRING, SESSION_ID_GENERATION_UUID, SESSION_ID_SIZE, SESSION_MANAGER_CLASS, SESSION_TIMEOUT_MINS, SOURCES_ACTIVATE, SUBSCRIBER_CLASS, SUBSCRIPTION_CLASS
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    -static Subscriptioncreate(java.lang.String aSubject) - -
    -          Create instance through factory method.
    -static Subscriptioncreate(java.lang.String aSubject, - java.lang.String aLabel) - -
    -          Create instance through factory method.
    - java.lang.StringgetId() - -
    -           
    - java.lang.StringgetLabel() - -
    -           
    - java.lang.StringgetSubject() - -
    -           
    - booleanmatch(Event event) - -
    -          Determine if Event matches subscription.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Field Detail
    - -

    -ID_SIZE

    -
    -public static final int ID_SIZE
    -
    -
    -
    See Also:
    Constant Field Values
    -
    -
    - -

    -SUBJECT_SEPARATOR

    -
    -public static final java.lang.String SUBJECT_SEPARATOR
    -
    -
    -
    See Also:
    Constant Field Values
    -
    - - - - - - - - -
    -Method Detail
    - -

    -create

    -
    -public static Subscription create(java.lang.String aSubject)
    -                           throws PushletException
    -
    -
    Create instance through factory method. -

    -

    -
    -
    -
    -
    Parameters:
    aSubject - the subject (topic). -
    Returns:
    a Subscription object (or derived) -
    Throws: -
    PushletException - exception, usually misconfiguration
    -
    -
    -
    - -

    -create

    -
    -public static Subscription create(java.lang.String aSubject,
    -                                  java.lang.String aLabel)
    -                           throws PushletException
    -
    -
    Create instance through factory method. -

    -

    -
    -
    -
    -
    Parameters:
    aSubject - the subject (topic).
    aLabel - the subject label (optional). -
    Returns:
    a Subscription object (or derived) -
    Throws: -
    PushletException - exception, usually misconfiguration
    -
    -
    -
    - -

    -getId

    -
    -public java.lang.String getId()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -getLabel

    -
    -public java.lang.String getLabel()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -getSubject

    -
    -public java.lang.String getSubject()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    -match

    -
    -public boolean match(Event event)
    -
    -
    Determine if Event matches subscription. -

    -

    -
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/BrowserAdapter.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/BrowserAdapter.html deleted file mode 100755 index 0f2c153c8c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/BrowserAdapter.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.BrowserAdapter - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.BrowserAdapter

    -
    -No usage of nl.justobjects.pushlet.core.BrowserAdapter -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/ClientAdapter.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/ClientAdapter.html deleted file mode 100755 index 68e17479dd..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/ClientAdapter.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - -Uses of Interface nl.justobjects.pushlet.core.ClientAdapter - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Interface
    nl.justobjects.pushlet.core.ClientAdapter

    -
    - - - - - - - - - -
    -Packages that use ClientAdapter
    nl.justobjects.pushlet.core  
    -  -

    - - - - - -
    -Uses of ClientAdapter in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - -
    Classes in nl.justobjects.pushlet.core that implement ClientAdapter
    - classBrowserAdapter - -
    -          Generic implementation of ClientAdapter for browser clients.
    -  -

    - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core that return ClientAdapter
    - ClientAdapterCommand.getClientAdapter() - -
    -          Get client adapter for request.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Command.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Command.html deleted file mode 100755 index 94a71ddd61..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Command.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.Command - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.Command

    -
    - - - - - - - - - -
    -Packages that use Command
    nl.justobjects.pushlet.core  
    -  -

    - - - - - -
    -Uses of Command in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core that return Command
    -static CommandCommand.create(Session aSession, - Event aReqEvent, - javax.servlet.http.HttpServletRequest aHTTPReq, - javax.servlet.http.HttpServletResponse aHTTPRsp) - -
    -          Create new Command object.
    -  -

    - - - - - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core with parameters of type Command
    - voidController.doCommand(Command aCommand) - -
    -          Handle command.
    - voidSubscriber.fetchEvents(Command aCommand) - -
    -          Get events from queue and push to client.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Config.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Config.html deleted file mode 100755 index 46255ef603..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Config.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.Config - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.Config

    -
    -No usage of nl.justobjects.pushlet.core.Config -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/ConfigDefs.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/ConfigDefs.html deleted file mode 100755 index dfb3985ab3..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/ConfigDefs.html +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - -Uses of Interface nl.justobjects.pushlet.core.ConfigDefs - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Interface
    nl.justobjects.pushlet.core.ConfigDefs

    -
    - - - - - - - - - - - - - -
    -Packages that use ConfigDefs
    nl.justobjects.pushlet.core  
    nl.justobjects.pushlet.util  
    -  -

    - - - - - -
    -Uses of ConfigDefs in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Classes in nl.justobjects.pushlet.core that implement ConfigDefs
    - classConfig - -
    -          Loads and maintains overall configuration.
    - classController - -
    -          Handles servlet requests from client.
    - classDispatcher - -
    -          Routes Events to Subscribers.
    - classSession - -
    -          Represents client pushlet session state.
    - classSessionManager - -
    -          Manages lifecycle of Sessions.
    - classSubscriber - -
    -          Handles data channel between dispatcher and client.
    - classSubscription - -
    -          Represents single subject subscription
    -  -

    - - - - - -
    -Uses of ConfigDefs in nl.justobjects.pushlet.util
    -  -

    - - - - - - - - - -
    Subinterfaces of ConfigDefs in nl.justobjects.pushlet.util
    - interfacePushletLogger - -
    -          Logger interface to allow different logging providers.
    -  -

    - - - - - - - - - - - - - - - - - -
    Classes in nl.justobjects.pushlet.util that implement ConfigDefs
    - classDefaultLogger - -
    -          Default logger.
    - classLog - -
    -          Logging wrapper.
    - classLog4jLogger - -
    -          Logger to use Log4j for logging.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Controller.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Controller.html deleted file mode 100755 index 4f520ef738..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Controller.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.Controller - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.Controller

    -
    - - - - - - - - - -
    -Packages that use Controller
    nl.justobjects.pushlet.core  
    -  -

    - - - - - -
    -Uses of Controller in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core that return Controller
    -static ControllerController.create(Session aSession) - -
    -          Create instance through factory method.
    - ControllerSession.getController() - -
    -          Return command controller.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Dispatcher.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Dispatcher.html deleted file mode 100755 index c8ccd83bca..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Dispatcher.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.Dispatcher - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.Dispatcher

    -
    - - - - - - - - - -
    -Packages that use Dispatcher
    nl.justobjects.pushlet.core  
    -  -

    - - - - - -
    -Uses of Dispatcher in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core that return Dispatcher
    -static DispatcherDispatcher.getInstance() - -
    -          Singleton pattern: get single instance.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Event.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Event.html deleted file mode 100755 index 50717b0574..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Event.html +++ /dev/null @@ -1,423 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.Event - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.Event

    -
    - - - - - - - - - - - - - -
    -Packages that use Event
    nl.justobjects.pushlet.client  
    nl.justobjects.pushlet.core  
    -  -

    - - - - - -
    -Uses of Event in nl.justobjects.pushlet.client
    -  -

    - - - - - - - - - - - - - - - - - -
    Methods in nl.justobjects.pushlet.client with parameters of type Event
    - voidPushletClientListener.onAbort(Event theEvent) - -
    -          Abort event from server.
    - voidPushletClientListener.onData(Event theEvent) - -
    -          Data event from server.
    - voidPushletClientListener.onHeartbeat(Event theEvent) - -
    -          Heartbeat event from server.
    -  -

    - - - - - -
    -Uses of Event in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - -
    Fields in nl.justobjects.pushlet.core declared as Event
    - EventCommand.reqEvent - -
    -          Pushlet request event.
    -  -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core that return Event
    -static EventEvent.createDataEvent(java.lang.String aSubject) - -
    -           
    -static EventEvent.createDataEvent(java.lang.String aSubject, - java.util.Map theAttributes) - -
    -           
    - EventEventQueue.deQueue() - -
    -          Get head; if empty wait until something in queue.
    - EventEventQueue.deQueue(long maxWaitTime) - -
    -          Get head; if empty wait for specified time at max.
    - Event[]EventQueue.deQueueAll(long maxWaitTime) - -
    -          Get all queued Events.
    - EventCommand.getResponseEvent() - -
    -          Get pushlet response event.
    -static EventEventParser.parse(java.io.File aFile) - -
    -          Parse Event from a File.
    -static EventEventParser.parse(java.io.Reader aReader) - -
    -          Parse Event from input Reader.
    -static EventEventParser.parse(java.lang.String aString) - -
    -          Parse Event from a String.
    -  -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core with parameters of type Event
    - voidDispatcher.broadcast(Event anEvent) - -
    -          Send event to all subscribers.
    -static CommandCommand.create(Session aSession, - Event aReqEvent, - javax.servlet.http.HttpServletRequest aHTTPReq, - javax.servlet.http.HttpServletResponse aHTTPRsp) - -
    -          Create new Command object.
    - SessionSessionManager.createSession(Event anEvent) - -
    -          Create new Session (but add later).
    - booleanEventQueue.enQueue(Event item) - -
    -          Put item in queue; waits() indefinitely if queue is full.
    - booleanEventQueue.enQueue(Event item, - long maxWaitTime) - -
    -          Put item in queue; if full wait maxtime.
    - booleanSubscription.match(Event event) - -
    -          Determine if Event matches subscription.
    - SubscriptionSubscriber.match(Event event) - -
    -          Determine if we should receive event.
    - voidDispatcher.multicast(Event anEvent) - -
    -          Send event to subscribers matching Event subject.
    - voidSubscriber.onEvent(Event theEvent) - -
    -          Event from Dispatcher: enqueue it.
    - voidClientAdapter.push(Event anEvent) - -
    -          Push single Event to client.
    - voidBrowserAdapter.push(Event anEvent) - -
    -          Push Event to client.
    - voidCommand.setResponseEvent(Event aResponseEvent) - -
    -          Set pushlet response event.
    - voidDispatcher.unicast(Event event, - java.lang.String aSessionId) - -
    -          Send event to specific subscriber.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventParser.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventParser.html deleted file mode 100755 index 8d75087ded..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventParser.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.EventParser - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.EventParser

    -
    -No usage of nl.justobjects.pushlet.core.EventParser -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventPullSource.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventPullSource.html deleted file mode 100755 index b5b040cdba..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventPullSource.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.EventPullSource - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.EventPullSource

    -
    -No usage of nl.justobjects.pushlet.core.EventPullSource -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventQueue.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventQueue.html deleted file mode 100755 index fb00ab765a..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventQueue.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.EventQueue - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.EventQueue

    -
    -No usage of nl.justobjects.pushlet.core.EventQueue -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventSource.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventSource.html deleted file mode 100755 index 56109cb391..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventSource.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - -Uses of Interface nl.justobjects.pushlet.core.EventSource - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Interface
    nl.justobjects.pushlet.core.EventSource

    -
    - - - - - - - - - - - - - -
    -Packages that use EventSource
    nl.justobjects.pushlet.core  
    pow.webserver  
    -  -

    - - - - - -
    -Uses of EventSource in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - -
    Classes in nl.justobjects.pushlet.core that implement EventSource
    - classEventPullSource - -
    -          ABC for specifc EventPullSources.
    -  -

    - - - - - -
    -Uses of EventSource in pow.webserver
    -  -

    - - - - - - - - - -
    Classes in pow.webserver that implement EventSource
    -static classServeur.IvyEventSource - -
    -           
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventSourceManager.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventSourceManager.html deleted file mode 100755 index 1be8aada5b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/EventSourceManager.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.EventSourceManager - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.EventSourceManager

    -
    -No usage of nl.justobjects.pushlet.core.EventSourceManager -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Protocol.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Protocol.html deleted file mode 100755 index c5ac055017..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Protocol.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - -Uses of Interface nl.justobjects.pushlet.core.Protocol - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Interface
    nl.justobjects.pushlet.core.Protocol

    -
    - - - - - - - - - - - - - - - - - -
    -Packages that use Protocol
    nl.justobjects.pushlet.client  
    nl.justobjects.pushlet.core  
    nl.justobjects.pushlet.servlet  
    -  -

    - - - - - -
    -Uses of Protocol in nl.justobjects.pushlet.client
    -  -

    - - - - - - - - - -
    Subinterfaces of Protocol in nl.justobjects.pushlet.client
    - interfacePushletClientListener - -
    -          Interface for listener of the PushletClient object.
    -  -

    - - - - - - - - - -
    Classes in nl.justobjects.pushlet.client that implement Protocol
    - classPushletClient - -
    -          Client API for Java HTTP client applets or apps.
    -  -

    - - - - - -
    -Uses of Protocol in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Classes in nl.justobjects.pushlet.core that implement Protocol
    - classBrowserAdapter - -
    -          Generic implementation of ClientAdapter for browser clients.
    - classCommand - -
    -          Wraps pushlet request/response data.
    - classController - -
    -          Handles servlet requests from client.
    - classDispatcher - -
    -          Routes Events to Subscribers.
    - classEvent - -
    -          Represents the event data.
    - classSession - -
    -          Represents client pushlet session state.
    - classSubscriber - -
    -          Handles data channel between dispatcher and client.
    -  -

    - - - - - -
    -Uses of Protocol in nl.justobjects.pushlet.servlet
    -  -

    - - - - - - - - - -
    Classes in nl.justobjects.pushlet.servlet that implement Protocol
    - classPushlet - -
    -          Servlet runs a Subscriber per request.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Session.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Session.html deleted file mode 100755 index 994d9fa1be..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Session.html +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.Session - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.Session

    -
    - - - - - - - - - -
    -Packages that use Session
    nl.justobjects.pushlet.core  
    -  -

    - - - - - -
    -Uses of Session in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - -
    Fields in nl.justobjects.pushlet.core declared as Session
    - SessionCommand.session - -
    -          Pushlet session.
    -  -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core that return Session
    -static SessionSession.create(java.lang.String anId) - -
    -          Create instance through factory method.
    - SessionSessionManager.createSession(Event anEvent) - -
    -          Create new Session (but add later).
    - SessionSubscriber.getSession() - -
    -          Return client session.
    - SessionSessionManager.getSession(java.lang.String anId) - -
    -          Get Session by session id.
    - Session[]SessionManager.getSessions() - -
    -          Get copy of listening Sessions.
    - SessionSessionManager.removeSession(Session aSession) - -
    -          Register session for removal.
    -  -

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core with parameters of type Session
    - voidSessionManager.addSession(Session session) - -
    -          Add session.
    -static SubscriberSubscriber.create(Session aSession) - -
    -          Create instance through factory method.
    -static ControllerController.create(Session aSession) - -
    -          Create instance through factory method.
    -static CommandCommand.create(Session aSession, - Event aReqEvent, - javax.servlet.http.HttpServletRequest aHTTPReq, - javax.servlet.http.HttpServletResponse aHTTPRsp) - -
    -          Create new Command object.
    - SessionSessionManager.removeSession(Session aSession) - -
    -          Register session for removal.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/SessionManager.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/SessionManager.html deleted file mode 100755 index 3850cbaf0f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/SessionManager.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.SessionManager - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.SessionManager

    -
    - - - - - - - - - -
    -Packages that use SessionManager
    nl.justobjects.pushlet.core  
    -  -

    - - - - - -
    -Uses of SessionManager in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core that return SessionManager
    -static SessionManagerSessionManager.getInstance() - -
    -          Singleton pattern: get single instance.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Subscriber.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Subscriber.html deleted file mode 100755 index 90e5e479cc..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Subscriber.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.Subscriber - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.Subscriber

    -
    - - - - - - - - - -
    -Packages that use Subscriber
    nl.justobjects.pushlet.core  
    -  -

    - - - - - -
    -Uses of Subscriber in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core that return Subscriber
    -static SubscriberSubscriber.create(Session aSession) - -
    -          Create instance through factory method.
    - SubscriberSession.getSubscriber() - -
    -          Return subscriber.
    - SubscriberController.getSubscriber() - -
    -           
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Subscription.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Subscription.html deleted file mode 100755 index d5cca49ecf..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/class-use/Subscription.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.core.Subscription - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.core.Subscription

    -
    - - - - - - - - - -
    -Packages that use Subscription
    nl.justobjects.pushlet.core  
    -  -

    - - - - - -
    -Uses of Subscription in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core that return Subscription
    - SubscriptionSubscriber.addSubscription(java.lang.String aSubject, - java.lang.String aLabel) - -
    -          Add a subscription.
    -static SubscriptionSubscription.create(java.lang.String aSubject) - -
    -          Create instance through factory method.
    -static SubscriptionSubscription.create(java.lang.String aSubject, - java.lang.String aLabel) - -
    -          Create instance through factory method.
    - Subscription[]Subscriber.getSubscriptions() - -
    -          Return subscriptions.
    - SubscriptionSubscriber.match(Event event) - -
    -          Determine if we should receive event.
    - SubscriptionSubscriber.removeSubscription(java.lang.String aSubscriptionId) - -
    -          Remove a subscription.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/package-frame.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/package-frame.html deleted file mode 100755 index 119c97abb3..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/package-frame.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - -nl.justobjects.pushlet.core - - - - - - - - - - - -nl.justobjects.pushlet.core - - - - -
    -Interfaces  - -
    -ClientAdapter -
    -ConfigDefs -
    -EventSource -
    -Protocol
    - - - - - - -
    -Classes  - -
    -BrowserAdapter -
    -Command -
    -Config -
    -Controller -
    -Dispatcher -
    -Event -
    -EventParser -
    -EventPullSource -
    -EventQueue -
    -EventSourceManager -
    -Session -
    -SessionManager -
    -Subscriber -
    -Subscription
    - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/package-summary.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/package-summary.html deleted file mode 100755 index 407d1ab569..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/package-summary.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - -nl.justobjects.pushlet.core - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -

    -Package nl.justobjects.pushlet.core -

    - - - - - - - - - - - - - - - - - - - - - -
    -Interface Summary
    ClientAdapterAdapter interface for encapsulation of specific HTTP clients.
    ConfigDefsDefinition of config property strings.
    EventSourceInterface for specifc Event(Pull/Push)Sources.
    ProtocolConstants for Pushlet protocols.
    -  - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class Summary
    BrowserAdapterGeneric implementation of ClientAdapter for browser clients.
    CommandWraps pushlet request/response data.
    ConfigLoads and maintains overall configuration.
    ControllerHandles servlet requests from client.
    DispatcherRoutes Events to Subscribers.
    EventRepresents the event data.
    EventParserParses XML into Event objects.
    EventPullSourceABC for specifc EventPullSources.
    EventQueueFIFO queue with guarded suspension.
    EventSourceManagerMaintains lifecycle of event sources.
    SessionRepresents client pushlet session state.
    SessionManagerManages lifecycle of Sessions.
    SubscriberHandles data channel between dispatcher and client.
    SubscriptionRepresents single subject subscription
    -  - -

    -

    -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/package-tree.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/package-tree.html deleted file mode 100755 index f3cb407847..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/package-tree.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - -nl.justobjects.pushlet.core Class Hierarchy - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Hierarchy For Package nl.justobjects.pushlet.core -

    -
    -
    -
    Package Hierarchies:
    All Packages
    -
    -

    -Class Hierarchy -

    - -

    -Interface Hierarchy -

    - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/package-use.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/package-use.html deleted file mode 100755 index cadd226116..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/core/package-use.html +++ /dev/null @@ -1,318 +0,0 @@ - - - - - - -Uses of Package nl.justobjects.pushlet.core - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Package
    nl.justobjects.pushlet.core

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Packages that use nl.justobjects.pushlet.core
    nl.justobjects.pushlet.client  
    nl.justobjects.pushlet.core  
    nl.justobjects.pushlet.servlet  
    nl.justobjects.pushlet.util  
    pow.webserver  
    -  -

    - - - - - - - - - - - -
    -Classes in nl.justobjects.pushlet.core used by nl.justobjects.pushlet.client
    Event - -
    -          Represents the event data.
    Protocol - -
    -          Constants for Pushlet protocols.
    -  -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Classes in nl.justobjects.pushlet.core used by nl.justobjects.pushlet.core
    ClientAdapter - -
    -          Adapter interface for encapsulation of specific HTTP clients.
    Command - -
    -          Wraps pushlet request/response data.
    ConfigDefs - -
    -          Definition of config property strings.
    Controller - -
    -          Handles servlet requests from client.
    Dispatcher - -
    -          Routes Events to Subscribers.
    Event - -
    -          Represents the event data.
    EventSource - -
    -          Interface for specifc Event(Pull/Push)Sources.
    Protocol - -
    -          Constants for Pushlet protocols.
    Session - -
    -          Represents client pushlet session state.
    SessionManager - -
    -          Manages lifecycle of Sessions.
    Subscriber - -
    -          Handles data channel between dispatcher and client.
    Subscription - -
    -          Represents single subject subscription
    -  -

    - - - - - - - - -
    -Classes in nl.justobjects.pushlet.core used by nl.justobjects.pushlet.servlet
    Protocol - -
    -          Constants for Pushlet protocols.
    -  -

    - - - - - - - - -
    -Classes in nl.justobjects.pushlet.core used by nl.justobjects.pushlet.util
    ConfigDefs - -
    -          Definition of config property strings.
    -  -

    - - - - - - - - -
    -Classes in nl.justobjects.pushlet.core used by pow.webserver
    EventSource - -
    -          Interface for specifc Event(Pull/Push)Sources.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/package-frame.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/package-frame.html deleted file mode 100755 index 94d69f80bf..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/package-frame.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -nl.justobjects.pushlet - - - - - - - - - - - -nl.justobjects.pushlet - - - - -
    -Classes  - -
    -Version
    - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/package-summary.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/package-summary.html deleted file mode 100755 index eaa2e994bd..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/package-summary.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - -nl.justobjects.pushlet - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -

    -Package nl.justobjects.pushlet -

    - - - - - - - - - -
    -Class Summary
    VersionVersion info class.
    -  - -

    -

    -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/package-tree.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/package-tree.html deleted file mode 100755 index bfff2aa261..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/package-tree.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - -nl.justobjects.pushlet Class Hierarchy - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Hierarchy For Package nl.justobjects.pushlet -

    -
    -
    -
    Package Hierarchies:
    All Packages
    -
    -

    -Class Hierarchy -

    -
      -
    • java.lang.Object -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/package-use.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/package-use.html deleted file mode 100755 index 8c57ff1ce2..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/package-use.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Package nl.justobjects.pushlet - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Package
    nl.justobjects.pushlet

    -
    -No usage of nl.justobjects.pushlet -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/Pushlet.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/Pushlet.html deleted file mode 100755 index 13187fa22c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/Pushlet.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - -Pushlet - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.servlet -
    -Class Pushlet

    -
    -java.lang.Object
    -  extended by javax.servlet.GenericServlet
    -      extended by javax.servlet.http.HttpServlet
    -          extended by nl.justobjects.pushlet.servlet.Pushlet
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, Protocol
    -
    -
    -
    -
    public class Pushlet
    extends javax.servlet.http.HttpServlet
    implements Protocol
    - - -

    -Servlet runs a Subscriber per request. -

    - -

    -

    -
    Version:
    -
    $Id: Pushlet.java,v 1.23 2007/12/04 13:55:53 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    See Also:
    Serialized Form
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.Protocol
    DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
    -  - - - - - - - - - - -
    -Constructor Summary
    Pushlet() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voiddestroy() - -
    -           
    - voiddoGet(javax.servlet.http.HttpServletRequest request, - javax.servlet.http.HttpServletResponse response) - -
    -          Servlet GET request: handles event requests.
    - voiddoPost(javax.servlet.http.HttpServletRequest request, - javax.servlet.http.HttpServletResponse response) - -
    -          Servlet POST request: extracts event data from body.
    - voidinit() - -
    -           
    - - - - - - - -
    Methods inherited from class javax.servlet.http.HttpServlet
    service
    - - - - - - - -
    Methods inherited from class javax.servlet.GenericServlet
    getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Pushlet

    -
    -public Pushlet()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -init

    -
    -public void init()
    -          throws javax.servlet.ServletException
    -
    -
    -
    Overrides:
    init in class javax.servlet.GenericServlet
    -
    -
    - -
    Throws: -
    javax.servlet.ServletException
    -
    -
    -
    - -

    -destroy

    -
    -public void destroy()
    -
    -
    -
    Specified by:
    destroy in interface javax.servlet.Servlet
    Overrides:
    destroy in class javax.servlet.GenericServlet
    -
    -
    -
    -
    -
    -
    - -

    -doGet

    -
    -public void doGet(javax.servlet.http.HttpServletRequest request,
    -                  javax.servlet.http.HttpServletResponse response)
    -           throws javax.servlet.ServletException,
    -                  java.io.IOException
    -
    -
    Servlet GET request: handles event requests. -

    -

    -
    Overrides:
    doGet in class javax.servlet.http.HttpServlet
    -
    -
    - -
    Throws: -
    javax.servlet.ServletException -
    java.io.IOException
    -
    -
    -
    - -

    -doPost

    -
    -public void doPost(javax.servlet.http.HttpServletRequest request,
    -                   javax.servlet.http.HttpServletResponse response)
    -            throws javax.servlet.ServletException,
    -                   java.io.IOException
    -
    -
    Servlet POST request: extracts event data from body. -

    -

    -
    Overrides:
    doPost in class javax.servlet.http.HttpServlet
    -
    -
    - -
    Throws: -
    javax.servlet.ServletException -
    java.io.IOException
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/class-use/Pushlet.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/class-use/Pushlet.html deleted file mode 100755 index 35d5559cdf..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/class-use/Pushlet.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.servlet.Pushlet - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.servlet.Pushlet

    -
    -No usage of nl.justobjects.pushlet.servlet.Pushlet -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/package-frame.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/package-frame.html deleted file mode 100755 index dbfc6c327c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/package-frame.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -nl.justobjects.pushlet.servlet - - - - - - - - - - - -nl.justobjects.pushlet.servlet - - - - -
    -Classes  - -
    -Pushlet
    - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/package-summary.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/package-summary.html deleted file mode 100755 index f27cba36c1..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/package-summary.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - -nl.justobjects.pushlet.servlet - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -

    -Package nl.justobjects.pushlet.servlet -

    - - - - - - - - - -
    -Class Summary
    PushletServlet runs a Subscriber per request.
    -  - -

    -

    -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/package-tree.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/package-tree.html deleted file mode 100755 index f123e72142..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/package-tree.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - -nl.justobjects.pushlet.servlet Class Hierarchy - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Hierarchy For Package nl.justobjects.pushlet.servlet -

    -
    -
    -
    Package Hierarchies:
    All Packages
    -
    -

    -Class Hierarchy -

    -
      -
    • java.lang.Object
        -
      • javax.servlet.GenericServlet (implements java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig) -
          -
        • javax.servlet.http.HttpServlet (implements java.io.Serializable) -
            -
          • nl.justobjects.pushlet.servlet.Pushlet (implements nl.justobjects.pushlet.core.Protocol) -
          -
        -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/package-use.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/package-use.html deleted file mode 100755 index 6d7fc88a89..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/servlet/package-use.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Package nl.justobjects.pushlet.servlet - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Package
    nl.justobjects.pushlet.servlet

    -
    -No usage of nl.justobjects.pushlet.servlet -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/DefaultLogger.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/DefaultLogger.html deleted file mode 100755 index 848a70a702..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/DefaultLogger.html +++ /dev/null @@ -1,538 +0,0 @@ - - - - - - -DefaultLogger - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.util -
    -Class DefaultLogger

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.util.DefaultLogger
    -
    -
    -
    All Implemented Interfaces:
    ConfigDefs, PushletLogger
    -
    -
    -
    -
    public class DefaultLogger
    extends java.lang.Object
    implements PushletLogger
    - - -

    -Default logger. -

    - Logs to stdout. Override this class by setting "logger.class" in pushlet.properties to your own logger - to integrate your own logging library. -

    - -

    -

    -
    Version:
    -
    $Id: DefaultLogger.java,v 1.2 2007/12/07 12:57:40 justb Exp $
    -
    Author:
    -
    Just van den Broecke
    -
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.ConfigDefs
    CONTROLLER_CLASS, DISPATCHER_CLASS, LISTEN_FORCE_PULL_AGENTS, LISTEN_FORCE_PULL_ALL, LOG_LEVEL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, LOGGER_CLASS, POLL_REFRESH_TIMEOUT_MILLIS, POLL_REFRESH_WAIT_MAX_MILLIS, POLL_REFRESH_WAIT_MIN_MILLIS, PULL_REFRESH_TIMEOUT_MILLIS, PULL_REFRESH_WAIT_MAX_MILLIS, PULL_REFRESH_WAIT_MIN_MILLIS, QUEUE_READ_TIMEOUT_MILLIS, QUEUE_SIZE, QUEUE_WRITE_TIMEOUT_MILLIS, SESSION_CLASS, SESSION_ID_GENERATION, SESSION_ID_GENERATION_RANDOMSTRING, SESSION_ID_GENERATION_UUID, SESSION_ID_SIZE, SESSION_MANAGER_CLASS, SESSION_TIMEOUT_MINS, SOURCES_ACTIVATE, SUBSCRIBER_CLASS, SUBSCRIPTION_CLASS
    -  - - - - - - - - - - -
    -Constructor Summary
    DefaultLogger() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voiddebug(java.lang.String aMessage) - -
    -          Log message for debug level.
    - voiderror(java.lang.String aMessage) - -
    -          Log message for error level.
    - voiderror(java.lang.String aMessage, - java.lang.Throwable aThrowable) - -
    -          Log message (error level with exception).
    - voidfatal(java.lang.String aMessage) - -
    -          Log message for fatal level.
    - voidfatal(java.lang.String aMessage, - java.lang.Throwable aThrowable) - -
    -          Log message (fatal level with exception).
    - voidinfo(java.lang.String aMessage) - -
    -          Log message for info level.
    - voidinit() - -
    -          Method allowing to initialize our logger
    - voidsetLevel(int aLevel) - -
    -          Set log level
    - voidtrace(java.lang.String aMessage) - -
    -          Log message for trace level.
    - voidwarn(java.lang.String aMessage) - -
    -          Log message for warning level.
    - voidwarn(java.lang.String aMessage, - java.lang.Throwable aThrowable) - -
    -          Log message for warning level with exception.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -DefaultLogger

    -
    -public DefaultLogger()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -init

    -
    -public void init()
    -
    -
    Description copied from interface: PushletLogger
    -
    Method allowing to initialize our logger -

    -

    -
    Specified by:
    init in interface PushletLogger
    -
    -
    -
    -
    -
    -
    - -

    -trace

    -
    -public void trace(java.lang.String aMessage)
    -
    -
    Log message for trace level. -

    -

    -
    Specified by:
    trace in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -debug

    -
    -public void debug(java.lang.String aMessage)
    -
    -
    Log message for debug level. -

    -

    -
    Specified by:
    debug in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -info

    -
    -public void info(java.lang.String aMessage)
    -
    -
    Log message for info level. -

    -

    -
    Specified by:
    info in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -warn

    -
    -public void warn(java.lang.String aMessage)
    -
    -
    Log message for warning level. -

    -

    -
    Specified by:
    warn in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -warn

    -
    -public void warn(java.lang.String aMessage,
    -                 java.lang.Throwable aThrowable)
    -
    -
    Log message for warning level with exception. -

    -

    -
    Specified by:
    warn in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    aThrowable - the exception
    -
    -
    -
    - -

    -error

    -
    -public void error(java.lang.String aMessage)
    -
    -
    Log message for error level. -

    -

    -
    Specified by:
    error in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -error

    -
    -public void error(java.lang.String aMessage,
    -                  java.lang.Throwable aThrowable)
    -
    -
    Log message (error level with exception). -

    -

    -
    Specified by:
    error in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    aThrowable - the exception
    -
    -
    -
    - -

    -fatal

    -
    -public void fatal(java.lang.String aMessage)
    -
    -
    Log message for fatal level. -

    -

    -
    Specified by:
    fatal in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -fatal

    -
    -public void fatal(java.lang.String aMessage,
    -                  java.lang.Throwable aThrowable)
    -
    -
    Log message (fatal level with exception). -

    -

    -
    Specified by:
    fatal in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    aThrowable - the exception
    -
    -
    -
    - -

    -setLevel

    -
    -public void setLevel(int aLevel)
    -
    -
    Set log level -

    -

    -
    Specified by:
    setLevel in interface PushletLogger
    -
    -
    -
    Parameters:
    aLevel - the message to be logged
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Log.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Log.html deleted file mode 100755 index e3ebf07a3e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Log.html +++ /dev/null @@ -1,538 +0,0 @@ - - - - - - -Log - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.util -
    -Class Log

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.util.Log
    -
    -
    -
    All Implemented Interfaces:
    ConfigDefs
    -
    -
    -
    -
    public class Log
    extends java.lang.Object
    implements ConfigDefs
    - - -

    -Logging wrapper. -

    - Provides a hook to direct logging to your own logging library. Override the DefaultLogger class by setting - "logger.class" in pushlet.properties to your own logger - to integrate your own logging library. -

    - -

    -

    -
    Version:
    -
    $Id: Log.java,v 1.5 2007/12/07 12:57:40 justb Exp $
    -
    Author:
    -
    Just van den Broecke
    -
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.ConfigDefs
    CONTROLLER_CLASS, DISPATCHER_CLASS, LISTEN_FORCE_PULL_AGENTS, LISTEN_FORCE_PULL_ALL, LOG_LEVEL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, LOGGER_CLASS, POLL_REFRESH_TIMEOUT_MILLIS, POLL_REFRESH_WAIT_MAX_MILLIS, POLL_REFRESH_WAIT_MIN_MILLIS, PULL_REFRESH_TIMEOUT_MILLIS, PULL_REFRESH_WAIT_MAX_MILLIS, PULL_REFRESH_WAIT_MIN_MILLIS, QUEUE_READ_TIMEOUT_MILLIS, QUEUE_SIZE, QUEUE_WRITE_TIMEOUT_MILLIS, SESSION_CLASS, SESSION_ID_GENERATION, SESSION_ID_GENERATION_RANDOMSTRING, SESSION_ID_GENERATION_UUID, SESSION_ID_SIZE, SESSION_MANAGER_CLASS, SESSION_TIMEOUT_MINS, SOURCES_ACTIVATE, SUBSCRIBER_CLASS, SUBSCRIPTION_CLASS
    -  - - - - - - - - - - -
    -Constructor Summary
    Log() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    -static voiddebug(java.lang.String aMessage) - -
    -          Log message for debug level.
    -static voiderror(java.lang.String aMessage) - -
    -          Log message for error level.
    -static voiderror(java.lang.String aMessage, - java.lang.Throwable aThrowable) - -
    -          Log message (error level with exception).
    -static voidfatal(java.lang.String aMessage) - -
    -          Log message for fatal level.
    -static voidfatal(java.lang.String aMessage, - java.lang.Throwable aThrowable) - -
    -          Log message (fatal level with exception).
    -static voidinfo(java.lang.String aMessage) - -
    -          Log message for info level.
    -static voidinit() - -
    -          General purpose initialization.
    -static voidsetLevel(int aLevel) - -
    -          Set log level
    -static voidtrace(java.lang.String aMessage) - -
    -          Log message for trace level.
    -static voidwarn(java.lang.String aMessage) - -
    -          Log message for warning level.
    -static voidwarn(java.lang.String aMessage, - java.lang.Throwable aThrowable) - -
    -          Log message for warning level with exception.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Log

    -
    -public Log()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -init

    -
    -public static void init()
    -
    -
    General purpose initialization. -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -trace

    -
    -public static void trace(java.lang.String aMessage)
    -
    -
    Log message for trace level. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -debug

    -
    -public static void debug(java.lang.String aMessage)
    -
    -
    Log message for debug level. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -info

    -
    -public static void info(java.lang.String aMessage)
    -
    -
    Log message for info level. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -warn

    -
    -public static void warn(java.lang.String aMessage)
    -
    -
    Log message for warning level. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -warn

    -
    -public static void warn(java.lang.String aMessage,
    -                        java.lang.Throwable aThrowable)
    -
    -
    Log message for warning level with exception. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    aThrowable - the exception
    -
    -
    -
    - -

    -error

    -
    -public static void error(java.lang.String aMessage)
    -
    -
    Log message for error level. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -error

    -
    -public static void error(java.lang.String aMessage,
    -                         java.lang.Throwable aThrowable)
    -
    -
    Log message (error level with exception). -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    aThrowable - the exception
    -
    -
    -
    - -

    -fatal

    -
    -public static void fatal(java.lang.String aMessage)
    -
    -
    Log message for fatal level. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -fatal

    -
    -public static void fatal(java.lang.String aMessage,
    -                         java.lang.Throwable aThrowable)
    -
    -
    Log message (fatal level with exception). -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    aThrowable - the exception
    -
    -
    -
    - -

    -setLevel

    -
    -public static void setLevel(int aLevel)
    -
    -
    Set log level -

    -

    -
    -
    -
    -
    Parameters:
    aLevel - the message to be logged
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Log4jLogger.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Log4jLogger.html deleted file mode 100755 index bd4fcaf448..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Log4jLogger.html +++ /dev/null @@ -1,548 +0,0 @@ - - - - - - -Log4jLogger - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.util -
    -Class Log4jLogger

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.util.Log4jLogger
    -
    -
    -
    All Implemented Interfaces:
    ConfigDefs, PushletLogger
    -
    -
    -
    -
    public class Log4jLogger
    extends java.lang.Object
    implements PushletLogger
    - - -

    -Logger to use Log4j for logging. -

    - Logs using Log4j. - This class will require a log4j library in the classpath of the Pushlet. -

    - -

    -

    -
    Version:
    -
    $Id: Log4jLogger.java,v 1.1 2007/12/07 12:57:40 justb Exp $
    -
    Author:
    -
    Uli Romahn
    -
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.ConfigDefs
    CONTROLLER_CLASS, DISPATCHER_CLASS, LISTEN_FORCE_PULL_AGENTS, LISTEN_FORCE_PULL_ALL, LOG_LEVEL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, LOGGER_CLASS, POLL_REFRESH_TIMEOUT_MILLIS, POLL_REFRESH_WAIT_MAX_MILLIS, POLL_REFRESH_WAIT_MIN_MILLIS, PULL_REFRESH_TIMEOUT_MILLIS, PULL_REFRESH_WAIT_MAX_MILLIS, PULL_REFRESH_WAIT_MIN_MILLIS, QUEUE_READ_TIMEOUT_MILLIS, QUEUE_SIZE, QUEUE_WRITE_TIMEOUT_MILLIS, SESSION_CLASS, SESSION_ID_GENERATION, SESSION_ID_GENERATION_RANDOMSTRING, SESSION_ID_GENERATION_UUID, SESSION_ID_SIZE, SESSION_MANAGER_CLASS, SESSION_TIMEOUT_MINS, SOURCES_ACTIVATE, SUBSCRIBER_CLASS, SUBSCRIPTION_CLASS
    -  - - - - - - - - - - -
    -Constructor Summary
    Log4jLogger() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voiddebug(java.lang.String aMessage) - -
    -          Log message for debug level.
    - voiderror(java.lang.String aMessage) - -
    -          Log message for error level.
    - voiderror(java.lang.String aMessage, - java.lang.Throwable aThrowable) - -
    -          Log message (error level with exception).
    - voidfatal(java.lang.String aMessage) - -
    -          Log message for fatal level.
    - voidfatal(java.lang.String aMessage, - java.lang.Throwable aThrowable) - -
    -          Log message (fatal level with exception).
    - voidinfo(java.lang.String aMessage) - -
    -          Log message for info level.
    - voidinit() - -
    -          Method allowing to initialize our logger
    - voidsetLevel(int aLevel) - -
    -          Set log level
    - voidtrace(java.lang.String aMessage) - -
    -          Log message for trace level.
    - voidwarn(java.lang.String aMessage) - -
    -          Log message for warning level.
    - voidwarn(java.lang.String aMessage, - java.lang.Throwable aThrowable) - -
    -          Log message for warning level with exception.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Log4jLogger

    -
    -public Log4jLogger()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -init

    -
    -public void init()
    -
    -
    Description copied from interface: PushletLogger
    -
    Method allowing to initialize our logger -

    -

    -
    Specified by:
    init in interface PushletLogger
    -
    -
    -
    -
    -
    -
    - -

    -debug

    -
    -public void debug(java.lang.String aMessage)
    -
    -
    Description copied from interface: PushletLogger
    -
    Log message for debug level. -

    -

    -
    Specified by:
    debug in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -error

    -
    -public void error(java.lang.String aMessage)
    -
    -
    Description copied from interface: PushletLogger
    -
    Log message for error level. -

    -

    -
    Specified by:
    error in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -error

    -
    -public void error(java.lang.String aMessage,
    -                  java.lang.Throwable aThrowable)
    -
    -
    Description copied from interface: PushletLogger
    -
    Log message (error level with exception). -

    -

    -
    Specified by:
    error in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    aThrowable - the exception
    -
    -
    -
    - -

    -fatal

    -
    -public void fatal(java.lang.String aMessage)
    -
    -
    Description copied from interface: PushletLogger
    -
    Log message for fatal level. -

    -

    -
    Specified by:
    fatal in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -fatal

    -
    -public void fatal(java.lang.String aMessage,
    -                  java.lang.Throwable aThrowable)
    -
    -
    Description copied from interface: PushletLogger
    -
    Log message (fatal level with exception). -

    -

    -
    Specified by:
    fatal in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    aThrowable - the exception
    -
    -
    -
    - -

    -info

    -
    -public void info(java.lang.String aMessage)
    -
    -
    Description copied from interface: PushletLogger
    -
    Log message for info level. -

    -

    -
    Specified by:
    info in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -trace

    -
    -public void trace(java.lang.String aMessage)
    -
    -
    Description copied from interface: PushletLogger
    -
    Log message for trace level. -

    -

    -
    Specified by:
    trace in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -warn

    -
    -public void warn(java.lang.String aMessage)
    -
    -
    Description copied from interface: PushletLogger
    -
    Log message for warning level. -

    -

    -
    Specified by:
    warn in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -warn

    -
    -public void warn(java.lang.String aMessage,
    -                 java.lang.Throwable aThrowable)
    -
    -
    Description copied from interface: PushletLogger
    -
    Log message for warning level with exception. -

    -

    -
    Specified by:
    warn in interface PushletLogger
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    aThrowable - the exception
    -
    -
    -
    - -

    -setLevel

    -
    -public void setLevel(int aLevel)
    -
    -
    Description copied from interface: PushletLogger
    -
    Set log level -

    -

    -
    Specified by:
    setLevel in interface PushletLogger
    -
    -
    -
    Parameters:
    aLevel - a valid Level from ConfigDefs
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/PushletException.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/PushletException.html deleted file mode 100755 index 86bd047644..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/PushletException.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - -PushletException - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.util -
    -Class PushletException

    -
    -java.lang.Object
    -  extended by java.lang.Throwable
    -      extended by java.lang.Exception
    -          extended by nl.justobjects.pushlet.util.PushletException
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable
    -
    -
    -
    -
    public class PushletException
    extends java.lang.Exception
    - - -

    -Generic exception wrapper. -

    - -

    -

    -
    Version:
    -
    $Id: PushletException.java,v 1.1 2005/02/15 15:14:34 justb Exp $
    -
    Author:
    -
    Just van den Broecke
    -
    See Also:
    Serialized Form
    -
    - -

    - - - - - - - - - - - - - - - - - -
    -Constructor Summary
    PushletException(java.lang.String aMessage) - -
    -           
    PushletException(java.lang.String aMessage, - java.lang.Throwable t) - -
    -           
    PushletException(java.lang.Throwable t) - -
    -           
    -  - - - - - - - - - - - -
    -Method Summary
    - java.lang.StringtoString() - -
    -           
    - - - - - - - -
    Methods inherited from class java.lang.Throwable
    fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -PushletException

    -
    -public PushletException(java.lang.String aMessage,
    -                        java.lang.Throwable t)
    -
    -
    -
    - -

    -PushletException

    -
    -public PushletException(java.lang.String aMessage)
    -
    -
    -
    - -

    -PushletException

    -
    -public PushletException(java.lang.Throwable t)
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -toString

    -
    -public java.lang.String toString()
    -
    -
    -
    Overrides:
    toString in class java.lang.Throwable
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/PushletLogger.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/PushletLogger.html deleted file mode 100755 index 434ae4992b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/PushletLogger.html +++ /dev/null @@ -1,492 +0,0 @@ - - - - - - -PushletLogger - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.util -
    -Interface PushletLogger

    -
    -
    All Superinterfaces:
    ConfigDefs
    -
    -
    -
    All Known Implementing Classes:
    DefaultLogger, Log4jLogger
    -
    -
    -
    -
    public interface PushletLogger
    extends ConfigDefs
    - - -

    -Logger interface to allow different logging providers. -

    -

    - -

    -

    -
    Version:
    -
    $Id: PushletLogger.java,v 1.1 2007/12/07 12:57:40 justb Exp $
    -
    Author:
    -
    Ulrich Romahn
    -
    -
    - -

    - - - - - - - -
    -Field Summary
    - - - - - - - -
    Fields inherited from interface nl.justobjects.pushlet.core.ConfigDefs
    CONTROLLER_CLASS, DISPATCHER_CLASS, LISTEN_FORCE_PULL_AGENTS, LISTEN_FORCE_PULL_ALL, LOG_LEVEL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, LOGGER_CLASS, POLL_REFRESH_TIMEOUT_MILLIS, POLL_REFRESH_WAIT_MAX_MILLIS, POLL_REFRESH_WAIT_MIN_MILLIS, PULL_REFRESH_TIMEOUT_MILLIS, PULL_REFRESH_WAIT_MAX_MILLIS, PULL_REFRESH_WAIT_MIN_MILLIS, QUEUE_READ_TIMEOUT_MILLIS, QUEUE_SIZE, QUEUE_WRITE_TIMEOUT_MILLIS, SESSION_CLASS, SESSION_ID_GENERATION, SESSION_ID_GENERATION_RANDOMSTRING, SESSION_ID_GENERATION_UUID, SESSION_ID_SIZE, SESSION_MANAGER_CLASS, SESSION_TIMEOUT_MINS, SOURCES_ACTIVATE, SUBSCRIBER_CLASS, SUBSCRIPTION_CLASS
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voiddebug(java.lang.String aMessage) - -
    -          Log message for debug level.
    - voiderror(java.lang.String aMessage) - -
    -          Log message for error level.
    - voiderror(java.lang.String aMessage, - java.lang.Throwable aThrowable) - -
    -          Log message (error level with exception).
    - voidfatal(java.lang.String aMessage) - -
    -          Log message for fatal level.
    - voidfatal(java.lang.String aMessage, - java.lang.Throwable aThrowable) - -
    -          Log message (fatal level with exception).
    - voidinfo(java.lang.String aMessage) - -
    -          Log message for info level.
    - voidinit() - -
    -          Method allowing to initialize our logger
    - voidsetLevel(int aLevel) - -
    -          Set log level
    - voidtrace(java.lang.String aMessage) - -
    -          Log message for trace level.
    - voidwarn(java.lang.String aMessage) - -
    -          Log message for warning level.
    - voidwarn(java.lang.String aMessage, - java.lang.Throwable aThrowable) - -
    -          Log message for warning level with exception.
    -  -

    - - - - - - - - -
    -Method Detail
    - -

    -init

    -
    -void init()
    -
    -
    Method allowing to initialize our logger -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -trace

    -
    -void trace(java.lang.String aMessage)
    -
    -
    Log message for trace level. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -debug

    -
    -void debug(java.lang.String aMessage)
    -
    -
    Log message for debug level. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -info

    -
    -void info(java.lang.String aMessage)
    -
    -
    Log message for info level. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -warn

    -
    -void warn(java.lang.String aMessage)
    -
    -
    Log message for warning level. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -warn

    -
    -void warn(java.lang.String aMessage,
    -          java.lang.Throwable aThrowable)
    -
    -
    Log message for warning level with exception. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    aThrowable - the exception
    -
    -
    -
    - -

    -error

    -
    -void error(java.lang.String aMessage)
    -
    -
    Log message for error level. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -error

    -
    -void error(java.lang.String aMessage,
    -           java.lang.Throwable aThrowable)
    -
    -
    Log message (error level with exception). -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    aThrowable - the exception
    -
    -
    -
    - -

    -fatal

    -
    -void fatal(java.lang.String aMessage)
    -
    -
    Log message for fatal level. -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    -
    -
    -
    - -

    -fatal

    -
    -void fatal(java.lang.String aMessage,
    -           java.lang.Throwable aThrowable)
    -
    -
    Log message (fatal level with exception). -

    -

    -
    -
    -
    -
    Parameters:
    aMessage - the message to be logged
    aThrowable - the exception
    -
    -
    -
    - -

    -setLevel

    -
    -void setLevel(int aLevel)
    -
    -
    Set log level -

    -

    -
    -
    -
    -
    Parameters:
    aLevel - a valid Level from ConfigDefs
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Rand.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Rand.html deleted file mode 100755 index 406ce07389..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Rand.html +++ /dev/null @@ -1,622 +0,0 @@ - - - - - - -Rand - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.util -
    -Class Rand

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.util.Rand
    -
    -
    -
    -
    public class Rand
    extends java.lang.Object
    - - -

    -Randomizing routines. -

    - -

    -

    -
    Version:
    -
    $Id: Rand.java,v 1.4 2007/12/07 12:57:40 justb Exp $
    -
    Author:
    -
    Just van den Broecke
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    Rand() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    -static java.io.FilerandomBinaryFile(int aSize) - -
    -           
    -static byte[]randomBlob(int aSize) - -
    -           
    -static byterandomByte() - -
    -           
    -static byte[]randomBytes(int aSize) - -
    -           
    -static charrandomChar() - -
    -           
    -static doublerandomDouble() - -
    -           
    -static intrandomInt() - -
    -           
    -static intrandomInt(int min, - int max) - -
    -           
    -static longrandomLong() - -
    -           
    -static longrandomLong(long min, - long max) - -
    -           
    -static java.lang.StringrandomName(int aLength) - -
    -           
    -static charrandomNonVowel() - -
    -           
    -static voidrandomSleep(long min, - long max) - -
    -           
    -static java.lang.StringrandomString() - -
    -           
    -static java.lang.StringrandomString(int aLength) - -
    -           
    -static java.io.FilerandomTempDir() - -
    -           
    -static java.io.FilerandomTempFile() - -
    -           
    -static java.io.FilerandomTextFile(int aSize) - -
    -           
    -static charrandomVowel() - -
    -           
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Rand

    -
    -public Rand()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -randomChar

    -
    -public static char randomChar()
    -
    -
    -
    -
    -
    -
    - -

    -randomVowel

    -
    -public static char randomVowel()
    -
    -
    -
    -
    -
    -
    - -

    -randomNonVowel

    -
    -public static char randomNonVowel()
    -
    -
    -
    -
    -
    -
    - -

    -randomTempDir

    -
    -public static java.io.File randomTempDir()
    -                                  throws java.lang.Exception
    -
    -
    - -
    Throws: -
    java.lang.Exception
    -
    -
    -
    - -

    -randomTempFile

    -
    -public static java.io.File randomTempFile()
    -                                   throws java.lang.Exception
    -
    -
    - -
    Throws: -
    java.lang.Exception
    -
    -
    -
    - -

    -randomBinaryFile

    -
    -public static java.io.File randomBinaryFile(int aSize)
    -                                     throws java.lang.Exception
    -
    -
    - -
    Throws: -
    java.lang.Exception
    -
    -
    -
    - -

    -randomTextFile

    -
    -public static java.io.File randomTextFile(int aSize)
    -                                   throws java.lang.Exception
    -
    -
    - -
    Throws: -
    java.lang.Exception
    -
    -
    -
    - -

    -randomBytes

    -
    -public static byte[] randomBytes(int aSize)
    -
    -
    -
    -
    -
    -
    - -

    -randomBlob

    -
    -public static byte[] randomBlob(int aSize)
    -
    -
    -
    -
    -
    -
    - -

    -randomByte

    -
    -public static byte randomByte()
    -
    -
    -
    -
    -
    -
    - -

    -randomDouble

    -
    -public static double randomDouble()
    -
    -
    -
    -
    -
    -
    - -

    -randomInt

    -
    -public static int randomInt()
    -
    -
    -
    -
    -
    -
    - -

    -randomInt

    -
    -public static int randomInt(int min,
    -                            int max)
    -
    -
    -
    -
    -
    -
    - -

    -randomLong

    -
    -public static long randomLong()
    -
    -
    -
    -
    -
    -
    - -

    -randomLong

    -
    -public static long randomLong(long min,
    -                              long max)
    -
    -
    -
    -
    -
    -
    - -

    -randomName

    -
    -public static java.lang.String randomName(int aLength)
    -
    -
    -
    -
    -
    -
    - -

    -randomSleep

    -
    -public static void randomSleep(long min,
    -                               long max)
    -
    -
    -
    -
    -
    -
    - -

    -randomString

    -
    -public static java.lang.String randomString(int aLength)
    -
    -
    -
    -
    -
    -
    - -

    -randomString

    -
    -public static java.lang.String randomString()
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Servlets.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Servlets.html deleted file mode 100755 index 8166fff7e2..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Servlets.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - -Servlets - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.util -
    -Class Servlets

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.util.Servlets
    -
    -
    -
    -
    public class Servlets
    extends java.lang.Object
    - - -

    -Servlet utilities. -

    - -

    -

    -
    Version:
    -
    $Id: Servlets.java,v 1.2 2007/11/23 21:10:17 justb Exp $
    -
    Author:
    -
    Just van den Broecke - Just Objects ©
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    Servlets() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    -static java.lang.StringgetParameter(javax.servlet.http.HttpServletRequest aRequest, - java.lang.String aName) - -
    -          Get parameter; if not set or empty return null.
    -static java.lang.StringgetParameter(javax.servlet.http.HttpServletRequest aRequest, - java.lang.String aName, - java.lang.String aDefault) - -
    -          Get parameter; if not set or empty return specified default value.
    -static voidsetNoCacheHeaders(javax.servlet.http.HttpServletResponse aResponse) - -
    -          Set HTTP headers to prevent caching.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Servlets

    -
    -public Servlets()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -getParameter

    -
    -public static java.lang.String getParameter(javax.servlet.http.HttpServletRequest aRequest,
    -                                            java.lang.String aName)
    -
    -
    Get parameter; if not set or empty return null. -

    -

    -
    -
    -
    -
    - -

    -getParameter

    -
    -public static java.lang.String getParameter(javax.servlet.http.HttpServletRequest aRequest,
    -                                            java.lang.String aName,
    -                                            java.lang.String aDefault)
    -
    -
    Get parameter; if not set or empty return specified default value. -

    -

    -
    -
    -
    -
    - -

    -setNoCacheHeaders

    -
    -public static void setNoCacheHeaders(javax.servlet.http.HttpServletResponse aResponse)
    -
    -
    Set HTTP headers to prevent caching. -

    -

    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Sys.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Sys.html deleted file mode 100755 index 033dbac5ec..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/Sys.html +++ /dev/null @@ -1,351 +0,0 @@ - - - - - - -Sys - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -nl.justobjects.pushlet.util -
    -Class Sys

    -
    -java.lang.Object
    -  extended by nl.justobjects.pushlet.util.Sys
    -
    -
    -
    -
    public class Sys
    extends java.lang.Object
    - - -

    -Utilities that interact with the underlying OS/JVM. -

    - -

    -

    -
    Version:
    -
    $Id: Sys.java,v 1.4 2007/11/10 14:17:18 justb Exp $
    -
    Author:
    -
    Just van den Broecke
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    Sys() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    -static java.lang.StringforHTMLTag(java.lang.String aTagFragment) - -
    -          Replace characters having special meaning inside HTML tags - with their escaped equivalents, using character entities such as '&'.
    -static java.util.PropertiesloadPropertiesFile(java.lang.String aFilePath) - -
    -          Load properties file from file path.
    -static java.util.PropertiesloadPropertiesResource(java.lang.String aResourcePath) - -
    -          Load properties file from classpath.
    -static longnow() - -
    -          Shorthand for current time.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Sys

    -
    -public Sys()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -forHTMLTag

    -
    -public static java.lang.String forHTMLTag(java.lang.String aTagFragment)
    -
    -
    Replace characters having special meaning inside HTML tags - with their escaped equivalents, using character entities such as '&'. -

    -

    The escaped characters are : -

      -
    • < -
    • > -
    • " -
    • ' -
    • \ -
    • & -
    -

    -

    This method ensures that arbitrary text appearing inside a tag does not "confuse" - the tag. For example, HREF='Blah.do?Page=1&Sort=ASC' - does not comply with strict HTML because of the ampersand, and should be changed to - HREF='Blah.do?Page=1&Sort=ASC'. This is commonly seen in building - query strings. (In JSTL, the c:url tag performs this task automatically.) -

    -

    -
    -
    -
    -
    - -

    -loadPropertiesResource

    -
    -public static java.util.Properties loadPropertiesResource(java.lang.String aResourcePath)
    -                                                   throws java.io.IOException
    -
    -
    Load properties file from classpath. -

    -

    - -
    Throws: -
    java.io.IOException
    -
    -
    -
    - -

    -loadPropertiesFile

    -
    -public static java.util.Properties loadPropertiesFile(java.lang.String aFilePath)
    -                                               throws java.io.IOException
    -
    -
    Load properties file from file path. -

    -

    - -
    Throws: -
    java.io.IOException
    -
    -
    -
    - -

    -now

    -
    -public static long now()
    -
    -
    Shorthand for current time. -

    -

    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/DefaultLogger.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/DefaultLogger.html deleted file mode 100755 index 61add5a443..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/DefaultLogger.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.util.DefaultLogger - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.util.DefaultLogger

    -
    -No usage of nl.justobjects.pushlet.util.DefaultLogger -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Log.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Log.html deleted file mode 100755 index ece188f484..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Log.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.util.Log - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.util.Log

    -
    -No usage of nl.justobjects.pushlet.util.Log -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Log4jLogger.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Log4jLogger.html deleted file mode 100755 index 60f499e256..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Log4jLogger.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.util.Log4jLogger - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.util.Log4jLogger

    -
    -No usage of nl.justobjects.pushlet.util.Log4jLogger -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/PushletException.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/PushletException.html deleted file mode 100755 index fc784fd751..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/PushletException.html +++ /dev/null @@ -1,404 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.util.PushletException - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.util.PushletException

    -
    - - - - - - - - - - - - - -
    -Packages that use PushletException
    nl.justobjects.pushlet.client  
    nl.justobjects.pushlet.core  
    -  -

    - - - - - -
    -Uses of PushletException in nl.justobjects.pushlet.client
    -  -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Methods in nl.justobjects.pushlet.client that throw PushletException
    - voidPushletClient.join() - -
    -          Join server, starts session.
    - voidPushletClient.joinListen(PushletClientListener aListener, - java.lang.String aMode, - java.lang.String aSubject) - -
    -          Immediate listener: joins/subscribes and listens in one action.
    - voidPushletClient.leave() - -
    -          Leave server, stops session.
    - voidPushletClient.listen(PushletClientListener aListener) - -
    -          Open data channel.
    - voidPushletClient.listen(PushletClientListener aListener, - java.lang.String aMode) - -
    -          Open data channel in stream or push mode.
    - voidPushletClient.listen(PushletClientListener aListener, - java.lang.String aMode, - java.lang.String aSubject) - -
    -          Open data channel in stream or push mode with a subject.
    - voidPushletClient.publish(java.lang.String aSubject, - java.util.Map theAttributes) - -
    -          Publish an event through server.
    - voidPushletClient.stopListen() - -
    -          Stop the listener.
    - java.lang.StringPushletClient.subscribe(java.lang.String aSubject) - -
    -          Subscribes, returning subscription id.
    - java.lang.StringPushletClient.subscribe(java.lang.String aSubject, - java.lang.String aLabel) - -
    -          Subscribes, returning subscription id.
    - voidPushletClient.unsubscribe() - -
    -          Unsubscribes from all subjects.
    - voidPushletClient.unsubscribe(java.lang.String aSubscriptionId) - -
    -          Unsubscribes with subscription id.
    -  -

    - - - - - -
    -Uses of PushletException in nl.justobjects.pushlet.core
    -  -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Methods in nl.justobjects.pushlet.core that throw PushletException
    - SubscriptionSubscriber.addSubscription(java.lang.String aSubject, - java.lang.String aLabel) - -
    -          Add a subscription.
    -static SubscriberSubscriber.create(Session aSession) - -
    -          Create instance through factory method.
    -static ControllerController.create(Session aSession) - -
    -          Create instance through factory method.
    -static SubscriptionSubscription.create(java.lang.String aSubject) - -
    -          Create instance through factory method.
    -static SessionSession.create(java.lang.String anId) - -
    -          Create instance through factory method.
    -static SubscriptionSubscription.create(java.lang.String aSubject, - java.lang.String aLabel) - -
    -          Create instance through factory method.
    -static java.lang.ObjectConfig.createObject(java.lang.String aClassNameProp, - java.lang.String aDefault) - -
    -          Factory method: create object from property denoting class name.
    - SessionSessionManager.createSession(Event anEvent) - -
    -          Create new Session (but add later).
    - voidSubscriber.fetchEvents(Command aCommand) - -
    -          Get events from queue and push to client.
    -static java.lang.ClassConfig.getClass(java.lang.String aClassNameProp, - java.lang.String aDefault) - -
    -          Factory method: create object from property denoting class name.
    - ClientAdapterCommand.getClientAdapter() - -
    -          Get client adapter for request.
    - voidSessionManager.start() - -
    -          Starts us.
    - voidDispatcher.start() - -
    -          Start Dispatcher.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/PushletLogger.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/PushletLogger.html deleted file mode 100755 index bac428fb26..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/PushletLogger.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - -Uses of Interface nl.justobjects.pushlet.util.PushletLogger - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Interface
    nl.justobjects.pushlet.util.PushletLogger

    -
    - - - - - - - - - -
    -Packages that use PushletLogger
    nl.justobjects.pushlet.util  
    -  -

    - - - - - -
    -Uses of PushletLogger in nl.justobjects.pushlet.util
    -  -

    - - - - - - - - - - - - - -
    Classes in nl.justobjects.pushlet.util that implement PushletLogger
    - classDefaultLogger - -
    -          Default logger.
    - classLog4jLogger - -
    -          Logger to use Log4j for logging.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Rand.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Rand.html deleted file mode 100755 index d9c7ea1cb3..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Rand.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.util.Rand - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.util.Rand

    -
    -No usage of nl.justobjects.pushlet.util.Rand -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Servlets.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Servlets.html deleted file mode 100755 index bde66d502d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Servlets.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.util.Servlets - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.util.Servlets

    -
    -No usage of nl.justobjects.pushlet.util.Servlets -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Sys.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Sys.html deleted file mode 100755 index 08d21994c3..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/class-use/Sys.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class nl.justobjects.pushlet.util.Sys - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    nl.justobjects.pushlet.util.Sys

    -
    -No usage of nl.justobjects.pushlet.util.Sys -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/package-frame.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/package-frame.html deleted file mode 100755 index ca303f8d09..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/package-frame.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - -nl.justobjects.pushlet.util - - - - - - - - - - - -nl.justobjects.pushlet.util - - - - -
    -Interfaces  - -
    -PushletLogger
    - - - - - - -
    -Classes  - -
    -DefaultLogger -
    -Log -
    -Log4jLogger -
    -Rand -
    -Servlets -
    -Sys
    - - - - - - -
    -Exceptions  - -
    -PushletException
    - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/package-summary.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/package-summary.html deleted file mode 100755 index b49d7c9abc..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/package-summary.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - -nl.justobjects.pushlet.util - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -

    -Package nl.justobjects.pushlet.util -

    - - - - - - - - - -
    -Interface Summary
    PushletLoggerLogger interface to allow different logging providers.
    -  - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class Summary
    DefaultLoggerDefault logger.
    LogLogging wrapper.
    Log4jLoggerLogger to use Log4j for logging.
    RandRandomizing routines.
    ServletsServlet utilities.
    SysUtilities that interact with the underlying OS/JVM.
    -  - -

    - - - - - - - - - -
    -Exception Summary
    PushletExceptionGeneric exception wrapper.
    -  - -

    -

    -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/package-tree.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/package-tree.html deleted file mode 100755 index dc9b6206b8..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/package-tree.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - -nl.justobjects.pushlet.util Class Hierarchy - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Hierarchy For Package nl.justobjects.pushlet.util -

    -
    -
    -
    Package Hierarchies:
    All Packages
    -
    -

    -Class Hierarchy -

    -
      -
    • java.lang.Object
        -
      • nl.justobjects.pushlet.util.DefaultLogger (implements nl.justobjects.pushlet.util.PushletLogger) -
      • nl.justobjects.pushlet.util.Log (implements nl.justobjects.pushlet.core.ConfigDefs) -
      • nl.justobjects.pushlet.util.Log4jLogger (implements nl.justobjects.pushlet.util.PushletLogger) -
      • nl.justobjects.pushlet.util.Rand
      • nl.justobjects.pushlet.util.Servlets
      • nl.justobjects.pushlet.util.Sys
      • java.lang.Throwable (implements java.io.Serializable) - -
      -
    -

    -Interface Hierarchy -

    - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/package-use.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/package-use.html deleted file mode 100755 index fd4fe27f0a..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/nl/justobjects/pushlet/util/package-use.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - -Uses of Package nl.justobjects.pushlet.util - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Package
    nl.justobjects.pushlet.util

    -
    - - - - - - - - - - - - - - - - - -
    -Packages that use nl.justobjects.pushlet.util
    nl.justobjects.pushlet.client  
    nl.justobjects.pushlet.core  
    nl.justobjects.pushlet.util  
    -  -

    - - - - - - - - -
    -Classes in nl.justobjects.pushlet.util used by nl.justobjects.pushlet.client
    PushletException - -
    -          Generic exception wrapper.
    -  -

    - - - - - - - - -
    -Classes in nl.justobjects.pushlet.util used by nl.justobjects.pushlet.core
    PushletException - -
    -          Generic exception wrapper.
    -  -

    - - - - - - - - -
    -Classes in nl.justobjects.pushlet.util used by nl.justobjects.pushlet.util
    PushletLogger - -
    -          Logger interface to allow different logging providers.
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/overview-frame.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/overview-frame.html deleted file mode 100755 index 70bcaf008e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/overview-frame.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - -Overview List - - - - - - - - - - - - - - - -
    -
    - - - - - -
    All Classes -

    - -Packages -
    -pow -
    -pow.ivyclient -
    -pow.webserver -
    -

    - -

    -  - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/overview-summary.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/overview-summary.html deleted file mode 100755 index aa2f36c5fc..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/overview-summary.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - -Overview - - - - - - - - - - - - -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - - - - - - - - - - - - - - - -
    -Packages
    pow 
    pow.ivyclient 
    pow.webserver 
    - -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/overview-tree.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/overview-tree.html deleted file mode 100755 index 96fd5faaeb..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/overview-tree.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - -Class Hierarchy - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Hierarchy For All Packages

    -
    -
    -
    Package Hierarchies:
    pow, pow.ivyclient, pow.webserver
    -
    -

    -Class Hierarchy -

    - -

    -Enum Hierarchy -

    -
      -
    • java.lang.Object
        -
      • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) - -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/package-list b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/package-list deleted file mode 100755 index d58c57ef57..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/package-list +++ /dev/null @@ -1,3 +0,0 @@ -pow -pow.ivyclient -pow.webserver diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/AES.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/AES.html deleted file mode 100755 index 563638a102..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/AES.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - - - -AES - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow -
    -Class AES

    -
    -java.lang.Object
    -  extended by pow.AES
    -
    -
    -
    -
    public class AES
    extends java.lang.Object
    - - -

    -implements AES encryption and decryption algorithms - see @link http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html - see @link http://stackoverflow.com/questions/992019/java-256bit-aes-encryption -

    - -

    -


    - -

    - - - - - - - - - - - - - - - - - -
    -Constructor Summary
    AES() - -
    -          construct a cipher with a generated 128 bits key
    AES(byte[] key, - byte[] iv) - -
    -          construct a cipher from a key and a parameter array - usefull to create a remote decryption cypher
    AES(java.lang.String password) - -
    -          construct a cipher from an user specified key
    -  - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - byte[]decrypt(byte[] msg) - -
    -          decrypt a byte array with AES algorithm - see @link org.apache.commons.codec.binary.Hex to convert byte Array into hexString
    - byte[]encrypt(byte[] msg) - -
    -          encrypt a byte array with AES algorithm
    - byte[]getKey() - -
    -          get the cipher key
    - byte[]getParamsEncrypt() - -
    -          get the init parameter of the cipher object in order to initialyse correctly a - remote cipher
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -AES

    -
    -public AES()
    -    throws java.security.NoSuchAlgorithmException,
    -           javax.crypto.NoSuchPaddingException,
    -           java.security.InvalidKeyException,
    -           java.security.spec.InvalidParameterSpecException,
    -           java.security.InvalidAlgorithmParameterException
    -
    -
    construct a cipher with a generated 128 bits key -

    -

    - -
    Throws: -
    java.security.spec.InvalidParameterSpecException -
    java.security.InvalidAlgorithmParameterException -
    java.security.NoSuchAlgorithmException -
    javax.crypto.NoSuchPaddingException -
    java.security.InvalidKeyException
    -
    -
    - -

    -AES

    -
    -public AES(java.lang.String password)
    -    throws java.security.NoSuchAlgorithmException,
    -           javax.crypto.NoSuchPaddingException,
    -           java.security.InvalidKeyException,
    -           java.security.spec.InvalidParameterSpecException,
    -           java.security.InvalidAlgorithmParameterException,
    -           java.security.spec.InvalidKeySpecException
    -
    -
    construct a cipher from an user specified key -

    -

    -
    Parameters:
    password - a string representing the user key -
    Throws: -
    java.security.NoSuchAlgorithmException -
    javax.crypto.NoSuchPaddingException -
    java.security.InvalidKeyException -
    java.security.spec.InvalidParameterSpecException -
    java.security.InvalidAlgorithmParameterException -
    java.security.spec.InvalidKeySpecException
    -
    -
    - -

    -AES

    -
    -public AES(byte[] key,
    -           byte[] iv)
    -    throws java.security.InvalidKeyException,
    -           java.security.InvalidAlgorithmParameterException,
    -           java.security.NoSuchAlgorithmException,
    -           javax.crypto.NoSuchPaddingException
    -
    -
    construct a cipher from a key and a parameter array - usefull to create a remote decryption cypher -

    -

    -
    Parameters:
    key - the key in array byte format
    iv - parameter of the cipher -
    Throws: -
    java.security.InvalidKeyException -
    java.security.InvalidAlgorithmParameterException -
    java.security.NoSuchAlgorithmException -
    javax.crypto.NoSuchPaddingException
    -
    - - - - - - - - -
    -Method Detail
    - -

    -getParamsEncrypt

    -
    -public byte[] getParamsEncrypt()
    -                        throws java.security.spec.InvalidParameterSpecException
    -
    -
    get the init parameter of the cipher object in order to initialyse correctly a - remote cipher -

    -

    - -
    Throws: -
    java.security.spec.InvalidParameterSpecException
    -
    -
    -
    - -

    -getKey

    -
    -public byte[] getKey()
    -
    -
    get the cipher key -

    -

    - -
    Returns:
    the cipher key in byte array
    -
    -
    -
    - -

    -encrypt

    -
    -public byte[] encrypt(byte[] msg)
    -               throws java.io.IOException,
    -                      javax.crypto.IllegalBlockSizeException,
    -                      javax.crypto.BadPaddingException
    -
    -
    encrypt a byte array with AES algorithm -

    -

    -
    Parameters:
    msg - -
    Returns:
    a byte array containing the ciphered data -
    Throws: -
    java.io.IOException -
    javax.crypto.BadPaddingException -
    javax.crypto.IllegalBlockSizeException
    See Also:
    to convert byte Array into hexString
    -
    -
    -
    - -

    -decrypt

    -
    -public byte[] decrypt(byte[] msg)
    -               throws java.io.IOException,
    -                      javax.crypto.IllegalBlockSizeException,
    -                      javax.crypto.BadPaddingException
    -
    -
    decrypt a byte array with AES algorithm - see @link org.apache.commons.codec.binary.Hex to convert byte Array into hexString -

    -

    -
    Parameters:
    msg - the msg to decrypt -
    Returns:
    the message decrypted -
    Throws: -
    java.io.IOException -
    javax.crypto.BadPaddingException -
    javax.crypto.IllegalBlockSizeException
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/InstallCert.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/InstallCert.html deleted file mode 100755 index 74e5602fa1..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/InstallCert.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - -InstallCert - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow -
    -Class InstallCert

    -
    -java.lang.Object
    -  extended by pow.InstallCert
    -
    -
    -
    -
    public class InstallCert
    extends java.lang.Object
    - - -

    -query the server about its certificate and create a 'jssecacerts' file to copy - into /usr/lib/jvm/java-x-x/jre/lib/security - allow a java http client to connect to https server -

    - -

    -


    - -

    - - - - - - - - - - - -
    -Constructor Summary
    InstallCert() - -
    -           
    -  - - - - - - - - - - - -
    -Method Summary
    -static voidmain(java.lang.String[] args) - -
    -           
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -InstallCert

    -
    -public InstallCert()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -main

    -
    -public static void main(java.lang.String[] args)
    -                 throws java.lang.Exception
    -
    -
    - -
    Throws: -
    java.lang.Exception
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/class-use/AES.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/class-use/AES.html deleted file mode 100755 index 2b2c095905..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/class-use/AES.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - -Uses of Class pow.AES - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.AES

    -
    - - - - - - - - - - - - - -
    -Packages that use AES
    pow.ivyclient  
    pow.webserver  
    -  -

    - - - - - -
    -Uses of AES in pow.ivyclient
    -  -

    - - - - - - - - -
    Constructors in pow.ivyclient with parameters of type AES
    HeartBeat(AES cipher, - int webId, - java.net.InetAddress srv, - int port2send, - long heartbeatPeriod) - -
    -          define the parameter of the heartbeat message
    -  -

    - - - - - -
    -Uses of AES in pow.webserver
    -  -

    - - - - - - - - - -
    Methods in pow.webserver that return AES
    - AESSessionIvy.getCipher() - -
    -           
    -  -

    - - - - - - - - -
    Constructors in pow.webserver with parameters of type AES
    SessionIvy(java.lang.String l, - int w, - AES c, - java.net.InetAddress IvyAddr) - -
    -          create a session which store information about an ivy bus client connected to the server - main information are its net address to send him orders from web users - and drones which are connected to this ivy bus
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/class-use/InstallCert.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/class-use/InstallCert.html deleted file mode 100755 index ee11ff6788..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/class-use/InstallCert.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.InstallCert - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.InstallCert

    -
    -No usage of pow.InstallCert -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/AcNetId.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/AcNetId.html deleted file mode 100755 index a65ac71f3a..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/AcNetId.html +++ /dev/null @@ -1,451 +0,0 @@ - - - - - - -AcNetId - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.ivyclient -
    -Class AcNetId

    -
    -java.lang.Object
    -  extended by pow.ivyclient.AcNetId
    -
    -
    -
    -
    public class AcNetId
    extends java.lang.Object
    - - -

    -this object represents the data concerning a drone extracted from Ivy - A drone has two identities. One on its ivy drone which can be the same as - another drone on a different ivy bus. The second identifier is the I.D. of the drone - on the web. This I.D. is unique. So a link has to be done between these two kind of id. -

    - -

    -

    -
    Author:
    -
    genin
    -
    -
    - -

    - - - - - - - - - - - - - - -
    -Constructor Summary
    AcNetId(int idBusIvy, - java.lang.String idIvy, - java.lang.String n, - java.lang.String pln, - java.lang.String s, - java.lang.String c, - int maxACOnIvy) - -
    -           
    AcNetId(int idBusIvy, - java.lang.String droneWebId, - java.lang.String idIvy, - java.lang.String n, - java.lang.String pln, - java.lang.String s, - java.lang.String c, - int maxACOnIvy) - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - java.lang.StringgetColor() - -
    -          provides the color of the drone on the GCS view
    - java.lang.StringgetIdOnIvy() - -
    -          provides the id of the drone on the ivy bus
    - java.lang.StringgetIdOnWeb() - -
    -          provides the id of the drone on the web
    - java.lang.StringgetName() - -
    -          provides the name of the drone on the ivy bus
    - java.lang.StringgetPlnPath() - -
    -          provides the path of the xml file (on the server) containing - the information of the flightplan of the drone - (waypoints and blocks of instructions)
    - java.lang.StringgetSettingPath() - -
    -          provides the path of the xml file (on the server) containing the settings - of the drone
    - java.lang.StringtoString() - -
    -          return information about the drone in a string format
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -AcNetId

    -
    -public AcNetId(int idBusIvy,
    -               java.lang.String idIvy,
    -               java.lang.String n,
    -               java.lang.String pln,
    -               java.lang.String s,
    -               java.lang.String c,
    -               int maxACOnIvy)
    -
    -
    -
    Parameters:
    idBusIvy - the id of the ivy bus
    idIvy - the identifier of the drone on ivy
    n - the name of the ivy drone (MJ5,TJ1...)
    pln - the full pathname of the configuration file FlightPlan.xml
    s - the full pathname of the configuration file Settings.xml
    c - the color of the drone on ivy (in hexa '#FF00FF' or with its common name 'red')
    maxACOnIvy - the maximal number of aircrafts on ivy bus (is no important anymore)
    -
    -
    - -

    -AcNetId

    -
    -public AcNetId(int idBusIvy,
    -               java.lang.String droneWebId,
    -               java.lang.String idIvy,
    -               java.lang.String n,
    -               java.lang.String pln,
    -               java.lang.String s,
    -               java.lang.String c,
    -               int maxACOnIvy)
    -
    -
    -
    Parameters:
    idBusIvy - the id of the ivy bus
    droneWebId - the identifier of the drone on the web
    idIvy - the identifier of the drone on ivy
    n - the name of the ivy drone (MJ5,TJ1...)
    pln - the full pathname of the configuration file FlightPlan.xml
    s - the full pathname of the configuration file Settings.xml
    c - the color of the drone on ivy (in hexa '#FF00FF' or with its common name 'red')
    maxACOnIvy - the maximal number of aircrafts on ivy bus (is no important anymore)
    -
    - - - - - - - - -
    -Method Detail
    - -

    -getIdOnIvy

    -
    -public java.lang.String getIdOnIvy()
    -
    -
    provides the id of the drone on the ivy bus -

    -

    - -
    Returns:
    the id number of the drone on its ivy bus
    -
    -
    -
    - -

    -getName

    -
    -public java.lang.String getName()
    -
    -
    provides the name of the drone on the ivy bus -

    -

    - -
    Returns:
    the name of the drone on its ivy bus
    -
    -
    -
    - -

    -getIdOnWeb

    -
    -public java.lang.String getIdOnWeb()
    -
    -
    provides the id of the drone on the web -

    -

    - -
    Returns:
    the single id number of the drone on the web server
    -
    -
    -
    - -

    -getPlnPath

    -
    -public java.lang.String getPlnPath()
    -
    -
    provides the path of the xml file (on the server) containing - the information of the flightplan of the drone - (waypoints and blocks of instructions) -

    -

    - -
    Returns:
    the full path of the flight plan config file on the GCS station
    -
    -
    -
    - -

    -getSettingPath

    -
    -public java.lang.String getSettingPath()
    -
    -
    provides the path of the xml file (on the server) containing the settings - of the drone -

    -

    - -
    Returns:
    the full path of the settings file on the GCS station
    -
    -
    -
    - -

    -getColor

    -
    -public java.lang.String getColor()
    -
    -
    provides the color of the drone on the GCS view -

    -

    - -
    Returns:
    the color of the drone on the GCS station (either in string or in hexadecimal)
    -
    -
    -
    - -

    -toString

    -
    -public java.lang.String toString()
    -
    -
    return information about the drone in a string format -

    -

    -
    Overrides:
    toString in class java.lang.Object
    -
    -
    - -
    Returns:
    a string containing information about the drone
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/AcNetIdStorage.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/AcNetIdStorage.html deleted file mode 100755 index fc331284da..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/AcNetIdStorage.html +++ /dev/null @@ -1,379 +0,0 @@ - - - - - - -AcNetIdStorage - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.ivyclient -
    -Class AcNetIdStorage

    -
    -java.lang.Object
    -  extended by pow.ivyclient.AcNetIdStorage
    -
    -
    -
    -
    public class AcNetIdStorage
    extends java.lang.Object
    - - -

    -this structure memorize all the drone which exist on the ivy bus. - A drone has two identities. One on its ivy drone which can be the same as - another drone on a different ivy bus. The second identifier is the I.D. of the drone - on the web. This I.D. is unique. So a link has to be done between these two kind of id. -

    - -

    -

    -
    Author:
    -
    genin
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    AcNetIdStorage(int ii, - fr.dgac.ivy.Ivy b, - java.lang.String u, - int maxAC, - java.util.concurrent.ConcurrentHashMap<java.lang.String,AcStatus> states) - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - java.lang.StringgetAcIvyId(int idOnWeb) - -
    -          do the link between the id of the drone on the web and is true id on its ivy bus
    - AcNetIdgetAcNetId(java.lang.String idOnIvy) - -
    -          Return the identity object of the drone on the web
    - java.lang.StringgetNewDroneWebId(java.lang.String IvyDroneId) - -
    -          ask a unique new web id to the server for a new drone detected on the ivy bus
    - voidseekAcNetId(java.lang.String s) - -
    -          search the drone net id of a drone from its ivy id - if the drone is a new one, a new net id is requested to the server
    - booleanuploadConfFile(AcNetId ac) - -
    -          upload de fichier de conf sur le serveur - verifier que ca marche sur long fichier - si probleme changer avec : - factory.setSizeThreshold(yourMaxMemorySize); - factory.setRepository(yourTempDirectory); - upload.setSizeMax(yourMaxRequestSize);
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -AcNetIdStorage

    -
    -public AcNetIdStorage(int ii,
    -                      fr.dgac.ivy.Ivy b,
    -                      java.lang.String u,
    -                      int maxAC,
    -                      java.util.concurrent.ConcurrentHashMap<java.lang.String,AcStatus> states)
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -getAcNetId

    -
    -public AcNetId getAcNetId(java.lang.String idOnIvy)
    -
    -
    Return the identity object of the drone on the web -

    -

    -
    Parameters:
    idOnIvy - -
    Returns:
    the identity of the drone on the web or null if it is not present
    -
    -
    -
    - -

    -getAcIvyId

    -
    -public java.lang.String getAcIvyId(int idOnWeb)
    -
    -
    do the link between the id of the drone on the web and is true id on its ivy bus -

    -

    -
    Parameters:
    idOnWeb - the id of the drone on the web -
    Returns:
    the id of the drone on the ivy bus
    -
    -
    -
    - -

    -seekAcNetId

    -
    -public void seekAcNetId(java.lang.String s)
    -
    -
    search the drone net id of a drone from its ivy id - if the drone is a new one, a new net id is requested to the server -

    -

    -
    Parameters:
    s - the ivy id of the drone
    -
    -
    -
    - -

    -uploadConfFile

    -
    -public boolean uploadConfFile(AcNetId ac)
    -                       throws java.io.FileNotFoundException
    -
    -
    upload de fichier de conf sur le serveur - verifier que ca marche sur long fichier - si probleme changer avec : - factory.setSizeThreshold(yourMaxMemorySize); - factory.setRepository(yourTempDirectory); - upload.setSizeMax(yourMaxRequestSize); -

    -

    -
    Parameters:
    ac - the information object about the drone -
    Throws: -
    java.lang.InterruptedException -
    java.io.FileNotFoundException
    -
    -
    -
    - -

    -getNewDroneWebId

    -
    -public java.lang.String getNewDroneWebId(java.lang.String IvyDroneId)
    -                                  throws IvyConnectionExeption
    -
    -
    ask a unique new web id to the server for a new drone detected on the ivy bus -

    -

    -
    Parameters:
    IvyDroneId - the drone id on ivy -
    Returns:
    the new web drone id -
    Throws: -
    IvyConnectionExeption
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/AcStatus.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/AcStatus.html deleted file mode 100755 index 19ecd9b9bb..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/AcStatus.html +++ /dev/null @@ -1,464 +0,0 @@ - - - - - - -AcStatus - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.ivyclient -
    -Enum AcStatus

    -
    -java.lang.Object
    -  extended by java.lang.Enum<AcStatus>
    -      extended by pow.ivyclient.AcStatus
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<AcStatus>
    -
    -
    -
    -
    public enum AcStatus
    extends java.lang.Enum<AcStatus>
    - - -

    -implements the life cycle of a drone when it is detected on the ivy bus. - these steps are needed to prevent that a ivy message is processed before - that all information about the drone were retrieved - these status follow the steps that are followed by the module when a new drone - is detected on the bus -

    - -

    -

    -
    Author:
    -
    genin
    -
    See Also:
    Ivy2Udp
    -
    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Enum Constant Summary
    ALIVE - -
    -          the module can received ivy message for this drone and send them to the server
    ASKING_IVY_CONF - -
    -          a request about the configuration has been sent on ivy
    ASKING_WEB_ID - -
    -          the module sends request to the web server for having a web id for the drone
    CONF_NOTOK - -
    -          a problem occurred during the process
    CONF_OK - -
    -          the 2 configuration files have been uploaded successfully
    IVY_CONF_RECEIVED - -
    -          the configuration has been received from ivy
    UNKNOWN - -
    -          the system does not know this drone, information are requested
    UPLOADING_CONF - -
    -          the module upload the two configuration files of the drone on the server
    WEB_ID_RECEIVED - -
    -          the drone web id has been received from the server
    -  - - - - - - - - - - - - - - - -
    -Method Summary
    -static AcStatusvalueOf(java.lang.String name) - -
    -          Returns the enum constant of this type with the specified name.
    -static AcStatus[]values() - -
    -          Returns an array containing the constants of this enum type, in -the order they are declared.
    - - - - - - - -
    Methods inherited from class java.lang.Enum
    compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
    - - - - - - - -
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, wait, wait, wait
    -  -

    - - - - - - - - -
    -Enum Constant Detail
    - -

    -UNKNOWN

    -
    -public static final AcStatus UNKNOWN
    -
    -
    the system does not know this drone, information are requested -

    -

    -
    -
    -
    - -

    -ASKING_IVY_CONF

    -
    -public static final AcStatus ASKING_IVY_CONF
    -
    -
    a request about the configuration has been sent on ivy -

    -

    -
    -
    -
    - -

    -IVY_CONF_RECEIVED

    -
    -public static final AcStatus IVY_CONF_RECEIVED
    -
    -
    the configuration has been received from ivy -

    -

    -
    -
    -
    - -

    -ASKING_WEB_ID

    -
    -public static final AcStatus ASKING_WEB_ID
    -
    -
    the module sends request to the web server for having a web id for the drone -

    -

    -
    -
    -
    - -

    -WEB_ID_RECEIVED

    -
    -public static final AcStatus WEB_ID_RECEIVED
    -
    -
    the drone web id has been received from the server -

    -

    -
    -
    -
    - -

    -UPLOADING_CONF

    -
    -public static final AcStatus UPLOADING_CONF
    -
    -
    the module upload the two configuration files of the drone on the server -

    -

    -
    -
    -
    - -

    -CONF_OK

    -
    -public static final AcStatus CONF_OK
    -
    -
    the 2 configuration files have been uploaded successfully -

    -

    -
    -
    -
    - -

    -ALIVE

    -
    -public static final AcStatus ALIVE
    -
    -
    the module can received ivy message for this drone and send them to the server -

    -

    -
    -
    -
    - -

    -CONF_NOTOK

    -
    -public static final AcStatus CONF_NOTOK
    -
    -
    a problem occurred during the process -

    -

    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -values

    -
    -public static AcStatus[] values()
    -
    -
    Returns an array containing the constants of this enum type, in -the order they are declared. This method may be used to iterate -over the constants as follows: -
    -for (AcStatus c : AcStatus.values())
    -    System.out.println(c);
    -
    -

    -

    - -
    Returns:
    an array containing the constants of this enum type, in -the order they are declared
    -
    -
    -
    - -

    -valueOf

    -
    -public static AcStatus valueOf(java.lang.String name)
    -
    -
    Returns the enum constant of this type with the specified name. -The string must match exactly an identifier used to declare an -enum constant in this type. (Extraneous whitespace characters are -not permitted.) -

    -

    -
    Parameters:
    name - the name of the enum constant to be returned. -
    Returns:
    the enum constant with the specified name -
    Throws: -
    java.lang.IllegalArgumentException - if this enum type has no constant -with the specified name -
    java.lang.NullPointerException - if the argument is null
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/BusIvy_.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/BusIvy_.html deleted file mode 100755 index 32962eb614..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/BusIvy_.html +++ /dev/null @@ -1,411 +0,0 @@ - - - - - - -BusIvy_ - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.ivyclient -
    -Class BusIvy_

    -
    -java.lang.Object
    -  extended by pow.ivyclient.BusIvy_
    -
    -
    -
    -
    public class BusIvy_
    extends java.lang.Object
    - - -

    -inner representation of an ivy bus - store the drones' information about the drones which belong to this ivy bus - store the IP adress of the machine where the ivy bus is working -

    - -

    -


    - -

    - - - - - - - - - - - -
    -Constructor Summary
    BusIvy_() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidaddDrones(int newDroneId) - -
    -          inform the bus that a new drone send information on this bus
    - voiddisplayDrones() - -
    -          display information on stdout about the drones present on the bus
    - java.net.InetAddressgetAddress() - -
    -          provides the IP adress of the host hosting the bus
    - java.util.ArrayList<java.lang.Integer>getDrones() - -
    -          get a array list containing the ivy id of the drones present on the bus
    - booleanisAlive() - -
    -          inform if the bus is alive
    - booleanisOwnBy(int myDroneId) - -
    -          inform if a drone is present or not on the bus
    - voidsetAddress(java.net.InetAddress myInetAddress) - -
    -           
    - voidupdateTime() - -
    -          update the 'inner clock' of the object when a message for this bus is detected - useful to know if the bus is still alive
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -BusIvy_

    -
    -public BusIvy_()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -setAddress

    -
    -public void setAddress(java.net.InetAddress myInetAddress)
    -
    -
    -
    Parameters:
    myInetAddress - the ip address of the ivy host
    -
    -
    -
    - -

    -updateTime

    -
    -public void updateTime()
    -
    -
    update the 'inner clock' of the object when a message for this bus is detected - useful to know if the bus is still alive -

    -

    -
    -
    -
    -
    - -

    -addDrones

    -
    -public void addDrones(int newDroneId)
    -
    -
    inform the bus that a new drone send information on this bus -

    -

    -
    Parameters:
    newDroneId - (the ivy id)
    -
    -
    -
    - -

    -getDrones

    -
    -public java.util.ArrayList<java.lang.Integer> getDrones()
    -
    -
    get a array list containing the ivy id of the drones present on the bus -

    -

    - -
    Returns:
    the array list containing the ivy id of the drones present on the bus
    -
    -
    -
    - -

    -displayDrones

    -
    -public void displayDrones()
    -
    -
    display information on stdout about the drones present on the bus -

    -

    -
    -
    -
    -
    - -

    -getAddress

    -
    -public java.net.InetAddress getAddress()
    -
    -
    provides the IP adress of the host hosting the bus -

    -

    - -
    Returns:
    the IP adress of the host hosting the bus
    -
    -
    -
    - -

    -isOwnBy

    -
    -public boolean isOwnBy(int myDroneId)
    -
    -
    inform if a drone is present or not on the bus -

    -

    -
    Parameters:
    myDroneId - the ivy id -
    Returns:
    true if the drone is present on the bus
    -
    -
    -
    - -

    -isAlive

    -
    -public boolean isAlive()
    -
    -
    inform if the bus is alive -

    -

    - -
    Returns:
    true if the last message was received less than 10 seconds ago
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/HeartBeat.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/HeartBeat.html deleted file mode 100755 index 8cfab6db5e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/HeartBeat.html +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - -HeartBeat - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.ivyclient -
    -Class HeartBeat

    -
    -java.lang.Object
    -  extended by pow.ivyclient.HeartBeat
    -
    -
    -
    All Implemented Interfaces:
    java.lang.Runnable
    -
    -
    -
    -
    public class HeartBeat
    extends java.lang.Object
    implements java.lang.Runnable
    - - -

    -thread which send a periodic message to a client or server to say that the connection - is still alive (period has to be less than the socket timeout of the the server) -

    - -

    -

    -
    Author:
    -
    genin
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    HeartBeat(AES cipher, - int webId, - java.net.InetAddress srv, - int port2send, - long heartbeatPeriod) - -
    -          define the parameter of the heartbeat message
    -  - - - - - - - - - - - - - - - -
    -Method Summary
    - voidrun() - -
    -          send a periodic heartbeat message
    - voidstop_thread() - -
    -          stop the heartbeat thread by ending the infinite loop
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -HeartBeat

    -
    -public HeartBeat(AES cipher,
    -                 int webId,
    -                 java.net.InetAddress srv,
    -                 int port2send,
    -                 long heartbeatPeriod)
    -
    -
    define the parameter of the heartbeat message -

    -

    -
    Parameters:
    cipher - the way to encrypt message to be send on udp channel
    webId - the id of the bus
    srv - the ip address of the host hosting the ivy bus
    port2send - the udp port on which the heartbeat is sent
    heartbeatPeriod - the period of time to send heartbeat message
    -
    - - - - - - - - -
    -Method Detail
    - -

    -run

    -
    -public void run()
    -
    -
    send a periodic heartbeat message -

    -

    -
    Specified by:
    run in interface java.lang.Runnable
    -
    -
    -
    -
    -
    -
    - -

    -stop_thread

    -
    -public void stop_thread()
    -
    -
    stop the heartbeat thread by ending the infinite loop -

    -

    -
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/Ivy2Udp.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/Ivy2Udp.html deleted file mode 100755 index 29f859c97c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/Ivy2Udp.html +++ /dev/null @@ -1,554 +0,0 @@ - - - - - - -Ivy2Udp - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.ivyclient -
    -Class Ivy2Udp

    -
    -java.lang.Object
    -  extended by pow.ivyclient.Ivy2Udp
    -
    -
    -
    All Implemented Interfaces:
    java.lang.Runnable
    -
    -
    -
    -
    public class Ivy2Udp
    extends java.lang.Object
    implements java.lang.Runnable
    - - -

    -It contact the server to get an identifier, some configuration parameter and - the key to encrypt and decrypt messages. - Then it listens messages on the ivy bus and send messages on active drones to the - web server. -

    - -

    -

    -
    Version:
    -
    2.0
    -
    Author:
    -
    jabln, thomas genin
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    Ivy2Udp(IvyIHM ihm, - PowUrl urlObj, - java.lang.String login, - java.lang.String password) - -
    -          create an object which listens on the local ivy bus and send messages to the server
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidbindMsg2Ivy() - -
    -          This method binds the object to some messages - of the bus Ivy.
    - intgetIvyWebId() - -
    -          return the id of the bus for the server - this id is provided by the server and is unique
    - AcNetIdStoragegetStorage() - -
    -          provides the structure where data about the drone present on the ivy bus are stored
    - voidgetWebId() - -
    -          request a single id for the bus to the web server - method get - see @link http://hc.apache.org/httpclient-3.x/tutorial.html - see @link blogs.sun.com/gc/entry/unable_to_find_valid_certification - see @link http://blogs.sun.com/andreas/entry/no_more_unable_to_find
    - voidrun() - -
    -          listen the udp socket to get orders from web clients and send them to ivy
    - voidsend(int acId) - -
    -          This method send to the web server the datagram containing the informations - about the aircraft
    - voidsend(int acId, - java.lang.String s) - -
    -          This method send a particular message about an aircraft
    - voidsend(int acId, - java.lang.String s, - java.lang.String[] as) - -
    -          This method send to the web server a specific order with parameters
    - voidsetStorage() - -
    -          initiate the object which allow to store information about drones
    - voidstartHeartBeat() - -
    -          create a thread which send heart beat message to the server
    - voidstop_thread() - -
    -          stop all the thread Ivy2Udp , HeartBeat and ivy2UdpWriting
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Ivy2Udp

    -
    -public Ivy2Udp(IvyIHM ihm,
    -               PowUrl urlObj,
    -               java.lang.String login,
    -               java.lang.String password)
    -
    -
    create an object which listens on the local ivy bus and send messages to the server -

    -

    -
    Parameters:
    urlObj - describes information about the server
    login -
    password -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -setStorage

    -
    -public void setStorage()
    -
    -
    initiate the object which allow to store information about drones -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getStorage

    -
    -public AcNetIdStorage getStorage()
    -
    -
    provides the structure where data about the drone present on the ivy bus are stored -

    -

    -
    -
    -
    - -
    Returns:
    the structure which allow to store information about drones
    -
    -
    -
    - -

    -getIvyWebId

    -
    -public int getIvyWebId()
    -
    -
    return the id of the bus for the server - this id is provided by the server and is unique -

    -

    -
    -
    -
    - -
    Returns:
    the unique id of this ivy bus for the server
    -
    -
    -
    - -

    -getWebId

    -
    -public void getWebId()
    -              throws IvyConnectionExeption
    -
    -
    request a single id for the bus to the web server - method get - see @link http://hc.apache.org/httpclient-3.x/tutorial.html - see @link blogs.sun.com/gc/entry/unable_to_find_valid_certification - see @link http://blogs.sun.com/andreas/entry/no_more_unable_to_find -

    -

    -
    -
    -
    - -
    Throws: -
    IvyConnectionExeption
    -
    -
    -
    - -

    -startHeartBeat

    -
    -public void startHeartBeat()
    -
    -
    create a thread which send heart beat message to the server -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -bindMsg2Ivy

    -
    -public void bindMsg2Ivy()
    -                 throws fr.dgac.ivy.IvyException
    -
    -
    This method binds the object to some messages - of the bus Ivy. Each information that is needed by the web server is put in an - array. This array is sent to server. -

    -

    -
    -
    -
    - -
    Throws: -
    fr.dgac.ivy.IvyException
    -
    -
    -
    - -

    -stop_thread

    -
    -public void stop_thread()
    -
    -
    stop all the thread Ivy2Udp , HeartBeat and ivy2UdpWriting -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -send

    -
    -public void send(int acId)
    -
    -
    This method send to the web server the datagram containing the informations - about the aircraft -

    -

    -
    -
    -
    -
    Parameters:
    acId - Line of the matrix containing the informations about the plane -
    Throws: -
    java.lang.Exception
    -
    -
    -
    - -

    -send

    -
    -public void send(int acId,
    -                 java.lang.String s,
    -                 java.lang.String[] as)
    -
    -
    This method send to the web server a specific order with parameters -

    -

    -
    -
    -
    -
    Parameters:
    acId - : Line of the matrix containing the informations about the plane
    s - : order
    as - : parameters
    -
    -
    -
    - -

    -send

    -
    -public void send(int acId,
    -                 java.lang.String s)
    -
    -
    This method send a particular message about an aircraft -

    -

    -
    -
    -
    -
    Parameters:
    acId - line of the matrix containing the informations about the plane
    s - message that is to be sent to send
    -
    -
    -
    - -

    -run

    -
    -public void run()
    -
    -
    listen the udp socket to get orders from web clients and send them to ivy -

    -

    -
    Specified by:
    run in interface java.lang.Runnable
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/Ivy2UdpWriting.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/Ivy2UdpWriting.html deleted file mode 100755 index 66eec584d3..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/Ivy2UdpWriting.html +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - -Ivy2UdpWriting - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.ivyclient -
    -Class Ivy2UdpWriting

    -
    -java.lang.Object
    -  extended by pow.ivyclient.Ivy2UdpWriting
    -
    -
    -
    All Implemented Interfaces:
    fr.dgac.ivy.IvyMessageListener, java.util.EventListener
    -
    -
    -
    -
    public class Ivy2UdpWriting
    extends java.lang.Object
    implements fr.dgac.ivy.IvyMessageListener
    - - -

    -This class aims to give order to the drones according to the datagrams it - receive from the web -

    - -

    -

    -
    Author:
    -
    jabln
    -
    -
    - -

    - - - - - - - - - - - - -
    -Method Summary
    - voidreceive(fr.dgac.ivy.IvyClient client, - java.lang.String[] args) - -
    -          This method implements the method receive of the bus Ivy class.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Method Detail
    - -

    -receive

    -
    -public void receive(fr.dgac.ivy.IvyClient client,
    -                    java.lang.String[] args)
    -
    -
    This method implements the method receive of the bus Ivy class. - It sends the informations on the ivy bus and stop the binding -

    -

    -
    Specified by:
    receive in interface fr.dgac.ivy.IvyMessageListener
    -
    -
    -
    Parameters:
    client -
    args -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/IvyConnectionExeption.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/IvyConnectionExeption.html deleted file mode 100755 index bc138ea490..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/IvyConnectionExeption.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - -IvyConnectionExeption - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.ivyclient -
    -Class IvyConnectionExeption

    -
    -java.lang.Object
    -  extended by java.lang.Throwable
    -      extended by java.lang.Exception
    -          extended by pow.ivyclient.IvyConnectionExeption
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable
    -
    -
    -
    -
    public class IvyConnectionExeption
    extends java.lang.Exception
    - - -

    -

    -
    See Also:
    Serialized Form
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    IvyConnectionExeption(java.lang.String res) - -
    -          create an ivy exception with a particular message
    -  - - - - - - - - - - - -
    -Method Summary
    - java.lang.StringtoString() - -
    -          display the exception on stdout
    - - - - - - - -
    Methods inherited from class java.lang.Throwable
    fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -IvyConnectionExeption

    -
    -public IvyConnectionExeption(java.lang.String res)
    -
    -
    create an ivy exception with a particular message -

    -

    -
    Parameters:
    res - the message
    -
    - - - - - - - - -
    -Method Detail
    - -

    -toString

    -
    -public java.lang.String toString()
    -
    -
    display the exception on stdout -

    -

    -
    Overrides:
    toString in class java.lang.Throwable
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/IvyIHM.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/IvyIHM.html deleted file mode 100755 index 61cd9c687b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/IvyIHM.html +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - -IvyIHM - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.ivyclient -
    -Class IvyIHM

    -
    -java.lang.Object
    -  extended by pow.ivyclient.IvyIHM
    -
    -
    -
    All Implemented Interfaces:
    java.lang.Runnable
    -
    -
    -
    -
    public class IvyIHM
    extends java.lang.Object
    implements java.lang.Runnable
    - - -

    -represent the interface for a ivy user who wants to connect a bus ivy to - the web server -

    - -

    -

    -
    Author:
    -
    genin
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    IvyIHM() - -
    -          construct the interface
    -  - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    -static voidmain(java.lang.String[] args) - -
    -          launch the interface to connect the ivy bus to POW server
    - voidrun() - -
    -          loop to perform a periodic check for automatic reconnection
    - voidsetReLogged(boolean l) - -
    -          specify whether the module should reconnected or not
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -IvyIHM

    -
    -public IvyIHM()
    -
    -
    construct the interface -

    -

    - - - - - - - - -
    -Method Detail
    - -

    -setReLogged

    -
    -public void setReLogged(boolean l)
    -
    -
    specify whether the module should reconnected or not -

    -

    -
    -
    -
    -
    Parameters:
    l - true or false
    -
    -
    -
    - -

    -run

    -
    -public void run()
    -
    -
    loop to perform a periodic check for automatic reconnection -

    -

    -
    Specified by:
    run in interface java.lang.Runnable
    -
    -
    -
    -
    -
    -
    - -

    -main

    -
    -public static void main(java.lang.String[] args)
    -
    -
    launch the interface to connect the ivy bus to POW server -

    -

    -
    -
    -
    -
    Parameters:
    args -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/MsgFilter.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/MsgFilter.html deleted file mode 100755 index d6d98c7f36..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/MsgFilter.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - -MsgFilter - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.ivyclient -
    -Class MsgFilter

    -
    -java.lang.Object
    -  extended by pow.ivyclient.MsgFilter
    -
    -
    -
    -
    public class MsgFilter
    extends java.lang.Object
    - - -

    -this class filters the message, thanks to their hash code - it is used because Paparazzi send periodic messages that are often the same - so we filter them to lighten the server load and the bandwidth of the udp channel -

    - -

    -

    -
    Author:
    -
    genin
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    MsgFilter() - -
    -          create a message filter
    -  - - - - - - - - - - - - - - - -
    -Method Summary
    - booleanisNew(java.lang.String msg) - -
    -          inform whether the message is new or not
    - voidresetfilter() - -
    -          empty the filter
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -MsgFilter

    -
    -public MsgFilter()
    -
    -
    create a message filter -

    -

    - - - - - - - - -
    -Method Detail
    - -

    -isNew

    -
    -public boolean isNew(java.lang.String msg)
    -
    -
    inform whether the message is new or not -

    -

    -
    Parameters:
    msg - -
    Returns:
    true if the message is a new one and was added to the filter
    -
    -
    -
    - -

    -resetfilter

    -
    -public void resetfilter()
    -
    -
    empty the filter -

    -

    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/PowUrl.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/PowUrl.html deleted file mode 100755 index 0898ad21dd..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/PowUrl.html +++ /dev/null @@ -1,301 +0,0 @@ - - - - - - -PowUrl - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.ivyclient -
    -Class PowUrl

    -
    -java.lang.Object
    -  extended by pow.ivyclient.PowUrl
    -
    -
    -
    -
    public class PowUrl
    extends java.lang.Object
    - - -

    -object which store all information about the url to log on the server -

    - -

    -

    -
    Author:
    -
    genin
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    PowUrl(java.lang.String protocol, - java.lang.String server, - int port, - java.lang.String webapp, - java.lang.String servletName) - -
    -          create all the information requested to connect the ivy module to the server - when all parameters are correct can give an url like - https://paparazzi.fr/ServletPow/Login.srv
    -  - - - - - - - - - - - - - - - -
    -Method Summary
    - java.lang.StringgetServerName() - -
    -          provides the server name to which the module is connected
    - java.lang.StringgetWebUrl() - -
    -          provides the complete URL to log on the POW server
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -PowUrl

    -
    -public PowUrl(java.lang.String protocol,
    -              java.lang.String server,
    -              int port,
    -              java.lang.String webapp,
    -              java.lang.String servletName)
    -
    -
    create all the information requested to connect the ivy module to the server - when all parameters are correct can give an url like - https://paparazzi.fr/ServletPow/Login.srv -

    -

    -
    Parameters:
    protocol - the protocol used to log to the server (HTTP by default)
    server - the server name (paparazzi.fr) for example
    port - a specific protocol port ( -1 means that this parameter is not used )
    webapp - the name of the application on the server (ServletPow for example)
    servletName - the name of the login servlet (Login.srv)
    -
    - - - - - - - - -
    -Method Detail
    - -

    -getServerName

    -
    -public java.lang.String getServerName()
    -
    -
    provides the server name to which the module is connected -

    -

    - -
    Returns:
    server hostname
    -
    -
    -
    - -

    -getWebUrl

    -
    -public java.lang.String getWebUrl()
    -
    -
    provides the complete URL to log on the POW server -

    -

    - -
    Returns:
    the complete url to log in as a string
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/AcNetId.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/AcNetId.html deleted file mode 100755 index ca566cd3e4..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/AcNetId.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - -Uses of Class pow.ivyclient.AcNetId - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.ivyclient.AcNetId

    -
    - - - - - - - - - -
    -Packages that use AcNetId
    pow.ivyclient  
    -  -

    - - - - - -
    -Uses of AcNetId in pow.ivyclient
    -  -

    - - - - - - - - - -
    Methods in pow.ivyclient that return AcNetId
    - AcNetIdAcNetIdStorage.getAcNetId(java.lang.String idOnIvy) - -
    -          Return the identity object of the drone on the web
    -  -

    - - - - - - - - - -
    Methods in pow.ivyclient with parameters of type AcNetId
    - booleanAcNetIdStorage.uploadConfFile(AcNetId ac) - -
    -          upload de fichier de conf sur le serveur - verifier que ca marche sur long fichier - si probleme changer avec : - factory.setSizeThreshold(yourMaxMemorySize); - factory.setRepository(yourTempDirectory); - upload.setSizeMax(yourMaxRequestSize);
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/AcNetIdStorage.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/AcNetIdStorage.html deleted file mode 100755 index ff41618633..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/AcNetIdStorage.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class pow.ivyclient.AcNetIdStorage - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.ivyclient.AcNetIdStorage

    -
    - - - - - - - - - -
    -Packages that use AcNetIdStorage
    pow.ivyclient  
    -  -

    - - - - - -
    -Uses of AcNetIdStorage in pow.ivyclient
    -  -

    - - - - - - - - - -
    Methods in pow.ivyclient that return AcNetIdStorage
    - AcNetIdStorageIvy2Udp.getStorage() - -
    -          provides the structure where data about the drone present on the ivy bus are stored
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/AcStatus.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/AcStatus.html deleted file mode 100755 index 19b8f1b54d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/AcStatus.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - -Uses of Class pow.ivyclient.AcStatus - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.ivyclient.AcStatus

    -
    - - - - - - - - - -
    -Packages that use AcStatus
    pow.ivyclient  
    -  -

    - - - - - -
    -Uses of AcStatus in pow.ivyclient
    -  -

    - - - - - - - - - - - - - -
    Methods in pow.ivyclient that return AcStatus
    -static AcStatusAcStatus.valueOf(java.lang.String name) - -
    -          Returns the enum constant of this type with the specified name.
    -static AcStatus[]AcStatus.values() - -
    -          Returns an array containing the constants of this enum type, in -the order they are declared.
    -  -

    - - - - - - - - -
    Constructor parameters in pow.ivyclient with type arguments of type AcStatus
    AcNetIdStorage(int ii, - fr.dgac.ivy.Ivy b, - java.lang.String u, - int maxAC, - java.util.concurrent.ConcurrentHashMap<java.lang.String,AcStatus> states) - -
    -           
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/BusIvy_.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/BusIvy_.html deleted file mode 100755 index ac331b7e7c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/BusIvy_.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - -Uses of Class pow.ivyclient.BusIvy_ - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.ivyclient.BusIvy_

    -
    - - - - - - - - - -
    -Packages that use BusIvy_
    pow.webserver  
    -  -

    - - - - - -
    -Uses of BusIvy_ in pow.webserver
    -  -

    - - - - - - - - - -
    Methods in pow.webserver that return BusIvy_
    - BusIvy_SessionIvy.getBusIvy() - -
    -           
    -  -

    - - - - - - - - - -
    Methods in pow.webserver with parameters of type BusIvy_
    - voidSessionIvy.setBusIvy(BusIvy_ b) - -
    -          store the information of the ivy bus into the ivy session
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/HeartBeat.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/HeartBeat.html deleted file mode 100755 index 83fbc120e6..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/HeartBeat.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.ivyclient.HeartBeat - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.ivyclient.HeartBeat

    -
    -No usage of pow.ivyclient.HeartBeat -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/Ivy2Udp.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/Ivy2Udp.html deleted file mode 100755 index e84e016dce..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/Ivy2Udp.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.ivyclient.Ivy2Udp - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.ivyclient.Ivy2Udp

    -
    -No usage of pow.ivyclient.Ivy2Udp -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/Ivy2UdpWriting.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/Ivy2UdpWriting.html deleted file mode 100755 index df8569e28f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/Ivy2UdpWriting.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.ivyclient.Ivy2UdpWriting - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.ivyclient.Ivy2UdpWriting

    -
    -No usage of pow.ivyclient.Ivy2UdpWriting -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/IvyConnectionExeption.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/IvyConnectionExeption.html deleted file mode 100755 index 36374cd779..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/IvyConnectionExeption.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - -Uses of Class pow.ivyclient.IvyConnectionExeption - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.ivyclient.IvyConnectionExeption

    -
    - - - - - - - - - -
    -Packages that use IvyConnectionExeption
    pow.ivyclient  
    -  -

    - - - - - -
    -Uses of IvyConnectionExeption in pow.ivyclient
    -  -

    - - - - - - - - - - - - - -
    Methods in pow.ivyclient that throw IvyConnectionExeption
    - java.lang.StringAcNetIdStorage.getNewDroneWebId(java.lang.String IvyDroneId) - -
    -          ask a unique new web id to the server for a new drone detected on the ivy bus
    - voidIvy2Udp.getWebId() - -
    -          request a single id for the bus to the web server - method get - see @link http://hc.apache.org/httpclient-3.x/tutorial.html - see @link blogs.sun.com/gc/entry/unable_to_find_valid_certification - see @link http://blogs.sun.com/andreas/entry/no_more_unable_to_find
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/IvyIHM.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/IvyIHM.html deleted file mode 100755 index 5aa1be8d71..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/IvyIHM.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - -Uses of Class pow.ivyclient.IvyIHM - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.ivyclient.IvyIHM

    -
    - - - - - - - - - -
    -Packages that use IvyIHM
    pow.ivyclient  
    -  -

    - - - - - -
    -Uses of IvyIHM in pow.ivyclient
    -  -

    - - - - - - - - -
    Constructors in pow.ivyclient with parameters of type IvyIHM
    Ivy2Udp(IvyIHM ihm, - PowUrl urlObj, - java.lang.String login, - java.lang.String password) - -
    -          create an object which listens on the local ivy bus and send messages to the server
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/MsgFilter.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/MsgFilter.html deleted file mode 100755 index 1468460156..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/MsgFilter.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.ivyclient.MsgFilter - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.ivyclient.MsgFilter

    -
    -No usage of pow.ivyclient.MsgFilter -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/PowUrl.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/PowUrl.html deleted file mode 100755 index b8b8ce4511..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/class-use/PowUrl.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - -Uses of Class pow.ivyclient.PowUrl - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.ivyclient.PowUrl

    -
    - - - - - - - - - -
    -Packages that use PowUrl
    pow.ivyclient  
    -  -

    - - - - - -
    -Uses of PowUrl in pow.ivyclient
    -  -

    - - - - - - - - -
    Constructors in pow.ivyclient with parameters of type PowUrl
    Ivy2Udp(IvyIHM ihm, - PowUrl urlObj, - java.lang.String login, - java.lang.String password) - -
    -          create an object which listens on the local ivy bus and send messages to the server
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/package-frame.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/package-frame.html deleted file mode 100755 index 47b6910e50..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/package-frame.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - -pow.ivyclient - - - - - - - - - - - -pow.ivyclient - - - - -
    -Classes  - -
    -AcNetId -
    -AcNetIdStorage -
    -BusIvy_ -
    -HeartBeat -
    -Ivy2Udp -
    -Ivy2UdpWriting -
    -IvyIHM -
    -MsgFilter -
    -PowUrl
    - - - - - - -
    -Enums  - -
    -AcStatus
    - - - - - - -
    -Exceptions  - -
    -IvyConnectionExeption
    - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/package-summary.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/package-summary.html deleted file mode 100755 index b72600ebe4..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/package-summary.html +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - -pow.ivyclient - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -

    -Package pow.ivyclient -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class Summary
    AcNetIdthis object represents the data concerning a drone extracted from Ivy - A drone has two identities.
    AcNetIdStoragethis structure memorize all the drone which exist on the ivy bus.
    BusIvy_inner representation of an ivy bus - store the drones' information about the drones which belong to this ivy bus - store the IP adress of the machine where the ivy bus is working
    HeartBeatthread which send a periodic message to a client or server to say that the connection - is still alive (period has to be less than the socket timeout of the the server)
    Ivy2UdpIt contact the server to get an identifier, some configuration parameter and - the key to encrypt and decrypt messages.
    Ivy2UdpWritingThis class aims to give order to the drones according to the datagrams it - receive from the web
    IvyIHMrepresent the interface for a ivy user who wants to connect a bus ivy to - the web server
    MsgFilterthis class filters the message, thanks to their hash code - it is used because Paparazzi send periodic messages that are often the same - so we filter them to lighten the server load and the bandwidth of the udp channel
    PowUrlobject which store all information about the url to log on the server
    -  - -

    - - - - - - - - - -
    -Enum Summary
    AcStatusimplements the life cycle of a drone when it is detected on the ivy bus.
    -  - -

    - - - - - - - - - -
    -Exception Summary
    IvyConnectionExeption 
    -  - -

    -

    -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/package-tree.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/package-tree.html deleted file mode 100755 index 95aa0d2349..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/package-tree.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - -pow.ivyclient Class Hierarchy - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Hierarchy For Package pow.ivyclient -

    -
    -
    -
    Package Hierarchies:
    All Packages
    -
    -

    -Class Hierarchy -

    - -

    -Enum Hierarchy -

    -
      -
    • java.lang.Object
        -
      • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) - -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/package-use.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/package-use.html deleted file mode 100755 index 01bbf5521c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/ivyclient/package-use.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - -Uses of Package pow.ivyclient - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Package
    pow.ivyclient

    -
    - - - - - - - - - - - - - -
    -Packages that use pow.ivyclient
    pow.ivyclient  
    pow.webserver  
    -  -

    - - - - - - - - - - - - - - - - - - - - - - - -
    -Classes in pow.ivyclient used by pow.ivyclient
    AcNetId - -
    -          this object represents the data concerning a drone extracted from Ivy - A drone has two identities.
    AcNetIdStorage - -
    -          this structure memorize all the drone which exist on the ivy bus.
    AcStatus - -
    -          implements the life cycle of a drone when it is detected on the ivy bus.
    IvyConnectionExeption - -
    -           
    IvyIHM - -
    -          represent the interface for a ivy user who wants to connect a bus ivy to - the web server
    PowUrl - -
    -          object which store all information about the url to log on the server
    -  -

    - - - - - - - - -
    -Classes in pow.ivyclient used by pow.webserver
    BusIvy_ - -
    -          inner representation of an ivy bus - store the drones' information about the drones which belong to this ivy bus - store the IP adress of the machine where the ivy bus is working
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/package-frame.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/package-frame.html deleted file mode 100755 index 9819cb6a07..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/package-frame.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - -pow - - - - - - - - - - - -pow - - - - -
    -Classes  - -
    -AES -
    -InstallCert
    - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/package-summary.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/package-summary.html deleted file mode 100755 index 5153706328..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/package-summary.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - -pow - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -

    -Package pow -

    - - - - - - - - - - - - - -
    -Class Summary
    AESimplements AES encryption and decryption algorithms - see @link http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html - see @link http://stackoverflow.com/questions/992019/java-256bit-aes-encryption
    InstallCertquery the server about its certificate and create a 'jssecacerts' file to copy - into /usr/lib/jvm/java-x-x/jre/lib/security - allow a java http client to connect to https server
    -  - -

    -

    -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/package-tree.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/package-tree.html deleted file mode 100755 index dc0faed1fc..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/package-tree.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - -pow Class Hierarchy - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Hierarchy For Package pow -

    -
    -
    -
    Package Hierarchies:
    All Packages
    -
    -

    -Class Hierarchy -

    - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/package-use.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/package-use.html deleted file mode 100755 index 8f4b510b9f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/package-use.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - -Uses of Package pow - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Package
    pow

    -
    - - - - - - - - - - - - - -
    -Packages that use pow
    pow.ivyclient  
    pow.webserver  
    -  -

    - - - - - - - - -
    -Classes in pow used by pow.ivyclient
    AES - -
    -          implements AES encryption and decryption algorithms - see @link http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html - see @link http://stackoverflow.com/questions/992019/java-256bit-aes-encryption
    -  -

    - - - - - - - - -
    -Classes in pow used by pow.webserver
    AES - -
    -          implements AES encryption and decryption algorithms - see @link http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html - see @link http://stackoverflow.com/questions/992019/java-256bit-aes-encryption
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/AjaxRqst.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/AjaxRqst.html deleted file mode 100755 index c40339441d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/AjaxRqst.html +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - -AjaxRqst - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class AjaxRqst

    -
    -java.lang.Object
    -  extended by javax.servlet.GenericServlet
    -      extended by javax.servlet.http.HttpServlet
    -          extended by pow.webserver.AjaxRqst
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
    -
    -
    -
    -
    public class AjaxRqst
    extends javax.servlet.http.HttpServlet
    - - -

    -Servlet implementation class ajaxRqst - handles the different request from a web client which wants to give orders to a drone - and it handles administrator queries to manage users' profiles -

    - -

    -

    -
    See Also:
    Serialized Form
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    AjaxRqst() - -
    -           
    -  - - - - - - - - - - - -
    -Method Summary
    - voidinit(javax.servlet.ServletConfig config) - -
    -          init the servlet
    - - - - - - - -
    Methods inherited from class javax.servlet.http.HttpServlet
    service
    - - - - - - - -
    Methods inherited from class javax.servlet.GenericServlet
    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -AjaxRqst

    -
    -public AjaxRqst()
    -
    -
    -
    See Also:
    HttpServlet.HttpServlet()
    -
    - - - - - - - - -
    -Method Detail
    - -

    -init

    -
    -public void init(javax.servlet.ServletConfig config)
    -          throws javax.servlet.ServletException
    -
    -
    init the servlet -

    -

    -
    Specified by:
    init in interface javax.servlet.Servlet
    Overrides:
    init in class javax.servlet.GenericServlet
    -
    -
    - -
    Throws: -
    javax.servlet.ServletException
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/AlreadyRegisteredUserException.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/AlreadyRegisteredUserException.html deleted file mode 100755 index 6738f364d8..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/AlreadyRegisteredUserException.html +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - -AlreadyRegisteredUserException - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class AlreadyRegisteredUserException

    -
    -java.lang.Object
    -  extended by java.lang.Throwable
    -      extended by java.lang.Exception
    -          extended by pow.webserver.AlreadyRegisteredUserException
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable
    -
    -
    -
    -
    public class AlreadyRegisteredUserException
    extends java.lang.Exception
    - - -

    -exception to inform that a user cannot be created in the users' file - because it exists yet -

    - -

    -

    -
    Author:
    -
    genin
    -
    See Also:
    Serialized Form
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    AlreadyRegisteredUserException(User u) - -
    -           
    -  - - - - - - - - - - - -
    -Method Summary
    - java.lang.StringtoString() - -
    -           
    - - - - - - - -
    Methods inherited from class java.lang.Throwable
    fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -AlreadyRegisteredUserException

    -
    -public AlreadyRegisteredUserException(User u)
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -toString

    -
    -public java.lang.String toString()
    -
    -
    -
    Overrides:
    toString in class java.lang.Throwable
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Conf.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Conf.html deleted file mode 100755 index bca73ad8f1..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Conf.html +++ /dev/null @@ -1,564 +0,0 @@ - - - - - - -Conf - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class Conf

    -
    -java.lang.Object
    -  extended by pow.webserver.Conf
    -
    -
    -
    -
    public class Conf
    extends java.lang.Object
    - - -

    -store useful data about the server configuration - and database connection by - reading a specific file place in the 'conf' folder of - the web application -

    - -

    -


    - -

    - - - - - - - - - - - -
    -Constructor Summary
    Conf(java.lang.String default_folder, - java.lang.String conf_filename) - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - java.lang.StringadminLogin() - -
    -           
    - java.lang.StringgetDataBaseName() - -
    -           
    - intgetDataEventTimeoutTime() - -
    -           
    - DbModegetDbMode() - -
    -           
    - java.lang.StringgetDBPassword() - -
    -           
    - java.lang.StringgetDBUserName() - -
    -           
    - intgetDieEventTimeoutTime() - -
    -           
    - intgetOrderResponseTimeout() - -
    -           
    - intgetSocketTimeout() - -
    -           
    - longgetTime2checkDeadBuses() - -
    -           
    - longgetTime2resetFilter() - -
    -           
    - longgetTimeToSendValues() - -
    -           
    - intgetUdpSize() - -
    -           
    - java.lang.StringmailAdmin() - -
    -           
    - intportIvyToWeb() - -
    -           
    - intportWebToIvy() - -
    -           
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Conf

    -
    -public Conf(java.lang.String default_folder,
    -            java.lang.String conf_filename)
    -
    -
    -
    Parameters:
    default_folder - folder of the web application on the server
    conf_filename - name of the configuration file placed in 'conf' folder of the web application
    -
    - - - - - - - - -
    -Method Detail
    - -

    -portIvyToWeb

    -
    -public int portIvyToWeb()
    -
    -
    - -
    Returns:
    the udp port on which the server receive data from ivy buses
    -
    -
    -
    - -

    -portWebToIvy

    -
    -public int portWebToIvy()
    -
    -
    - -
    Returns:
    the udp port on which the server send data to ivy buses
    -
    -
    -
    - -

    -getUdpSize

    -
    -public int getUdpSize()
    -
    -
    - -
    Returns:
    the max size of an udp trame
    -
    -
    -
    - -

    -getDBPassword

    -
    -public java.lang.String getDBPassword()
    -
    -
    - -
    Returns:
    the password to connect to the database
    -
    -
    -
    - -

    -getDBUserName

    -
    -public java.lang.String getDBUserName()
    -
    -
    - -
    Returns:
    the login to connect to the database
    -
    -
    -
    - -

    -getDataBaseName

    -
    -public java.lang.String getDataBaseName()
    -
    -
    - -
    Returns:
    the database name
    -
    -
    -
    - -

    -getSocketTimeout

    -
    -public int getSocketTimeout()
    -
    -
    - -
    Returns:
    a time after what an exception is thrown if no message has been received by server
    -
    -
    -
    - -

    -mailAdmin

    -
    -public java.lang.String mailAdmin()
    -
    -
    - -
    Returns:
    the mail to contact if any problem occurs
    -
    -
    -
    - -

    -adminLogin

    -
    -public java.lang.String adminLogin()
    -
    -
    - -
    Returns:
    the login of the administrator of the site
    -
    -
    -
    - -

    -getTime2resetFilter

    -
    -public long getTime2resetFilter()
    -
    -
    - -
    Returns:
    period of time in millisec to reset the filter of waypoint_moved messages
    -
    -
    -
    - -

    -getTimeToSendValues

    -
    -public long getTimeToSendValues()
    -
    -
    - -
    Returns:
    period of time in millisec to send all the parameter values for a specific drone
    -
    -
    -
    - -

    -getOrderResponseTimeout

    -
    -public int getOrderResponseTimeout()
    -
    -
    - -
    Returns:
    time to wait for the acknowledgement of an order
    -
    -
    -
    - -

    -getDieEventTimeoutTime

    -
    -public int getDieEventTimeoutTime()
    -
    -
    - -
    Returns:
    time to wait after a die event to remove the drone
    -
    -
    -
    - -

    -getDataEventTimeoutTime

    -
    -public int getDataEventTimeoutTime()
    -
    -
    - -
    Returns:
    time to wait after receiving no data for a drone to remove the drone
    -
    -
    -
    - -

    -getTime2checkDeadBuses

    -
    -public long getTime2checkDeadBuses()
    -
    -
    - -
    Returns:
    period of time to check for dead ivy buses in serveur.java
    -
    -
    -
    - -

    -getDbMode

    -
    -public DbMode getDbMode()
    -
    -
    - -
    Returns:
    SILENT or VERBOSE
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/DbMode.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/DbMode.html deleted file mode 100755 index 064ea2b667..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/DbMode.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - -DbMode - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Enum DbMode

    -
    -java.lang.Object
    -  extended by java.lang.Enum<DbMode>
    -      extended by pow.webserver.DbMode
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DbMode>
    -
    -
    -
    -
    public enum DbMode
    extends java.lang.Enum<DbMode>
    - - -

    -specify how the database works -

    - -

    -

    -
    Author:
    -
    genin
    -
    -
    - -

    - - - - - - - - - - - - - -
    -Enum Constant Summary
    SILENT - -
    -          the database stores only connection activity of ivy client
    VERBOSE - -
    -          the database records all ivy messages the server receives
    -  - - - - - - - - - - - - - - - -
    -Method Summary
    -static DbModevalueOf(java.lang.String name) - -
    -          Returns the enum constant of this type with the specified name.
    -static DbMode[]values() - -
    -          Returns an array containing the constants of this enum type, in -the order they are declared.
    - - - - - - - -
    Methods inherited from class java.lang.Enum
    compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
    - - - - - - - -
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, wait, wait, wait
    -  -

    - - - - - - - - -
    -Enum Constant Detail
    - -

    -VERBOSE

    -
    -public static final DbMode VERBOSE
    -
    -
    the database records all ivy messages the server receives -

    -

    -
    -
    -
    - -

    -SILENT

    -
    -public static final DbMode SILENT
    -
    -
    the database stores only connection activity of ivy client -

    -

    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -values

    -
    -public static DbMode[] values()
    -
    -
    Returns an array containing the constants of this enum type, in -the order they are declared. This method may be used to iterate -over the constants as follows: -
    -for (DbMode c : DbMode.values())
    -    System.out.println(c);
    -
    -

    -

    - -
    Returns:
    an array containing the constants of this enum type, in -the order they are declared
    -
    -
    -
    - -

    -valueOf

    -
    -public static DbMode valueOf(java.lang.String name)
    -
    -
    Returns the enum constant of this type with the specified name. -The string must match exactly an identifier used to declare an -enum constant in this type. (Extraneous whitespace characters are -not permitted.) -

    -

    -
    Parameters:
    name - the name of the enum constant to be returned. -
    Returns:
    the enum constant with the specified name -
    Throws: -
    java.lang.IllegalArgumentException - if this enum type has no constant -with the specified name -
    java.lang.NullPointerException - if the argument is null
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/DbOrder.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/DbOrder.html deleted file mode 100755 index 9723fdca9a..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/DbOrder.html +++ /dev/null @@ -1,373 +0,0 @@ - - - - - - -DbOrder - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Enum DbOrder

    -
    -java.lang.Object
    -  extended by java.lang.Enum<DbOrder>
    -      extended by pow.webserver.DbOrder
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DbOrder>
    -
    -
    -
    -
    public enum DbOrder
    extends java.lang.Enum<DbOrder>
    - - -

    -represents 4 kind of message stored in database - CONNECT first connection of an ivy bus --> inform db - DECONNECT ivy bus deconnected --> inform db - ADD add message to db -

    - -

    -

    -
    Author:
    -
    genin
    -
    -
    - -

    - - - - - - - - - - - - - - - - - - - -
    -Enum Constant Summary
    ADD_DATA - -
    -          just store the data in the log table
    ADD_ORDER - -
    -          the message is an order coming from a web user
    CONNECT - -
    -          store the message and create a record in the 'connexion' table
    DECONNECT - -
    -          store the message and complete the end field in the 'connexion' table
    -  - - - - - - - - - - - - - - - -
    -Method Summary
    -static DbOrdervalueOf(java.lang.String name) - -
    -          Returns the enum constant of this type with the specified name.
    -static DbOrder[]values() - -
    -          Returns an array containing the constants of this enum type, in -the order they are declared.
    - - - - - - - -
    Methods inherited from class java.lang.Enum
    compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
    - - - - - - - -
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, wait, wait, wait
    -  -

    - - - - - - - - -
    -Enum Constant Detail
    - -

    -CONNECT

    -
    -public static final DbOrder CONNECT
    -
    -
    store the message and create a record in the 'connexion' table -

    -

    -
    -
    -
    - -

    -DECONNECT

    -
    -public static final DbOrder DECONNECT
    -
    -
    store the message and complete the end field in the 'connexion' table -

    -

    -
    -
    -
    - -

    -ADD_DATA

    -
    -public static final DbOrder ADD_DATA
    -
    -
    just store the data in the log table -

    -

    -
    -
    -
    - -

    -ADD_ORDER

    -
    -public static final DbOrder ADD_ORDER
    -
    -
    the message is an order coming from a web user -

    -

    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -values

    -
    -public static DbOrder[] values()
    -
    -
    Returns an array containing the constants of this enum type, in -the order they are declared. This method may be used to iterate -over the constants as follows: -
    -for (DbOrder c : DbOrder.values())
    -    System.out.println(c);
    -
    -

    -

    - -
    Returns:
    an array containing the constants of this enum type, in -the order they are declared
    -
    -
    -
    - -

    -valueOf

    -
    -public static DbOrder valueOf(java.lang.String name)
    -
    -
    Returns the enum constant of this type with the specified name. -The string must match exactly an identifier used to declare an -enum constant in this type. (Extraneous whitespace characters are -not permitted.) -

    -

    -
    Parameters:
    name - the name of the enum constant to be returned. -
    Returns:
    the enum constant with the specified name -
    Throws: -
    java.lang.IllegalArgumentException - if this enum type has no constant -with the specified name -
    java.lang.NullPointerException - if the argument is null
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Greeting.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Greeting.html deleted file mode 100755 index 1fd3eed639..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Greeting.html +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - -Greeting - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class Greeting

    -
    -java.lang.Object
    -  extended by javax.servlet.GenericServlet
    -      extended by javax.servlet.http.HttpServlet
    -          extended by pow.webserver.Greeting
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
    -
    -
    -
    -
    public class Greeting
    extends javax.servlet.http.HttpServlet
    - - -

    -Servlet implementation class Greeting - Handles the connection request from a new web client - check the login's information and rights -

    - -

    -

    -
    See Also:
    Serialized Form
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    Greeting() - -
    -           
    -  - - - - - - - - - - - -
    -Method Summary
    - voidinit(javax.servlet.ServletConfig config) - -
    -           
    - - - - - - - -
    Methods inherited from class javax.servlet.http.HttpServlet
    service
    - - - - - - - -
    Methods inherited from class javax.servlet.GenericServlet
    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Greeting

    -
    -public Greeting()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -init

    -
    -public void init(javax.servlet.ServletConfig config)
    -          throws javax.servlet.ServletException
    -
    -
    -
    Specified by:
    init in interface javax.servlet.Servlet
    Overrides:
    init in class javax.servlet.GenericServlet
    -
    -
    - -
    Throws: -
    javax.servlet.ServletException
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/HeartBeat.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/HeartBeat.html deleted file mode 100755 index 6831e97645..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/HeartBeat.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - -HeartBeat - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class HeartBeat

    -
    -java.lang.Object
    -  extended by pow.webserver.HeartBeat
    -
    -
    -
    All Implemented Interfaces:
    java.lang.Runnable
    -
    -
    -
    -
    public class HeartBeat
    extends java.lang.Object
    implements java.lang.Runnable
    - - -

    -


    - -

    - - - - - - - - - - - -
    -Constructor Summary
    HeartBeat(javax.servlet.ServletContext s, - int h, - int p) - -
    -           
    -  - - - - - - - - - - - - - - - -
    -Method Summary
    - voidrun() - -
    -          send a periodic heartbeat message to every connected ivy bus
    - voidstop_thread() - -
    -          stop the heartbeat process of the server
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -HeartBeat

    -
    -public HeartBeat(javax.servlet.ServletContext s,
    -                 int h,
    -                 int p)
    -
    -
    -
    Parameters:
    s - the object which stores ivysessions
    h - the period of the heartbeats
    p - the udp port to use to send heartbeat
    -
    - - - - - - - - -
    -Method Detail
    - -

    -run

    -
    -public void run()
    -
    -
    send a periodic heartbeat message to every connected ivy bus -

    -

    -
    Specified by:
    run in interface java.lang.Runnable
    -
    -
    -
    -
    -
    -
    - -

    -stop_thread

    -
    -public void stop_thread()
    -
    -
    stop the heartbeat process of the server -

    -

    -
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Ivy2TomcatHttpServer.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Ivy2TomcatHttpServer.html deleted file mode 100755 index f772ae0887..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Ivy2TomcatHttpServer.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - -Ivy2TomcatHttpServer - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class Ivy2TomcatHttpServer

    -
    -java.lang.Object
    -  extended by javax.servlet.GenericServlet
    -      extended by javax.servlet.http.HttpServlet
    -          extended by pow.webserver.Ivy2TomcatHttpServer
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
    -
    -
    -
    -
    public class Ivy2TomcatHttpServer
    extends javax.servlet.http.HttpServlet
    - - -

    -Handles the connection request from a new ivy bus - provide a unique id for the ivy bus - provide a unique id for each new drone on a ivy bus - handles the uploading of the configuration files for each new drone on a ivy bus -

    - -

    -

    -
    See Also:
    Serialized Form
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    Ivy2TomcatHttpServer() - -
    -           
    -  - - - - - - - - - - - - - - - -
    -Method Summary
    - intgetWebId(java.lang.String login) - -
    -          contact database if any to have a new webid
    - voidinit(javax.servlet.ServletConfig config) - -
    -           
    - - - - - - - -
    Methods inherited from class javax.servlet.http.HttpServlet
    service
    - - - - - - - -
    Methods inherited from class javax.servlet.GenericServlet
    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Ivy2TomcatHttpServer

    -
    -public Ivy2TomcatHttpServer()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -init

    -
    -public void init(javax.servlet.ServletConfig config)
    -          throws javax.servlet.ServletException
    -
    -
    -
    Specified by:
    init in interface javax.servlet.Servlet
    Overrides:
    init in class javax.servlet.GenericServlet
    -
    -
    - -
    Throws: -
    javax.servlet.ServletException
    -
    -
    -
    - -

    -getWebId

    -
    -public int getWebId(java.lang.String login)
    -
    -
    contact database if any to have a new webid -

    -

    - -
    Returns:
    a webid>0 or -1 if failed
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/IvyMsg.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/IvyMsg.html deleted file mode 100755 index a99621ba67..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/IvyMsg.html +++ /dev/null @@ -1,404 +0,0 @@ - - - - - - -IvyMsg - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class IvyMsg

    -
    -java.lang.Object
    -  extended by pow.webserver.IvyMsg
    -
    -
    -
    -
    public class IvyMsg
    extends java.lang.Object
    - - -

    -represents information which are sended by the source event to the database on the queue fifo -

    - -

    -

    -
    Author:
    -
    genin
    -
    -
    - -

    - - - - - - - - - - - - - - - - - -
    -Constructor Summary
    IvyMsg(int wId) - -
    -           
    IvyMsg(int wId, - long num, - java.lang.String date, - java.lang.String msg) - -
    -           
    IvyMsg(int wId, - long num, - java.lang.String date, - java.lang.String msg, - DbOrder order) - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - java.lang.StringgetIvyMsg() - -
    -           
    - longgetNumMsg() - -
    -           
    - DbOrdergetOrder() - -
    -           
    - java.lang.StringgetTimeMsg() - -
    -           
    - intgetWebId() - -
    -           
    - voidsetOrder(DbOrder o) - -
    -          specify how to store the message in database
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -IvyMsg

    -
    -public IvyMsg(int wId,
    -              long num,
    -              java.lang.String date,
    -              java.lang.String msg,
    -              DbOrder order)
    -
    -
    -
    - -

    -IvyMsg

    -
    -public IvyMsg(int wId,
    -              long num,
    -              java.lang.String date,
    -              java.lang.String msg)
    -
    -
    -
    - -

    -IvyMsg

    -
    -public IvyMsg(int wId)
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -getWebId

    -
    -public int getWebId()
    -
    -
    - -
    Returns:
    the ivy web ivy which has sent the message
    -
    -
    -
    - -

    -getNumMsg

    -
    -public long getNumMsg()
    -
    -
    - -
    Returns:
    the number of the message
    -
    -
    -
    - -

    -getTimeMsg

    -
    -public java.lang.String getTimeMsg()
    -
    -
    - -
    Returns:
    the time at which the message was sent
    -
    -
    -
    - -

    -getIvyMsg

    -
    -public java.lang.String getIvyMsg()
    -
    -
    - -
    Returns:
    the ivy message
    -
    -
    -
    - -

    -getOrder

    -
    -public DbOrder getOrder()
    -
    -
    - -
    Returns:
    an order on how to store the ivy message in database
    -
    -
    -
    - -

    -setOrder

    -
    -public void setOrder(DbOrder o)
    -
    -
    specify how to store the message in database -

    -

    -
    Parameters:
    o - the way to store the message in database
    See Also:
    DbOrder
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Log.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Log.html deleted file mode 100755 index aa44e8d019..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Log.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - - -Log - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class Log

    -
    -java.lang.Object
    -  extended by pow.webserver.Log
    -
    -
    -
    -
    public class Log
    extends java.lang.Object
    - - -

    -Handles the writing of a log in a file -

    - -

    -

    -
    Since:
    -
    V1
    -
    Author:
    -
    from V1
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    Log(java.lang.String path) - -
    -          create a log file into the log floder of the web application
    -  - - - - - - - - - - - -
    -Method Summary
    - voidwrite(java.lang.String writing) - -
    -          write a string in log file and on stdout
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Log

    -
    -public Log(java.lang.String path)
    -
    -
    create a log file into the log floder of the web application -

    -

    -
    Parameters:
    path - the complete path of the web application
    -
    - - - - - - - - -
    -Method Detail
    - -

    -write

    -
    -public void write(java.lang.String writing)
    -
    -
    write a string in log file and on stdout -

    -

    -
    Parameters:
    writing - the string to write in the log file
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Md5.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Md5.html deleted file mode 100755 index 258bdff760..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Md5.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -Md5 - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class Md5

    -
    -java.lang.Object
    -  extended by pow.webserver.Md5
    -
    -
    -
    -
    public class Md5
    extends java.lang.Object
    - - -

    -tool class to implemente MD5 encoding - ( found on the web ) -

    - -

    -


    - -

    - - - - - - - - - - - -
    -Constructor Summary
    Md5() - -
    -           
    -  - - - - - - - - - - - - - - - -
    -Method Summary
    -static java.lang.Stringencode(java.lang.String password) - -
    -           
    -static voidmain(java.lang.String[] args) - -
    -          example
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Md5

    -
    -public Md5()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -encode

    -
    -public static java.lang.String encode(java.lang.String password)
    -
    -
    -
    Parameters:
    password - the string to encode with MD5 algorithm -
    Returns:
    the encoded string with MD5 algorithm
    -
    -
    -
    - -

    -main

    -
    -public static void main(java.lang.String[] args)
    -
    -
    example -

    -

    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Rights.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Rights.html deleted file mode 100755 index 67989cb50c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Rights.html +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - -Rights - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Enum Rights

    -
    -java.lang.Object
    -  extended by java.lang.Enum<Rights>
    -      extended by pow.webserver.Rights
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Rights>
    -
    -
    -
    -
    public enum Rights
    extends java.lang.Enum<Rights>
    - - -

    -describe the different rights a web user can have -

    - -

    -

    -
    Author:
    -
    genin
    -
    -
    - -

    - - - - - - - - - - - - - - - - - - - -
    -Enum Constant Summary
    ADMIN - -
    -          can pilot all the drones and manage user's account and create others administrators
    IVY - -
    -          specify an ivy user which send data to the server via UDP
    USER - -
    -          can pilot only specific drones which are specified in its user account
    VISITOR - -
    -          can only see the drones
    -  - - - - - - - - - - - - - - - -
    -Method Summary
    -static RightsvalueOf(java.lang.String name) - -
    -          Returns the enum constant of this type with the specified name.
    -static Rights[]values() - -
    -          Returns an array containing the constants of this enum type, in -the order they are declared.
    - - - - - - - -
    Methods inherited from class java.lang.Enum
    compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
    - - - - - - - -
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, wait, wait, wait
    -  -

    - - - - - - - - -
    -Enum Constant Detail
    - -

    -VISITOR

    -
    -public static final Rights VISITOR
    -
    -
    can only see the drones -

    -

    -
    -
    -
    - -

    -ADMIN

    -
    -public static final Rights ADMIN
    -
    -
    can pilot all the drones and manage user's account and create others administrators -

    -

    -
    -
    -
    - -

    -USER

    -
    -public static final Rights USER
    -
    -
    can pilot only specific drones which are specified in its user account -

    -

    -
    -
    -
    - -

    -IVY

    -
    -public static final Rights IVY
    -
    -
    specify an ivy user which send data to the server via UDP -

    -

    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -values

    -
    -public static Rights[] values()
    -
    -
    Returns an array containing the constants of this enum type, in -the order they are declared. This method may be used to iterate -over the constants as follows: -
    -for (Rights c : Rights.values())
    -    System.out.println(c);
    -
    -

    -

    - -
    Returns:
    an array containing the constants of this enum type, in -the order they are declared
    -
    -
    -
    - -

    -valueOf

    -
    -public static Rights valueOf(java.lang.String name)
    -
    -
    Returns the enum constant of this type with the specified name. -The string must match exactly an identifier used to declare an -enum constant in this type. (Extraneous whitespace characters are -not permitted.) -

    -

    -
    Parameters:
    name - the name of the enum constant to be returned. -
    Returns:
    the enum constant with the specified name -
    Throws: -
    java.lang.IllegalArgumentException - if this enum type has no constant -with the specified name -
    java.lang.NullPointerException - if the argument is null
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SGBDfeeder.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SGBDfeeder.html deleted file mode 100755 index a68f1cb4fe..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SGBDfeeder.html +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - -SGBDfeeder - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class SGBDfeeder

    -
    -java.lang.Object
    -  extended by pow.webserver.SGBDfeeder
    -
    -
    -
    All Implemented Interfaces:
    java.lang.Runnable
    -
    -
    -
    -
    public class SGBDfeeder
    extends java.lang.Object
    implements java.lang.Runnable
    - - -

    -thread which waits for ivy messages sent by event source (serveur.java) - and stores them into a mysql database - the ivy messages are extracted from a blocking queue (fifo) - parameter of the database are extracted from conf file -

    - -

    -


    - -

    - - - - - - - - - - - -
    -Constructor Summary
    SGBDfeeder(java.lang.String dbname, - java.lang.String dbuser, - java.lang.String dbpwd, - DbMode mode) - -
    -          create a thread which fill the database with the message it extracts from the fifo
    -  - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - java.util.concurrent.LinkedBlockingQueue<IvyMsg>getQueueFIFO() - -
    -           
    - voidkill() - -
    -          stop the thread by ending run method - used caused Thread.stop is now deprecated
    - voidrun() - -
    -          listens fifo queue and stores ivy messages in database - if the message has the DECONNECT type it also fills the end field corresponding - to this ivy session into the 'connexion' table
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -SGBDfeeder

    -
    -public SGBDfeeder(java.lang.String dbname,
    -                  java.lang.String dbuser,
    -                  java.lang.String dbpwd,
    -                  DbMode mode)
    -
    -
    create a thread which fill the database with the message it extracts from the fifo -

    -

    -
    Parameters:
    dbname - the name of the database
    dbuser - the user login to connect to the database
    dbpwd - the user password to connect to the database
    -
    - - - - - - - - -
    -Method Detail
    - -

    -getQueueFIFO

    -
    -public java.util.concurrent.LinkedBlockingQueue<IvyMsg> getQueueFIFO()
    -
    -
    -
    -
    -
    - -
    Returns:
    the fifo to communicate with the database feeder
    -
    -
    -
    - -

    -kill

    -
    -public void kill()
    -
    -
    stop the thread by ending run method - used caused Thread.stop is now deprecated -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -run

    -
    -public void run()
    -
    -
    listens fifo queue and stores ivy messages in database - if the message has the DECONNECT type it also fills the end field corresponding - to this ivy session into the 'connexion' table -

    -

    -
    Specified by:
    run in interface java.lang.Runnable
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities.FakeHostnameVerifier.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities.FakeHostnameVerifier.html deleted file mode 100755 index 873103aef5..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities.FakeHostnameVerifier.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -SSLUtilities.FakeHostnameVerifier - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class SSLUtilities.FakeHostnameVerifier

    -
    -java.lang.Object
    -  extended by pow.webserver.SSLUtilities.FakeHostnameVerifier
    -
    -
    -
    All Implemented Interfaces:
    javax.net.ssl.HostnameVerifier
    -
    -
    -
    Enclosing class:
    SSLUtilities
    -
    -
    -
    -
    public static class SSLUtilities.FakeHostnameVerifier
    extends java.lang.Object
    implements javax.net.ssl.HostnameVerifier
    - - -

    -This class implements a fake hostname verificator, trusting any host - name. -

    - -

    -

    -
    Author:
    -
    Francis Labrie
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    SSLUtilities.FakeHostnameVerifier() - -
    -           
    -  - - - - - - - - - - - -
    -Method Summary
    - booleanverify(java.lang.String hostname, - javax.net.ssl.SSLSession session) - -
    -          Always return true, indicating that the host name is - an acceptable match with the server's authentication scheme.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -SSLUtilities.FakeHostnameVerifier

    -
    -public SSLUtilities.FakeHostnameVerifier()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -verify

    -
    -public boolean verify(java.lang.String hostname,
    -                      javax.net.ssl.SSLSession session)
    -
    -
    Always return true, indicating that the host name is - an acceptable match with the server's authentication scheme. -

    -

    -
    Specified by:
    verify in interface javax.net.ssl.HostnameVerifier
    -
    -
    -
    Parameters:
    hostname - the host name.
    session - the SSL session used on the connection to - host. -
    Returns:
    the true boolean value - indicating the host name is trusted.
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities.FakeX509TrustManager.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities.FakeX509TrustManager.html deleted file mode 100755 index d76b6bd955..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities.FakeX509TrustManager.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - -SSLUtilities.FakeX509TrustManager - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class SSLUtilities.FakeX509TrustManager

    -
    -java.lang.Object
    -  extended by pow.webserver.SSLUtilities.FakeX509TrustManager
    -
    -
    -
    All Implemented Interfaces:
    javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager
    -
    -
    -
    Enclosing class:
    SSLUtilities
    -
    -
    -
    -
    public static class SSLUtilities.FakeX509TrustManager
    extends java.lang.Object
    implements javax.net.ssl.X509TrustManager
    - - -

    -This class allow any X509 certificates to be used to authenticate the - remote side of a secure socket, including self-signed certificates. -

    - -

    -

    -
    Author:
    -
    Francis Labrie
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    SSLUtilities.FakeX509TrustManager() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidcheckClientTrusted(java.security.cert.X509Certificate[] chain, - java.lang.String authType) - -
    -          Always trust for client SSL chain peer certificate - chain with any authType authentication types.
    - voidcheckServerTrusted(java.security.cert.X509Certificate[] chain, - java.lang.String authType) - -
    -          Always trust for server SSL chain peer certificate - chain with any authType exchange algorithm types.
    - java.security.cert.X509Certificate[]getAcceptedIssuers() - -
    -          Return an empty array of certificate authority certificates which - are trusted for authenticating peers.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -SSLUtilities.FakeX509TrustManager

    -
    -public SSLUtilities.FakeX509TrustManager()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -checkClientTrusted

    -
    -public void checkClientTrusted(java.security.cert.X509Certificate[] chain,
    -                               java.lang.String authType)
    -
    -
    Always trust for client SSL chain peer certificate - chain with any authType authentication types. -

    -

    -
    Specified by:
    checkClientTrusted in interface javax.net.ssl.X509TrustManager
    -
    -
    -
    Parameters:
    chain - the peer certificate chain.
    authType - the authentication type based on the client - certificate.
    -
    -
    -
    - -

    -checkServerTrusted

    -
    -public void checkServerTrusted(java.security.cert.X509Certificate[] chain,
    -                               java.lang.String authType)
    -
    -
    Always trust for server SSL chain peer certificate - chain with any authType exchange algorithm types. -

    -

    -
    Specified by:
    checkServerTrusted in interface javax.net.ssl.X509TrustManager
    -
    -
    -
    Parameters:
    chain - the peer certificate chain.
    authType - the key exchange algorithm used.
    -
    -
    -
    - -

    -getAcceptedIssuers

    -
    -public java.security.cert.X509Certificate[] getAcceptedIssuers()
    -
    -
    Return an empty array of certificate authority certificates which - are trusted for authenticating peers. -

    -

    -
    Specified by:
    getAcceptedIssuers in interface javax.net.ssl.X509TrustManager
    -
    -
    - -
    Returns:
    a empty array of issuer certificates.
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities._FakeHostnameVerifier.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities._FakeHostnameVerifier.html deleted file mode 100755 index 1774d01874..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities._FakeHostnameVerifier.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - -SSLUtilities._FakeHostnameVerifier - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class SSLUtilities._FakeHostnameVerifier

    -
    -java.lang.Object
    -  extended by pow.webserver.SSLUtilities._FakeHostnameVerifier
    -
    -
    -
    All Implemented Interfaces:
    com.sun.net.ssl.HostnameVerifier
    -
    -
    -
    Enclosing class:
    SSLUtilities
    -
    -
    -Deprecated. see SSLUtilities.FakeHostnameVerifier. -

    -

    -
    public static class SSLUtilities._FakeHostnameVerifier
    extends java.lang.Object
    implements com.sun.net.ssl.HostnameVerifier
    - - -

    -This class implements a fake hostname verificator, trusting any host - name. This class uses the old deprecated API from the com.sun. - ssl package. -

    - -

    -

    -
    Author:
    -
    Francis Labrie
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    SSLUtilities._FakeHostnameVerifier() - -
    -          Deprecated.  
    -  - - - - - - - - - - - -
    -Method Summary
    - booleanverify(java.lang.String hostname, - java.lang.String session) - -
    -          Deprecated. Always return true, indicating that the host name is an - acceptable match with the server's authentication scheme.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -SSLUtilities._FakeHostnameVerifier

    -
    -public SSLUtilities._FakeHostnameVerifier()
    -
    -
    Deprecated. 
    - - - - - - - - -
    -Method Detail
    - -

    -verify

    -
    -public boolean verify(java.lang.String hostname,
    -                      java.lang.String session)
    -
    -
    Deprecated. 
    Always return true, indicating that the host name is an - acceptable match with the server's authentication scheme. -

    -

    -
    Specified by:
    verify in interface com.sun.net.ssl.HostnameVerifier
    -
    -
    -
    Parameters:
    hostname - the host name.
    session - the SSL session used on the connection to - host. -
    Returns:
    the true boolean value - indicating the host name is trusted.
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities._FakeX509TrustManager.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities._FakeX509TrustManager.html deleted file mode 100755 index 9b1c2f4f9b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities._FakeX509TrustManager.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - - -SSLUtilities._FakeX509TrustManager - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class SSLUtilities._FakeX509TrustManager

    -
    -java.lang.Object
    -  extended by pow.webserver.SSLUtilities._FakeX509TrustManager
    -
    -
    -
    All Implemented Interfaces:
    com.sun.net.ssl.TrustManager, com.sun.net.ssl.X509TrustManager
    -
    -
    -
    Enclosing class:
    SSLUtilities
    -
    -
    -Deprecated. see SSLUtilities.FakeX509TrustManager. -

    -

    -
    public static class SSLUtilities._FakeX509TrustManager
    extends java.lang.Object
    implements com.sun.net.ssl.X509TrustManager
    - - -

    -This class allow any X509 certificates to be used to authenticate the - remote side of a secure socket, including self-signed certificates. This - class uses the old deprecated API from the com.sun.ssl - package. -

    - -

    -

    -
    Author:
    -
    Francis Labrie
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    SSLUtilities._FakeX509TrustManager() - -
    -          Deprecated.  
    -  - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - java.security.cert.X509Certificate[]getAcceptedIssuers() - -
    -          Deprecated. Return an empty array of certificate authority certificates which - are trusted for authenticating peers.
    - booleanisClientTrusted(java.security.cert.X509Certificate[] chain) - -
    -          Deprecated. Always return true, trusting for client SSL - chain peer certificate chain.
    - booleanisServerTrusted(java.security.cert.X509Certificate[] chain) - -
    -          Deprecated. Always return true, trusting for server SSL - chain peer certificate chain.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -SSLUtilities._FakeX509TrustManager

    -
    -public SSLUtilities._FakeX509TrustManager()
    -
    -
    Deprecated. 
    - - - - - - - - -
    -Method Detail
    - -

    -isClientTrusted

    -
    -public boolean isClientTrusted(java.security.cert.X509Certificate[] chain)
    -
    -
    Deprecated. 
    Always return true, trusting for client SSL - chain peer certificate chain. -

    -

    -
    Specified by:
    isClientTrusted in interface com.sun.net.ssl.X509TrustManager
    -
    -
    -
    Parameters:
    chain - the peer certificate chain. -
    Returns:
    the true boolean value - indicating the chain is trusted.
    -
    -
    -
    - -

    -isServerTrusted

    -
    -public boolean isServerTrusted(java.security.cert.X509Certificate[] chain)
    -
    -
    Deprecated. 
    Always return true, trusting for server SSL - chain peer certificate chain. -

    -

    -
    Specified by:
    isServerTrusted in interface com.sun.net.ssl.X509TrustManager
    -
    -
    -
    Parameters:
    chain - the peer certificate chain. -
    Returns:
    the true boolean value - indicating the chain is trusted.
    -
    -
    -
    - -

    -getAcceptedIssuers

    -
    -public java.security.cert.X509Certificate[] getAcceptedIssuers()
    -
    -
    Deprecated. 
    Return an empty array of certificate authority certificates which - are trusted for authenticating peers. -

    -

    -
    Specified by:
    getAcceptedIssuers in interface com.sun.net.ssl.X509TrustManager
    -
    -
    - -
    Returns:
    a empty array of issuer certificates.
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities.html deleted file mode 100755 index 9d12a1fe97..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SSLUtilities.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - -SSLUtilities - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class SSLUtilities

    -
    -java.lang.Object
    -  extended by pow.webserver.SSLUtilities
    -
    -
    -
    -
    public final class SSLUtilities
    extends java.lang.Object
    - - -

    -This class provide various static methods that relax X509 certificate and - hostname verification while using the SSL over the HTTP protocol. - call: - SSLUtilities.trustAllHostnames() to turn off the default hostname verification on HTTPS connection; - SSLUtilities.trustAllHttpsCertificates() to turn off the default certificate validation on HTTPS connection. -

    - -

    -

    -
    Author:
    -
    Francis Labrie
    -
    -
    - -

    - - - - - - - - - - - - - - - - - - - - - - - -
    -Nested Class Summary
    -static classSSLUtilities._FakeHostnameVerifier - -
    -          Deprecated. see SSLUtilities.FakeHostnameVerifier.
    -static classSSLUtilities._FakeX509TrustManager - -
    -          Deprecated. see SSLUtilities.FakeX509TrustManager.
    -static classSSLUtilities.FakeHostnameVerifier - -
    -          This class implements a fake hostname verificator, trusting any host - name.
    -static classSSLUtilities.FakeX509TrustManager - -
    -          This class allow any X509 certificates to be used to authenticate the - remote side of a secure socket, including self-signed certificates.
    -  - - - - - - - - - - -
    -Constructor Summary
    SSLUtilities() - -
    -           
    -  - - - - - - - - - - - - - - - -
    -Method Summary
    -static voidtrustAllHostnames() - -
    -          Set the default Hostname Verifier to an instance of a fake class that - trust all hostnames.
    -static voidtrustAllHttpsCertificates() - -
    -          Set the default X509 Trust Manager to an instance of a fake class that - trust all certificates, even the self-signed ones.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -SSLUtilities

    -
    -public SSLUtilities()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -trustAllHostnames

    -
    -public static void trustAllHostnames()
    -
    -
    Set the default Hostname Verifier to an instance of a fake class that - trust all hostnames. -

    -

    -
    -
    -
    -
    - -

    -trustAllHttpsCertificates

    -
    -public static void trustAllHttpsCertificates()
    -
    -
    Set the default X509 Trust Manager to an instance of a fake class that - trust all certificates, even the self-signed ones. -

    -

    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Serveur.IvyEventSource.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Serveur.IvyEventSource.html deleted file mode 100755 index 6243259a72..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Serveur.IvyEventSource.html +++ /dev/null @@ -1,385 +0,0 @@ - - - - - - -Serveur.IvyEventSource - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class Serveur.IvyEventSource

    -
    -java.lang.Object
    -  extended by pow.webserver.Serveur.IvyEventSource
    -
    -
    -
    All Implemented Interfaces:
    java.lang.Runnable, nl.justobjects.pushlet.core.EventSource
    -
    -
    -
    Enclosing class:
    Serveur
    -
    -
    -
    -
    public static class Serveur.IvyEventSource
    extends java.lang.Object
    implements nl.justobjects.pushlet.core.EventSource, java.lang.Runnable
    - - -

    -


    - -

    - - - - - - - - - - - -
    -Constructor Summary
    Serveur.IvyEventSource() - -
    -           
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidactivate() - -
    -          Activate the event source.
    - voidpassivate() - -
    -          Desactivate the event source.
    - voidrun() - -
    -          main loop : - listens to the udp channel - deciphers the udp message - checks if the sender is a new bus or not - send the message to database through a fifo - turns the ivy message into a pushlet event - send the event to web users - checks if there are some buses that doesn't send messages anymore - removes drone which belonged to dead buses
    - voidsetServletContext(javax.servlet.ServletContext srvCtxt) - -
    -          method qui renseigne la source sur la servlet qui l'a appelé - modification de la librairie pushlet - Pushlet.java - EventSource.java - EventSourceManager.java
    - voidstop() - -
    -          Desactivate the event source.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Serveur.IvyEventSource

    -
    -public Serveur.IvyEventSource()
    -
    -
    - - - - - - - - -
    -Method Detail
    - -

    -activate

    -
    -public void activate()
    -
    -
    Activate the event source. - load configuration, create log and create link to database MySQL - ! setServletContext method should be called before activating -

    -

    -
    Specified by:
    activate in interface nl.justobjects.pushlet.core.EventSource
    -
    -
    -
    See Also:
    class
    -
    -
    -
    - -

    -passivate

    -
    -public void passivate()
    -
    -
    Desactivate the event source. -

    -

    -
    Specified by:
    passivate in interface nl.justobjects.pushlet.core.EventSource
    -
    -
    -
    -
    -
    -
    - -

    -stop

    -
    -public void stop()
    -
    -
    Desactivate the event source. -

    -

    -
    Specified by:
    stop in interface nl.justobjects.pushlet.core.EventSource
    -
    -
    -
    -
    -
    -
    - -

    -run

    -
    -public void run()
    -
    -
    main loop : - listens to the udp channel - deciphers the udp message - checks if the sender is a new bus or not - send the message to database through a fifo - turns the ivy message into a pushlet event - send the event to web users - checks if there are some buses that doesn't send messages anymore - removes drone which belonged to dead buses -

    -

    -
    Specified by:
    run in interface java.lang.Runnable
    -
    -
    -
    -
    -
    -
    - -

    -setServletContext

    -
    -public void setServletContext(javax.servlet.ServletContext srvCtxt)
    -
    -
    method qui renseigne la source sur la servlet qui l'a appelé - modification de la librairie pushlet - Pushlet.java - EventSource.java - EventSourceManager.java -

    -

    -
    Specified by:
    setServletContext in interface nl.justobjects.pushlet.core.EventSource
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Serveur.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Serveur.html deleted file mode 100755 index 87a92ee036..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/Serveur.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - -Serveur - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class Serveur

    -
    -java.lang.Object
    -  extended by pow.webserver.Serveur
    -
    -
    -
    -
    public class Serveur
    extends java.lang.Object
    - - -

    -Class which receive a datagramm from ivy bus via UDP - transforms it into a Pushlet event and send it to the Pushlet server - in order that it will be sent to web clients -

    - -

    -

    -
    Author:
    -
    genin
    -
    -
    - -

    - - - - - - - - - - - -
    -Nested Class Summary
    -static classServeur.IvyEventSource - -
    -           
    -  - - - - - - - - - - -
    -Constructor Summary
    Serveur() - -
    -           
    -  - - - - - - - -
    -Method Summary
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -Serveur

    -
    -public Serveur()
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SessionIvy.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SessionIvy.html deleted file mode 100755 index ce2bbfbd98..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/SessionIvy.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - - -SessionIvy - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class SessionIvy

    -
    -java.lang.Object
    -  extended by pow.webserver.SessionIvy
    -
    -
    -
    -
    public class SessionIvy
    extends java.lang.Object
    - - -

    -store information about a specific ivy bus which is connected - to the server -

    - -

    -

    -
    Author:
    -
    genin
    -
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    SessionIvy(java.lang.String l, - int w, - AES c, - java.net.InetAddress IvyAddr) - -
    -          create a session which store information about an ivy bus client connected to the server - main information are its net address to send him orders from web users - and drones which are connected to this ivy bus
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - BusIvy_getBusIvy() - -
    -           
    - AESgetCipher() - -
    -           
    - java.net.InetAddressgetIvyInetAddress() - -
    -           
    - java.lang.StringgetLogin() - -
    -           
    - intgetWebId() - -
    -           
    - voidsetBusIvy(BusIvy_ b) - -
    -          store the information of the ivy bus into the ivy session
    - voidsetIvyInetAddress(java.net.InetAddress addr) - -
    -          set the ip adress of the ivy bus host
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -SessionIvy

    -
    -public SessionIvy(java.lang.String l,
    -                  int w,
    -                  AES c,
    -                  java.net.InetAddress IvyAddr)
    -           throws java.net.UnknownHostException
    -
    -
    create a session which store information about an ivy bus client connected to the server - main information are its net address to send him orders from web users - and drones which are connected to this ivy bus -

    -

    -
    Parameters:
    l - the login of the ivy user
    w - the webid of the ivy bus
    c - the cipher object
    IvyAddr - the IP address of the ivy host machine -
    Throws: -
    java.net.UnknownHostException
    -
    - - - - - - - - -
    -Method Detail
    - -

    -getIvyInetAddress

    -
    -public java.net.InetAddress getIvyInetAddress()
    -
    -
    - -
    Returns:
    the ip adress of the ivy bus
    -
    -
    -
    - -

    -setIvyInetAddress

    -
    -public void setIvyInetAddress(java.net.InetAddress addr)
    -
    -
    set the ip adress of the ivy bus host -

    -

    -
    -
    -
    -
    - -

    -getCipher

    -
    -public AES getCipher()
    -
    -
    - -
    Returns:
    the AES object which allows to encrypt and decrypt a message with
    -
    -
    -
    - -

    -getBusIvy

    -
    -public BusIvy_ getBusIvy()
    -
    -
    - -
    Returns:
    the object storing data about drones on the bus
    -
    -
    -
    - -

    -setBusIvy

    -
    -public void setBusIvy(BusIvy_ b)
    -
    -
    store the information of the ivy bus into the ivy session -

    -

    -
    Parameters:
    b - the ivy bus object
    -
    -
    -
    - -

    -getWebId

    -
    -public int getWebId()
    -
    -
    - -
    Returns:
    the ivy bus identifier
    -
    -
    -
    - -

    -getLogin

    -
    -public java.lang.String getLogin()
    -
    -
    - -
    Returns:
    the login of the user who is connected via this ivy bus
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/StrictSSLProtocolSocketFactory.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/StrictSSLProtocolSocketFactory.html deleted file mode 100755 index 2dad9ff236..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/StrictSSLProtocolSocketFactory.html +++ /dev/null @@ -1,537 +0,0 @@ - - - - - - -StrictSSLProtocolSocketFactory - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class StrictSSLProtocolSocketFactory

    -
    -java.lang.Object
    -  extended by pow.webserver.StrictSSLProtocolSocketFactory
    -
    -
    -
    All Implemented Interfaces:
    org.apache.commons.httpclient.protocol.ProtocolSocketFactory, org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory
    -
    -
    -
    -
    public class StrictSSLProtocolSocketFactory
    extends java.lang.Object
    implements org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory
    - - -

    -A SecureProtocolSocketFactory that uses JSSE to create - SSL sockets. It will also support host name verification to help preventing - man-in-the-middle attacks. Host name verification is turned on by - default but one will be able to turn it off, which might be a useful feature - during development. Host name verification will make sure the SSL sessions - server host name matches with the the host name returned in the - server certificates "Common Name" field of the "SubjectDN" entry. -

    - -

    -

    -
    Author:
    -
    Sebastian Hauer -

    - DISCLAIMER: HttpClient developers DO NOT actively support this component. - The component is provided as a reference material, which may be inappropriate - for use without additional customization. -

    -
    -
    - -

    - - - - - - - - - - - - - - -
    -Constructor Summary
    StrictSSLProtocolSocketFactory() - -
    -          Constructor for StrictSSLProtocolSocketFactory.
    StrictSSLProtocolSocketFactory(boolean verifyHostname) - -
    -          Constructor for StrictSSLProtocolSocketFactory.
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - java.net.SocketcreateSocket(java.net.Socket socket, - java.lang.String host, - int port, - boolean autoClose) - -
    -           
    - java.net.SocketcreateSocket(java.lang.String host, - int port) - -
    -           
    - java.net.SocketcreateSocket(java.lang.String host, - int port, - java.net.InetAddress clientHost, - int clientPort) - -
    -           
    - java.net.SocketcreateSocket(java.lang.String host, - int port, - java.net.InetAddress localAddress, - int localPort, - org.apache.commons.httpclient.params.HttpConnectionParams params) - -
    -          Attempts to get a new socket connection to the given host within the given time limit.
    - booleanequals(java.lang.Object obj) - -
    -           
    - booleangetHostnameVerification() - -
    -          Gets the status of the host name verification flag.
    - inthashCode() - -
    -           
    - voidsetHostnameVerification(boolean verifyHostname) - -
    -          Set the host name verification flag.
    - - - - - - - -
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -StrictSSLProtocolSocketFactory

    -
    -public StrictSSLProtocolSocketFactory(boolean verifyHostname)
    -
    -
    Constructor for StrictSSLProtocolSocketFactory. -

    -

    -
    Parameters:
    verifyHostname - The host name verification flag. If set to - true the SSL sessions server host name will be compared - to the host name returned in the server certificates "Common Name" - field of the "SubjectDN" entry. If these names do not match a - Exception is thrown to indicate this. Enabling host name verification - will help to prevent from man-in-the-middle attacks. If set to - false host name verification is turned off. - - Code sample: - -
    - Protocol stricthttps = new Protocol( - "https", new StrictSSLProtocolSocketFactory(true), 443); - - HttpClient client = new HttpClient(); - client.getHostConfiguration().setHost("localhost", 443, stricthttps); -
    -
    -
    - -

    -StrictSSLProtocolSocketFactory

    -
    -public StrictSSLProtocolSocketFactory()
    -
    -
    Constructor for StrictSSLProtocolSocketFactory. - Host name verification will be enabled by default. -

    -

    - - - - - - - - -
    -Method Detail
    - -

    -setHostnameVerification

    -
    -public void setHostnameVerification(boolean verifyHostname)
    -
    -
    Set the host name verification flag. -

    -

    -
    -
    -
    -
    Parameters:
    verifyHostname - The host name verification flag. If set to - true the SSL sessions server host name will be compared - to the host name returned in the server certificates "Common Name" - field of the "SubjectDN" entry. If these names do not match a - Exception is thrown to indicate this. Enabling host name verification - will help to prevent from man-in-the-middle attacks. If set to - false host name verification is turned off.
    -
    -
    -
    - -

    -getHostnameVerification

    -
    -public boolean getHostnameVerification()
    -
    -
    Gets the status of the host name verification flag. -

    -

    -
    -
    -
    - -
    Returns:
    Host name verification flag. Either true if host - name verification is turned on, or false if host name - verification is turned off.
    -
    -
    -
    - -

    -createSocket

    -
    -public java.net.Socket createSocket(java.lang.String host,
    -                                    int port,
    -                                    java.net.InetAddress clientHost,
    -                                    int clientPort)
    -                             throws java.io.IOException,
    -                                    java.net.UnknownHostException
    -
    -
    -
    Specified by:
    createSocket in interface org.apache.commons.httpclient.protocol.ProtocolSocketFactory
    -
    -
    - -
    Throws: -
    java.io.IOException -
    java.net.UnknownHostException
    See Also:
    ProtocolSocketFactory.createSocket(java.lang.String,int,java.net.InetAddress,int)
    -
    -
    -
    - -

    -createSocket

    -
    -public java.net.Socket createSocket(java.lang.String host,
    -                                    int port,
    -                                    java.net.InetAddress localAddress,
    -                                    int localPort,
    -                                    org.apache.commons.httpclient.params.HttpConnectionParams params)
    -                             throws java.io.IOException,
    -                                    java.net.UnknownHostException,
    -                                    org.apache.commons.httpclient.ConnectTimeoutException
    -
    -
    Attempts to get a new socket connection to the given host within the given time limit. -

    - This method employs several techniques to circumvent the limitations of older JREs that - do not support connect timeout. When running in JRE 1.4 or above reflection is used to - call Socket#connect(SocketAddress endpoint, int timeout) method. When executing in older - JREs a controller thread is executed. The controller thread attempts to create a new socket - within the given limit of time. If socket constructor does not return until the timeout - expires, the controller terminates and throws an ConnectTimeoutException -

    -

    -

    -
    Specified by:
    createSocket in interface org.apache.commons.httpclient.protocol.ProtocolSocketFactory
    -
    -
    -
    Parameters:
    host - the host name/IP
    port - the port on the host
    params - Http connection parameters -
    Returns:
    Socket a new socket -
    Throws: -
    java.io.IOException - if an I/O error occurs while creating the socket -
    java.net.UnknownHostException - if the IP address of the host cannot be - determined -
    org.apache.commons.httpclient.ConnectTimeoutException
    -
    -
    -
    - -

    -createSocket

    -
    -public java.net.Socket createSocket(java.lang.String host,
    -                                    int port)
    -                             throws java.io.IOException,
    -                                    java.net.UnknownHostException
    -
    -
    -
    Specified by:
    createSocket in interface org.apache.commons.httpclient.protocol.ProtocolSocketFactory
    -
    -
    - -
    Throws: -
    java.io.IOException -
    java.net.UnknownHostException
    See Also:
    ProtocolSocketFactory.createSocket(java.lang.String,int)
    -
    -
    -
    - -

    -createSocket

    -
    -public java.net.Socket createSocket(java.net.Socket socket,
    -                                    java.lang.String host,
    -                                    int port,
    -                                    boolean autoClose)
    -                             throws java.io.IOException,
    -                                    java.net.UnknownHostException
    -
    -
    -
    Specified by:
    createSocket in interface org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory
    -
    -
    - -
    Throws: -
    java.io.IOException -
    java.net.UnknownHostException
    See Also:
    SecureProtocolSocketFactory.createSocket(java.net.Socket,java.lang.String,int,boolean)
    -
    -
    -
    - -

    -equals

    -
    -public boolean equals(java.lang.Object obj)
    -
    -
    -
    Overrides:
    equals in class java.lang.Object
    -
    -
    -
    -
    -
    -
    - -

    -hashCode

    -
    -public int hashCode()
    -
    -
    -
    Overrides:
    hashCode in class java.lang.Object
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/User.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/User.html deleted file mode 100755 index db97accfe4..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/User.html +++ /dev/null @@ -1,543 +0,0 @@ - - - - - - -User - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class User

    -
    -java.lang.Object
    -  extended by pow.webserver.User
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable
    -
    -
    -
    -
    public class User
    extends java.lang.Object
    implements java.io.Serializable
    - - -

    -represents a ivy or a web user account - for the web user the account nest also the list of drones that the user can control - the list contains the ivy name of the drone (MJ5, TJ1...). - In Paparazzi a drone is not identified in a unique identifier, that means that if a user - can pilot a drone MJ5, he can pilot all 'MJ5' drone -

    - -

    -

    -
    Author:
    -
    genin
    -
    See Also:
    Serialized Form
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    User(java.lang.String log, - java.lang.String pwd, - Rights rght) - -
    -          create a user account
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - voidaddDrone(java.lang.String d) - -
    -          add a drone name to the list of drones that the user can control
    - booleancanControl(java.lang.String droneName) - -
    -          inform whether the user can pilot a drone or not
    - voidclearListDrone() - -
    -          reset the list of drone that the web user can control
    - java.lang.StringgetListDrone() - -
    -          the list of drone that the web user can control
    - java.lang.StringgetLogin() - -
    -           
    - java.lang.StringgetPassword() - -
    -           
    - RightsgetRights() - -
    -           
    - java.util.Iterator<java.lang.String>getSetItr() - -
    -           
    - booleanIsPwdTrue(java.lang.String pwd) - -
    -          check if the password given in argument corresponds to the password user
    - voidsetNom(java.lang.String log) - -
    -          specify the login of the user
    - voidsetPwd(java.lang.String pwd) - -
    -          specify the user password, it's not stored in clear (md5 hash)
    - voidsetRights(Rights r) - -
    -          specify the type of right granted to the user
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -User

    -
    -public User(java.lang.String log,
    -            java.lang.String pwd,
    -            Rights rght)
    -
    -
    create a user account -

    -

    -
    Parameters:
    log - the login of the user
    pwd - the password of the user
    rght - the type of the user
    -
    - - - - - - - - -
    -Method Detail
    - -

    -getSetItr

    -
    -public java.util.Iterator<java.lang.String> getSetItr()
    -
    -
    -
    -
    -
    - -
    Returns:
    an iterator containing the list of all drone that the user can control
    -
    -
    -
    - -

    -clearListDrone

    -
    -public void clearListDrone()
    -
    -
    reset the list of drone that the web user can control -

    -

    -
    -
    -
    -
    -
    -
    -
    - -

    -getListDrone

    -
    -public java.lang.String getListDrone()
    -
    -
    the list of drone that the web user can control -

    -

    -
    -
    -
    - -
    Returns:
    a formatted string containing all the drone that the user can control separated by commas
    -
    -
    -
    - -

    -addDrone

    -
    -public void addDrone(java.lang.String d)
    -
    -
    add a drone name to the list of drones that the user can control -

    -

    -
    -
    -
    -
    Parameters:
    d -
    -
    -
    -
    - -

    -canControl

    -
    -public boolean canControl(java.lang.String droneName)
    -
    -
    inform whether the user can pilot a drone or not -

    -

    -
    -
    -
    -
    Parameters:
    droneName - the name of the drone -
    Returns:
    true if the user can pilot the drones with this name
    -
    -
    -
    - -

    -getRights

    -
    -public Rights getRights()
    -
    -
    -
    -
    -
    - -
    Returns:
    the type of right granted to the user
    -
    -
    -
    - -

    -setRights

    -
    -public void setRights(Rights r)
    -
    -
    specify the type of right granted to the user -

    -

    -
    -
    -
    -
    Parameters:
    r - the right granted to the user
    -
    -
    -
    - -

    -getLogin

    -
    -public java.lang.String getLogin()
    -
    -
    -
    -
    -
    - -
    Returns:
    the login of the user
    -
    -
    -
    - -

    -setNom

    -
    -public void setNom(java.lang.String log)
    -
    -
    specify the login of the user -

    -

    -
    -
    -
    -
    Parameters:
    log - the login of the user
    -
    -
    -
    - -

    -getPassword

    -
    -public java.lang.String getPassword()
    -
    -
    -
    -
    -
    - -
    Returns:
    the password of the user encoded with md5 algorithm
    -
    -
    -
    - -

    -setPwd

    -
    -public void setPwd(java.lang.String pwd)
    -
    -
    specify the user password, it's not stored in clear (md5 hash) -

    -

    -
    -
    -
    -
    Parameters:
    pwd - the user password in clear
    -
    -
    -
    - -

    -IsPwdTrue

    -
    -public boolean IsPwdTrue(java.lang.String pwd)
    -
    -
    check if the password given in argument corresponds to the password user -

    -

    -
    -
    -
    -
    Parameters:
    pwd - the password to check -
    Returns:
    true if the password is correct
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/UserTab.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/UserTab.html deleted file mode 100755 index 8f2ce66f24..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/UserTab.html +++ /dev/null @@ -1,472 +0,0 @@ - - - - - - -UserTab - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - -

    - -pow.webserver -
    -Class UserTab

    -
    -java.lang.Object
    -  extended by pow.webserver.UserTab
    -
    -
    -
    All Implemented Interfaces:
    java.io.Serializable
    -
    -
    -
    -
    public class UserTab
    extends java.lang.Object
    implements java.io.Serializable
    - - -

    -User objects are stored in a UserTab object which can be serialized in a file on the server disk -

    - -

    -

    -
    Author:
    -
    genin
    -
    See Also:
    User, -Serialized Form
    -
    - -

    - - - - - - - - - - - -
    -Constructor Summary
    UserTab() - -
    -          create a empty list of users
    -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Method Summary
    - booleancheckUser(java.lang.String log, - java.lang.String pwd) - -
    -          Check if the password of the user having the specified login is correct
    - java.util.Iterator<java.lang.String>getItrUsr(java.lang.String log) - -
    -          return the list of all drone which may be controlled by the user
    - java.util.Iterator<java.lang.String>getLoginIterator() - -
    -           
    - voidinsert(User u) - -
    -          insert a user in the list
    - booleanisInside(java.lang.String log) - -
    -          check if an user with this logging exists yet
    - voidremove(java.lang.String log) - -
    -          remove the user with the spefied login
    - Userseek(java.lang.String log) - -
    -          return the user corresponding to the given login
    - voidserialize(java.lang.String nomfichier) - -
    -          Save the object in a file
    -static UserTabunserialize(java.lang.String nomfichier) - -
    -          load the object from a file
    - - - - - - - -
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -  -

    - - - - - - - - -
    -Constructor Detail
    - -

    -UserTab

    -
    -public UserTab()
    -
    -
    create a empty list of users -

    -

    - - - - - - - - -
    -Method Detail
    - -

    -insert

    -
    -public void insert(User u)
    -            throws AlreadyRegisteredUserException
    -
    -
    insert a user in the list -

    -

    -
    -
    -
    -
    Parameters:
    u - a user object to insert -
    Throws: -
    AlreadyRegisteredUserException
    -
    -
    -
    - -

    -remove

    -
    -public void remove(java.lang.String log)
    -
    -
    remove the user with the spefied login -

    -

    -
    -
    -
    -
    Parameters:
    log - the login of the user to remove
    -
    -
    -
    - -

    -seek

    -
    -public User seek(java.lang.String log)
    -
    -
    return the user corresponding to the given login -

    -

    -
    -
    -
    -
    Parameters:
    log - the login of the user to seek -
    Returns:
    the user object corresponding to the login or null if it is not present
    -
    -
    -
    - -

    -isInside

    -
    -public boolean isInside(java.lang.String log)
    -
    -
    check if an user with this logging exists yet -

    -

    -
    -
    -
    -
    Parameters:
    log - the login of the user to check -
    Returns:
    true if the user having the login exists
    -
    -
    -
    - -

    -checkUser

    -
    -public boolean checkUser(java.lang.String log,
    -                         java.lang.String pwd)
    -
    -
    Check if the password of the user having the specified login is correct -

    -

    -
    -
    -
    -
    Parameters:
    log - the login of the user
    pwd - the password -
    Returns:
    true if there is a user with this login and this password
    -
    -
    -
    - -

    -getItrUsr

    -
    -public java.util.Iterator<java.lang.String> getItrUsr(java.lang.String log)
    -
    -
    return the list of all drone which may be controlled by the user -

    -

    -
    -
    -
    -
    Parameters:
    log - the login of the user -
    Returns:
    an iterator containing the list of drone or null is the user does not exist
    -
    -
    -
    - -

    -getLoginIterator

    -
    -public java.util.Iterator<java.lang.String> getLoginIterator()
    -
    -
    -
    -
    -
    - -
    Returns:
    an iterator on all login in the list
    -
    -
    -
    - -

    -serialize

    -
    -public void serialize(java.lang.String nomfichier)
    -
    -
    Save the object in a file -

    -

    -
    -
    -
    -
    Parameters:
    nomfichier - the file where the user's accounts will be stored
    -
    -
    -
    - -

    -unserialize

    -
    -public static UserTab unserialize(java.lang.String nomfichier)
    -
    -
    load the object from a file -

    -

    -
    -
    -
    -
    Parameters:
    nomfichier - the file where the user's accounts are stored -
    Returns:
    an object containing the users list or null if the pathname is not correct
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/AjaxRqst.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/AjaxRqst.html deleted file mode 100755 index 35be99bf24..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/AjaxRqst.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.AjaxRqst - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.AjaxRqst

    -
    -No usage of pow.webserver.AjaxRqst -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/AlreadyRegisteredUserException.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/AlreadyRegisteredUserException.html deleted file mode 100755 index dc697a84bf..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/AlreadyRegisteredUserException.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class pow.webserver.AlreadyRegisteredUserException - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.AlreadyRegisteredUserException

    -
    - - - - - - - - - -
    -Packages that use AlreadyRegisteredUserException
    pow.webserver  
    -  -

    - - - - - -
    -Uses of AlreadyRegisteredUserException in pow.webserver
    -  -

    - - - - - - - - - -
    Methods in pow.webserver that throw AlreadyRegisteredUserException
    - voidUserTab.insert(User u) - -
    -          insert a user in the list
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Conf.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Conf.html deleted file mode 100755 index 4d5a6ea5eb..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Conf.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.Conf - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.Conf

    -
    -No usage of pow.webserver.Conf -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/DbMode.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/DbMode.html deleted file mode 100755 index bfb5b3ac95..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/DbMode.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - -Uses of Class pow.webserver.DbMode - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.DbMode

    -
    - - - - - - - - - -
    -Packages that use DbMode
    pow.webserver  
    -  -

    - - - - - -
    -Uses of DbMode in pow.webserver
    -  -

    - - - - - - - - - - - - - - - - - -
    Methods in pow.webserver that return DbMode
    - DbModeConf.getDbMode() - -
    -           
    -static DbModeDbMode.valueOf(java.lang.String name) - -
    -          Returns the enum constant of this type with the specified name.
    -static DbMode[]DbMode.values() - -
    -          Returns an array containing the constants of this enum type, in -the order they are declared.
    -  -

    - - - - - - - - -
    Constructors in pow.webserver with parameters of type DbMode
    SGBDfeeder(java.lang.String dbname, - java.lang.String dbuser, - java.lang.String dbpwd, - DbMode mode) - -
    -          create a thread which fill the database with the message it extracts from the fifo
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/DbOrder.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/DbOrder.html deleted file mode 100755 index 90566e8ae3..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/DbOrder.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - -Uses of Class pow.webserver.DbOrder - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.DbOrder

    -
    - - - - - - - - - -
    -Packages that use DbOrder
    pow.webserver  
    -  -

    - - - - - -
    -Uses of DbOrder in pow.webserver
    -  -

    - - - - - - - - - - - - - - - - - -
    Methods in pow.webserver that return DbOrder
    - DbOrderIvyMsg.getOrder() - -
    -           
    -static DbOrderDbOrder.valueOf(java.lang.String name) - -
    -          Returns the enum constant of this type with the specified name.
    -static DbOrder[]DbOrder.values() - -
    -          Returns an array containing the constants of this enum type, in -the order they are declared.
    -  -

    - - - - - - - - - -
    Methods in pow.webserver with parameters of type DbOrder
    - voidIvyMsg.setOrder(DbOrder o) - -
    -          specify how to store the message in database
    -  -

    - - - - - - - - -
    Constructors in pow.webserver with parameters of type DbOrder
    IvyMsg(int wId, - long num, - java.lang.String date, - java.lang.String msg, - DbOrder order) - -
    -           
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Greeting.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Greeting.html deleted file mode 100755 index 05f566b054..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Greeting.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.Greeting - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.Greeting

    -
    -No usage of pow.webserver.Greeting -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/HeartBeat.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/HeartBeat.html deleted file mode 100755 index 2e2e360276..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/HeartBeat.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.HeartBeat - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.HeartBeat

    -
    -No usage of pow.webserver.HeartBeat -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Ivy2TomcatHttpServer.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Ivy2TomcatHttpServer.html deleted file mode 100755 index e80454938e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Ivy2TomcatHttpServer.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.Ivy2TomcatHttpServer - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.Ivy2TomcatHttpServer

    -
    -No usage of pow.webserver.Ivy2TomcatHttpServer -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/IvyMsg.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/IvyMsg.html deleted file mode 100755 index dac7ad7c6a..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/IvyMsg.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class pow.webserver.IvyMsg - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.IvyMsg

    -
    - - - - - - - - - -
    -Packages that use IvyMsg
    pow.webserver  
    -  -

    - - - - - -
    -Uses of IvyMsg in pow.webserver
    -  -

    - - - - - - - - - -
    Methods in pow.webserver that return types with arguments of type IvyMsg
    - java.util.concurrent.LinkedBlockingQueue<IvyMsg>SGBDfeeder.getQueueFIFO() - -
    -           
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Log.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Log.html deleted file mode 100755 index 75aaa030fe..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Log.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.Log - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.Log

    -
    -No usage of pow.webserver.Log -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Md5.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Md5.html deleted file mode 100755 index a14e32624c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Md5.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.Md5 - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.Md5

    -
    -No usage of pow.webserver.Md5 -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Rights.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Rights.html deleted file mode 100755 index 18fe48e970..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Rights.html +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - -Uses of Class pow.webserver.Rights - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.Rights

    -
    - - - - - - - - - -
    -Packages that use Rights
    pow.webserver  
    -  -

    - - - - - -
    -Uses of Rights in pow.webserver
    -  -

    - - - - - - - - - - - - - - - - - -
    Methods in pow.webserver that return Rights
    - RightsUser.getRights() - -
    -           
    -static RightsRights.valueOf(java.lang.String name) - -
    -          Returns the enum constant of this type with the specified name.
    -static Rights[]Rights.values() - -
    -          Returns an array containing the constants of this enum type, in -the order they are declared.
    -  -

    - - - - - - - - - -
    Methods in pow.webserver with parameters of type Rights
    - voidUser.setRights(Rights r) - -
    -          specify the type of right granted to the user
    -  -

    - - - - - - - - -
    Constructors in pow.webserver with parameters of type Rights
    User(java.lang.String log, - java.lang.String pwd, - Rights rght) - -
    -          create a user account
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SGBDfeeder.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SGBDfeeder.html deleted file mode 100755 index 2fb130cc19..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SGBDfeeder.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.SGBDfeeder - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.SGBDfeeder

    -
    -No usage of pow.webserver.SGBDfeeder -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities.FakeHostnameVerifier.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities.FakeHostnameVerifier.html deleted file mode 100755 index c742aebeb1..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities.FakeHostnameVerifier.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.SSLUtilities.FakeHostnameVerifier - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.SSLUtilities.FakeHostnameVerifier

    -
    -No usage of pow.webserver.SSLUtilities.FakeHostnameVerifier -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities.FakeX509TrustManager.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities.FakeX509TrustManager.html deleted file mode 100755 index f5de159940..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities.FakeX509TrustManager.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.SSLUtilities.FakeX509TrustManager - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.SSLUtilities.FakeX509TrustManager

    -
    -No usage of pow.webserver.SSLUtilities.FakeX509TrustManager -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities._FakeHostnameVerifier.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities._FakeHostnameVerifier.html deleted file mode 100755 index 3295523544..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities._FakeHostnameVerifier.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.SSLUtilities._FakeHostnameVerifier - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.SSLUtilities._FakeHostnameVerifier

    -
    -No usage of pow.webserver.SSLUtilities._FakeHostnameVerifier -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities._FakeX509TrustManager.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities._FakeX509TrustManager.html deleted file mode 100755 index bc7ea4646b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities._FakeX509TrustManager.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.SSLUtilities._FakeX509TrustManager - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.SSLUtilities._FakeX509TrustManager

    -
    -No usage of pow.webserver.SSLUtilities._FakeX509TrustManager -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities.html deleted file mode 100755 index 15b204fe4d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SSLUtilities.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.SSLUtilities - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.SSLUtilities

    -
    -No usage of pow.webserver.SSLUtilities -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Serveur.IvyEventSource.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Serveur.IvyEventSource.html deleted file mode 100755 index 171ee8f695..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Serveur.IvyEventSource.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.Serveur.IvyEventSource - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.Serveur.IvyEventSource

    -
    -No usage of pow.webserver.Serveur.IvyEventSource -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Serveur.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Serveur.html deleted file mode 100755 index 9bfae12605..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/Serveur.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.Serveur - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.Serveur

    -
    -No usage of pow.webserver.Serveur -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SessionIvy.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SessionIvy.html deleted file mode 100755 index a20be41ac4..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/SessionIvy.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.SessionIvy - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.SessionIvy

    -
    -No usage of pow.webserver.SessionIvy -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/StrictSSLProtocolSocketFactory.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/StrictSSLProtocolSocketFactory.html deleted file mode 100755 index 83bfbc3749..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/StrictSSLProtocolSocketFactory.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class pow.webserver.StrictSSLProtocolSocketFactory - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.StrictSSLProtocolSocketFactory

    -
    -No usage of pow.webserver.StrictSSLProtocolSocketFactory -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/User.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/User.html deleted file mode 100755 index 158d303aac..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/User.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - -Uses of Class pow.webserver.User - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.User

    -
    - - - - - - - - - -
    -Packages that use User
    pow.webserver  
    -  -

    - - - - - -
    -Uses of User in pow.webserver
    -  -

    - - - - - - - - - -
    Methods in pow.webserver that return User
    - UserUserTab.seek(java.lang.String log) - -
    -          return the user corresponding to the given login
    -  -

    - - - - - - - - - -
    Methods in pow.webserver with parameters of type User
    - voidUserTab.insert(User u) - -
    -          insert a user in the list
    -  -

    - - - - - - - - -
    Constructors in pow.webserver with parameters of type User
    AlreadyRegisteredUserException(User u) - -
    -           
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/UserTab.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/UserTab.html deleted file mode 100755 index 09ef6d77e7..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/class-use/UserTab.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class pow.webserver.UserTab - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Class
    pow.webserver.UserTab

    -
    - - - - - - - - - -
    -Packages that use UserTab
    pow.webserver  
    -  -

    - - - - - -
    -Uses of UserTab in pow.webserver
    -  -

    - - - - - - - - - -
    Methods in pow.webserver that return UserTab
    -static UserTabUserTab.unserialize(java.lang.String nomfichier) - -
    -          load the object from a file
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/package-frame.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/package-frame.html deleted file mode 100755 index 59e87a47b4..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/package-frame.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - -pow.webserver - - - - - - - - - - - -pow.webserver - - - - -
    -Classes  - -
    -AjaxRqst -
    -Conf -
    -Greeting -
    -HeartBeat -
    -Ivy2TomcatHttpServer -
    -IvyMsg -
    -Log -
    -Md5 -
    -Serveur -
    -Serveur.IvyEventSource -
    -SessionIvy -
    -SGBDfeeder -
    -SSLUtilities -
    -SSLUtilities._FakeHostnameVerifier -
    -SSLUtilities._FakeX509TrustManager -
    -SSLUtilities.FakeHostnameVerifier -
    -SSLUtilities.FakeX509TrustManager -
    -StrictSSLProtocolSocketFactory -
    -User -
    -UserTab
    - - - - - - -
    -Enums  - -
    -DbMode -
    -DbOrder -
    -Rights
    - - - - - - -
    -Exceptions  - -
    -AlreadyRegisteredUserException
    - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/package-summary.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/package-summary.html deleted file mode 100755 index 5e2b700de1..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/package-summary.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - -pow.webserver - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -

    -Package pow.webserver -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class Summary
    AjaxRqstServlet implementation class ajaxRqst - handles the different request from a web client which wants to give orders to a drone - and it handles administrator queries to manage users' profiles
    Confstore useful data about the server configuration - and database connection by - reading a specific file place in the 'conf' folder of - the web application
    GreetingServlet implementation class Greeting - Handles the connection request from a new web client - check the login's information and rights
    HeartBeat 
    Ivy2TomcatHttpServerHandles the connection request from a new ivy bus - provide a unique id for the ivy bus - provide a unique id for each new drone on a ivy bus - handles the uploading of the configuration files for each new drone on a ivy bus
    IvyMsgrepresents information which are sended by the source event to the database on the queue fifo
    LogHandles the writing of a log in a file
    Md5tool class to implemente MD5 encoding - ( found on the web )
    ServeurClass which receive a datagramm from ivy bus via UDP - transforms it into a Pushlet event and send it to the Pushlet server - in order that it will be sent to web clients
    Serveur.IvyEventSource 
    SessionIvystore information about a specific ivy bus which is connected - to the server
    SGBDfeederthread which waits for ivy messages sent by event source (serveur.java) - and stores them into a mysql database - the ivy messages are extracted from a blocking queue (fifo) - parameter of the database are extracted from conf file
    SSLUtilitiesThis class provide various static methods that relax X509 certificate and - hostname verification while using the SSL over the HTTP protocol.
    SSLUtilities._FakeHostnameVerifierDeprecated. see SSLUtilities.FakeHostnameVerifier.
    SSLUtilities._FakeX509TrustManagerDeprecated. see SSLUtilities.FakeX509TrustManager.
    SSLUtilities.FakeHostnameVerifierThis class implements a fake hostname verificator, trusting any host - name.
    SSLUtilities.FakeX509TrustManagerThis class allow any X509 certificates to be used to authenticate the - remote side of a secure socket, including self-signed certificates.
    StrictSSLProtocolSocketFactoryA SecureProtocolSocketFactory that uses JSSE to create - SSL sockets.
    Userrepresents a ivy or a web user account - for the web user the account nest also the list of drones that the user can control - the list contains the ivy name of the drone (MJ5, TJ1...).
    UserTabUser objects are stored in a UserTab object which can be serialized in a file on the server disk
    -  - -

    - - - - - - - - - - - - - - - - - -
    -Enum Summary
    DbModespecify how the database works
    DbOrderrepresents 4 kind of message stored in database - CONNECT first connection of an ivy bus --> inform db - DECONNECT ivy bus deconnected --> inform db - ADD add message to db
    Rightsdescribe the different rights a web user can have
    -  - -

    - - - - - - - - - -
    -Exception Summary
    AlreadyRegisteredUserExceptionexception to inform that a user cannot be created in the users' file - because it exists yet
    -  - -

    -

    -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/package-tree.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/package-tree.html deleted file mode 100755 index c848877f62..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/package-tree.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - -pow.webserver Class Hierarchy - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Hierarchy For Package pow.webserver -

    -
    -
    -
    Package Hierarchies:
    All Packages
    -
    -

    -Class Hierarchy -

    - -

    -Enum Hierarchy -

    -
      -
    • java.lang.Object
        -
      • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) - -
      -
    -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/package-use.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/package-use.html deleted file mode 100755 index 762260c019..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/pow/webserver/package-use.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - -Uses of Package pow.webserver - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Uses of Package
    pow.webserver

    -
    - - - - - - - - - -
    -Packages that use pow.webserver
    pow.webserver  
    -  -

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Classes in pow.webserver used by pow.webserver
    AlreadyRegisteredUserException - -
    -          exception to inform that a user cannot be created in the users' file - because it exists yet
    DbMode - -
    -          specify how the database works
    DbOrder - -
    -          represents 4 kind of message stored in database - CONNECT first connection of an ivy bus --> inform db - DECONNECT ivy bus deconnected --> inform db - ADD add message to db
    IvyMsg - -
    -          represents information which are sended by the source event to the database on the queue fifo
    Rights - -
    -          describe the different rights a web user can have
    User - -
    -          represents a ivy or a web user account - for the web user the account nest also the list of drones that the user can control - the list contains the ivy name of the drone (MJ5, TJ1...).
    UserTab - -
    -          User objects are stored in a UserTab object which can be serialized in a file on the server disk
    -  -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/resources/inherit.gif b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/resources/inherit.gif deleted file mode 100755 index c814867a13..0000000000 Binary files a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/resources/inherit.gif and /dev/null differ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/serialized-form.html b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/serialized-form.html deleted file mode 100755 index 9a0ee8f735..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/serialized-form.html +++ /dev/null @@ -1,442 +0,0 @@ - - - - - - -Serialized Form - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    - -
    - - - -
    -
    -

    -Serialized Form

    -
    -
    - - - - - -
    -Package pow.ivyclient
    - -

    - - - - - -
    -Class pow.ivyclient.IvyConnectionExeption extends java.lang.Exception implements Serializable
    - -

    -serialVersionUID: 1805159521752564076L - -

    - - - - - -
    -Serialized Fields
    - -

    -reason

    -
    -java.lang.String reason
    -
    -
    -
    -
    -
    - - - - - -
    -Package pow.webserver
    - -

    - - - - - -
    -Class pow.webserver.AjaxRqst extends javax.servlet.http.HttpServlet implements Serializable
    - -

    -serialVersionUID: 1L - -

    - - - - - -
    -Serialized Fields
    - -

    -default_folder

    -
    -java.lang.String default_folder
    -
    -
    -
    -
    -
    -

    -srvCtxt

    -
    -javax.servlet.ServletContext srvCtxt
    -
    -
    -
    -
    -
    -

    -myConf

    -
    -Conf myConf
    -
    -
    -
    -
    - -

    - - - - - -
    -Class pow.webserver.AlreadyRegisteredUserException extends java.lang.Exception implements Serializable
    - -

    -serialVersionUID: 1L - -

    - - - - - -
    -Serialized Fields
    - -

    -usr

    -
    -User usr
    -
    -
    -
    -
    - -

    - - - - - -
    -Class pow.webserver.Greeting extends javax.servlet.http.HttpServlet implements Serializable
    - -

    -serialVersionUID: 1L - -

    - - - - - -
    -Serialized Fields
    - -

    -default_folder

    -
    -java.lang.String default_folder
    -
    -
    -
    -
    - -

    - - - - - -
    -Class pow.webserver.Ivy2TomcatHttpServer extends javax.servlet.http.HttpServlet implements Serializable
    - -

    -serialVersionUID: 1L - -

    - - - - - -
    -Serialized Fields
    - -

    -srvCtxt

    -
    -javax.servlet.ServletContext srvCtxt
    -
    -
    -
    -
    -
    -

    -default_folder

    -
    -java.lang.String default_folder
    -
    -
    -
    -
    -
    -

    -tableIvySession

    -
    -java.util.HashMap<K,V> tableIvySession
    -
    -
    -
    -
    -
    -

    -myConf

    -
    -Conf myConf
    -
    -
    -
    -
    - -

    - - - - - -
    -Class pow.webserver.User extends java.lang.Object implements Serializable
    - -

    -serialVersionUID: 1L - -

    - - - - - -
    -Serialized Fields
    - -

    -login

    -
    -java.lang.String login
    -
    -
    -
    -
    -
    -

    -password

    -
    -java.lang.String password
    -
    -
    -
    -
    -
    -

    -dronesNamePermitted

    -
    -java.util.HashSet<E> dronesNamePermitted
    -
    -
    -
    -
    -
    -

    -right

    -
    -Rights right
    -
    -
    -
    -
    - -

    - - - - - -
    -Class pow.webserver.UserTab extends java.lang.Object implements Serializable
    - -

    -serialVersionUID: 1L - -

    - - - - - -
    -Serialized Fields
    - -

    -tabUser

    -
    -java.util.HashMap<K,V> tabUser
    -
    -
    -
    -
    - -

    -


    - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/stylesheet.css b/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/stylesheet.css deleted file mode 100755 index 6ea9e51616..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/doc/stylesheet.css +++ /dev/null @@ -1,29 +0,0 @@ -/* Javadoc style sheet */ - -/* Define colors, fonts and other style attributes here to override the defaults */ - -/* Page background color */ -body { background-color: #FFFFFF; color:#000000 } - -/* Headings */ -h1 { font-size: 145% } - -/* Table colors */ -.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ -.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ -.TableRowColor { background: #FFFFFF; color:#000000 } /* White */ - -/* Font used in left-hand frame lists */ -.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } -.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } -.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } - -/* Navigation bar fonts and colors */ -.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ -.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ -.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} -.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} - -.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} -.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/Version.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/Version.java deleted file mode 100755 index a2563f7192..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/Version.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet; - -/** - * Version info class. - * - *

    Purpose

    - * Extract version info from jar manifest file. - * - * @author Just van den Broecke - * @version $Id: Version.java,v 1.4 2006/05/06 00:10:11 justb Exp $ - */ - -public class Version { - /** Version info extracted from the .jar manifest file (see build.xml and build.properties). */ - public static final String SOFTWARE_VERSION = Version.class.getPackage().getSpecificationVersion(); - public static final String BUILD_DATE = Version.class.getPackage().getImplementationVersion(); -} - -/* - * $Log: Version.java,v $ - * Revision 1.4 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.3 2004/02/08 16:07:55 justb - * *** empty log message *** - * - * Revision 1.2 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.1 2003/08/11 21:29:48 justb - * first checkin - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/client/PushletClient.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/client/PushletClient.java deleted file mode 100755 index e1c77ebcfa..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/client/PushletClient.java +++ /dev/null @@ -1,699 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.client; - -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.EventParser; -import nl.justobjects.pushlet.core.Protocol; -import nl.justobjects.pushlet.util.PushletException; - -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.OutputStream; -import java.net.*; -import java.util.Map; - -/** - * Client API for Java HTTP client applets or apps. - *

    - * Use this class within Java client applications or applets. - * Implement a PushletClientListener to receive callbacks for - * data-related Event objects pushed by the server. - *

    - * This class may also be used as a base class and be extended - * for custom clients, hence the presence of many proteced methods. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: PushletClient.java,v 1.19 2009/06/04 12:46:35 justb Exp $ - * @see PushletClientListener - * @see nl.justobjects.pushlet.test.PushletApplet - * @see nl.justobjects.pushlet.test.PushletPingApplication - */ -public class PushletClient implements Protocol { - /** - * Pushlet URL. - */ - private String pushletURL; - - /** - * Debug flag for verbose output. - */ - private boolean debug; - - /** - * Id gotten on join ack - */ - private String id; - - /** - * Internal listener for data events pushed by server. - */ - protected DataEventListener dataEventListener; - - /** - * Constructor with full pushlet URL. - */ - public PushletClient(String aPushletURL) { - pushletURL = aPushletURL; - } - - /** - * Constructor with host and port using default URI. - */ - public PushletClient(String aHost, int aPort) { - this("http://" + aHost + ":" + aPort + DEFAULT_SERVLET_URI); - } - - /** - * Set proxy options and optional proxy authentication. - *

    - * Contributed by Dele Olajide - * See http://groups.yahoo.com/group/pushlet/message/634 - *

    - * Usage: - * PushletClient pushletClient = new PushletClient("http:://www.domain.com/pushlet"); - * pushletClient.setProxyOptions("proxy.bla.com", "8080", ....); - *

    - * use pushletClient further as normal - */ - public void setProxyOptions(String aProxyHost, - String aProxyPort, String theNonProxyHosts, - String aUserName, String aPassword, String anNTLMDomain) { - - // Enable proxying - System.setProperty("http.proxySet", "true"); - System.setProperty("http.proxyHost", aProxyHost); - System.setProperty("http.proxyPort", aProxyPort); - - // Set optional non-proxy hosts - if (theNonProxyHosts != null) { - System.setProperty("http.nonProxyHosts", theNonProxyHosts); - } - - // If user name specified configure proxy authentication - if (aUserName != null) { - System.setProperty("http.proxyUser", aUserName); - System.setProperty("http.proxyPassword", aPassword); - - // See inner class below - Authenticator.setDefault(new HTTPAuthenticateProxy(aUserName, aPassword)); - - // Optional NT domain - if (anNTLMDomain != null) { - System.setProperty("http.auth.ntlm.domain", anNTLMDomain); - } - } - } - - /** - * Join server, starts session. - */ - public void join() throws PushletException { - Event event = new Event(E_JOIN); - event.setField(P_FORMAT, FORMAT_XML); - Event response = doControl(event); - throwOnNack(response); - - // Join Ack received - id = response.getField(P_ID); - } - - /** - * Leave server, stops session. - */ - public void leave() throws PushletException { - stopListen(); - throwOnInvalidSession(); - Event event = new Event(E_LEAVE); - event.setField(P_ID, id); - Event response = doControl(event); - - throwOnNack(response); - id = null; - } - - /** - * Open data channel. - */ - public void listen(PushletClientListener aListener) throws PushletException { - listen(aListener, MODE_STREAM); - } - - /** - * Open data channel in stream or push mode. - */ - public void listen(PushletClientListener aListener, String aMode) throws PushletException { - listen(aListener, aMode, null); - } - - /** - * Open data channel in stream or push mode with a subject. - */ - public void listen(PushletClientListener aListener, String aMode, String aSubject) throws PushletException { - throwOnInvalidSession(); - stopListen(); - - String listenURL = pushletURL - + "?" + P_EVENT + "=" + E_LISTEN - + "&" + P_ID + "=" + id - + "&" + P_MODE + "=" + aMode; - if (aSubject != null) { - listenURL = listenURL + "&" + P_SUBJECT + "=" + aSubject; - } - - // Start listener thread (sync call). - startDataEventListener(aListener, listenURL); - } - - /** - * Immediate listener: joins/subscribes and listens in one action. - */ - public void joinListen(PushletClientListener aListener, String aMode, String aSubject) throws PushletException { - stopListen(); - - String listenURL = pushletURL - + "?" + P_EVENT + "=" + E_JOIN_LISTEN - + "&" + P_FORMAT + "=" + FORMAT_XML - + "&" + P_MODE + "=" + aMode - + "&" + P_SUBJECT + "=" + aSubject; - - // Start listener thread (sync call). - startDataEventListener(aListener, listenURL); - } - - /** - * Publish an event through server. - */ - public void publish(String aSubject, Map theAttributes) throws PushletException { - throwOnInvalidSession(); - Event event = new Event(E_PUBLISH, theAttributes); - event.setField(P_SUBJECT, aSubject); - event.setField(P_ID, id); - Event response = doControl(event); - throwOnNack(response); - } - - /** - * Subscribes, returning subscription id. - */ - public String subscribe(String aSubject, String aLabel) throws PushletException { - throwOnInvalidSession(); - Event event = new Event(E_SUBSCRIBE); - event.setField(P_ID, id); - event.setField(P_SUBJECT, aSubject); - - // Optional label, is returned in data events - if (aLabel != null) { - event.setField(P_SUBSCRIPTION_LABEL, aLabel); - } - - // Send request - Event response = doControl(event); - throwOnNack(response); - - return response.getField(P_SUBSCRIPTION_ID); - } - - /** - * Subscribes, returning subscription id. - */ - public String subscribe(String aSubject) throws PushletException { - return subscribe(aSubject, null); - } - - /** - * Unsubscribes with subscription id. - */ - public void unsubscribe(String aSubscriptionId) throws PushletException { - throwOnInvalidSession(); - Event event = new Event(E_UNSUBSCRIBE); - event.setField(P_ID, id); - - // Optional subscription id - if (aSubscriptionId != null) { - event.setField(P_SUBSCRIPTION_ID, aSubscriptionId); - } - - Event response = doControl(event); - throwOnNack(response); - } - - /** - * Unsubscribes from all subjects. - */ - public void unsubscribe() throws PushletException { - unsubscribe(null); - } - - /** - * Stop the listener. - */ - public void stopListen() throws PushletException { - if (dataEventListener != null) { - unsubscribe(); - dataEventListener.stop(); - dataEventListener = null; - } - } - - public void setDebug(boolean b) { - debug = b; - } - - /** - * Starts default DataEventListener and waits for its thread to start. - */ - protected void startDataEventListener(PushletClientListener aListener, String aListenURL) { - // Suggestion by Jeff Nowakowski 29.oct.2006 - dataEventListener = new DataEventListener(aListener, aListenURL); - - synchronized (dataEventListener) { - dataEventListener.start(); - try { - // Wait for data event listener (thread) to start - dataEventListener.wait(); - } catch (InterruptedException e) { - } - } - } - - protected void throwOnNack(Event anEvent) throws PushletException { - if (anEvent.getEventType().equals(E_NACK)) { - throw new PushletException("Negative response: reason=" + anEvent.getField(P_REASON)); - } - } - - protected void throwOnInvalidSession() throws PushletException { - if (id == null) { - throw new PushletException("Invalid pushlet session"); - } - } - - protected Reader openURL(String aURL) throws PushletException { - // Open URL connection with server - try { - p("Connecting to " + aURL); - URL url = new URL(aURL); - URLConnection urlConnection = url.openConnection(); - - // Disable any kind of caching. - urlConnection.setUseCaches(false); - urlConnection.setDefaultUseCaches(false); - - // TODO: later version may use POST - // Enable HTTP POST - // urlConnection.setDoOutput(true); - - // Do the POST with Event in XML in body - // OutputStream os = urlConnection.getOutputStream(); - // os.write(anEvent.toXML().getBytes()); - // os.flush(); - // os.close(); - - // Get the stream from the server. - // reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); - // Note: somehow the client does not work with some JVMs when using - // BufferedInputStream... So do unbuffered input. - // p("Opening urlConnection inputstream"); - return new InputStreamReader(urlConnection.getInputStream()); - - } catch (Throwable t) { - warn("openURL() could not open " + aURL, t); - throw new PushletException(" could not open " + aURL, t); - } - } - - - /** - * Send control events to server and return response. - */ - protected Event doControl(Event aControlEvent) throws PushletException { - String controlURL = pushletURL + "?" + aControlEvent.toQueryString(); - - p("doControl to " + controlURL); - - // Open URL connection with server - Reader reader = openURL(controlURL); - - // Get Pushlet event from stream - Event event = null; - try { - p("Getting event..."); - // Get next event from server - event = EventParser.parse(reader); - p("Event received " + event); - return event; - } catch (Throwable t) { - // Stop and report error. - warn("doControl() exception", t); - throw new PushletException(" error parsing response from" + controlURL, t); - } - } - - /** - * Util: print. - */ - protected void p(String s) { - if (debug) { - System.out.println("[PushletClient] " + s); - } - } - - /** - * Util: warn. - */ - protected void warn(String s) { - warn(s, null); - } - - /** - * Util: warn with exception. - */ - protected void warn(String s, Throwable t) { - System.err.println("[PushletClient] - WARN - " + s + " ex=" + t); - - if (t != null) { - t.printStackTrace(); - } - } - - /** - * Internal (default) listener for the Pushlet data channel. - */ - protected class DataEventListener implements Runnable { - /** - * Client's listener that gets called back on events. - */ - private PushletClientListener listener; - - /** - * Receiver receiveThread. - */ - private Thread receiveThread = null; - private Reader reader; - private String refreshURL; - private String listenURL; - - public DataEventListener(PushletClientListener aListener, String aListenURL) { - listener = aListener; - listenURL = aListenURL; - } - - public void start() { - // All ok: start a receiver receiveThread - receiveThread = new Thread(this); - receiveThread.start(); - - } - - /** - * Stop listening; may restart later with start(). - */ - public void stop() { - p("In stop()"); - bailout(); - } - - /** - * Receive event objects from server and callback listener. - */ - public void run() { - p("Start run()"); - try { - while (receiveThread != null && receiveThread.isAlive()) { - // Connect to server - reader = openURL(listenURL); - - synchronized (this) { - // Inform the calling thread we're ready to receive events. - // Suggestion by Jeff Nowakowski 29.oct.2006 - this.notify(); - } - - // Get events while we're alive. - while (receiveThread != null && receiveThread.isAlive()) { - Event event = null; - try { - // p("Getting event..."); - // Get next event from server - event = EventParser.parse(reader); - p("Event received " + event); - } catch (Throwable t) { - - // Stop and report error. - // warn("Stop run() on exception", t); - if (listener != null) { - listener.onError("exception during receive: " + t); - } - - break; - } - - // Handle event by calling listener - if (event != null && listener != null) { - // p("received: " + event.toXML()); - String eventType = event.getEventType(); - if (eventType.equals(E_HEARTBEAT)) { - listener.onHeartbeat(event); - } else if (eventType.equals(E_DATA)) { - listener.onData(event); - } else if (eventType.equals(E_JOIN_LISTEN_ACK)) { - id = event.getField(P_ID); - } else if (eventType.equals(E_LISTEN_ACK)) { - p("Listen ack ok"); - } else if (eventType.equals(E_REFRESH_ACK)) { - // ignore - } else if (eventType.equals(E_ABORT)) { - listener.onAbort(event); - listener = null; - break; - } else if (eventType.equals(E_REFRESH)) { - refresh(event); - } else { - handleUnknownEventType(eventType, event, listener); - } - } - } - } - } catch (Throwable t) { - warn("Exception in run() ", t); - // bailout(); - } - } - - protected void disconnect() { - p("start disconnect()"); - if (reader != null) { - try { - // this blocks, find another way - // reader.close(); - p("Closed reader ok"); - } catch (Exception ignore) { - } finally { - reader = null; - } - } - p("end disconnect()"); - } - - /** - * Stop receiver receiveThread. - */ - public void stopThread() { - p("In stopThread()"); - - // Keep a reference such that we can kill it from here. - Thread targetThread = receiveThread; - - receiveThread = null; - - // This should stop the main loop for this receiveThread. - // Killing a receiveThread on a blcing read is tricky. - // See also http://gee.cs.oswego.edu/dl/cpj/cancel.html - if ((targetThread != null) && targetThread.isAlive()) { - - targetThread.interrupt(); - - try { - - // Wait for it to die - targetThread.join(500); - } catch (InterruptedException ignore) { - } - - // If current receiveThread refuses to die, - // take more rigorous methods. - if (targetThread.isAlive()) { - - // Not preferred but may be needed - // to stop during a blocking read. - targetThread.stop(); - - // Wait for it to die - try { - targetThread.join(500); - } catch (Throwable ignore) { - } - } - - p("Stopped receiveThread alive=" + targetThread.isAlive()); - - } - } - - /** - * Stop listening on stream from server. - */ - public void bailout() { - p("In bailout()"); - stopThread(); - disconnect(); - } - - /** - * Handle refresh, by pausing. - */ - protected void refresh(Event aRefreshEvent) throws PushletException { - try { - // Wait for specified time. - Thread.sleep(Long.parseLong(aRefreshEvent.getField(P_WAIT))); - } catch (Throwable t) { - warn("abort while refresing"); - refreshURL = null; - return; - } - - // If stopped during sleep, don't proceed - if (receiveThread == null) { - return; - } - - // Create url to refresh - refreshURL = pushletURL - + "?" + P_ID + "=" + id - + "&" + P_EVENT + "=" + E_REFRESH - ; - - if (reader != null) { - try { - reader.close(); - - } catch (IOException ignore) { - - } - reader = null; - } - - reader = openURL(refreshURL); - } - - /** - * Handle unknown Event (default behaviour). - */ - protected void handleUnknownEventType(String eventType, Event event, PushletClientListener listener) { - warn("unsupported event type received: " + eventType); - } - } - - /** - * Authenticator - */ - private static class HTTPAuthenticateProxy extends Authenticator { - - /** - * Contributed by Dele Olajide - * See http://groups.yahoo.com/group/pushlet/message/634 - */ - - private String thePassword = ""; - private String theUser = ""; - - public HTTPAuthenticateProxy(String username, String password) { - - thePassword = password; - theUser = username; - } - - protected PasswordAuthentication getPasswordAuthentication() { - // System.out.println("[HttpAuthenticateProxy] Username = " + theUser); - // System.out.println("[HttpAuthenticateProxy] Password = " + thePassword); - - return new PasswordAuthentication(theUser, thePassword.toCharArray()); - } - - } - -} - -/* - * $Log: PushletClient.java,v $ - * Revision 1.19 2009/06/04 12:46:35 justb - * PushletClient: add more hooks for extension (feat ID: 2799694 Craig M) - * - * Revision 1.18 2007/11/10 13:52:47 justb - * make startDataEventListener method protected to allow overriding - * - * Revision 1.17 2006/10/29 16:47:57 justb - * included patch from Jeff Nowakowski: wait until listener thread runs - * - * Revision 1.16 2005/05/06 20:08:20 justb - * client enhancements - * - * Revision 1.15 2005/03/27 17:42:27 justb - * enhancements - * - * Revision 1.14 2005/03/25 23:54:04 justb - * *** empty log message *** - * - * Revision 1.13 2005/02/28 16:59:40 justb - * fixes for leave and disconnect - * - * Revision 1.12 2005/02/28 15:57:54 justb - * added SimpleListener example - * - * Revision 1.11 2005/02/21 12:31:44 justb - * added proxy contribution from Dele Olajide - * - * Revision 1.10 2005/02/20 13:05:32 justb - * removed the Postlet (integrated in Pushlet protocol) - * - * Revision 1.9 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.8 2005/02/18 09:54:12 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.7 2005/02/15 15:46:30 justb - * client API improves - * - * Revision 1.6 2005/02/15 13:28:56 justb - * first quick rewrite adapt for v2 protocol - * - * Revision 1.5 2004/10/25 21:23:44 justb - * *** empty log message *** - * - * Revision 1.4 2004/10/24 13:52:51 justb - * small fixes in client lib - * - * Revision 1.3 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.2 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.1 2004/03/10 20:14:17 justb - * renamed all *JavaPushletClient* to *PushletClient* - * - * Revision 1.10 2004/03/10 15:45:55 justb - * many cosmetic changes - * - * Revision 1.9 2003/08/17 20:30:20 justb - * cosmetic changes - * - * Revision 1.8 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * - */ \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/client/PushletClient.java.patch b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/client/PushletClient.java.patch deleted file mode 100755 index 63d660354d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/client/PushletClient.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- PushletClient.java 6 May 2005 20:08:20 -0000 1.16 -+++ PushletClient.java 28 Oct 2006 23:19:12 -0000 -@@ -142,7 +142,13 @@ - } - - dataEventListener = new DataEventListener(aListener, listenURL); -- dataEventListener.start(); -+ synchronized (dataEventListener) { -+ dataEventListener.start(); -+ try { -+ dataEventListener.wait(); -+ } catch (InterruptedException e) { -+ } -+ } - } - - /** Immediate listener. */ -@@ -354,6 +360,11 @@ - // Connect to server - reader = openURL(listenURL); - -+ synchronized (this) { -+ // Inform the calling thread we're ready to receive events. -+ this.notify(); -+ } -+ - // Get events while we're alive. - while (receiveThread != null && receiveThread.isAlive()) { - Event event = null; diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/client/PushletClientListener.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/client/PushletClientListener.java deleted file mode 100755 index 864e2ef7dd..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/client/PushletClientListener.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.client; - -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.Protocol; - -/** - * Interface for listener of the PushletClient object. - * - * @version $Id: PushletClientListener.java,v 1.5 2005/02/21 11:50:37 justb Exp $ - * @author Just van den Broecke - Just Objects © - **/ -public interface PushletClientListener extends Protocol { - /** Abort event from server. */ - public void onAbort(Event theEvent); - - /** Data event from server. */ - public void onData(Event theEvent); - - /** Heartbeat event from server. */ - public void onHeartbeat(Event theEvent); - - /** Error occurred. */ - public void onError(String message); -} - -/* -* $Log: PushletClientListener.java,v $ -* Revision 1.5 2005/02/21 11:50:37 justb -* ohase1 of refactoring Subscriber into Session/Controller/Subscriber -* -* Revision 1.4 2005/02/15 15:46:31 justb -* client API improves -* -* Revision 1.3 2004/10/24 12:58:18 justb -* revised client and test classes for new protocol -* -* Revision 1.2 2004/09/03 22:35:37 justb -* Almost complete rewrite, just checking in now -* -* Revision 1.1 2004/03/10 20:14:17 justb -* renamed all *JavaPushletClient* to *PushletClient* -* -* Revision 1.3 2003/08/15 08:37:40 justb -* fix/add Copyright+LGPL file headers and footers -* -* -*/ \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/BrowserAdapter.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/BrowserAdapter.java deleted file mode 100755 index d523882f49..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/BrowserAdapter.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Iterator; - -/** - * Generic implementation of ClientAdapter for browser clients. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: BrowserAdapter.java,v 1.6 2007/11/09 13:15:35 justb Exp $ - */ -public class BrowserAdapter implements ClientAdapter, Protocol { - - public static final String START_DOCUMENT = - "" - + "" - + "\n"; - public static final String END_DOCUMENT = ""; - - private PrintWriter servletOut; - private HttpServletResponse servletRsp; - private int bytesSent; - - /** - * Constructor. - */ - public BrowserAdapter(HttpServletResponse aServletResponse) { - servletRsp = aServletResponse; - } - - /** - * Generic init. - */ - public void start() throws IOException { - // Keep servlet request/response objects until page ends in stop() - // Content type as HTML - servletRsp.setStatus(HttpServletResponse.SC_OK); - servletRsp.setContentType("text/html;charset=UTF-8"); - - // http://www.junlu.com/msg/45902.html - // Log.debug("bufsize=" + aRsp.getBufferSize()); - servletOut = servletRsp.getWriter(); - send(START_DOCUMENT); - } - - /** - * Push Event to client. - */ - public void push(Event anEvent) throws IOException { - Log.debug("BCA event=" + anEvent.toXML()); - - // Check if we should refresh - if (anEvent.getEventType().equals(Protocol.E_REFRESH)) { - // Append refresh and tail of HTML document - // Construct the JS callback line to be sent as last line of doc. - // This will refresh the request using the unique id to determine - // the subscriber instance on the server. The client will wait for - // a number of milliseconds. - long refreshWaitMillis = Long.parseLong(anEvent.getField(P_WAIT)); - - // Create servlet request for requesting next events (refresh) - String url = anEvent.getField(P_URL); - String jsRefreshTrigger = "\n"; - - - send(jsRefreshTrigger + END_DOCUMENT); - } else { - send(event2JavaScript(anEvent)); - } - } - - /** - * End HTML page in client browser. - */ - public void stop() { - // To be garbage collected if adapter remains active - servletOut = null; - } - - /** - * Send any string to browser. - */ - protected void send(String s) throws IOException { - // Send string to browser. - // Log.debug("Adapter: sending: " + s); - if (servletOut == null) { - throw new IOException("Client adapter was stopped"); - } - - servletOut.print(s); - - servletOut.flush(); - - // Note: this doesn't seem to have effect - // in Tomcat 4/5 if the client already disconnected. - servletRsp.flushBuffer(); - - bytesSent += s.length(); - Log.debug("bytesSent= " + bytesSent); - // Log.debug("BCA sent event: " + s); - } - - /** - * Converts the Java Event to a JavaScript function call in browser page. - */ - protected String event2JavaScript(Event event) throws IOException { - - // Convert the event to a comma-separated string. - String jsArgs = ""; - for (Iterator iter = event.getFieldNames(); iter.hasNext();) { - String name = (String) iter.next(); - String value = event.getField(name); - String nextArgument = (jsArgs.equals("") ? "" : ",") + "'" + name + "'" + ", \"" + value + "\""; - jsArgs += nextArgument; - } - - // Construct and return the function call */ - return ""; - } - -} - -/* - * $Log: BrowserAdapter.java,v $ - * Revision 1.6 2007/11/09 13:15:35 justb - * add charset=UTF-8 in returned HTTP content types - * - * Revision 1.5 2006/05/15 11:52:53 justb - * updates mainly for AJAX client - * - * Revision 1.4 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.3 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.2 2005/02/21 11:50:44 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.1 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.12 2005/02/15 13:30:23 justb - * changes for Tomcat buffering (now working in tc4 and 5.0) - * - * Revision 1.11 2005/01/24 22:45:58 justb - * getting safari to work - * - * Revision 1.10 2005/01/18 16:46:27 justb - * buffer size setting ignored by tomcat workings - * - * Revision 1.9 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.8 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.7 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.6 2004/08/15 16:00:15 justb - * enhancements to pull mode - * - * Revision 1.5 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.4 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.3 2003/08/12 09:57:05 justb - * replaced all print statements to Log.*() calls - * - * Revision 1.2 2003/05/18 16:15:07 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:30 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:02 justb - * first import into SF - * - * Revision 1.5 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.4 2000/12/27 22:39:35 just - * no message - * - * Revision 1.3 2000/10/30 14:15:47 just - * no message - * - * - */ - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/ClientAdapter.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/ClientAdapter.java deleted file mode 100755 index 4b187325ef..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/ClientAdapter.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import java.io.IOException; - -/** - * Adapter interface for encapsulation of specific HTTP clients. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: ClientAdapter.java,v 1.8 2007/11/23 14:33:07 justb Exp $ - */ -public interface ClientAdapter { - - /** - * Start event push. - */ - public void start() throws IOException; - - /** - * Push single Event to client. - */ - public void push(Event anEvent) throws IOException; - - /** - * Stop event push. - */ - public void stop() throws IOException; -} - -/* - * $Log: ClientAdapter.java,v $ - * Revision 1.8 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.7 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.6 2005/02/21 11:50:45 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.5 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.4 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.3 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:30 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Command.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Command.java deleted file mode 100755 index dbba4fae76..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Command.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Servlets; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * Wraps pushlet request/response data. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Command.java,v 1.4 2007/11/23 14:33:07 justb Exp $ - */ -public class Command implements Protocol { - - /** - * Pushlet request event. - */ - public final Event reqEvent; - - /** - * Pushlet response event. - */ - private Event rspEvent; - - /** - * HTTP Servlet GET/POST request. - */ - public final HttpServletRequest httpReq; - - /** - * HTTP Servlet GET/POST response. - */ - public final HttpServletResponse httpRsp; - - /** - * Pushlet session. - */ - public final Session session; - - /** - * Per-response client adapter. - */ - private ClientAdapter clientAdapter; - - /** - * Constructor. - */ - private Command(Session aSession, Event aRequestEvent, HttpServletRequest aHTTPReq, HttpServletResponse aHTTPRsp) { - session = aSession; - reqEvent = aRequestEvent; - httpReq = aHTTPReq; - httpRsp = aHTTPRsp; - } - - /** - * Create new Command object. - */ - public static Command create(Session aSession, Event aReqEvent, HttpServletRequest aHTTPReq, HttpServletResponse aHTTPRsp) { - return new Command(aSession, aReqEvent, aHTTPReq, aHTTPRsp); - } - - /** - * Set pushlet response event. - */ - public void setResponseEvent(Event aResponseEvent) { - rspEvent = aResponseEvent; - } - - /** - * Get pushlet response event. - */ - public Event getResponseEvent() { - return rspEvent; - } - - /** - * Get client adapter for request. - */ - public ClientAdapter getClientAdapter() throws PushletException { - if (clientAdapter == null) { - // Create and initialize client-specific adapter. - clientAdapter = createClientAdapter(); - } - return clientAdapter; - } - - /** - * Create client notifier based on "format" parameter passed in request. - */ - protected ClientAdapter createClientAdapter() throws PushletException { - - // Assumed to be set by parent. - String outputFormat = session.getFormat(); - - // Determine client adapter to create. - if (outputFormat.equals(FORMAT_JAVASCRIPT)) { - // Client expects to receive Events as JavaScript dispatch calls.. - return new BrowserAdapter(httpRsp); - } else if (outputFormat.equals(FORMAT_SERIALIZED_JAVA_OBJECT)) { - // Client expects to receive Events as Serialized Java Objects. - return new SerializedAdapter(httpRsp); - } else if (outputFormat.equals(FORMAT_XML)) { - // Client expects to receive Events as stream of XML docs. - return new XMLAdapter(httpRsp); - } else if (outputFormat.equals(FORMAT_XML_STRICT)) { - // Client expects to receive Events embedded in single XML doc. - return new XMLAdapter(httpRsp, true); - } else { - throw new PushletException("Null or invalid output format: " + outputFormat); - } - } - - /** - * Sends HTTP response headers. - */ - protected void sendResponseHeaders() { - // Just to try to prevent caching in any form. - Servlets.setNoCacheHeaders(httpRsp); - - // Close connection for Java enabled browsers - if (session.getUserAgent().indexOf("java") > 0) { - // The connection should be closed after this request - // NB: this allows sending a "long response". Some clients - // in particular java.net.URL in VMs > 1.1 that use HTTP/1.1 - // will block if - // - the content length is not sent - // - if Connection: close HTTP header is not sent. - // - // Since we don't know the content length we will assume - // the underlying servlet engine will use chunked encoding. - httpRsp.setHeader("Connection", "close"); - } - } - - -} - -/* - * $Log: Command.java,v $ - * Revision 1.4 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.3 2005/05/06 19:44:00 justb - * added xml-strict format - * - * Revision 1.2 2005/02/28 17:25:15 justb - * commented - * - * Revision 1.1 2005/02/28 12:45:59 justb - * introduced Command class - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Config.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Config.java deleted file mode 100755 index c598e033d7..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Config.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Sys; - -import java.io.File; -import java.util.Properties; - -/** - * Loads and maintains overall configuration. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Config.java,v 1.5 2007/11/23 21:10:17 justb Exp $ - */ -public class Config implements ConfigDefs { - private static final String PROPERTIES_FILE = "pushlet.properties"; - private static Properties properties; - - /** - * Factory method: create object from property denoting class name. - * - * @param aClassNameProp property name e.g. "session.class" - * @return an instance of class denoted by property - * @throws PushletException when class cannot be instantiated - */ - public static Object createObject(String aClassNameProp, String aDefault) throws PushletException { - Class clazz = getClass(aClassNameProp, aDefault); - try { - return clazz.newInstance(); - } catch (Throwable t) { - // Usually a misconfiguration - throw new PushletException("Cannot instantiate class for " + aClassNameProp + "=" + clazz, t); - } - } - - /** - * Factory method: create object from property denoting class name. - * - * @param aClassNameProp property name e.g. "session.class" - * @return a Class object denoted by property - * @throws PushletException when class cannot be instantiated - */ - public static Class getClass(String aClassNameProp, String aDefault) throws PushletException { - // Singleton + factory pattern: create object instance - // from configured class name - String clazz = (aDefault == null ? getProperty(aClassNameProp) : getProperty(aClassNameProp, aDefault)); - - try { - return Class.forName(clazz); - } catch (ClassNotFoundException t) { - // Usually a misconfiguration - throw new PushletException("Cannot find class for " + aClassNameProp + "=" + clazz, t); - } - } - - /** - * Initialize event sources from properties file. - */ - public static void load(String aDirPath) { - // Load Event sources using properties file. - try { - // Try loading through classpath first (e.g. in WEB-INF/classes or from .jar) - Log.info("Config: loading " + PROPERTIES_FILE + " from classpath"); - properties = Sys.loadPropertiesResource(PROPERTIES_FILE); - } catch (Throwable t) { - // Try from provided dir (e.g. WEB_INF/pushlet.properties) - String filePath = aDirPath + File.separator + PROPERTIES_FILE; - Log.info("Config: cannot load " + PROPERTIES_FILE + " from classpath, will try from " + filePath); - - try { - properties = Sys.loadPropertiesFile(filePath); - } catch (Throwable t2) { - Log.fatal("Config: cannot load properties file from " + filePath, t); - - // Give up - return; - } - } - - Log.info("Config: loaded values=" + properties); - } - - public static String getProperty(String aName, String aDefault) { - return properties.getProperty(aName, aDefault); - } - - public static String getProperty(String aName) { - String value = properties.getProperty(aName); - if (value == null) { - throw new IllegalArgumentException("Unknown property: " + aName); - } - return value; - } - - public static boolean getBoolProperty(String aName) { - String value = getProperty(aName); - try { - return value.equals("true"); - } catch (Throwable t) { - throw new IllegalArgumentException("Illegal property value: " + aName + " val=" + value); - } - } - - public static int getIntProperty(String aName) { - String value = getProperty(aName); - try { - return Integer.parseInt(value); - } catch (Throwable t) { - throw new IllegalArgumentException("Illegal property value: " + aName + " val=" + value); - } - } - - public static long getLongProperty(String aName) { - String value = getProperty(aName); - try { - return Long.parseLong(value); - } catch (Throwable t) { - throw new IllegalArgumentException("Illegal property value: " + aName + " val=" + value); - } - } - - public static boolean hasProperty(String aName) { - return properties.containsKey(aName); - } - - -} - -/* - * $Log: Config.java,v $ - * Revision 1.5 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.4 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.3 2007/11/10 13:44:02 justb - * pushlet.properties and sources.properties can now also be put under WEB-INF - * - * Revision 1.2 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.1 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/ConfigDefs.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/ConfigDefs.java deleted file mode 100755 index df00d41beb..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/ConfigDefs.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - - -/** - * Definition of config property strings. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: ConfigDefs.java,v 1.9 2007/12/07 12:57:40 justb Exp $ - */ -public interface ConfigDefs { - /** - * Class factory definitions, used to insert your custom classes. - */ - public static final String CONTROLLER_CLASS = "controller.class"; - public static final String DISPATCHER_CLASS = "dispatcher.class"; - public static final String LOGGER_CLASS = "logger.class"; - public static final String SESSION_MANAGER_CLASS = "sessionmanager.class"; - public static final String SESSION_CLASS = "session.class"; - public static final String SUBSCRIBER_CLASS = "subscriber.class"; - public static final String SUBSCRIPTION_CLASS = "subscription.class"; - - /** - * Session management. - */ - public static final String SESSION_ID_SIZE = "session.id.size"; - public static final String SESSION_ID_GENERATION = "session.id.generation"; - public static final String SESSION_ID_GENERATION_UUID = "uuid"; - public static final String SESSION_ID_GENERATION_RANDOMSTRING = "randomstring"; - public static final String SESSION_TIMEOUT_MINS = "session.timeout.mins"; - - public static final String SOURCES_ACTIVATE = "sources.activate"; - - /** - * Logging - */ - public static final String LOG_LEVEL = "log.level"; - public static final int LOG_LEVEL_FATAL = 1; - public static final int LOG_LEVEL_ERROR = 2; - public static final int LOG_LEVEL_WARN = 3; - public static final int LOG_LEVEL_INFO = 4; - public static final int LOG_LEVEL_DEBUG = 5; - public static final int LOG_LEVEL_TRACE = 6; - - /** - * Queues - */ - public static final String QUEUE_SIZE = "queue.size"; - public static final String QUEUE_READ_TIMEOUT_MILLIS = "queue.read.timeout.millis"; - public static final String QUEUE_WRITE_TIMEOUT_MILLIS = "queue.write.timeout.millis"; - - /** - * Listening modes. - */ - public static final String LISTEN_FORCE_PULL_ALL = "listen.force.pull.all"; - public static final String LISTEN_FORCE_PULL_AGENTS = "listen.force.pull.agents"; - - - public static final String PULL_REFRESH_TIMEOUT_MILLIS = "pull.refresh.timeout.millis"; - public static final String PULL_REFRESH_WAIT_MIN_MILLIS = "pull.refresh.wait.min.millis"; - public static final String PULL_REFRESH_WAIT_MAX_MILLIS = "pull.refresh.wait.max.millis"; - - - public static final String POLL_REFRESH_TIMEOUT_MILLIS = "poll.refresh.timeout.millis"; - public static final String POLL_REFRESH_WAIT_MIN_MILLIS = "poll.refresh.wait.min.millis"; - public static final String POLL_REFRESH_WAIT_MAX_MILLIS = "poll.refresh.wait.max.millis"; - -} - -/* - * $Log: ConfigDefs.java,v $ - * Revision 1.9 2007/12/07 12:57:40 justb - * added log4j and make it the default logging method - * - * Revision 1.8 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.7 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.6 2007/11/10 14:48:35 justb - * make session key generation configurable (can use uuid) - * - * Revision 1.5 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.4 2005/02/21 16:59:00 justb - * SessionManager and session lease introduced - * - * Revision 1.3 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.2 2005/02/21 11:16:44 justb - * add log level config prop - * - * Revision 1.1 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - * - * - */ - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Controller.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Controller.java deleted file mode 100755 index ca90b1539e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Controller.java +++ /dev/null @@ -1,502 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.PushletException; - -import java.io.IOException; - -/** - * Handles servlet requests from client. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Controller.java,v 1.9 2007/11/23 14:33:07 justb Exp $ - */ -public class Controller implements Protocol, ConfigDefs { - - private Session session; - - /** - * Protected constructor as we create through factory method. - */ - protected Controller() { - } - - /** - * Create instance through factory method. - * - * @param aSession the parent Session - * @return a Controller object (or derived) - * @throws PushletException exception, usually misconfiguration - */ - public static Controller create(Session aSession) throws PushletException { - Controller controller; - try { - controller = (Controller) Config.getClass(CONTROLLER_CLASS, "nl.justobjects.pushlet.core.Controller").newInstance(); - } catch (Throwable t) { - throw new PushletException("Cannot instantiate Controller from config", t); - } - controller.session = aSession; - return controller; - } - - /** - * Handle command. - */ - public void doCommand(Command aCommand) { - try { - // Update lease time to live - session.kick(); - - // Set remote IP address of client - session.setAddress(aCommand.httpReq.getRemoteAddr()); - - debug("doCommand() event=" + aCommand.reqEvent); - - // Get event type - String eventType = aCommand.reqEvent.getEventType(); - - // Determine action based on event type - if (eventType.equals(Protocol.E_REFRESH)) { - // Pull/poll mode clients that refresh - doRefresh(aCommand); - } else if (eventType.equals(Protocol.E_SUBSCRIBE)) { - // Subscribe - doSubscribe(aCommand); - } else if (eventType.equals(Protocol.E_UNSUBSCRIBE)) { - // Unsubscribe - doUnsubscribe(aCommand); - } else if (eventType.equals(Protocol.E_JOIN)) { - // Join - doJoin(aCommand); - } else if (eventType.equals(Protocol.E_JOIN_LISTEN)) { - // Join and listen (for simple and e.g. REST apps) - doJoinListen(aCommand); - } else if (eventType.equals(Protocol.E_LEAVE)) { - // Leave - doLeave(aCommand); - } else if (eventType.equals(Protocol.E_HEARTBEAT)) { - // Heartbeat mainly to do away with browser "busy" cursor - doHeartbeat(aCommand); - } else if (eventType.equals(Protocol.E_PUBLISH)) { - // Publish event - doPublish(aCommand); - } else if (eventType.equals(Protocol.E_LISTEN)) { - // Listen to pushed events - doListen(aCommand); - } - - // Handle response back to client - if (eventType.endsWith(Protocol.E_LISTEN) || - eventType.equals(Protocol.E_REFRESH)) { - // Data channel events - // Loops until refresh or connection closed - getSubscriber().fetchEvents(aCommand); - - } else { - // Send response for control commands - sendControlResponse(aCommand); - } - - } catch (Throwable t) { - warn("Exception in doCommand(): " + t); - t.printStackTrace(); - } - } - - public String toString() { - return session.toString(); - } - - /** - * Handle heartbeat event. - */ - protected void doHeartbeat(Command aCommand) { - - // Set heartbeat acknowledgement to client - aCommand.setResponseEvent(new Event(E_HEARTBEAT_ACK)); - } - - /** - * Handle Join request. - */ - protected void doJoin(Command aCommand) throws PushletException { - - Event responseEvent = null; - - try { - - session.start(); - - // Determine format for encoding Events to client. - // Default assume a userAgent window on the other end. - String format = aCommand.reqEvent.getField(P_FORMAT, FORMAT_JAVASCRIPT); - - session.setFormat(format); - responseEvent = new Event(E_JOIN_ACK); - - // Set unique subscriber id and encoding format - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_FORMAT, format); - info("joined"); - } catch (Throwable t) { - session.stop(); - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doJoin() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - - } - - /** - * Handle JoinListen request. - */ - protected void doJoinListen(Command aCommand) throws PushletException { - - // Basically bundles a join and a listen - // This request is handly for simple apps that - // need to do a single request to get events immediately - // For example in RESTful apps. - - // First do regular join - doJoin(aCommand); - if (!aCommand.getResponseEvent().getEventType().equals(E_NACK)) { - // If successful do the listen - doListen(aCommand); - if (!aCommand.getResponseEvent().getEventType().equals(E_NACK)) { - // If still ok do the listen ack - aCommand.getResponseEvent().setField(P_EVENT, E_JOIN_LISTEN_ACK); - } - } - } - - /** - * Handle Leave request. - */ - protected void doLeave(Command aCommand) throws IOException { - - Event responseEvent = null; - - try { - // Also removes all subscriptions - session.stop(); - - // Prepare acknowledgement - responseEvent = new Event(E_LEAVE_ACK); - - // Set unique subscriber id - responseEvent.setField(P_ID, session.getId()); - info("left"); - } catch (Throwable t) { - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doLeave() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - - } - - /** - * Handle Listen request. - */ - protected void doListen(Command aCommand) throws PushletException { - - - String mode = MODE_STREAM; - // Should we always force "pull" mode ? - if (Config.getBoolProperty(LISTEN_FORCE_PULL_ALL)) { - mode = MODE_PULL; - } else { - // Determine optimal mode determined by parameter and/or user agent - // Mode param determines how events are transfered to the client - - // In "stream" mode, a stream of events is sent, i.e. the document - // is neverending. In "pull" or "poll" mode a complete document is returned - // ending with a request to refresh. - mode = aCommand.reqEvent.getField(P_MODE, MODE_STREAM); - - String userAgent = aCommand.httpReq.getHeader("User-Agent"); - if (userAgent != null) { - userAgent = userAgent.toLowerCase(); - for (int i = 0; i < session.FORCED_PULL_AGENTS.length; i++) { - if ((userAgent.indexOf(session.FORCED_PULL_AGENTS[i]) != -1)) { - info("Forcing pull mode for agent=" + userAgent); - mode = MODE_PULL; - break; - } - } - } else { - userAgent = "unknown"; - } - } - - getSubscriber().setMode(mode); - - // Prepare acknowledgement - Event listenAckEvent = new Event(E_LISTEN_ACK); - - // Add subscription(s) if subject(s) specified - String subject = aCommand.reqEvent.getField(P_SUBJECT); - if (subject != null) { - // Optional label for subscription - String label = aCommand.reqEvent.getField(Protocol.P_SUBSCRIPTION_LABEL); - - // Add a subscription - Subscription subscription = getSubscriber().addSubscription(subject, label); - - // Add subscription id and optional label to listen-ack event - listenAckEvent.setField(P_SUBSCRIPTION_ID, subscription.getId()); - if (label != null) { - listenAckEvent.setField(P_SUBSCRIPTION_LABEL, label); - } - } - - // Set unique subscriber id, push mode and encoding format - listenAckEvent.setField(P_ID, session.getId()); - listenAckEvent.setField(P_MODE, mode); - listenAckEvent.setField(P_FORMAT, session.getFormat()); - - // Activate the subscriber - getSubscriber().start(); - - // Enqueue listen ack event on data channel - aCommand.setResponseEvent(listenAckEvent); - - info("Listening mode=" + mode + " userAgent=" + session.getUserAgent()); - - } - - /** - * Handle Publish request. - */ - protected void doPublish(Command aCommand) { - Event responseEvent = null; - - try { - String subject = aCommand.reqEvent.getField(Protocol.P_SUBJECT); - if (subject == null) { - // Return error response - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "no subject provided"); - } else { - aCommand.reqEvent.setField(P_FROM, session.getId()); - aCommand.reqEvent.setField(P_EVENT, E_DATA); - - // Event may be targeted to specific user (p_to field) - String to = aCommand.reqEvent.getField(P_TO); - if (to != null) { - Dispatcher.getInstance().unicast(aCommand.reqEvent, to); - } else { - // No to: multicast - debug("doPublish() event=" + aCommand.reqEvent); - Dispatcher.getInstance().multicast(aCommand.reqEvent); - } - - // Acknowledge - responseEvent = new Event(E_PUBLISH_ACK); - } - - } catch (Throwable t) { - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doPublish() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - } - - /** - * Handle refresh event. - */ - protected void doRefresh(Command aCommand) { - // Set ack - aCommand.setResponseEvent(new Event(E_REFRESH_ACK)); - } - - /** - * Handle Subscribe request. - */ - protected void doSubscribe(Command aCommand) throws IOException { - - Event responseEvent = null; - try { - String subject = aCommand.reqEvent.getField(Protocol.P_SUBJECT); - Subscription subscription = null; - if (subject == null) { - // Return error response - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "no subject provided"); - } else { - - String label = aCommand.reqEvent.getField(Protocol.P_SUBSCRIPTION_LABEL); - subscription = getSubscriber().addSubscription(subject, label); - - // Acknowledge - responseEvent = new Event(E_SUBSCRIBE_ACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_SUBJECT, subject); - responseEvent.setField(P_SUBSCRIPTION_ID, subscription.getId()); - if (label != null) { - responseEvent.setField(P_SUBSCRIPTION_LABEL, label); - } - info("subscribed to " + subject + " sid=" + subscription.getId()); - } - - } catch (Throwable t) { - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doSubscribe() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - } - - /** - * Handle Unsubscribe request. - */ - protected void doUnsubscribe(Command aCommand) throws IOException { - - - Event responseEvent = null; - try { - String subscriptionId = aCommand.reqEvent.getField(Protocol.P_SUBSCRIPTION_ID); - if (subscriptionId == null) { - // Unsuscbribe all - getSubscriber().removeSubscriptions(); - responseEvent = new Event(E_UNSUBSCRIBE_ACK); - responseEvent.setField(P_ID, session.getId()); - info("unsubscribed all"); - } else { - // Subscription id provided: remove Subscription - Subscription subscription = getSubscriber().removeSubscription(subscriptionId); - if (subscription == null) { - // Unknown subscription id: return error response - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "no subscription for sid=" + subscriptionId); - warn("unsubscribe: no subscription for sid=" + subscriptionId); - } else { - // OK return ack - responseEvent = new Event(E_UNSUBSCRIBE_ACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_SUBSCRIPTION_ID, subscription.getId()); - responseEvent.setField(P_SUBJECT, subscription.getSubject()); - if (subscription.getLabel() != null) { - responseEvent.setField(P_SUBSCRIPTION_LABEL, subscription.getLabel()); - } - info("unsubscribed sid= " + subscriptionId); - } - } - } catch (Throwable t) { - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doUnsubscribe() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - } - - public Subscriber getSubscriber() { - return session.getSubscriber(); - } - - /** - * Send response on the control channel. - */ - protected void sendControlResponse(Command aCommand) { - try { - - // Try to prevent caching in any form. - aCommand.sendResponseHeaders(); - - // Let clientAdapter determine how to send event - aCommand.getClientAdapter().start(); - - // Push to client through client adapter - aCommand.getClientAdapter().push(aCommand.getResponseEvent()); - - // One shot response - aCommand.getClientAdapter().stop(); - } catch (Throwable t) { - session.stop(); - } - } - - - /** - * Info. - */ - protected void info(String s) { - session.info("[Controller] " + s); - } - - /** - * Exceptional print util. - */ - protected void warn(String s) { - session.warn("[Controller] " + s); - } - - /** - * Exceptional print util. - */ - protected void debug(String s) { - session.debug("[Controller] " + s); - } - - -} - -/* - * $Log: Controller.java,v $ - * Revision 1.9 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.8 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * Revision 1.7 2005/02/28 13:05:59 justb - * introduced join-listen protocol service - * - * Revision 1.6 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.5 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.4 2005/02/25 15:13:00 justb - * session id generation more robust - * - * Revision 1.3 2005/02/21 16:59:06 justb - * SessionManager and session lease introduced - * - * Revision 1.2 2005/02/21 12:32:28 justb - * fixed publish event in Controller - * - * Revision 1.1 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Dispatcher.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Dispatcher.java deleted file mode 100755 index 83b402f693..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Dispatcher.java +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.PushletException; - -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; - -/** - * Routes Events to Subscribers. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Dispatcher.java,v 1.9 2007/12/04 13:55:53 justb Exp $ - */ -public class Dispatcher implements Protocol, ConfigDefs { - /** - * Singleton pattern: single instance. - */ - private static Dispatcher instance; - protected SessionManagerVisitor sessionManagerVisitor; - - static { - try { - instance = (Dispatcher) Config.getClass(DISPATCHER_CLASS, "nl.justobjects.pushlet.core.Dispatcher").newInstance(); - Log.info("Dispatcher created className=" + instance.getClass()); - } catch (Throwable t) { - Log.fatal("Cannot instantiate Dispatcher from config", t); - } - } - - /** - * Singleton pattern with factory method: protected constructor. - */ - protected Dispatcher() { - - } - - /** - * Singleton pattern: get single instance. - */ - public static Dispatcher getInstance() { - return instance; - } - - /** - * Send event to all subscribers. - */ - public synchronized void broadcast(Event anEvent) { - try { - // Let the SessionManager loop through Sessions, calling - // our Visitor Method for each Session. This is done to guard - // synchronization with SessionManager and to optimize by - // not getting an array of all sessions. - Object[] args = new Object[2]; - args[1] = anEvent; - Method method = sessionManagerVisitor.getMethod("visitBroadcast"); - SessionManager.getInstance().apply(sessionManagerVisitor, method, args); - } catch (Throwable t) { - Log.error("Error calling SessionManager.apply: ", t); - } - } - - /** - * Send event to subscribers matching Event subject. - */ - public synchronized void multicast(Event anEvent) { - try { - // Let the SessionManager loop through Sessions, calling - // our Visitor Method for each Session. This is done to guard - // synchronization with SessionManager and to optimize by - // not getting an array of all sessions. - Method method = sessionManagerVisitor.getMethod("visitMulticast"); - Object[] args = new Object[2]; - args[1] = anEvent; - SessionManager.getInstance().apply(sessionManagerVisitor, method, args); - } catch (Throwable t) { - Log.error("Error calling SessionManager.apply: ", t); - } - } - - - /** - * Send event to specific subscriber. - */ - public synchronized void unicast(Event event, String aSessionId) { - // Get subscriber to send event to - Session session = SessionManager.getInstance().getSession(aSessionId); - if (session == null) { - Log.warn("unicast: session with id=" + aSessionId + " does not exist"); - return; - } - - // Send Event to subscriber. - session.getSubscriber().onEvent((Event) event.clone()); - } - - /** - * Start Dispatcher. - */ - public void start() throws PushletException { - Log.info("Dispatcher started"); - - // Create callback for SessionManager visits. - sessionManagerVisitor = new SessionManagerVisitor(); - } - - /** - * Stop Dispatcher. - */ - public void stop() { - // Send abort control event to all subscribers. - Log.info("Dispatcher stopped: broadcast abort to all subscribers"); - broadcast(new Event(E_ABORT)); - } - - /** - * Supplies Visitor methods for callbacks from SessionManager. - */ - private class SessionManagerVisitor { - private final Map visitorMethods = new HashMap(2); - - SessionManagerVisitor() throws PushletException { - - try { - // Setup Visitor Methods for callback from SessionManager - // This is a slight opitmization over creating Method objects - // on each invokation. - Class[] argsClasses = {Session.class, Event.class}; - visitorMethods.put("visitMulticast", this.getClass().getMethod("visitMulticast", argsClasses)); - visitorMethods.put("visitBroadcast", this.getClass().getMethod("visitBroadcast", argsClasses)); - } catch (NoSuchMethodException e) { - throw new PushletException("Failed to setup SessionManagerVisitor", e); - } - } - - /** - * Return Visitor Method by name. - */ - public Method getMethod(String aName) { - return (Method) visitorMethods.get(aName); - - } - - /** - * Visitor method called by SessionManager. - */ - public void visitBroadcast(Session aSession, Event event) { - aSession.getSubscriber().onEvent((Event) event.clone()); - } - - /** - * Visitor method called by SessionManager. - */ - public void visitMulticast(Session aSession, Event event) { - Subscriber subscriber = aSession.getSubscriber(); - Event clonedEvent; - Subscription subscription; - - // Send only if the subscriber's criteria - // match the event. - if ((subscription = subscriber.match(event)) != null) { - // Personalize event - clonedEvent = (Event) event.clone(); - - // Set subscription id and optional label - clonedEvent.setField(P_SUBSCRIPTION_ID, subscription.getId()); - if (subscription.getLabel() != null) { - event.setField(P_SUBSCRIPTION_LABEL, subscription.getLabel()); - } - - subscriber.onEvent(clonedEvent); - } - } - } -} - -/* - * $Log: Dispatcher.java,v $ - * Revision 1.9 2007/12/04 13:55:53 justb - * reimplement SessionManager concurrency (prev version was not thread-safe!) - * - * Revision 1.8 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.7 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.6 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.5 2005/02/21 16:59:06 justb - * SessionManager and session lease introduced - * - * Revision 1.4 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.3 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - * Revision 1.2 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.1 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.14 2005/02/16 14:39:34 justb - * fixed leave handling and added "poll" mode - * - * Revision 1.13 2004/10/24 20:50:35 justb - * refine subscription with label and sending sid and label on events - * - * Revision 1.12 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.11 2004/09/26 21:39:43 justb - * allow multiple subscriptions and out-of-band requests - * - * Revision 1.10 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.9 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.8 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.7 2004/08/12 13:18:54 justb - * cosmetic changes - * - * Revision 1.6 2004/03/10 15:45:55 justb - * many cosmetic changes - * - * Revision 1.5 2004/03/10 13:59:28 justb - * rewrite using Collection classes and finer synchronization - * - * Revision 1.4 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.3 2003/08/12 08:54:40 justb - * added getSubscriberCount() and use Log - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:18 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:04 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Event.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Event.java deleted file mode 100755 index b74d3c9bab..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Event.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Sys; - -import java.io.Serializable; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -/** - * Represents the event data. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Event.java,v 1.13 2007/11/23 14:33:07 justb Exp $ - */ -public class Event implements Protocol, Serializable { - - protected Map attributes = new HashMap(3); - - public Event(String anEventType) { - this(anEventType, null); - } - - public Event(String anEventType, Map theAttributes) { - - if (theAttributes != null) { - setAttrs(theAttributes); - } - - // Set required field event type - setField(P_EVENT, anEventType); - - // Set time in seconds since 1970 - setField(P_TIME, System.currentTimeMillis() / 1000); - } - - public Event(Map theAttributes) { - if (!theAttributes.containsKey(P_EVENT)) { - throw new IllegalArgumentException(P_EVENT + " not found in attributes"); - } - setAttrs(theAttributes); - } - - public static Event createDataEvent(String aSubject) { - return createDataEvent(aSubject, null); - } - - public static Event createDataEvent(String aSubject, Map theAttributes) { - Event dataEvent = new Event(E_DATA, theAttributes); - dataEvent.setField(P_SUBJECT, aSubject); - return dataEvent; - } - - public String getEventType() { - return getField(P_EVENT); - } - - public String getSubject() { - return getField(P_SUBJECT); - } - - public void setField(String name, String value) { - attributes.put(name, value); - } - - public void setField(String name, int value) { - attributes.put(name, value + ""); - } - - public void setField(String name, long value) { - attributes.put(name, value + ""); - } - - public String getField(String name) { - return (String) attributes.get(name); - } - - /** - * Return field; if null return default. - */ - public String getField(String name, String aDefault) { - String result = getField(name); - return result == null ? aDefault : result; - } - - public Iterator getFieldNames() { - return attributes.keySet().iterator(); - } - - public String toString() { - return attributes.toString(); - } - - /** - * Convert to HTTP query string. - */ - public String toQueryString() { - String queryString = ""; - String amp = ""; - for (Iterator iter = getFieldNames(); iter.hasNext();) { - String nextAttrName = (String) iter.next(); - String nextAttrValue = getField(nextAttrName); - queryString = queryString + amp + nextAttrName + "=" + nextAttrValue; - // After first add "&". - amp = "&"; - } - - return queryString; - } - - public String toXML(boolean strict) { - String xmlString = " -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import java.io.*; -import java.util.HashMap; - -/** - * Parses XML into Event objects. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: EventParser.java,v 1.3 2007/11/23 14:33:07 justb Exp $ - */ -public class EventParser { - - - private EventParser() { - } - - /** - * Parse Event from a File. - */ - public static Event parse(File aFile) throws IOException { - BufferedReader br = new BufferedReader(new FileReader(aFile)); - return parse(br); - } - - /** - * Parse Event from input Reader. - */ - public static Event parse(Reader aReader) throws IOException { - StringBuffer preparsedString = new StringBuffer(24); - - // First find the opening tag ('<') - char nextChar; - while ((nextChar = (char) aReader.read()) != '<') ; - - // Append '<' - preparsedString.append(nextChar); - - // Then find end-tag ('>'), appending all chars to preparsed string. - do { - nextChar = (char) aReader.read(); - preparsedString.append(nextChar); - } while (nextChar != '>'); - - return parse(preparsedString.toString()); - } - - /** - * Parse Event from a String. - */ - public static Event parse(String aString) throws IOException { - aString = aString.trim(); - - if (!aString.startsWith("<") || !aString.endsWith("/>")) { - throw new IOException("No start or end tag found while parsing event [" + aString + "]"); - } - - // Create the attributes object. - HashMap properties = new HashMap(3); - - // Remove the start and end (< ... />) from the string - aString = aString.substring(1, aString.length() - 2).trim(); - - int index = 0; - - // Parse the tag - while (!Character.isWhitespace(aString.charAt(index)) - && (index < aString.length())) { - index++; - } - - // We don't use the tag: remove from string - aString = aString.substring(index).trim(); - index = 0; - - String attrName; - String attrValue; - - while (index < aString.length()) { - - // Parse attribute name - while ((aString.charAt(index) != '=') - && (index < aString.length())) { - index++; - } - - // Create attr name string - attrName = aString.substring(0, index).trim(); - - // remove the attributeName and the '=' from the string - aString = aString.substring(index + 1).trim(); - index = 1; // read past the first wrapping "\"" - - // Parse attribute value - while ((aString.charAt(index) != '\"') - && (index < aString.length())) { - - // bypass the special characters '\' and '"' inside the - // attributevalue itself which are deliniated with a preceding - // '\' - if (aString.charAt(index) == '\\') { - aString = aString.substring(0, index) - + aString.substring(index + 1); // remove the '\' - } - - index++; - } - - // create the attribute value; exclude the wrapping quote-characters - attrValue = aString.substring(1, index); - - // Set the attribute N/V - properties.put(attrName, attrValue); - - aString = aString.substring(index + 1).trim(); - index = 0; - } - - return new Event(properties); - } - - /** - * Test method: use files to test. - */ - public static void main(String[] args) { - try { - Event event = parse(new File(args[0])); - System.out.println("OK parsed Event file " + args[0]); - System.out.println(event.toXML()); - - event = parse(event.toXML()); - System.out.println("OK parsed Event string"); - System.out.println(event.toXML()); - } catch (Throwable t) { - System.out.println("Error parsing event file: " + args[0]); - t.printStackTrace(); - } - } -} - -/* - * $Log: EventParser.java,v $ - * Revision 1.3 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.2 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.1 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.3 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.2 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.1 2003/05/18 16:12:27 justb - * adding support for XML encoded Events - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/EventPullSource.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/EventPullSource.java deleted file mode 100755 index 0f183dba1b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/EventPullSource.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; - -/** - * Abstract Event source from which Events are pulled. - * - * @version $Id: EventPullSource.java,v 1.15 2007/11/23 14:33:07 justb Exp $ - * @author Just van den Broecke - Just Objects © - **/ - -/** - * ABC for specifc EventPullSources. - */ -abstract public class EventPullSource implements EventSource, Runnable { - private volatile boolean alive = false; - private volatile boolean active = false; - private static int threadNum = 0; - private Thread thread; - - public EventPullSource() { - } - - abstract protected long getSleepTime(); - - abstract protected Event pullEvent(); - - public void start() { - thread = new Thread(this, "EventPullSource-" + (++threadNum)); - thread.setDaemon(true); - thread.start(); - } - - public boolean isAlive() { - return alive; - } - - /** - * Stop the event generator thread. - */ - public void stop() { - alive = false; - - if (thread != null) { - thread.interrupt(); - thread = null; - } - - } - - /** - * Activate the event generator thread. - */ - synchronized public void activate() { - if (active) { - return; - } - active = true; - if (!alive) { - start(); - return; - } - Log.debug(getClass().getName() + ": notifying..."); - notifyAll(); - } - - /** - * Deactivate the event generator thread. - */ - public void passivate() { - if (!active) { - return; - } - active = false; - } - - /** - * Main loop: sleep, generate event and publish. - */ - public void run() { - Log.debug(getClass().getName() + ": starting..."); - alive = true; - while (alive) { - try { - - Thread.sleep(getSleepTime()); - - // Stopped during sleep: end loop. - if (!alive) { - break; - } - - // If passivated wait until we get - // get notify()-ied. If there are no subscribers - // it wasts CPU to remain producing events... - synchronized (this) { - while (!active) { - Log.debug(getClass().getName() + ": waiting..."); - wait(); - } - } - - } catch (InterruptedException e) { - break; - } - - try { - // Derived class should produce an event. - Event event = pullEvent(); - - // Let the publisher push it to subscribers. - Dispatcher.getInstance().multicast(event); - } catch (Throwable t) { - Log.warn("EventPullSource exception while multicasting ", t); - t.printStackTrace(); - } - } - Log.debug(getClass().getName() + ": stopped"); - } -} - -/* - * $Log: EventPullSource.java,v $ - * Revision 1.15 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.14 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.13 2005/02/21 16:59:08 justb - * SessionManager and session lease introduced - * - * Revision 1.12 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.11 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.10 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.9 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.8 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.7 2004/08/15 16:00:15 justb - * enhancements to pull mode - * - * Revision 1.6 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.5 2004/03/10 14:01:55 justb - * formatting and *Subscriber refactoring - * - * Revision 1.4 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.3 2003/08/12 09:57:05 justb - * replaced all print statements to Log.*() calls - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/EventQueue.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/EventQueue.java deleted file mode 100755 index 18fd52318d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/EventQueue.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -/** - * FIFO queue with guarded suspension. - * Purpose
    - *

    - * Implementation
    - * FIFO queue class implemented with circular array. The enQueue() and - * deQueue() methods use guarded suspension according to a readers/writers - * pattern, implemented with java.lang.Object.wait()/notify(). - *

    - * Examples
    - *

    - *
    - * - * @author Just van den Broecke - Just Objects © - * @version $Id: EventQueue.java,v 1.3 2007/11/23 14:33:07 justb Exp $ - */ -public class EventQueue { - /** - * Defines maximum queue size - */ - private int capacity = 8; - private Event[] queue = null; - private int front, rear; - - /** - * Construct queue with default (8) capacity. - */ - public EventQueue() { - this(8); - } - - /** - * Construct queue with specified capacity. - */ - public EventQueue(int capacity) { - this.capacity = capacity; - queue = new Event[capacity]; - front = rear = 0; - } - - /** - * Put item in queue; waits() indefinitely if queue is full. - */ - public synchronized boolean enQueue(Event item) throws InterruptedException { - return enQueue(item, -1); - } - - /** - * Put item in queue; if full wait maxtime. - */ - public synchronized boolean enQueue(Event item, long maxWaitTime) throws InterruptedException { - - // Wait (optional maxtime) as long as the queue is full - while (isFull()) { - if (maxWaitTime > 0) { - // Wait at most maximum time - wait(maxWaitTime); - - // Timed out or woken; if still full we - // had bad luck and return failure. - if (isFull()) { - return false; - } - } else { - wait(); - } - } - - // Put item in queue - queue[rear] = item; - rear = next(rear); - - // Wake up waiters; NOTE: first waiter will eat item - notifyAll(); - return true; - } - - /** - * Get head; if empty wait until something in queue. - */ - public synchronized Event deQueue() throws InterruptedException { - return deQueue(-1); - } - - /** - * Get head; if empty wait for specified time at max. - */ - public synchronized Event deQueue(long maxWaitTime) throws InterruptedException { - while (isEmpty()) { - if (maxWaitTime >= 0) { - wait(maxWaitTime); - - // Timed out or woken; if still empty we - // had bad luck and return failure. - if (isEmpty()) { - return null; - } - } else { - // Wait indefinitely for something in queue. - wait(); - } - } - - // Dequeue item - Event result = fetchNext(); - - // Notify possible wait()-ing enQueue()-ers - notifyAll(); - - // Return dequeued item - return result; - } - - /** - * Get all queued Events. - */ - public synchronized Event[] deQueueAll(long maxWaitTime) throws InterruptedException { - while (isEmpty()) { - if (maxWaitTime >= 0) { - wait(maxWaitTime); - - // Timed out or woken; if still empty we - // had bad luck and return failure. - if (isEmpty()) { - return null; - } - } else { - // Wait indefinitely for something in queue. - wait(); - } - } - - // Dequeue all items item - Event[] events = new Event[getSize()]; - for (int i = 0; i < events.length; i++) { - events[i] = fetchNext(); - } - - // Notify possible wait()-ing enQueue()-ers - notifyAll(); - - // Return dequeued item - return events; - } - - public synchronized int getSize() { - return (rear >= front) ? (rear - front) : (capacity - front + rear); - } - - /** - * Is the queue empty ? - */ - public synchronized boolean isEmpty() { - return front == rear; - } - - /** - * Is the queue full ? - */ - public synchronized boolean isFull() { - return (next(rear) == front); - } - - /** - * Circular counter. - */ - private int next(int index) { - return (index + 1 < capacity ? index + 1 : 0); - } - - /** - * Circular counter. - */ - private Event fetchNext() { - Event temp = queue[front]; - queue[front] = null; - front = next(front); - return temp; - } - - public static void p(String s) { - System.out.println(s); - } - - public static void main(String[] args) { - EventQueue q = new EventQueue(8); - Event event = new Event("t"); - try { - q.enQueue(event); - p("(1) size = " + q.getSize()); - q.enQueue(event); - p("(2) size = " + q.getSize()); - q.deQueue(); - p("(1) size = " + q.getSize()); - q.deQueue(); - p("(0) size = " + q.getSize()); - - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - p("(3) size = " + q.getSize()); - q.deQueue(); - p("(2) size = " + q.getSize()); - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - p("(5) size = " + q.getSize()); - q.enQueue(event); - q.enQueue(event); - p("(7) size = " + q.getSize()); - q.deQueue(); - q.deQueue(); - q.deQueue(); - p("(4) size = " + q.getSize()); - q.deQueue(); - q.deQueue(); - q.deQueue(); - ; - q.deQueue(); - p("(0) size = " + q.getSize()); - - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - p("(5) size = " + q.getSize()); - - q.deQueue(); - q.deQueue(); - q.deQueue(); - ; - q.deQueue(); - p("(1) size = " + q.getSize()); - } catch (InterruptedException ie) { - } - } -} - -/* -* $Log: EventQueue.java,v $ -* Revision 1.3 2007/11/23 14:33:07 justb -* core classes now configurable through factory -* -* Revision 1.2 2005/02/21 11:50:46 justb -* ohase1 of refactoring Subscriber into Session/Controller/Subscriber -* -* Revision 1.1 2005/02/18 10:07:23 justb -* many renamings of classes (make names compact) -* -* Revision 1.6 2005/02/16 12:16:16 justb -* added support for "poll" mode -* -* Revision 1.5 2005/01/13 14:47:15 justb -* control evt: send response on same (control) connection -* -* Revision 1.4 2004/09/03 22:35:37 justb -* Almost complete rewrite, just checking in now -* -* Revision 1.3 2003/08/15 08:37:40 justb -* fix/add Copyright+LGPL file headers and footers -* -* -*/ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/EventSource.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/EventSource.java deleted file mode 100755 index 0975bde10e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/EventSource.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import javax.servlet.ServletContext; - -/** - * Abstract Event source from which Events are pulled. - * - * @version $Id: EventSource.java,v 1.7 2007/11/23 14:33:07 justb Exp $ - * @author Just van den Broecke - Just Objects © - **/ - -/** - * Interface for specifc Event(Pull/Push)Sources. - */ -public interface EventSource { - /** - * Activate the event source. - */ - public void activate(); - - /** - * Deactivate the event source. - */ - public void passivate(); - - /** - * Halt the event source. - */ - public void stop(); - - /** - * @author thomas genin - * gives access to the servlet context of pushlet to the source class - */ - public void setServletContext(ServletContext srvCtxt); - -} - -/* - * $Log: EventSource.java,v $ - * Revision 1.7 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.6 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.5 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.4 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.3 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/EventSourceManager.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/EventSourceManager.java deleted file mode 100755 index 119c95fb58..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/EventSourceManager.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.Sys; - -import java.util.Enumeration; -import java.util.Properties; -import java.util.Vector; -import java.io.File; - -import javax.servlet.ServletContext; - -/** - * Maintains lifecycle of event sources. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: EventSourceManager.java,v 1.14 2007/11/10 13:44:02 justb Exp $ - */ -public class EventSourceManager { - private static Vector eventSources = new Vector(0); - private static final String PROPERTIES_FILE = "sources.properties"; - - /** - * Initialize event sources from properties file. - */ - public static void start(String aDirPath,ServletContext srvCtxt) { - // Load Event sources using properties file. - Log.info("EventSourceManager: start"); - - Properties properties = null; - - try { - properties = Sys.loadPropertiesResource(PROPERTIES_FILE); - } catch (Throwable t) { - // Try from provided dir (e.g. WEB_INF/pushlet.properties) - String filePath = aDirPath + File.separator + PROPERTIES_FILE; - Log.info("EventSourceManager: cannot load " + PROPERTIES_FILE + " from classpath, will try from " + filePath); - - try { - properties = Sys.loadPropertiesFile(filePath); - } catch (Throwable t2) { - Log.fatal("EventSourceManager: cannot load properties file from " + filePath, t); - - // Give up - Log.warn("EventSourceManager: not starting local event sources (maybe that is what you want)"); - return; - } - } - - // Create event source collection - eventSources = new Vector(properties.size()); - - // Add the configured sources - for (Enumeration e = properties.keys(); e.hasMoreElements();) { - String nextKey = (String) e.nextElement(); - String nextClass = properties.getProperty(nextKey); - EventSource nextEventSource = null; - try { - nextEventSource = (EventSource) Class.forName(nextClass).newInstance(); - //rajout thomas genin - nextEventSource.setServletContext(srvCtxt); - ////////////////////// - Log.info("created EventSource: key=" + nextKey + " class=" + nextClass); - eventSources.addElement(nextEventSource); - - } catch (Exception ex) { - Log.warn("Cannot create EventSource: class=" + nextClass, ex); - } - } - - activate(); - } - - /** - * Activate all event sources. - */ - public static void activate() { - Log.info("Activating " + eventSources.size() + " EventSources"); - for (int i = 0; i < eventSources.size(); i++) { - ((EventSource) eventSources.elementAt(i)).activate(); - } - Log.info("EventSources activated"); - } - - /** - * Deactivate all event sources. - */ - public static void passivate() { - Log.info("Passivating " + eventSources.size() + " EventSources"); - for (int i = 0; i < eventSources.size(); i++) { - ((EventSource) eventSources.elementAt(i)).passivate(); - } - Log.info("EventSources passivated"); - } - - /** - * Halt event sources. - */ - public static void stop() { - Log.info("Stopping " + eventSources.size() + " EventSources..."); - for (int i = 0; i < eventSources.size(); i++) { - ((EventSource) eventSources.elementAt(i)).stop(); - } - Log.info("EventSources stopped"); - } - -} - -/* - * $Log: EventSourceManager.java,v $ - * Revision 1.14 2007/11/10 13:44:02 justb - * pushlet.properties and sources.properties can now also be put under WEB-INF - * - * Revision 1.13 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.12 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - * Revision 1.11 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.10 2005/02/15 13:29:49 justb - * use Sys.loadPropertiesResource() - * - * Revision 1.9 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.8 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.7 2004/08/15 16:00:15 justb - * enhancements to pull mode - * - * Revision 1.6 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.5 2004/08/12 13:18:54 justb - * cosmetic changes - * - * Revision 1.4 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.3 2003/08/12 09:41:35 justb - * replace static initalizer with explicit init() - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.5 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.4 2000/10/30 14:15:47 just - * no message - * - * Revision 1.3 2000/08/31 08:26:54 just - * Changed classloader that loads eventsources.properties to use EventSourceManager's classloader - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Protocol.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Protocol.java deleted file mode 100755 index 79c265f62f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Protocol.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) 2004 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - - -/** - * Constants for Pushlet protocols. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Protocol.java,v 1.15 2007/11/23 14:33:07 justb Exp $ - */ -public interface Protocol { - /** - * Default URI . - */ - public static final String DEFAULT_SERVLET_URI = "/pushlet/pushlet.srv"; - - // - // Common protocol header/parameter names - // - - /** - * Event type (join, leave, data, subscribe etc) . - */ - public static final String P_EVENT = "p_event"; - - /** - * Time in seconds since 1970 - */ - public static final String P_TIME = "p_time"; - - /** - * Event sequence number, numbers per-client. - */ - public static final String P_SEQ = "p_seq"; - - /** - * Subject (topic) of data event. - */ - public static final String P_SUBJECT = "p_subject"; - - /** - * Originator of Event. - */ - public static final String P_FROM = "p_from"; - - /** - * Addressee of Event, subject or client p_id. - */ - public static final String P_TO = "p_to"; - - /** - * Identifier for client instance within server. - */ - public static final String P_ID = "p_id"; - - /** - * Subscription id, identifies single subscription. - */ - public static final String P_SUBSCRIPTION_ID = "p_sid"; - - /** - * Format to receive events - */ - public static final String P_FORMAT = "p_format"; - - /** - * Protocol mode. - */ - public static final String P_MODE = "p_mode"; - - /** - * Reason for errors. - */ - public static final String P_REASON = "p_reason"; - - /** - * URL attribute. - */ - public static final String P_URL = "p_url"; - - /** - * Wait attribute. - */ - public static final String P_WAIT = "p_wait"; - - /** - * Subscription label, may be used to return user-specific - * token with a data event, e.g. the name of a function for a callback. - */ - public static final String P_SUBSCRIPTION_LABEL = "p_label"; - - // - // Event values with direction for P_EVENT (C=client, S=server) - // - - /** - * C-->S Request to join server. - */ - public static final String E_JOIN = "join"; - - /** - * S-->C Acknowledgement of join. - */ - public static final String E_JOIN_ACK = "join-ack"; - - /** - * C-->S Request to join server. - */ - public static final String E_JOIN_LISTEN = "join-listen"; - - /** - * S-->C Acknowledgement of join. - */ - public static final String E_JOIN_LISTEN_ACK = "join-listen-ack"; - - /** - * C-->S Client starts listening. - */ - public static final String E_LISTEN = "listen"; - - /** - * S-->C Ack of listen. - */ - public static final String E_LISTEN_ACK = "listen-ack"; - - /** - * C-->S Client leaves server. - */ - public static final String E_LEAVE = "leave"; - - /** - * S-->C Ack of leave. - */ - public static final String E_LEAVE_ACK = "leave-ack"; - - /** - * C-->S Publish to subject. - */ - public static final String E_PUBLISH = "publish"; - - /** - * S-->C Publish to subject acknowledge. - */ - public static final String E_PUBLISH_ACK = "publish-ack"; - - /** - * C-->S Subscribe to subject request. - */ - public static final String E_SUBSCRIBE = "subscribe"; - - /** - * S-->C Subscribe to subject acknowledge. - */ - public static final String E_SUBSCRIBE_ACK = "subscribe-ack"; - - /** - * C-->S Unsubscribe from subject request. - */ - public static final String E_UNSUBSCRIBE = "unsubscribe"; - - /** - * S--C Unsubscribe from subject acknowledge. - */ - public static final String E_UNSUBSCRIBE_ACK = "unsubscribe-ack"; - - /** - * S-->C Client error response, transitional error. - */ - public static final String E_NACK = "nack"; - - /** - * S-->C Client should abort, permanent error. - */ - public static final String E_ABORT = "abort"; - - /** - * S-->C Data. - */ - public static final String E_DATA = "data"; - - /** - * S-->C or C-->S Heartbeat. - */ - public static final String E_HEARTBEAT = "hb"; - - /** - * S-->C S-->C or C-->S Heartbeat confirmed. - */ - public static final String E_HEARTBEAT_ACK = "hb-ack"; - - /** - * S-->C or C-->S client refresh of data channel. - */ - public static final String E_REFRESH = "refresh"; - - /** - * S-->C client should refresh data channel. - */ - public static final String E_REFRESH_ACK = "refresh-ack"; - - // - // Values for P_FORMAT parameter - // - - /** - * JavaScript callback. - */ - public static String FORMAT_JAVASCRIPT = "js"; - - /** - * Java serialized object. - */ - public static String FORMAT_SERIALIZED_JAVA_OBJECT = "ser"; - - /** - * Stream of XML documents. - */ - public static String FORMAT_XML = "xml"; - - /** - * Single XML document containing zero or more events. - */ - public static String FORMAT_XML_STRICT = "xml-strict"; - - // - // Values for P_MODE parameter - // - public static final String MODE_STREAM = "stream"; - public static final String MODE_PULL = "pull"; - public static final String MODE_POLL = "poll"; - - // - // Values for special/reserved subjects - // TODO: use these to publish events when clients do these actions - // TODO: Dispatcher may intercept these subjects to send cached events - // - public static final String SUBJECT_META = "/meta"; - public static final String SUBJECT_META_SUBS = SUBJECT_META + "/subs"; - public static final String SUBJECT_META_JOINS = SUBJECT_META + "/joins"; - - -} - -/* - * $Log: Protocol.java,v $ - * Revision 1.15 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.14 2006/10/19 12:33:40 justb - * add atomic join-listen support (one request) - * - * Revision 1.13 2005/05/06 19:44:00 justb - * added xml-strict format - * - * Revision 1.12 2005/02/28 13:05:59 justb - * introduced join-listen protocol service - * - * Revision 1.11 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.10 2005/02/16 12:16:17 justb - * added support for "poll" mode - * - * Revision 1.9 2005/01/24 22:46:02 justb - * getting safari to work - * - * Revision 1.8 2005/01/24 13:42:00 justb - * new protocol changes (p_listen) - * - * Revision 1.7 2005/01/18 16:47:10 justb - * protocol changes for v2 and publishing from pushlet client - * - * Revision 1.6 2005/01/13 14:47:15 justb - * control evt: send response on same (control) connection - * - * Revision 1.5 2004/10/24 13:52:52 justb - * small fixes in client lib - * - * Revision 1.4 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.3 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.2 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.1 2004/09/03 21:02:20 justb - * make more formalized protocol - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/SerializedAdapter.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/SerializedAdapter.java deleted file mode 100755 index 501a6ba3ce..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/SerializedAdapter.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.ObjectOutputStream; - -/** - * Implementation of ClientAdapter that sends Events as serialized objects. - *

    - * NOTE: You are discouraged to use this adapter, since it is Java-only - * and may have JVM-specific problems. Far better choice is to use XML - * and the XMLAdapter. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: SerializedAdapter.java,v 1.4 2007/11/23 14:33:07 justb Exp $ - */ -class SerializedAdapter implements ClientAdapter { - private ObjectOutputStream out = null; - public static final String CONTENT_TYPE = "application/x-java-serialized-object"; - private HttpServletResponse servletRsp; - - /** - * Initialize. - */ - public SerializedAdapter(HttpServletResponse aServletResponse) { - servletRsp = aServletResponse; - } - - public void start() throws IOException { - - servletRsp.setContentType(CONTENT_TYPE); - - // Use a serialized object output stream - out = new ObjectOutputStream(servletRsp.getOutputStream()); - - // Don't need this further - servletRsp = null; - } - - /** - * Push Event to client. - */ - public void push(Event anEvent) throws IOException { - out.writeObject(anEvent); - - out.flush(); - } - - - public void stop() throws IOException { - } -} - -/* - * $Log: SerializedAdapter.java,v $ - * Revision 1.4 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.3 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.2 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.1 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.4 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.3 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:13:48 justb - * fixed blocking for java.net.URL with HTTP/1.1 (JVMs > 1.1) - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:18 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.5 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.4 2000/12/27 22:39:35 just - * no message - * - * Revision 1.3 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Session.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Session.java deleted file mode 100755 index 8adf9ba6f4..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Session.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.PushletException; - -/** - * Represents client pushlet session state. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Session.java,v 1.8 2007/11/23 14:33:07 justb Exp $ - */ -public class Session implements Protocol, ConfigDefs { - private Controller controller; - private Subscriber subscriber; - - private String userAgent; - private long LEASE_TIME_MILLIS = Config.getLongProperty(SESSION_TIMEOUT_MINS) * 60 * 1000; - private volatile long timeToLive = LEASE_TIME_MILLIS; - - public static String[] FORCED_PULL_AGENTS = Config.getProperty(LISTEN_FORCE_PULL_AGENTS).split(","); - - private String address = "unknown"; - private String format = FORMAT_XML; - - private String id; - - /** - * Protected constructor as we create through factory method. - */ - protected Session() { - } - - /** - * Create instance through factory method. - * - * @param anId a session id - * @return a Session object (or derived) - * @throws PushletException exception, usually misconfiguration - */ - public static Session create(String anId) throws PushletException { - Session session; - try { - session = (Session) Config.getClass(SESSION_CLASS, "nl.justobjects.pushlet.core.Session").newInstance(); - } catch (Throwable t) { - throw new PushletException("Cannot instantiate Session from config", t); - } - - // Init session - session.id = anId; - session.controller = Controller.create(session); - session.subscriber = Subscriber.create(session); - return session; - } - - /** - * Return (remote) Subscriber client's IP address. - */ - public String getAddress() { - return address; - } - - /** - * Return command controller. - */ - public Controller getController() { - return controller; - } - - /** - * Return Event format to send to client. - */ - public String getFormat() { - return format; - } - - /** - * Return (remote) Subscriber client's unique id. - */ - public String getId() { - return id; - } - - /** - * Return subscriber. - */ - public Subscriber getSubscriber() { - return subscriber; - } - - /** - * Return remote HTTP User-Agent. - */ - public String getUserAgent() { - return userAgent; - } - - /** - * Set address. - */ - protected void setAddress(String anAddress) { - address = anAddress; - } - - /** - * Set event format to encode. - */ - protected void setFormat(String aFormat) { - format = aFormat; - } - - /** - * Set client HTTP UserAgent. - */ - public void setUserAgent(String aUserAgent) { - userAgent = aUserAgent; - } - - /** - * Decrease time to live. - */ - public void age(long aDeltaMillis) { - timeToLive -= aDeltaMillis; - } - - /** - * Has session timed out? - */ - public boolean isExpired() { - return timeToLive <= 0; - } - - /** - * Keep alive by resetting TTL. - */ - public void kick() { - timeToLive = LEASE_TIME_MILLIS; - } - - public void start() { - SessionManager.getInstance().addSession(this); - } - - public void stop() { - subscriber.stop(); - SessionManager.getInstance().removeSession(this); - } - - /** - * Info. - */ - public void info(String s) { - Log.info("S-" + this + ": " + s); - } - - /** - * Exceptional print util. - */ - public void warn(String s) { - Log.warn("S-" + this + ": " + s); - } - - /** - * Exceptional print util. - */ - public void debug(String s) { - Log.debug("S-" + this + ": " + s); - } - - public String toString() { - return getAddress() + "[" + getId() + "]"; - } -} - -/* - * $Log: Session.java,v $ - * Revision 1.8 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.7 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * Revision 1.6 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.5 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.4 2005/02/25 15:13:01 justb - * session id generation more robust - * - * Revision 1.3 2005/02/21 16:59:08 justb - * SessionManager and session lease introduced - * - * Revision 1.2 2005/02/21 12:32:28 justb - * fixed publish event in Controller - * - * Revision 1.1 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/SessionManager.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/SessionManager.java deleted file mode 100755 index 7d3441dc7b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/SessionManager.java +++ /dev/null @@ -1,386 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Rand; -import nl.justobjects.pushlet.util.Sys; - -import java.rmi.server.UID; -import java.util.*; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; - -/** - * Manages lifecycle of Sessions. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: SessionManager.java,v 1.12 2007/12/04 13:55:53 justb Exp $ - */ -public class SessionManager implements ConfigDefs { - - /** - * Singleton pattern: single instance. - */ - private static SessionManager instance; - - static { - // Singleton + factory pattern: create single instance - // from configured class name - try { - instance = (SessionManager) Config.getClass(SESSION_MANAGER_CLASS, "nl.justobjects.pushlet.core.SessionManager").newInstance(); - Log.info("SessionManager created className=" + instance.getClass()); - } catch (Throwable t) { - Log.fatal("Cannot instantiate SessionManager from config", t); - } - } - - /** - * Timer to schedule session leasing TimerTasks. - */ - private Timer timer; - private final long TIMER_INTERVAL_MILLIS = 60000; - - /** - * Map of active sessions, keyed by their id, all access is through mutex. - */ - private Map sessions = new HashMap(13); - - /** - * Cache of Sessions for iteration and to allow concurrent modification. - */ - private Session[] sessionCache = new Session[0]; - - /** - * State of SessionCache, becomes true whenever sessionCache out of sync with sessions Map. - */ - private boolean sessionCacheDirty = false; - - /** - * Lock for any operation on Sessions (Session Map and/or -cache). - */ - private final Object mutex = new Object(); - - /** - * Singleton pattern: protected constructor needed for derived classes. - */ - protected SessionManager() { - } - - /** - * Visitor pattern implementation for Session iteration. - *

    - * This method can be used to iterate over all Sessions in a threadsafe way. - * See Dispatcher.multicast and broadcast methods for examples. - * - * @param visitor the object that should implement method parm - * @param method the method to be called from visitor - * @param args arguments to be passed in visit method, args[0] will always be Session object - */ - public void apply(Object visitor, Method method, Object[] args) { - - synchronized (mutex) { - - // Refresh Session cache if required - // We use a cache for two reasons: - // 1. to prevent concurrent modification from within visitor method - // 2. some optimization (vs setting up Iterator for each apply() - if (sessionCacheDirty) { - // Clear out existing cache - for (int i = 0; i < sessionCache.length; i++) { - sessionCache[i] = null; - } - - // Refill cache and update state - sessionCache = (Session[]) sessions.values().toArray(sessionCache); - sessionCacheDirty = false; - } - - // Valid session cache: loop and call supplied Visitor method - Session nextSession; - for (int i = 0; i < sessionCache.length; i++) { - nextSession = sessionCache[i]; - - // Session cache may not be entirely filled - if (nextSession == null) { - break; - } - - try { - // First argument is always a Session object - args[0] = nextSession; - - // Use Java reflection to call the method passed by the Visitor - method.invoke(visitor, args); - } catch (IllegalAccessException e) { - Log.warn("apply: illegal method access: ", e); - } catch (InvocationTargetException e) { - Log.warn("apply: method invoke: ", e); - } - } - } - } - - /** - * Create new Session (but add later). - */ - public Session createSession(Event anEvent) throws PushletException { - // Trivial - return Session.create(createSessionId()); - } - - - /** - * Singleton pattern: get single instance. - */ - public static SessionManager getInstance() { - return instance; - } - - /** - * Get Session by session id. - */ - public Session getSession(String anId) { - synchronized (mutex) { - return (Session) sessions.get(anId); - } - } - - /** - * Get copy of listening Sessions. - */ - public Session[] getSessions() { - synchronized (mutex) { - return (Session[]) sessions.values().toArray(new Session[0]); - } - } - - /** - * Get number of listening Sessions. - */ - public int getSessionCount() { - synchronized (mutex) { - return sessions.size(); - } - } - - /** - * Get status info. - */ - public String getStatus() { - Session[] sessions = getSessions(); - StringBuffer statusBuffer = new StringBuffer(); - statusBuffer.append("SessionMgr: " + sessions.length + " sessions \\n"); - for (int i = 0; i < sessions.length; i++) { - statusBuffer.append(sessions[i] + "\\n"); - } - return statusBuffer.toString(); - } - - /** - * Is Session present?. - */ - public boolean hasSession(String anId) { - synchronized (mutex) { - return sessions.containsKey(anId); - } - } - - /** - * Add session. - */ - public void addSession(Session session) { - synchronized (mutex) { - sessions.put(session.getId(), session); - sessionCacheDirty = true; - } - // log(session.getId() + " at " + session.getAddress() + " adding "); - info(session.getId() + " at " + session.getAddress() + " added "); - } - - /** - * Register session for removal. - */ - public Session removeSession(Session aSession) { - synchronized (mutex) { - Session session = (Session) sessions.remove(aSession.getId()); - if (session != null) { - info(session.getId() + " at " + session.getAddress() + " removed "); - } - sessionCacheDirty = true; - return session; - } - } - - - /** - * Starts us. - */ - public void start() throws PushletException { - if (timer != null) { - stop(); - } - timer = new Timer(false); - timer.schedule(new AgingTimerTask(), TIMER_INTERVAL_MILLIS, TIMER_INTERVAL_MILLIS); - info("started; interval=" + TIMER_INTERVAL_MILLIS + "ms"); - } - - /** - * Stopis us. - */ - public void stop() { - if (timer != null) { - timer.cancel(); - timer = null; - } - synchronized (mutex) { - sessions.clear(); - } - info("stopped"); - } - - /** - * Create unique Session id. - */ - protected String createSessionId() { - // Use UUID if specified in config (thanks Uli Romahn) - if (Config.hasProperty(SESSION_ID_GENERATION) && Config.getProperty(SESSION_ID_GENERATION).equals(SESSION_ID_GENERATION_UUID)) { - // We want to be Java 1.4 compatible so use UID class (1.5+ we may use java.util.UUID). - return new UID().toString(); - } - - // Other cases use random name - - // Create a unique session id - // In 99.9999 % of the cases this should be generated at once - // We need the mutext to prevent the chance of creating - // same-valued ids (thanks Uli Romahn) - synchronized (mutex) { - String id; - while (true) { - id = Rand.randomName(Config.getIntProperty(SESSION_ID_SIZE)); - if (!hasSession(id)) { - // Created unique session id - break; - } - } - return id; - } - } - - /** - * Util: stdout printing. - */ - protected void info(String s) { - Log.info("SessionManager: " + new Date() + " " + s); - } - - /** - * Util: stdout printing. - */ - protected void warn(String s) { - Log.warn("SessionManager: " + s); - } - - /** - * Util: stdout printing. - */ - protected void debug(String s) { - Log.debug("SessionManager: " + s); - } - - /** - * Manages Session timeouts. - */ - private class AgingTimerTask extends TimerTask { - private long lastRun = Sys.now(); - private long delta; - private Method visitMethod; - - public AgingTimerTask() throws PushletException { - try { - // Setup Visitor Methods for callback from SessionManager - Class[] argsClasses = {Session.class}; - visitMethod = this.getClass().getMethod("visit", argsClasses); - } catch (NoSuchMethodException e) { - throw new PushletException("Failed to setup AgingTimerTask", e); - } - } - - /** - * Clock tick callback from Timer. - */ - public void run() { - long now = Sys.now(); - delta = now - lastRun; - lastRun = now; - debug("AgingTimerTask: tick"); - - // Use Visitor pattern to loop through Session objects (see visit() below) - getInstance().apply(this, visitMethod, new Object[1]); - } - - /** - * Callback from SessionManager during apply() - */ - public void visit(Session aSession) { - try { - // Age the lease - aSession.age(delta); - debug("AgingTimerTask: visit: " + aSession); - - // Stop session if lease expired - if (aSession.isExpired()) { - info("AgingTimerTask: Session expired: " + aSession); - aSession.stop(); - } - } catch (Throwable t) { - warn("AgingTimerTask: Error in timer task : " + t); - } - } - } -} - -/* - * $Log: SessionManager.java,v $ - * Revision 1.12 2007/12/04 13:55:53 justb - * reimplement SessionManager concurrency (prev version was not thread-safe!) - * - * Revision 1.11 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.10 2007/11/10 14:47:45 justb - * make session key generation configurable (can use uuid) - * - * Revision 1.9 2007/11/10 14:17:18 justb - * minor cosmetic changes just commit now - * - * Revision 1.8 2007/07/02 08:12:16 justb - * redo to original version of session cache (with break, but nullify array first) - * - * Revision 1.7 2007/07/02 07:33:02 justb - * small fix in sessionmgr for holes in sessioncache array (continue i.s.o. break) - * - * Revision 1.6 2006/11/18 12:13:47 justb - * made SessionManager constructor protected to allow constructing derived classes - * - * Revision 1.5 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * Revision 1.4 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.3 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.2 2005/02/25 15:13:01 justb - * session id generation more robust - * - * Revision 1.1 2005/02/21 16:59:09 justb - * SessionManager and session lease introduced - * - - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Subscriber.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Subscriber.java deleted file mode 100755 index dca30b6bfd..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Subscriber.java +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Rand; -import nl.justobjects.pushlet.util.Sys; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.net.URLEncoder; - -/** - * Handles data channel between dispatcher and client. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Subscriber.java,v 1.26 2007/11/23 14:33:07 justb Exp $ - */ -public class Subscriber implements Protocol, ConfigDefs { - private Session session; - - /** - * Blocking queue. - */ - private EventQueue eventQueue = new EventQueue(Config.getIntProperty(QUEUE_SIZE)); - - /** - * URL to be used in refresh requests in pull/poll modes. - */ - private long queueReadTimeoutMillis = Config.getLongProperty(QUEUE_READ_TIMEOUT_MILLIS); - private long queueWriteTimeoutMillis = Config.getLongProperty(QUEUE_WRITE_TIMEOUT_MILLIS); - private long refreshTimeoutMillis = Config.getLongProperty(PULL_REFRESH_TIMEOUT_MILLIS); - volatile long lastAlive = Sys.now(); - - /** - * Map of active subscriptions, keyed by their subscription id. - */ - private Map subscriptions = Collections.synchronizedMap(new HashMap(3)); - - /** - * Are we able to accept/send events ?. - */ - private volatile boolean active; - - /** - * Transfer mode (stream, pull, poll). - */ - private String mode; - - - /** - * Protected constructor as we create through factory method. - */ - protected Subscriber() { - } - - /** - * Create instance through factory method. - * - * @param aSession the parent Session - * @return a Subscriber object (or derived) - * @throws PushletException exception, usually misconfiguration - */ - public static Subscriber create(Session aSession) throws PushletException { - Subscriber subscriber; - try { - subscriber = (Subscriber) Config.getClass(SUBSCRIBER_CLASS, "nl.justobjects.pushlet.core.Subscriber").newInstance(); - } catch (Throwable t) { - throw new PushletException("Cannot instantiate Subscriber from config", t); - } - - subscriber.session = aSession; - return subscriber; - } - - public void start() { - active = true; - } - - public void stop() { - removeSubscriptions(); - active = false; - } - - public void bailout() { - session.stop(); - } - - /** - * Are we still active to handle events. - */ - public boolean isActive() { - return active; - } - - /** - * Return client session. - */ - public Session getSession() { - return session; - } - - /** - * Get (session) id. - */ - public String getId() { - return session.getId(); - } - - /** - * Return subscriptions. - */ - public Subscription[] getSubscriptions() { - // todo: Optimize - return (Subscription[]) subscriptions.values().toArray(new Subscription[0]); - } - - /** - * Add a subscription. - */ - public Subscription addSubscription(String aSubject, String aLabel) throws PushletException { - Subscription subscription = Subscription.create(aSubject, aLabel); - subscriptions.put(subscription.getId(), subscription); - info("Subscription added subject=" + aSubject + " sid=" + subscription.getId() + " label=" + aLabel); - return subscription; - } - - /** - * Remove a subscription. - */ - public Subscription removeSubscription(String aSubscriptionId) { - Subscription subscription = (Subscription) subscriptions.remove(aSubscriptionId); - if (subscription == null) { - warn("No subscription found sid=" + aSubscriptionId); - return null; - } - info("Subscription removed subject=" + subscription.getSubject() + " sid=" + subscription.getId() + " label=" + subscription.getLabel()); - return subscription; - } - - /** - * Remove all subscriptions. - */ - public void removeSubscriptions() { - subscriptions.clear(); - } - - public String getMode() { - return mode; - } - - public void setMode(String aMode) { - mode = aMode; - } - - public long getRefreshTimeMillis() { - String minWaitProperty = PULL_REFRESH_WAIT_MIN_MILLIS; - String maxWaitProperty = PULL_REFRESH_WAIT_MAX_MILLIS; - if (mode.equals((MODE_POLL))) { - minWaitProperty = POLL_REFRESH_WAIT_MIN_MILLIS; - maxWaitProperty = POLL_REFRESH_WAIT_MAX_MILLIS; - - } - return Rand.randomLong(Config.getLongProperty(minWaitProperty), - Config.getLongProperty(maxWaitProperty)); - } - - /** - * Get events from queue and push to client. - */ - public void fetchEvents(Command aCommand) throws PushletException { - - String refreshURL = aCommand.httpReq.getRequestURI() + "?" + P_ID + "=" + session.getId() + "&" + P_EVENT + "=" + E_REFRESH; - - // This is the only thing required to support "poll" mode - if (mode.equals(MODE_POLL)) { - queueReadTimeoutMillis = 0; - refreshTimeoutMillis = Config.getLongProperty(POLL_REFRESH_TIMEOUT_MILLIS); - } - - // Required for fast bailout (tomcat) - aCommand.httpRsp.setBufferSize(128); - - // Try to prevent caching in any form. - aCommand.sendResponseHeaders(); - - // Let clientAdapter determine how to send event - ClientAdapter clientAdapter = aCommand.getClientAdapter(); - Event responseEvent = aCommand.getResponseEvent(); - try { - clientAdapter.start(); - - // Send first event (usually hb-ack or listen-ack) - clientAdapter.push(responseEvent); - - // In pull/poll mode and when response is listen-ack or join-listen-ack, - // return and force refresh immediately - // such that the client recieves response immediately over this channel. - // This is usually when loading the browser app for the first time - if ((mode.equals(MODE_POLL) || mode.equals(MODE_PULL)) - && responseEvent.getEventType().endsWith(Protocol.E_LISTEN_ACK)) { - sendRefresh(clientAdapter, refreshURL); - - // We should come back later with refresh event... - return; - } - } catch (Throwable t) { - bailout(); - return; - } - - - Event[] events = null; - - // Main loop: as long as connected, get events and push to client - long eventSeqNr = 1; - while (isActive()) { - // Indicate we are still alive - lastAlive = Sys.now(); - - // Update session time to live - session.kick(); - - // Get next events; blocks until timeout or entire contents - // of event queue is returned. Note that "poll" mode - // will return immediately when queue is empty. - try { - // Put heartbeat in queue when starting to listen in stream mode - // This speeds up the return of *_LISTEN_ACK - if (mode.equals(MODE_STREAM) && eventSeqNr == 1) { - eventQueue.enQueue(new Event(E_HEARTBEAT)); - } - - events = eventQueue.deQueueAll(queueReadTimeoutMillis); - } catch (InterruptedException ie) { - warn("interrupted"); - bailout(); - } - - // Send heartbeat when no events received - if (events == null) { - events = new Event[1]; - events[0] = new Event(E_HEARTBEAT); - } - - // ASSERT: one or more events available - - // Send events to client using adapter - // debug("received event count=" + events.length); - for (int i = 0; i < events.length; i++) { - // Check for abort event - if (events[i].getEventType().equals(E_ABORT)) { - warn("Aborting Subscriber"); - bailout(); - } - - // Push next Event to client - try { - // Set sequence number - events[i].setField(P_SEQ, eventSeqNr++); - - // Push to client through client adapter - clientAdapter.push(events[i]); - } catch (Throwable t) { - bailout(); - return; - } - } - - // Force client refresh request in pull or poll modes - if (mode.equals(MODE_PULL) || mode.equals(MODE_POLL)) { - sendRefresh(clientAdapter, refreshURL); - - // Always leave loop in pull/poll mode - break; - } - } - } - - /** - * Determine if we should receive event. - */ - public Subscription match(Event event) { - Subscription[] subscriptions = getSubscriptions(); - for (int i = 0; i < subscriptions.length; i++) { - if (subscriptions[i].match(event)) { - return subscriptions[i]; - } - } - return null; - } - - /** - * Event from Dispatcher: enqueue it. - */ - public void onEvent(Event theEvent) { - if (!isActive()) { - return; - } - - // p("send: queue event: "+theEvent.getSubject()); - - // Check if we had any active continuation for at - // least 'timeOut' millisecs. If the client has left this - // instance there would be no way of knowing otherwise. - long now = Sys.now(); - if (now - lastAlive > refreshTimeoutMillis) { - warn("not alive for at least: " + refreshTimeoutMillis + "ms, leaving..."); - bailout(); - return; - } - - // Put event in queue; leave if queue full - try { - if (!eventQueue.enQueue(theEvent, queueWriteTimeoutMillis)) { - warn("queue full, bailing out..."); - bailout(); - } - - // ASSERTION : Event in queue. - // see fetchEvents() where Events are dequeued and pushed to the client. - } catch (InterruptedException ie) { - bailout(); - } - - } - - /** - * Send refresh command to pull/poll clients. - */ - protected void sendRefresh(ClientAdapter aClientAdapter, String aRefreshURL) { - Event refreshEvent = new Event(E_REFRESH); - - // Set wait time and url for refresh - refreshEvent.setField(P_WAIT, "" + getRefreshTimeMillis()); - refreshEvent.setField(P_URL, aRefreshURL); - - try { - // Push to client through client adapter - aClientAdapter.push(refreshEvent); - - // Stop this round until refresh event - aClientAdapter.stop(); - } catch (Throwable t) { - // Leave on any exception - bailout(); - } - } - - /** - * Info. - */ - protected void info(String s) { - session.info("[Subscriber] " + s); - } - - /** - * Exceptional print util. - */ - protected void warn(String s) { - session.warn("[Subscriber] " + s); - } - - /** - * Exceptional print util. - */ - protected void debug(String s) { - session.debug("[Subscriber] " + s); - } - - - public String toString() { - return session.toString(); - } -} - -/* - * $Log: Subscriber.java,v $ - * Revision 1.26 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.25 2007/11/10 15:53:15 justb - * put heartbeat in queue when start fetching events in stream-mode - * - * Revision 1.24 2006/10/19 12:33:40 justb - * add atomic join-listen support (one request) - * - * Revision 1.22 2006/05/06 00:06:28 justb - * first rough version AJAX client - * - * Revision 1.21 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.20 2005/02/21 16:59:09 justb - * SessionManager and session lease introduced - * - * Revision 1.19 2005/02/21 12:32:28 justb - * fixed publish event in Controller - * - * Revision 1.18 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.17 2005/02/20 13:05:32 justb - * removed the Postlet (integrated in Pushlet protocol) - * - * Revision 1.16 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - * Revision 1.15 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.14 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.13 2005/02/16 14:39:34 justb - * fixed leave handling and added "poll" mode - * - * Revision 1.12 2005/01/24 13:42:00 justb - * new protocol changes (p_listen) - * - * Revision 1.11 2005/01/13 14:47:15 justb - * control evt: send response on same (control) connection - * - * Revision 1.10 2004/10/24 20:50:35 justb - * refine subscription with label and sending sid and label on events - * - * Revision 1.9 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.8 2004/09/26 21:39:43 justb - * allow multiple subscriptions and out-of-band requests - * - * Revision 1.7 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.6 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.5 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.4 2004/03/10 14:01:55 justb - * formatting and *Subscriber refactoring - * - * Revision 1.3 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:32 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:18 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:04 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Subscription.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Subscription.java deleted file mode 100755 index c6f88bd597..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/Subscription.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Rand; -import nl.justobjects.pushlet.util.PushletException; - - -/** - * Represents single subject subscription - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Subscription.java,v 1.5 2007/11/23 14:33:07 justb Exp $ - */ -public class Subscription implements ConfigDefs { - public static final int ID_SIZE = 5; - public static final String SUBJECT_SEPARATOR = ","; - private String id = Rand.randomName(ID_SIZE); - private String subject; - private String[] subjects; - - /** - * Optional label, a user supplied token. - */ - private String label; - - - /** - * Protected constructor as we create through factory method. - */ - protected Subscription() { - } - - /** - * Create instance through factory method. - * - * @param aSubject the subject (topic). - * @return a Subscription object (or derived) - * @throws nl.justobjects.pushlet.util.PushletException - * exception, usually misconfiguration - */ - public static Subscription create(String aSubject) throws PushletException { - return create(aSubject, null); - } - - /** - * Create instance through factory method. - * - * @param aSubject the subject (topic). - * @param aLabel the subject label (optional). - * @return a Subscription object (or derived) - * @throws nl.justobjects.pushlet.util.PushletException - * exception, usually misconfiguration - */ - public static Subscription create(String aSubject, String aLabel) throws PushletException { - if (aSubject == null || aSubject.length() == 0) { - throw new IllegalArgumentException("Null or emtpy subject"); - } - - Subscription subscription; - try { - subscription = (Subscription) Config.getClass(SUBSCRIPTION_CLASS, "nl.justobjects.pushlet.core.Subscription").newInstance(); - } catch (Throwable t) { - throw new PushletException("Cannot instantiate Subscriber from config", t); - } - - // Init - subscription.subject = aSubject; - - // We may subscribe to multiple subjects by separating - // them with SUBJECT_SEPARATOR, e.g. "/stocks/aex,/system/memory,.."). - subscription.subjects = aSubject.split(SUBJECT_SEPARATOR); - - subscription.label = aLabel; - return subscription; - } - - - public String getId() { - return id; - } - - public String getLabel() { - return label; - } - - public String getSubject() { - return subject; - } - - /** - * Determine if Event matches subscription. - */ - public boolean match(Event event) { - String eventSubject = event.getSubject(); - - // Silly case but check anyway - if (eventSubject == null || eventSubject.length() == 0) { - return false; - } - - // Test if one of the subjects matches - for (int i = 0; i < subjects.length; i++) { - if (eventSubject.startsWith(subjects[i])) { - return true; - } - } - - // No match - return false; - } -} - -/* - * $Log: Subscription.java,v $ - * Revision 1.5 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.4 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.3 2005/02/16 15:23:10 justb - * multiple subject (, separated) support - * - * Revision 1.2 2005/01/18 16:47:10 justb - * protocol changes for v2 and publishing from pushlet client - * - * Revision 1.1 2004/09/26 21:39:43 justb - * allow multiple subscriptions and out-of-band requests - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/XMLAdapter.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/XMLAdapter.java deleted file mode 100755 index 70a9c3c47d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/core/XMLAdapter.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * ClientAdapter that sends Events as XML. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: XMLAdapter.java,v 1.7 2007/11/09 13:15:35 justb Exp $ - */ -class XMLAdapter implements ClientAdapter { - /** - * Header for strict XML - */ - // public static final String XML_HEAD = "\n"; - private String contentType = "text/plain;charset=UTF-8"; - private ServletOutputStream out = null; - private HttpServletResponse servletRsp; - private boolean strictXML; - - /** - * Initialize. - */ - public XMLAdapter(HttpServletResponse aServletResponse) { - this(aServletResponse, false); - } - - /** - * Initialize. - */ - public XMLAdapter(HttpServletResponse aServletResponse, boolean useStrictXML) { - servletRsp = aServletResponse; - - // Strict XML implies returning a complete XML document - strictXML = useStrictXML; - if (strictXML) { - contentType = "text/xml;charset=UTF-8"; - } - } - - public void start() throws IOException { - - // If content type is plain text - // then this is not a complete XML document, but rather - // a stream of XML documents where each document is - // an Event. In strict XML mode a complete document is returned. - servletRsp.setContentType(contentType); - - out = servletRsp.getOutputStream(); - - // Don't need this further - servletRsp = null; - - // Start XML document if strict XML mode - if (strictXML) { - out.print(""); - } - } - - /** - * Force client to refresh the request. - */ - public void push(Event anEvent) throws IOException { - debug("event=" + anEvent); - - // Send the event as XML to the client and flush. - out.print(anEvent.toXML(strictXML)); - out.flush(); - } - - /** - * No action. - */ - public void stop() throws IOException { - // Close XML document if strict XML mode - if (strictXML) { - out.print(""); - out.flush(); - } - } - - private void debug(String s) { - Log.debug("[XMLAdapter]" + s); - } -} - -/* - * $Log: XMLAdapter.java,v $ - * Revision 1.7 2007/11/09 13:15:35 justb - * add charset=UTF-8 in returned HTTP content types - * - * Revision 1.6 2006/05/15 11:52:53 justb - * updates mainly for AJAX client - * - * Revision 1.5 2006/05/06 00:06:28 justb - * first rough version AJAX client - * - * Revision 1.4 2005/05/06 19:44:00 justb - * added xml-strict format - * - * Revision 1.3 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.2 2005/02/21 11:50:47 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.1 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.7 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.6 2004/03/10 14:01:55 justb - * formatting and *Subscriber refactoring - * - * Revision 1.5 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.4 2003/08/13 14:00:00 justb - * some testing for applets; no real change - * - * Revision 1.3 2003/08/12 09:57:06 justb - * replaced all print statements to Log.*() calls - * - * Revision 1.2 2003/05/19 21:56:29 justb - * various fixes for applet clients - * - * Revision 1.1 2003/05/18 16:12:28 justb - * adding support for XML encoded Events - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/servlet/Pushlet.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/servlet/Pushlet.java deleted file mode 100755 index 7d5b087a74..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/servlet/Pushlet.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.servlet; - -import nl.justobjects.pushlet.core.*; -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.Servlets; -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.Version; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.Enumeration; - -/** - * Servlet runs a Subscriber per request. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Pushlet.java,v 1.23 2007/12/04 13:55:53 justb Exp $ - */ -public class Pushlet extends HttpServlet implements Protocol { - - public void init() throws ServletException { - try { - System.out.println("initiating pushlet servlet..."); - // Load configuration (from classpath or WEB-INF root path) - String webInfPath = getServletContext().getRealPath("/") + "/WEB-INF"; - Config.load(webInfPath); - - Log.init(); - - // Start - Log.info("init() Pushlet Webapp - version=" + Version.SOFTWARE_VERSION + " built=" + Version.BUILD_DATE); - - // Start session manager - SessionManager.getInstance().start(); - - // Start event Dispatcher - Dispatcher.getInstance().start(); - - System.out.println("pushlet initiates event sources..."); - if (Config.getBoolProperty(Config.SOURCES_ACTIVATE)) { - EventSourceManager.start(webInfPath,getServletContext());// changed by thomas genin - } else { - Log.info("Not starting local event sources"); - } - } catch (Throwable t) { - throw new ServletException("Failed to initialize Pushlet framework " + t, t); - } - } - - public void destroy() { - Log.info("destroy(): Exit Pushlet webapp"); - - if (Config.getBoolProperty(Config.SOURCES_ACTIVATE)) { - // Stop local event sources - EventSourceManager.stop(); - } else { - Log.info("No local event sources to stop"); - } - - // Should abort all subscribers - Dispatcher.getInstance().stop(); - - // Should stop all sessions - SessionManager.getInstance().stop(); - } - - /** - * Servlet GET request: handles event requests. - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - Event event = null; - - try { - // Event parm identifies event type from the client - String eventType = Servlets.getParameter(request, P_EVENT); - - // Always must have an event type - if (eventType == null) { - Log.warn("Pushlet.doGet(): bad request, no event specified"); - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "No eventType specified"); - return; - } - - // Create Event and set attributes from parameters - event = new Event(eventType); - for (Enumeration e = request.getParameterNames(); e.hasMoreElements();) { - String nextAttribute = (String) e.nextElement(); - event.setField(nextAttribute, request.getParameter(nextAttribute)); - } - - - } catch (Throwable t) { - // Error creating event - Log.warn("Pushlet: Error creating event in doGet(): ", t); - response.setStatus(HttpServletResponse.SC_BAD_REQUEST); - return; - } - - // Handle parsed request - doRequest(event, request, response); - - } - - /** - * Servlet POST request: extracts event data from body. - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - Event event = null; - try { - // Create Event by parsing XML from input stream. - event = EventParser.parse(new InputStreamReader(request.getInputStream())); - - // Always must have an event type - if (event.getEventType() == null) { - Log.warn("Pushlet.doPost(): bad request, no event specified"); - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "No eventType specified"); - return; - } - - - } catch (Throwable t) { - // Error creating event - Log.warn("Pushlet: Error creating event in doPost(): ", t); - response.setStatus(HttpServletResponse.SC_BAD_REQUEST); - return; - } - - // Handle parsed request - doRequest(event, request, response); - - } - - /** - * Generic request handler (GET+POST). - */ - protected void doRequest(Event anEvent, HttpServletRequest request, HttpServletResponse response) { - // Must have valid event type. - String eventType = anEvent.getEventType(); - try { - - // Get Session: either by creating (on Join eventType) - // or by id (any other eventType, since client is supposed to have joined). - Session session = null; - if (eventType.startsWith(Protocol.E_JOIN)) { - // Join request: create new subscriber - session = SessionManager.getInstance().createSession(anEvent); - - String userAgent = request.getHeader("User-Agent"); - if (userAgent != null) { - userAgent = userAgent.toLowerCase(); - } else { - userAgent = "unknown"; - } - session.setUserAgent(userAgent); - - } else { - // Must be a request for existing Session - - // Get id - String id = anEvent.getField(P_ID); - - // We must have an id value - if (id == null) { - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "No id specified"); - Log.warn("Pushlet: bad request, no id specified event=" + eventType); - return; - } - - // We have an id: get the session object - session = SessionManager.getInstance().getSession(id); - - // Check for invalid id - if (session == null) { - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid or expired id: " + id); - Log.warn("Pushlet: bad request, no session found id=" + id + " event=" + eventType); - return; - } - } - - // ASSERTION: we have a valid Session - - // Let Controller handle request further - // including exceptions - Command command = Command.create(session, anEvent, request, response); - session.getController().doCommand(command); - } catch (Throwable t) { - // Hmm we should never ever get here - Log.warn("Pushlet: Exception in doRequest() event=" + eventType, t); - t.printStackTrace(); - response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); - } - - } -} - -/* - * $Log: Pushlet.java,v $ - * Revision 1.23 2007/12/04 13:55:53 justb - * reimplement SessionManager concurrency (prev version was not thread-safe!) - * - * Revision 1.22 2007/11/24 10:29:36 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.21 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.20 2007/11/10 13:44:02 justb - * pushlet.properties and sources.properties can now also be put under WEB-INF - * - * Revision 1.19 2006/05/15 11:52:53 justb - * updates mainly for AJAX client - * - * Revision 1.18 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * Revision 1.17 2005/02/28 13:06:01 justb - * introduced join-listen protocol service - * - * Revision 1.16 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.15 2005/02/28 09:14:56 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.14 2005/02/25 15:13:04 justb - * session id generation more robust - * - * Revision 1.13 2005/02/21 17:19:21 justb - * move init()/destroy() to Pushlet servlet - * - * Revision 1.12 2005/02/21 16:59:17 justb - * SessionManager and session lease introduced - * - * Revision 1.11 2005/02/21 11:50:47 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.10 2005/02/20 13:05:32 justb - * removed the Postlet (integrated in Pushlet protocol) - * - * Revision 1.9 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.8 2005/01/13 14:47:15 justb - * control evt: send response on same (control) connection - * - * Revision 1.7 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.6 2004/09/26 21:39:44 justb - * allow multiple subscriptions and out-of-band requests - * - * Revision 1.5 2004/09/20 22:01:40 justb - * more changes for new protocol - * - * Revision 1.4 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.3 2004/08/13 23:36:06 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.2 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.1 2003/08/13 13:26:57 justb - * moved all servlets to servlet package - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:32 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:18 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:04 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/DefaultLogger.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/DefaultLogger.java deleted file mode 100755 index bc0648c9a1..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/DefaultLogger.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -/** - * Default logger. - *

    - * Logs to stdout. Override this class by setting "logger.class" in pushlet.properties to your own logger - * to integrate your own logging library. - * - * @author Just van den Broecke - * @version $Id: DefaultLogger.java,v 1.2 2007/12/07 12:57:40 justb Exp $ - */ -public class DefaultLogger implements PushletLogger { - - - /** - * Level intialized with default. - */ - private int level = LOG_LEVEL_INFO; - - public DefaultLogger() { - } - - public void init() { - - } - - /** - * Log message for trace level. - * - * @param aMessage the message to be logged - */ - public void trace(String aMessage) { - if (level < LOG_LEVEL_TRACE) { - return; - } - print("TRACE", aMessage); - } - - /** - * Log message for debug level. - * - * @param aMessage the message to be logged - */ - public void debug(String aMessage) { - if (level < LOG_LEVEL_DEBUG) { - return; - } - print("DEBUG", aMessage); - } - - /** - * Log message for info level. - * - * @param aMessage the message to be logged - */ - public void info(String aMessage) { - if (level < LOG_LEVEL_INFO) { - return; - } - print("INFO", aMessage); - } - - /** - * Log message for warning level. - * - * @param aMessage the message to be logged - */ - public void warn(String aMessage) { - if (level < LOG_LEVEL_WARN) { - return; - } - print("WARN", aMessage); - } - - /** - * Log message for warning level with exception. - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void warn(String aMessage, Throwable aThrowable) { - warn(aMessage + " exception=" + aThrowable); - } - - /** - * Log message for error level. - * - * @param aMessage the message to be logged - */ - public void error(String aMessage) { - if (level < LOG_LEVEL_ERROR) { - return; - } - print("FATAL", aMessage); - } - - /** - * Log message (error level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void error(String aMessage, Throwable aThrowable) { - error(aMessage + " exception=" + aThrowable); - } - - /** - * Log message for fatal level. - * - * @param aMessage the message to be logged - */ - public void fatal(String aMessage) { - if (level < LOG_LEVEL_FATAL) { - return; - } - print("FATAL", aMessage); - } - - /** - * Log message (fatal level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void fatal(String aMessage, Throwable aThrowable) { - fatal(aMessage + " exception=" + aThrowable); - } - - /** - * Set log level - * - * @param aLevel the message to be logged - */ - public void setLevel(int aLevel) { - level = aLevel; - } - - /** - * Print message. - * - * @param aTag the log type - * @param aMessage the message to be logged - */ - private void print(String aTag, String aMessage) { - // SImple std out e.g. to catalina.out in Tomcat - System.out.println("Pushlet[" + aTag + "] " + aMessage); - } - -} - -/* -* $Log: DefaultLogger.java,v $ -* Revision 1.2 2007/12/07 12:57:40 justb -* added log4j and make it the default logging method -* -* Revision 1.1 2007/11/23 21:10:17 justb -* add hooks for custom logging (you can override DefaultLogger in pushlet.properties) -* -* -* -*/ \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Log.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Log.java deleted file mode 100755 index ee6bd254d4..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Log.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -import nl.justobjects.pushlet.core.Config; -import nl.justobjects.pushlet.core.ConfigDefs; - -/** - * Logging wrapper. - *

    - * Provides a hook to direct logging to your own logging library. Override the DefaultLogger class by setting - * "logger.class" in pushlet.properties to your own logger - * to integrate your own logging library. - * - * @author Just van den Broecke - * @version $Id: Log.java,v 1.5 2007/12/07 12:57:40 justb Exp $ - */ -public class Log implements ConfigDefs { - /** - * Init with default to have at least some logging. - */ - private static PushletLogger logger = new DefaultLogger(); - - /** - * General purpose initialization. - */ - static public void init() { - try { - logger = (PushletLogger) Config.getClass(LOGGER_CLASS, "nl.justobjects.pushlet.util.DefaultLogger").newInstance(); - } catch (Throwable t) { - // Hmmm cannot log this since we don't have a log... - System.out.println("Cannot instantiate Logger from config ex=" + t); - return; - } - - logger.init(); - - // Set log level - logger.setLevel(Config.getIntProperty(Config.LOG_LEVEL)); - - logger.info("Logging intialized logger class=" + logger.getClass()); - } - - /** - * Log message for trace level. - * - * @param aMessage the message to be logged - */ - static public void trace(String aMessage) { - logger.debug(aMessage); - } - - /** - * Log message for debug level. - * - * @param aMessage the message to be logged - */ - static public void debug(String aMessage) { - logger.debug(aMessage); - } - - /** - * Log message for info level. - * - * @param aMessage the message to be logged - */ - static public void info(String aMessage) { - logger.info(aMessage); - } - - /** - * Log message for warning level. - * - * @param aMessage the message to be logged - */ - static public void warn(String aMessage) { - logger.warn(aMessage); - } - - /** - * Log message for warning level with exception. - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - static public void warn(String aMessage, Throwable aThrowable) { - logger.warn(aMessage, aThrowable); - } - - /** - * Log message for error level. - * - * @param aMessage the message to be logged - */ - static public void error(String aMessage) { - logger.error(aMessage); - } - - /** - * Log message (error level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - static public void error(String aMessage, Throwable aThrowable) { - logger.error(aMessage, aThrowable); - } - - /** - * Log message for fatal level. - * - * @param aMessage the message to be logged - */ - static public void fatal(String aMessage) { - logger.fatal(aMessage); - } - - /** - * Log message (fatal level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - static public void fatal(String aMessage, Throwable aThrowable) { - logger.fatal(aMessage, aThrowable); - } - - /** - * Set log level - * - * @param aLevel the message to be logged - */ - static public void setLevel(int aLevel) { - logger.setLevel(aLevel); - } -} - -/* -* $Log: Log.java,v $ -* Revision 1.5 2007/12/07 12:57:40 justb -* added log4j and make it the default logging method -* -* Revision 1.4 2007/11/23 21:29:43 justb -* add hooks for custom logging (you can override DefaultLogger in pushlet.properties) -* -* Revision 1.3 2007/11/23 21:10:17 justb -* add hooks for custom logging (you can override DefaultLogger in pushlet.properties) -* -* Revision 1.2 2005/02/21 11:15:59 justb -* support log levels -* -* Revision 1.1 2005/02/18 10:07:23 justb -* many renamings of classes (make names compact) -* -* Revision 1.7 2004/09/03 22:35:37 justb -* Almost complete rewrite, just checking in now -* -* Revision 1.6 2004/08/12 13:16:08 justb -* make debug flag false -* -* Revision 1.5 2004/03/10 14:01:55 justb -* formatting and *Subscriber refactoring -* -* Revision 1.4 2003/08/15 09:54:46 justb -* fix javadoc warnings -* -* Revision 1.3 2003/08/15 08:37:40 justb -* fix/add Copyright+LGPL file headers and footers -* -* Revision 1.2 2003/08/12 09:42:47 justb -* enhancements -* -* Revision 1.1 2003/08/12 08:46:00 justb -* cvs comment tags added -* -* -*/ \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Log4jLogger.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Log4jLogger.java deleted file mode 100755 index ca96762621..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Log4jLogger.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -import org.apache.log4j.Level; -import org.apache.log4j.LogManager; -import org.apache.log4j.Logger; - -/** - * Logger to use Log4j for logging. - *

    - * Logs using Log4j. - * This class will require a log4j library in the classpath of the Pushlet. - * - * @author Uli Romahn - * @version $Id: Log4jLogger.java,v 1.1 2007/12/07 12:57:40 justb Exp $ - */ -public class Log4jLogger implements PushletLogger { - - /** - * Level intialized with default. - */ - private Logger logger = LogManager.getLogger("pushlet"); - - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#init() - */ - public void init() { - setLevel(LOG_LEVEL_INFO); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#debug(java.lang.String) - */ - public void debug(String aMessage) { - if (!logger.isDebugEnabled()) { - return; - } - logger.debug(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#error(java.lang.String) - */ - public void error(String aMessage) { - logger.error(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#error(java.lang.String, java.lang.Throwable) - */ - public void error(String aMessage, Throwable aThrowable) { - logger.error(aMessage, aThrowable); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#fatal(java.lang.String) - */ - public void fatal(String aMessage) { - logger.fatal(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#fatal(java.lang.String, java.lang.Throwable) - */ - public void fatal(String aMessage, Throwable aThrowable) { - logger.fatal(aMessage, aThrowable); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#info(java.lang.String) - */ - public void info(String aMessage) { - if (!logger.isInfoEnabled()) { - return; - } - logger.info(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#trace(java.lang.String) - */ - public void trace(String aMessage) { - logger.trace(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#warn(java.lang.String) - */ - public void warn(String aMessage) { - logger.warn(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#warn(java.lang.String, java.lang.Throwable) - */ - public void warn(String aMessage, Throwable aThrowable) { - logger.warn(aMessage, aThrowable); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#setLevel(int) - */ - public void setLevel(int aLevel) { - if (aLevel < LOG_LEVEL_FATAL) { - logger.setLevel(Level.OFF); - } else { - switch (aLevel) { - case LOG_LEVEL_FATAL: - logger.setLevel(Level.FATAL); - break; - case LOG_LEVEL_ERROR: - logger.setLevel(Level.ERROR); - break; - case LOG_LEVEL_WARN: - logger.setLevel(Level.WARN); - break; - case LOG_LEVEL_INFO: - logger.setLevel(Level.INFO); - break; - case LOG_LEVEL_DEBUG: - logger.setLevel(Level.DEBUG); - break; - case LOG_LEVEL_TRACE: - logger.setLevel(Level.TRACE); - break; - default: - logger.setLevel(Level.INFO); - } - } - } -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/PushletException.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/PushletException.java deleted file mode 100755 index 09ecd3176c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/PushletException.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -/** - * Generic exception wrapper. - * - * @author Just van den Broecke - * @version $Id: PushletException.java,v 1.1 2005/02/15 15:14:34 justb Exp $ - */ -public class PushletException extends Exception { - - private PushletException() { - } - - public PushletException(String aMessage, Throwable t) { - super(aMessage + "\n embedded exception=" + t.toString()); - } - - public PushletException(String aMessage) { - super(aMessage); - } - - public PushletException(Throwable t) { - this("PushletException: ", t); - } - - public String toString() { - return "PushletException: " + getMessage(); - } -} - -/* - * $Log: PushletException.java,v $ - * Revision 1.1 2005/02/15 15:14:34 justb - * *** empty log message *** - * - - * - */ \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/PushletLogger.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/PushletLogger.java deleted file mode 100755 index e70bc68703..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/PushletLogger.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -import nl.justobjects.pushlet.core.ConfigDefs; - -/** - * Logger interface to allow different logging providers. - *

    - * - * @author Ulrich Romahn - * @version $Id: PushletLogger.java,v 1.1 2007/12/07 12:57:40 justb Exp $ - */ -public interface PushletLogger extends ConfigDefs { - - /** - * Method allowing to initialize our logger - */ - public void init(); - - /** - * Log message for trace level. - * - * @param aMessage the message to be logged - */ - public void trace(String aMessage); - - /** - * Log message for debug level. - * - * @param aMessage the message to be logged - */ - public void debug(String aMessage); - - /** - * Log message for info level. - * - * @param aMessage the message to be logged - */ - public void info(String aMessage); - - /** - * Log message for warning level. - * - * @param aMessage the message to be logged - */ - public void warn(String aMessage); - - /** - * Log message for warning level with exception. - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void warn(String aMessage, Throwable aThrowable); - - /** - * Log message for error level. - * - * @param aMessage the message to be logged - */ - public void error(String aMessage); - - /** - * Log message (error level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void error(String aMessage, Throwable aThrowable); - - /** - * Log message for fatal level. - * - * @param aMessage the message to be logged - */ - public void fatal(String aMessage); - - /** - * Log message (fatal level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void fatal(String aMessage, Throwable aThrowable); - - /** - * Set log level - * - * @param aLevel a valid Level from ConfigDefs - */ - public void setLevel(int aLevel); -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Rand.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Rand.java deleted file mode 100755 index 041970941f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Rand.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. -package nl.justobjects.pushlet.util; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.PrintWriter; -import java.util.Random; - -/** - * Randomizing routines. - * - * @author Just van den Broecke - * @version $Id: Rand.java,v 1.4 2007/12/07 12:57:40 justb Exp $ - */ -public class Rand { - private static char CHARS[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'v', 'w', 'y', 'z'}; - private static char NON_VOWELS[] = {'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'z'}; - private static char VOWELS[] = {'a', 'e', 'i', 'o', 'u', 'y'}; - private static Random random = new Random(); - - public static char randomChar() { - return CHARS[randomInt(0, CHARS.length - 1)]; - } - - public static char randomVowel() { - return VOWELS[randomInt(0, VOWELS.length - 1)]; - } - - public static char randomNonVowel() { - return NON_VOWELS[randomInt(0, NON_VOWELS.length - 1)]; - } - - public static File randomTempDir() throws Exception { - File file = new File(System.getProperty("java.io.tmpdir") + File.separator + "oasetest" + File.separator + randomString(12)); - file.mkdirs(); - file.deleteOnExit(); - return file; - } - - public static File randomTempFile() throws Exception { - File file = new File(System.getProperty("java.io.tmpdir") + File.separator + "oase-" + randomString(6)); - file.createNewFile(); - file.deleteOnExit(); - return file; - } - - public static File randomBinaryFile(int aSize) throws Exception { - File file = randomTempFile(); - FileOutputStream fos = new FileOutputStream(file); - fos.write(randomBytes(aSize)); - fos.close(); - return file; - } - - public static File randomTextFile(int aSize) throws Exception { - File file = randomTempFile(); - PrintWriter pw = new PrintWriter(new FileOutputStream(file)); - pw.write(randomString(aSize)); - pw.close(); - return file; - } - - public static byte[] randomBytes(int aSize) { - return randomBlob(aSize); - } - - public static byte[] randomBlob(int aSize) { - byte[] retval = new byte[aSize]; - for (int i = 0; i < retval.length; i++) { - retval[i] = randomByte(); - } - return retval; - } - - public static byte randomByte() { - return (byte) random.nextInt(); - } - - public static double randomDouble() { - return random.nextLong(); - } - - - public static int randomInt() { - return random.nextInt(); - } - - public static int randomInt(int min, int max) { - return (int) ((Math.random() * (double) (max + 1 - min)) + min); - } - - public static long randomLong() { - return random.nextLong(); - } - - public static long randomLong(long min, long max) { - return (long) ((Math.random() * (double) (max + 1L - min)) + min); - } - - public static String randomName(int aLength) { - StringBuffer sb = new StringBuffer(aLength); - for (int i = 0; i < aLength; i++) { - sb.append(i % 2 == 0 ? randomNonVowel() : randomVowel()); - } - return sb.toString(); - } - - public static void randomSleep(long min, long max) { - try { - Thread.sleep(randomLong(min, max)); - } catch (InterruptedException ie) { - - } - } - - public static String randomString(int aLength) { - StringBuffer sb = new StringBuffer(aLength); - for (int i = 0; i < aLength; i++) { - sb.append(randomChar()); - } - return sb.toString(); - } - - public static String randomString() { - return "" + randomLong(); - } - - -} - -/* - * $Log: Rand.java,v $ - * Revision 1.4 2007/12/07 12:57:40 justb - * added log4j and make it the default logging method - * - * Revision 1.3 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.2 2004/09/03 22:35:38 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.1 2004/03/10 12:21:27 justb - * *** empty log message *** - * - * - */ \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Servlets.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Servlets.java deleted file mode 100755 index 3b0f20c89f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Servlets.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - - -/** - * Servlet utilities. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Servlets.java,v 1.2 2007/11/23 21:10:17 justb Exp $ - */ -public class Servlets { - - /** - * Get parameter; if not set or empty return null. - */ - public static String getParameter(HttpServletRequest aRequest, String aName) { - return getParameter(aRequest, aName, null); - } - - /** - * Get parameter; if not set or empty return specified default value. - */ - public static String getParameter(HttpServletRequest aRequest, String aName, String aDefault) { - String value = aRequest.getParameter(aName); - if (value == null || value.length() == 0) { - value = aDefault; - } - return value; - } - - /** - * Set HTTP headers to prevent caching. - */ - public static void setNoCacheHeaders(HttpServletResponse aResponse) { - // Set to expire far in the past. - aResponse.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT"); - - // Set standard HTTP/1.1 no-cache headers. - aResponse.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); - - // Set IE extended HTTP/1.1 no-cache headers (use addHeader). - aResponse.addHeader("Cache-Control", "post-check=0, pre-check=0"); - - // Set standard HTTP/1.0 no-cache header. - aResponse.setHeader("Pragma", "no-cache"); - - } - -} - -/* - * $Log: Servlets.java,v $ - * Revision 1.2 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.1 2004/09/20 22:01:40 justb - * more changes for new protocol - * - * - */ - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Sys.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Sys.java deleted file mode 100755 index 2b72ab55e1..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/nl/justobjects/pushlet/util/Sys.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - - -import java.io.FileInputStream; -import java.io.IOException; -import java.text.CharacterIterator; -import java.text.StringCharacterIterator; -import java.util.Properties; - -/** - * Utilities that interact with the underlying OS/JVM. - * - * @author Just van den Broecke - * @version $Id: Sys.java,v 1.4 2007/11/10 14:17:18 justb Exp $ - */ -public class Sys { - - /** - * Replace characters having special meaning inside HTML tags - * with their escaped equivalents, using character entities such as '&'. - *

    - *

    The escaped characters are : - *

      - *
    • < - *
    • > - *
    • " - *
    • ' - *
    • \ - *
    • & - *
    - *

    - *

    This method ensures that arbitrary text appearing inside a tag does not "confuse" - * the tag. For example, HREF='Blah.do?Page=1&Sort=ASC' - * does not comply with strict HTML because of the ampersand, and should be changed to - * HREF='Blah.do?Page=1&Sort=ASC'. This is commonly seen in building - * query strings. (In JSTL, the c:url tag performs this task automatically.) - */ - static public String forHTMLTag(String aTagFragment) { - final StringBuffer result = new StringBuffer(); - - final StringCharacterIterator iterator = new StringCharacterIterator(aTagFragment); - char character = iterator.current(); - while (character != CharacterIterator.DONE) { - if (character == '<') { - result.append("<"); - } else if (character == '>') { - result.append(">"); - } else if (character == '\"') { - result.append("""); - } else if (character == '\'') { - result.append("'"); - } else if (character == '\\') { - result.append("\"); - } else if (character == '&') { - result.append("&"); - } else { - //the char is not a special one - //add it to the result as is - result.append(character); - } - character = iterator.next(); - } - return result.toString(); - } - - /** - * Load properties file from classpath. - */ - static public Properties loadPropertiesResource(String aResourcePath) throws IOException { - try { - // Use the class loader that loaded our class. - // This is required where for reasons like security - // multiple class loaders exist, e.g. BEA WebLogic. - // Thanks to Lutz Lennemann 29-aug-2000. - ClassLoader classLoader = Sys.class.getClassLoader(); - - Properties properties = new Properties(); - - // Try loading it. - properties.load(classLoader.getResourceAsStream(aResourcePath)); - return properties; - } catch (Throwable t) { - throw new IOException("failed loading Properties resource from " + aResourcePath); - } - } - - /** - * Load properties file from file path. - */ - static public Properties loadPropertiesFile(String aFilePath) throws IOException { - try { - - Properties properties = new Properties(); - - // Try loading it. - properties.load(new FileInputStream(aFilePath)); - return properties; - } catch (Throwable t) { - throw new IOException("failed loading Properties file from " + aFilePath); - } - } - - /** - * Shorthand for current time. - */ - static public long now() { - return System.currentTimeMillis(); - } - -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/AES.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/AES.java deleted file mode 100755 index e7bde1e0a7..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/AES.java +++ /dev/null @@ -1,190 +0,0 @@ -package pow; - -import java.security.*; -import java.security.spec.InvalidKeySpecException; -import java.security.spec.InvalidParameterSpecException; -import java.security.spec.KeySpec; -//import java.security.spec.KeySpec; - -import javax.crypto.*; -import javax.crypto.spec.*; - -//import org.apache.commons.codec.binary.Hex; - -import java.io.*; - -/** -* implements AES encryption and decryption algorithms -* see @link http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html -* see @link http://stackoverflow.com/questions/992019/java-256bit-aes-encryption -*/ - -public class AES { - - private byte[] key; - private SecretKeySpec skeySpec; - private Cipher cipher_encrypt; - private Cipher cipher_decrypt; - // - /** - * construct a cipher with a generated 128 bits key - * @throws InvalidParameterSpecException - * @throws InvalidAlgorithmParameterException - * @throws NoSuchAlgorithmException - * @throws NoSuchPaddingException - */ - public AES() throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidParameterSpecException, InvalidAlgorithmParameterException { - // Get the KeyGenerator - KeyGenerator kgen = KeyGenerator.getInstance("AES"); - kgen.init(128); // 192 and 256 bits may not be available - // Generate the secret key specs. - SecretKey skey = kgen.generateKey(); - key = skey.getEncoded(); - skeySpec = new SecretKeySpec(key, "AES"); - cipher_encrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher_encrypt.init(Cipher.ENCRYPT_MODE, skeySpec); - byte[] iv = cipher_encrypt.getParameters().getParameterSpec(IvParameterSpec.class).getIV(); - cipher_decrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher_decrypt.init(Cipher.DECRYPT_MODE, skeySpec,new IvParameterSpec(iv)); - } - /** - * construct a cipher from an user specified key - * @param password a string representing the user key - * @throws NoSuchAlgorithmException - * @throws NoSuchPaddingException - * @throws InvalidKeyException - * @throws InvalidParameterSpecException - * @throws InvalidAlgorithmParameterException - * @throws InvalidKeySpecException - */ - public AES(String password) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidParameterSpecException, InvalidAlgorithmParameterException, InvalidKeySpecException { - // autre facon de generer la cle - SecureRandom random = new SecureRandom(); - byte salt[] = new byte[8]; - random.nextBytes(salt); - - SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); - KeySpec spec = new PBEKeySpec(password.toCharArray(), salt, 1024, 256); - SecretKey tmp = factory.generateSecret(spec); - SecretKey skey = new SecretKeySpec(tmp.getEncoded(), "AES"); - // - key = skey.getEncoded(); - skeySpec = new SecretKeySpec(key, "AES"); - cipher_encrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher_encrypt.init(Cipher.ENCRYPT_MODE, skeySpec); - byte[] iv = cipher_encrypt.getParameters().getParameterSpec(IvParameterSpec.class).getIV(); - cipher_decrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher_decrypt.init(Cipher.DECRYPT_MODE, skeySpec,new IvParameterSpec(iv)); - } - /** - * construct a cipher from a key and a parameter array - * usefull to create a remote decryption cypher - * @param key the key in array byte format - * @param iv parameter of the cipher - * @throws InvalidKeyException - * @throws InvalidAlgorithmParameterException - * @throws NoSuchAlgorithmException - * @throws NoSuchPaddingException - */ - public AES(byte[] key,byte[] iv) throws InvalidKeyException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchPaddingException{ - skeySpec = new SecretKeySpec(key, "AES"); - key = skeySpec.getEncoded(); - cipher_encrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher_encrypt.init(Cipher.ENCRYPT_MODE, skeySpec,new IvParameterSpec(iv)); - cipher_decrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher_decrypt.init(Cipher.DECRYPT_MODE, skeySpec, new IvParameterSpec(iv)); - } - /** - * get the init parameter of the cipher object in order to initialyse correctly a - * remote cipher - */ - public byte[] getParamsEncrypt() throws InvalidParameterSpecException{ - AlgorithmParameters params = cipher_encrypt.getParameters(); - byte[] iv = params.getParameterSpec(IvParameterSpec.class).getIV(); - return iv; - } - /** - * get the cipher key - * @return the cipher key in byte array - */ - public byte[] getKey(){return key;} - -/** - * encrypt a byte array with AES algorithm - * @see org.apache.commons.codec.binary.Hex to convert byte Array into hexString - * @param msg - * @return a byte array containing the ciphered data - * @throws IOException - * @throws BadPaddingException - * @throws IllegalBlockSizeException - */ - public byte[] encrypt(byte[] msg) throws IOException, IllegalBlockSizeException, BadPaddingException{ - ByteArrayInputStream in= new ByteArrayInputStream(msg); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - crypt(in, out, cipher_encrypt); - return out.toByteArray(); - } - /** - * decrypt a byte array with AES algorithm - * see @link org.apache.commons.codec.binary.Hex to convert byte Array into hexString - * @param msg the msg to decrypt - * @return the message decrypted - * @throws IOException - * @throws BadPaddingException - * @throws IllegalBlockSizeException - */ - public byte[] decrypt(byte[] msg) throws IOException, IllegalBlockSizeException, BadPaddingException{ - ByteArrayInputStream in= new ByteArrayInputStream(msg); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - crypt(in, out, cipher_decrypt); - return out.toByteArray(); - } - /** - * Crypts or decrypts the specified input stream to the specified output - * stream with a given cipher. The crypting or decrypting operation is - * determined by the cipher's state. - * @param cipher The cipher used to crypt the specified input stream to the specified output - * stream. - * @param in the input srteal stream to be encypted or decrypted. - * @param out the output stream to be encypted or decrypted. - * @throws java.io.IOException if an I/O error occurs during crypting the input stream to the output stream. - * @throws BadPaddingException - * @throws IllegalBlockSizeException - */ - private void crypt(InputStream in, OutputStream out, Cipher cipher) - throws IOException, IllegalBlockSizeException, BadPaddingException - { - int blockSize = cipher.getBlockSize(); - int outputSize = cipher.getOutputSize(blockSize); - byte[] inBytes = new byte[blockSize]; - byte[] outBytes = new byte[outputSize]; - - int inLength = 0; - boolean done = false; - while(!done) - { - inLength = in.read(inBytes); - if(inLength == blockSize) - { - try - { - int outLength = cipher.update(inBytes, 0, blockSize, outBytes); - out.write(outBytes, 0, outLength); - } - catch(ShortBufferException e) - { - e.printStackTrace(); - } - } - else - done = true; - } - - if(inLength > 0) - outBytes = cipher.doFinal(inBytes, 0, inLength); - else - outBytes = cipher.doFinal(); - out.write(outBytes); - - } -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/InstallCert.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/InstallCert.java deleted file mode 100755 index ed3349203f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/InstallCert.java +++ /dev/null @@ -1,193 +0,0 @@ -package pow; -/* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of Sun Microsystems nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/** - * @see http://blogs.sun.com/gc/entry/unable_to_find_valid_certification - */ -import java.io.*; - -import java.security.*; -import java.security.cert.*; - -import javax.net.ssl.*; -/** - * - * query the server about its certificate and create a 'jssecacerts' file to copy - * into /usr/lib/jvm/java-x-x/jre/lib/security - * allow a java http client to connect to https server - */ -public class InstallCert { - - public static void main(String[] args) throws Exception { - String host; - int port; - char[] passphrase; - if ((args.length == 1) || (args.length == 2)) { - String[] c = args[0].split(":"); - host = c[0]; - port = (c.length == 1) ? 443 : Integer.parseInt(c[1]); - String p = (args.length == 1) ? "changeit" : args[1]; - passphrase = p.toCharArray(); - } else { - System.out.println("Usage: java InstallCert [:port] [passphrase]"); - return; - } - - File file = new File("jssecacerts"); - if (file.isFile() == false) { - char SEP = File.separatorChar; - File dir = new File(System.getProperty("java.home") + SEP - + "lib" + SEP + "security"); - file = new File(dir, "jssecacerts"); - if (file.isFile() == false) { - file = new File(dir, "cacerts"); - } - } - System.out.println("Loading KeyStore " + file + "..."); - InputStream in = new FileInputStream(file); - KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); - ks.load(in, passphrase); - in.close(); - - SSLContext context = SSLContext.getInstance("TLS"); - TrustManagerFactory tmf = - TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - tmf.init(ks); - X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0]; - SavingTrustManager tm = new SavingTrustManager(defaultTrustManager); - context.init(null, new TrustManager[] {tm}, null); - SSLSocketFactory factory = context.getSocketFactory(); - - System.out.println("Opening connection to " + host + ":" + port + "..."); - SSLSocket socket = (SSLSocket)factory.createSocket(host, port); - socket.setSoTimeout(10000); - try { - System.out.println("Starting SSL handshake..."); - socket.startHandshake(); - socket.close(); - System.out.println(); - System.out.println("No errors, certificate is already trusted"); - } catch (SSLException e) { - System.out.println(); - e.printStackTrace(System.out); - } - - X509Certificate[] chain = tm.chain; - if (chain == null) { - System.out.println("Could not obtain server certificate chain"); - return; - } - - BufferedReader reader = - new BufferedReader(new InputStreamReader(System.in)); - - System.out.println(); - System.out.println("Server sent " + chain.length + " certificate(s):"); - System.out.println(); - MessageDigest sha1 = MessageDigest.getInstance("SHA1"); - MessageDigest md5 = MessageDigest.getInstance("MD5"); - for (int i = 0; i < chain.length; i++) { - X509Certificate cert = chain[i]; - System.out.println - (" " + (i + 1) + " Subject " + cert.getSubjectDN()); - System.out.println(" Issuer " + cert.getIssuerDN()); - sha1.update(cert.getEncoded()); - System.out.println(" sha1 " + toHexString(sha1.digest())); - md5.update(cert.getEncoded()); - System.out.println(" md5 " + toHexString(md5.digest())); - System.out.println(); - } - - System.out.println("Enter certificate to add to trusted keystore or 'q' to quit: [1]"); - String line = reader.readLine().trim(); - int k; - try { - k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1; - } catch (NumberFormatException e) { - System.out.println("KeyStore not changed"); - return; - } - - X509Certificate cert = chain[k]; - String alias = host + "-" + (k + 1); - ks.setCertificateEntry(alias, cert); - - OutputStream out = new FileOutputStream("jssecacerts"); - ks.store(out, passphrase); - out.close(); - - System.out.println(); - System.out.println(cert); - System.out.println(); - System.out.println - ("Added certificate to keystore 'jssecacerts' using alias '" - + alias + "'"); - } - - private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray(); - - private static String toHexString(byte[] bytes) { - StringBuilder sb = new StringBuilder(bytes.length * 3); - for (int b : bytes) { - b &= 0xff; - sb.append(HEXDIGITS[b >> 4]); - sb.append(HEXDIGITS[b & 15]); - sb.append(' '); - } - return sb.toString(); - } - - private static class SavingTrustManager implements X509TrustManager { - - private final X509TrustManager tm; - private X509Certificate[] chain; - - SavingTrustManager(X509TrustManager tm) { - this.tm = tm; - } - - public X509Certificate[] getAcceptedIssuers() { - throw new UnsupportedOperationException(); - } - - public void checkClientTrusted(X509Certificate[] chain, String authType) - throws CertificateException { - throw new UnsupportedOperationException(); - } - - public void checkServerTrusted(X509Certificate[] chain, String authType) - throws CertificateException { - this.chain = chain; - tm.checkServerTrusted(chain, authType); - } - } - -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/AcNetId.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/AcNetId.java deleted file mode 100755 index 28f7ac4c9d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/AcNetId.java +++ /dev/null @@ -1,118 +0,0 @@ -package pow.ivyclient; -/** - * this object represents the data concerning a drone extracted from Ivy - * A drone has two identities. One on its ivy drone which can be the same as - * another drone on a different ivy bus. The second identifier is the I.D. of the drone - * on the web. This I.D. is unique. So a link has to be done between these two kind of id. - * @author genin - */ -public class AcNetId { - private int idOfBusIvy; - private String idOnIvy; - private String nameOnIvy; - private String idOnWeb; - private String flightplan_path; - private String setting_path; - private String color; - private int maxAircrafts; /// - /** - * - * @param idBusIvy the id of the ivy bus - * @param idIvy the identifier of the drone on ivy - * @param n the name of the ivy drone (MJ5,TJ1...) - * @param pln the full pathname of the configuration file FlightPlan.xml - * @param s the full pathname of the configuration file Settings.xml - * @param c the color of the drone on ivy (in hexa '#FF00FF' or with its common name 'red') - * @param maxACOnIvy the maximal number of aircrafts on ivy bus (is no important anymore) - */ - public AcNetId(int idBusIvy,String idIvy,String n,String pln,String s,String c,int maxACOnIvy){ - idOfBusIvy= idBusIvy; - idOnIvy=idIvy; - nameOnIvy=n; - flightplan_path = pln; - setting_path= s; - color = c; - maxAircrafts = maxACOnIvy; - idOnWeb = generateIdOnWeb(); - - } - /** - * - * @param idBusIvy the id of the ivy bus - * @param droneWebId the identifier of the drone on the web - * @param idIvy the identifier of the drone on ivy - * @param n the name of the ivy drone (MJ5,TJ1...) - * @param pln the full pathname of the configuration file FlightPlan.xml - * @param s the full pathname of the configuration file Settings.xml - * @param c the color of the drone on ivy (in hexa '#FF00FF' or with its common name 'red') - * @param maxACOnIvy the maximal number of aircrafts on ivy bus (is no important anymore) - */ - public AcNetId(int idBusIvy,String droneWebId,String idIvy,String n,String pln,String s,String c,int maxACOnIvy){ - idOfBusIvy= idBusIvy; - idOnIvy=idIvy; - nameOnIvy=n; - flightplan_path = pln; - setting_path= s; - color = c; - maxAircrafts = maxACOnIvy; - idOnWeb = droneWebId; - - } - /** - * provides the id of the drone on the ivy bus - * @return the id number of the drone on its ivy bus - */ - public String getIdOnIvy() {return idOnIvy;} - /** - * provides the name of the drone on the ivy bus - * @return the name of the drone on its ivy bus - */ - public String getName() {return nameOnIvy;} - /** - * provides the id of the drone on the web - * @return the single id number of the drone on the web server - */ - public String getIdOnWeb() {return idOnWeb;} - /** - * provides the path of the xml file (on the server) containing - * the information of the flightplan of the drone - * (waypoints and blocks of instructions) - * @return the full path of the flight plan config file on the GCS station - */ - public String getPlnPath() {return flightplan_path;} - /** - * provides the path of the xml file (on the server) containing the settings - * of the drone - * @return the full path of the settings file on the GCS station - */ - public String getSettingPath() {return setting_path;} - /** - * provides the color of the drone on the GCS view - * @return the color of the drone on the GCS station (either in string or in hexadecimal) - */ - public String getColor() {return color;} - /** - * generate a unique id for the drone on the web - * @deprecated the id is now sent by the server - * @return the id of the drone on the server - */ - private String generateIdOnWeb() { - //String newId = "" + (Integer.parseInt(idOnIvy) * ((int)Math.pow(maxAircrafts,idOfBusIvy))); - String newId = "" + (Integer.parseInt(idOnIvy) +maxAircrafts*idOfBusIvy*10); - System.out.println("### new Id generated : " + newId + " ###"); - return newId; - } - /** - * return information about the drone in a string format - * @return a string containing information about the drone - */ - public String toString(){ - return "id on ivy :\t" + idOnIvy + - "\nname :\t" + nameOnIvy + - "\nid on web :\t" + idOnWeb + - "\nfpl file :\t" + flightplan_path + - "\nsetting file :\t" + setting_path + - "\ncolor :\t" + color ; - } - -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/AcNetIdStorage.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/AcNetIdStorage.java deleted file mode 100755 index 4c1963f773..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/AcNetIdStorage.java +++ /dev/null @@ -1,309 +0,0 @@ -package pow.ivyclient; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.StringReader; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.concurrent.ConcurrentHashMap; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpException; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.httpclient.methods.PostMethod; -import org.apache.commons.httpclient.methods.multipart.FilePart; -import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity; -import org.apache.commons.httpclient.methods.multipart.Part; -import org.apache.commons.httpclient.methods.multipart.StringPart; -import org.apache.commons.httpclient.protocol.Protocol; -import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; - -import pow.webserver.StrictSSLProtocolSocketFactory; - -import fr.dgac.ivy.*; -/** - * this structure memorize all the drone which exist on the ivy bus. - * A drone has two identities. One on its ivy drone which can be the same as - * another drone on a different ivy bus. The second identifier is the I.D. of the drone - * on the web. This I.D. is unique. So a link has to be done between these two kind of id. - * @author genin - */ -public class AcNetIdStorage { - - private int ivyWebId; - private Ivy bus; - String url; // @server to upload - private HashMap acNetIdMap; - ConcurrentHashMap dronesStates; - private int maxAircrafts; - - public AcNetIdStorage(int ii,Ivy b,String u,int maxAC, ConcurrentHashMap states ){ - bus = b; - ivyWebId=ii; - acNetIdMap= new HashMap(); - url = u; - maxAircrafts = maxAC; - dronesStates = states; - } - /** - * Return the identity object of the drone on the web - * @param idOnIvy - * @return the identity of the drone on the web or null if it is not present - */ - public AcNetId getAcNetId(String idOnIvy) - { - return acNetIdMap.get(idOnIvy); - } - /** - * do the link between the id of the drone on the web and is true id on its ivy bus - * @param idOnWeb the id of the drone on the web - * @return the id of the drone on the ivy bus - */ - public String getAcIvyId(int idOnWeb) - { String res = null; - boolean doIt = true; - Collection col = acNetIdMap.values(); - Iterator it = col.iterator(); - while(it.hasNext()&& doIt) - { - AcNetId ac=it.next(); - if (Integer.parseInt(ac.getIdOnWeb())==idOnWeb){ doIt=false; res = ac.getIdOnIvy();} - } - return res; - } - /** - * search the drone net id of a drone from its ivy id - * if the drone is a new one, a new net id is requested to the server - * @param s the ivy id of the drone - */ - public void seekAcNetId(String s) { - String droneWebId; - AcNetId res = acNetIdMap.get(s); - if (res==null){ - try { - AcStatus acs = dronesStates.get(s); - if (acs==AcStatus.UNKNOWN) - { - dronesStates.replace(s,AcStatus.ASKING_WEB_ID); - droneWebId = getNewDroneWebId(s); - dronesStates.replace(s,AcStatus.WEB_ID_RECEIVED); - // send a message on ivy and wait the server - // answer to get the configuration data and create a acNetId object - String rqst_id = bus.getWBUId(); - String msgSend2Ivy = ivyWebId + " " + rqst_id + " CONFIG_REQ " + s + ""; - String msgtoBind= rqst_id +" (.*) CONFIG (.*) file://(.*) file://(.*) file://(.*) file://(.*) (.*) (.*)"; - try { - bus.bindMsgOnce(msgtoBind, new myListener(droneWebId)); - try { - dronesStates.replace(s,AcStatus.ASKING_IVY_CONF); - bus.sendMsg(msgSend2Ivy); - } catch (IvyException e) { - e.printStackTrace(); - System.out.println("### IvyException : can't send request msg ###"); - } - } catch (IvyException e) { - e.printStackTrace(); - } - } - } catch (IvyConnectionExeption e) { - System.out.println("### ERREUR on WEBID REQUEST for drone " +s+" ###"); - e.printStackTrace(); - } - } - } - - - /** - * upload de fichier de conf sur le serveur - * verifier que ca marche sur long fichier - * si probleme changer avec : - * factory.setSizeThreshold(yourMaxMemorySize); - * factory.setRepository(yourTempDirectory); - * upload.setSizeMax(yourMaxRequestSize); - * @param ac the information object about the drone - * @throws InterruptedException - * @throws FileNotFoundException - */ - - public boolean uploadConfFile(AcNetId ac) throws FileNotFoundException { - boolean res=false ; - String pathFPL = ac.getPlnPath(); - String pathSetting = ac.getSettingPath(); - String droneWebId = ac.getIdOnWeb(); - File f1 = new File(pathFPL); - File f2 = new File(pathSetting); - FilePart fp1 = new FilePart(f1.getName(), f1); - FilePart fp2 = new FilePart(f2.getName(), f2); - PostMethod filePost = new PostMethod(url); - Part[] parts = { - new StringPart("order", "uploadConfFile"), - new StringPart("ivyWebId", ""+ivyWebId), - new StringPart("droneWebId", ""+droneWebId), - fp1, - fp2 - }; - filePost.setRequestEntity( - new MultipartRequestEntity(parts, filePost.getParams()) - ); - //filePost.addParameter("requestWebId", ""+webId); - HttpClient client = new HttpClient(); - // useless ? - Protocol stricthttps = new Protocol("https", (ProtocolSocketFactory)new StrictSSLProtocolSocketFactory(true), 443); - client.getHostConfiguration().setHost("localhost", 443, stricthttps); - // - try { - int status = client.executeMethod(filePost); - System.out.println("reponse de la methode post uploading " + HttpStatus.getStatusText(status)); - if (status != HttpStatus.SC_OK) { - System.err.println("Method failed: "); - } - else{ - String responseBody = filePost.getResponseBodyAsString(); - try{ - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document document = parser.parse(new InputSource(new StringReader(responseBody))); - Element ack_node = (Element)document.getElementsByTagName("UploadAck").item(0); - int ack = Integer.parseInt(ack_node.getTextContent()); - if (ack==1){ - System.out.println("uploading ok for " +ack_node.getAttribute("iddrone")); - res = true; - } - else{ - System.out.println("uploading notok for " +ack_node.getAttribute("iddrone")); - res = false; - } - } - catch(Exception e){ - System.err.println("error during the parsing of xml response to a upload request"); - e.printStackTrace(); - } - - } - } catch (HttpException e) { - System.err.println("HttpException : echec execution requete post : uploading"); - e.printStackTrace(); - } catch (IOException e) { - System.err.println("IOException : echec execution requete post : uploading"); - e.printStackTrace(); - } finally { - // Release the connection. - filePost.releaseConnection(); - } - return res; - } - /** - * ask a unique new web id to the server for a new drone detected on the ivy bus - * @param IvyDroneId the drone id on ivy - * @return the new web drone id - * @throws IvyConnectionExeption - */ - public String getNewDroneWebId(String IvyDroneId) throws IvyConnectionExeption - { - String newDroneId = "#errorWebID#"; - int statusCode=-1; - HttpClient client = new HttpClient(); - client.getParams().setParameter("http.useragent", "Ivy request"); - // inutile mais bon pour 1 connection de temps en temps... - Protocol stricthttps = new Protocol("https", (ProtocolSocketFactory)new StrictSSLProtocolSocketFactory(true), 443); - client.getHostConfiguration().setHost("localhost", 443, stricthttps); - // - PostMethod method = new PostMethod(url); - method.addParameter("order", "requestNewDroneWebId"); - method.addParameter("ivyWebId", ""+ivyWebId); - try { - statusCode = client.executeMethod(method); - if (statusCode != HttpStatus.SC_OK) { - System.err.println("Method failed: " + method.getStatusLine()); - } - else - { - String responseBody = method.getResponseBodyAsString(); - if(responseBody.startsWith("")); - } - else - { - throw new IvyConnectionExeption("unable to reach server to get new drone webId"); - } - } - } catch (HttpException e) { - System.err.println("HttpException : post request failed : request new drone webId"); - e.printStackTrace(); - } catch (IOException e) { - System.err.println("IOException : post request failed : request new drone webId"); - e.printStackTrace(); - } finally { - // Release the connection. - method.releaseConnection(); - } - return newDroneId; - } - /** - * inner class, normaly could be nested in the bindMsgOnce method of Ivy but - * seems requested so that the ivy send method works - * @author genin - */ - class myListener implements IvyMessageListener { - private String droneWebId; - - myListener(String dwi){ - droneWebId=dwi; - } - @Override - public void receive(IvyClient arg0, String[] args) { - dronesStates.replace(args[1],AcStatus.IVY_CONF_RECEIVED); - System.out.println("message rqst CONFIG received from ivy for drone "+args[1]); - String idOnIvy = args[1]; - String flightplan_path = args[2]; - String setting_path = args[5]; - String drone_name = args[7]; - String color_drone = checkColor(args[6]); - AcNetId ac = new AcNetId(ivyWebId,droneWebId,idOnIvy,drone_name,flightplan_path,setting_path,color_drone,maxAircrafts); - acNetIdMap.put(idOnIvy, ac); - // upload configuration files on the server - try { - dronesStates.replace(args[1],AcStatus.UPLOADING_CONF); - boolean res = uploadConfFile(ac); - if(res) {dronesStates.replace(args[1],AcStatus.CONF_OK);} - else { - dronesStates.replace(args[1],AcStatus.CONF_NOTOK); - System.out.println("conf files upload of drone "+idOnIvy+" impossible, messages will be skipped");} - } catch (FileNotFoundException e) { - e.printStackTrace(); - System.out.println("### FileNotFoundException ###"); - } - } - /** - * on ivy, drone color can be either in text format or in hexa format - * this function send the color in an hex rgb format - * @param color the color in hexa format or in string format - * @return the color in hexa format - */ - private String checkColor(String color){ - String res = ""; - if ((color.length()==7)&&(color.charAt(0)=='#')){ - res = color; - } - else - { - if(color.equals("blue")){ res = "#0000FF"; } - else if (color.equals("red")){ res = "#FF0000"; } - else if (color.equals("green")){ res = "#00FF00"; } - else if (color.equals("yellow")){ res = "#00FFFF"; } - else if (color.equals("purple")){ res = "#FFFF00"; } - else {res = "#0F0F0F";} - } - return res; - } - - }// fin inner class - -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/AcStatus.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/AcStatus.java deleted file mode 100755 index c8b4ee5cfb..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/AcStatus.java +++ /dev/null @@ -1,30 +0,0 @@ -package pow.ivyclient; -/** - * implements the life cycle of a drone when it is detected on the ivy bus. - * these steps are needed to prevent that a ivy message is processed before - * that all information about the drone were retrieved - * these status follow the steps that are followed by the module when a new drone - * is detected on the bus - * @see Ivy2Udp - * @author genin - */ -public enum AcStatus { - /** the system does not know this drone, information are requested*/ - UNKNOWN, - /** a request about the configuration has been sent on ivy*/ - ASKING_IVY_CONF, - /** the configuration has been received from ivy*/ - IVY_CONF_RECEIVED, - /** the module sends request to the web server for having a web id for the drone*/ - ASKING_WEB_ID, - /** the drone web id has been received from the server */ - WEB_ID_RECEIVED, - /** the module upload the two configuration files of the drone on the server */ - UPLOADING_CONF, - /** the 2 configuration files have been uploaded successfully */ - CONF_OK, - /** the module can received ivy message for this drone and send them to the server*/ - ALIVE, - /** a problem occurred during the process*/ - CONF_NOTOK -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/BusIvy_.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/BusIvy_.java deleted file mode 100755 index 27fb91d1b4..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/BusIvy_.java +++ /dev/null @@ -1,91 +0,0 @@ -package pow.ivyclient; - -import java.net.*; -import java.util.*; -import java.util.Calendar; -/** - * inner representation of an ivy bus - * store the drones' information about the drones which belong to this ivy bus - * store the IP adress of the machine where the ivy bus is working - */ -public class BusIvy_ -{ - private Calendar oCalendar; - private long oTime; - private InetAddress busAddress; - private ArrayList DronesId = new ArrayList(); - /** - * - * @param myInetAddress the ip address of the ivy host - */ - public void setAddress(InetAddress myInetAddress) - { - busAddress = myInetAddress; - } - /** - * update the 'inner clock' of the object when a message for this bus is detected - * useful to know if the bus is still alive - */ - public void updateTime() - { - oCalendar=Calendar.getInstance(); - oTime = oCalendar.getTimeInMillis(); - } - /** - * inform the bus that a new drone send information on this bus - * @param newDroneId (the ivy id) - */ - public void addDrones(int newDroneId) - { - DronesId.add(newDroneId); - } - /** - * get a array list containing the ivy id of the drones present on the bus - * @return the array list containing the ivy id of the drones present on the bus - */ - public ArrayList getDrones() - { - return DronesId; - } - /** - * display information on stdout about the drones present on the bus - */ - public void displayDrones() - { - System.out.println("Bus Ivy : "); - System.out.println(busAddress); - System.out.println("Drones : "); - for(Integer myDrone : DronesId) - { - System.out.println(myDrone); - } - } - /** - * provides the IP adress of the host hosting the bus - * @return the IP adress of the host hosting the bus - */ - public InetAddress getAddress() - { - return busAddress; - } - /** - * inform if a drone is present or not on the bus - * @param myDroneId the ivy id - * @return true if the drone is present on the bus - */ - public boolean isOwnBy(int myDroneId) - { - return DronesId.contains(myDroneId); - } - /** - * inform if the bus is alive - * @return true if the last message was received less than 10 seconds ago - */ - public boolean isAlive() - { - Calendar iCalendar = Calendar.getInstance(); - long iTime = iCalendar.getTimeInMillis(); - - return ((iTime - oTime)<10000); // 10 secondes - } -} \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/HeartBeat.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/HeartBeat.java deleted file mode 100755 index 997f9d05cf..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/HeartBeat.java +++ /dev/null @@ -1,103 +0,0 @@ -package pow.ivyclient; - -import java.io.IOException; -import java.net.DatagramPacket; -import java.net.DatagramSocket; -import java.net.InetAddress; -import java.text.SimpleDateFormat; -import java.util.Date; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; - -import pow.AES; - -/** - * thread which send a periodic message to a client or server to say that the connection - * is still alive (period has to be less than the socket timeout of the the server) - * @author genin - */ -public class HeartBeat implements Runnable { - - private InetAddress serveur; - private int portUdpSend; - private long period2sendheartbeat; - private boolean doIt; // to stop thread - private int webId; - private SimpleDateFormat dateformat; - private int num_msg; - private AES aes; - - /** - * define the parameter of the heartbeat message - * @param cipher the way to encrypt message to be send on udp channel - * @param webId the id of the bus - * @param srv the ip address of the host hosting the ivy bus - * @param port2send the udp port on which the heartbeat is sent - * @param heartbeatPeriod the period of time to send heartbeat message - */ - public HeartBeat(AES cipher,int webId, InetAddress srv,int port2send,long heartbeatPeriod) { - aes = cipher; - this.webId = webId; - serveur = srv; - - portUdpSend = port2send; - period2sendheartbeat = heartbeatPeriod; - dateformat = new SimpleDateFormat("d:M:y:HH:mm:ss"); - num_msg = 0; - doIt =true; - } - - - /** - * send a periodic heartbeat message - */ - public void run(){ - - String msg = "HEARTBEAT "+ webId; - String full_msg; - byte[] buffer; - DatagramPacket dataUdp; - DatagramSocket socketUdp=null; - while(doIt){ - try{ - Thread.sleep(period2sendheartbeat); - full_msg = add_info_msg(msg); - buffer = aes.encrypt(full_msg.getBytes()); // method should be synchronized ? - try { - socketUdp = new DatagramSocket(); - dataUdp = new DatagramPacket(buffer, buffer.length, serveur, portUdpSend); - socketUdp.send(dataUdp); - System.out.println("H"); - } catch (IOException e) { - System.out.println("socket ioexception : can't send heart beat"); - } - finally{ - if (socketUdp!=null) {socketUdp.close();socketUdp=null;} - } - } - catch(InterruptedException iex){ - System.out.println("heartbeat sleep failed"); - } - catch(BadPaddingException bpex){System.out.println("error padding heartbeat");} - catch(IllegalBlockSizeException ex){System.out.println("error illegal block heartbeat");} - catch(IOException ioex){System.out.println("error io heartbeat");} - } - System.out.println("Thread HeartBeat stopped !"); - } - - /** - * add usefull info to msg for storage in database - * its requested because of the format of messages that server is waiting - */ - private String add_info_msg(String msg){ - String monHeure = this.dateformat.format(new Date()); - String res = "" + this.webId+" " + this.num_msg + " " + monHeure +" " + msg; - this.num_msg++; - return res; - } - /** - * stop the heartbeat thread by ending the infinite loop - */ - public void stop_thread(){doIt=false;} -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/Ivy2Udp.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/Ivy2Udp.java deleted file mode 100755 index dc60bd3962..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/Ivy2Udp.java +++ /dev/null @@ -1,1020 +0,0 @@ -package pow.ivyclient; - -import java.io.*; -import java.net.*; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -//import java.util.Vector; - -import fr.dgac.ivy.*; - -import org.apache.commons.codec.binary.Hex; -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpException; -import org.apache.commons.httpclient.methods.PostMethod; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.httpclient.protocol.Protocol; -import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; - -import java.io.StringReader; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; - -import pow.AES; -import pow.webserver.StrictSSLProtocolSocketFactory; - -/** - * It contact the server to get an identifier, some configuration parameter and - * the key to encrypt and decrypt messages. - * Then it listens messages on the ivy bus and send messages on active drones to the - * web server. - * @author jabln, thomas genin - * @version 2.0 - */ -public class Ivy2Udp implements Runnable{ - private InetAddress serveur; - private String login; - private String password; - final static int portUdpSend = 8535; - final static int portUdpReceive = 8536; - private Ivy bus; - private Thread heartbeatThread; - private HeartBeat heartbeatRun; - final static int taille = 1024; - static int maxAircrafts = 1000; // TODO a changer !!! mettre une map ou qqch - static int datagramLength = 17; // modif , on a rajoute la couleur a la fin - private String datagramMatrix[][] = new String[maxAircrafts][datagramLength];// TODO a changer !!! mettre une map ou qqch - private int aircraftNumber = 0; - private Boolean aircraftAlive[] = new Boolean[maxAircrafts];// TODO a changer !!! mettre une map ou qqch - private int count[] = new int[maxAircrafts];// TODO a changer !!! mettre une map ou qqch - private int countSettings[]=new int[maxAircrafts];// TODO a changer !!! mettre une map ou qqch - private HashMap> settingsToBeChanged = new HashMap>(); - private int webId=-999; - private byte[] aesKey ; - private AES aesCipher; - private String url; - private AcNetIdStorage acNetIds; - private ConcurrentHashMap dronesStatus; - /* *********************** */ - private long time2resetWptFilter = 20*60*1000; // on nettoie les filtres tous les 20min !!!!! - private MsgFilter waypointMsgFilter; - private long chrono_start; - private long elapsed_time; - private long timeToSendValues=60*1000; // on envoie les values d'un drone toutes les 60 secondes - private HashMap lastvaluesMap; - private long lastivymessage; - /* ************************ */ - private long num_msg; - private SimpleDateFormat dateformat; - /* ************************** */ - private int socketTimeOut ; - /* ************************* */ - private boolean continueListening ; - private boolean reconnect = false; - private HashSet bindSet; - IvyIHM ihm; - /** - * create an object which listens on the local ivy bus and send messages to the server - * @param urlObj describes information about the server - * @param login - * @param password - */ - public Ivy2Udp(IvyIHM ihm,PowUrl urlObj,String login, String password) - { - this.ihm = ihm; - continueListening = true; - num_msg = 0; - dateformat = new SimpleDateFormat("d:M:y:HH:mm:ss"); - try{ - this.login = login; - this.password = password; - serveur = InetAddress.getByName(urlObj.getServerName()); - // ********************************************* // - this.url = urlObj.getWebUrl(); - // ********************************************* // - dronesStatus = new ConcurrentHashMap(); - lastvaluesMap = new HashMap(); - // ********************************************* // - waypointMsgFilter = new MsgFilter(); - chrono_start = System.currentTimeMillis(); - // ********************************************* // - bindSet = new HashSet(); - bus = new Ivy("Ivy2Udp", "Ivy2Udp Ready", null); - } catch (Exception ie) { - System.out.println("Error : cannot connect to server"); - } - } - /* ******************************** */ - /* *********** structure de correspondance entre webid et ivyid pour chaque drone ************ */ - /** initiate the object which allow to store information about drones */ - public void setStorage(){ - acNetIds = new AcNetIdStorage(webId,bus,url,maxAircrafts,dronesStatus); - } - /** provides the structure where data about the drone present on the ivy bus are stored - * @return the structure which allow to store information about drones */ - public AcNetIdStorage getStorage(){ - return acNetIds ; - } - /** return the id of the bus for the server - * this id is provided by the server and is unique - * @return the unique id of this ivy bus for the server */ - public int getIvyWebId(){ - return webId; - } - /** - * request a single id for the bus to the web server - * method get - * see @link http://hc.apache.org/httpclient-3.x/tutorial.html - * see @link blogs.sun.com/gc/entry/unable_to_find_valid_certification - * see @link http://blogs.sun.com/andreas/entry/no_more_unable_to_find - */ - public void getWebId() throws IvyConnectionExeption - { - int statusCode=-1; - // http config - HttpClient client = new HttpClient(); - client.getParams().setParameter("http.useragent", "Ivy request"); - Protocol stricthttps = new Protocol("https", (ProtocolSocketFactory)new StrictSSLProtocolSocketFactory(true), 443); - client.getHostConfiguration().setHost("localhost", 443, stricthttps); - PostMethod method = new PostMethod(url); - method.addParameter("order", "requestWebId"); - method.addParameter("login", login); - method.addParameter("pwd", password); - try { - System.out.println("### envoie de la requete requestWebId###"); - statusCode = client.executeMethod(method); - if (statusCode != HttpStatus.SC_OK) { - System.err.println("Method failed: " + method.getStatusLine()); - throw new IvyConnectionExeption("Erreur de retour de la requete de connection"); - } - else - { - // Read the response body. - try { - String responseBody = method.getResponseBodyAsString();//getResponseBody();//); - // Deal with the response - try { - // parse response in XML tree - // @SEE http://java.developpez.com/faq/xml/?page=dom - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document document = parser.parse(new InputSource(new StringReader(responseBody))); - // get login acknowledgment - Element ack_node = (Element)document.getElementsByTagName("ConnectionAck").item(0); - int ack = Integer.parseInt(ack_node.getTextContent()); - if (ack==1){ - // get webid node - Element webid_node = (Element)document.getElementsByTagName("webid").item(0); - webId = Integer.parseInt(webid_node.getTextContent()); - if (webId==-999) {throw new IvyConnectionExeption("unable to have correct webId");} - // get key node - Element aeskey_node= (Element)document.getElementsByTagName("aeskey").item(0); - String str_hex_aeskey = aeskey_node.getTextContent(); - // get parameter key node - Element aesiv_node= (Element)document.getElementsByTagName("aesiv").item(0); - String str_hex_aesIvParameter = aesiv_node.getTextContent(); - // get periods of time - Element time2resetWptFilter_node=(Element)document.getElementsByTagName("time2resetFilter").item(0); - this.time2resetWptFilter =Long.parseLong(time2resetWptFilter_node.getTextContent()); - Element timeToSendValues_node =(Element)document.getElementsByTagName("timeToSendValues").item(0); - this.timeToSendValues=Long.parseLong(timeToSendValues_node.getTextContent()); - Element socketTimeOut_node =(Element)document.getElementsByTagName("socketTimeOut").item(0); - this.socketTimeOut=Integer.parseInt(socketTimeOut_node.getTextContent()); - // - aesKey = Hex.decodeHex(str_hex_aeskey.toCharArray()); - byte[] iv = Hex.decodeHex(str_hex_aesIvParameter.toCharArray()); - aesCipher = new AES(aesKey,iv); - // - System.out.println("##########################"); - System.out.println("### connection ok+\t###"); - System.out.println("### web id = "+ webId +"\t###"); - System.out.println("### aes key = "+ str_hex_aeskey +"\t###"); - System.out.println("##########################"); - } - else if (ack==2){ - throw new IvyConnectionExeption("login ok, but aes encryption not supported by server"); - } - else if (ack==3){ - throw new IvyConnectionExeption("login ok, but server unable to generate a web id"); - } - else - { - throw new IvyConnectionExeption("login process failed, you're not allowed to access the server"); - } - } - catch(Exception e) { - e.printStackTrace(); - throw new IvyConnectionExeption("unable to read the server response"); - } - } - catch (IOException e) { - System.err.println("IOException : echec execution requete post : request webId"); - e.printStackTrace(); - throw new IvyConnectionExeption("No response from the server"); - } - } - } catch (HttpException e) { - e.printStackTrace(); - throw new IvyConnectionExeption("HttpException : echec execution requete post : request webId"); - } catch (IOException e) { - e.printStackTrace(); - throw new IvyConnectionExeption("IOException : echec execution requete post : request webId"); - } finally { - method.releaseConnection(); // Release the connection. - - } - } - - - /** - * create a thread which send heart beat message to the server - */ - public void startHeartBeat(){ - heartbeatRun = new HeartBeat(aesCipher,webId,serveur,portUdpSend,socketTimeOut/3);// socket timeout = 10000 for server - heartbeatThread = new Thread(heartbeatRun); - heartbeatThread.start(); - System.out.println("process heartbeat started"); - } - - /** - * This method binds the object to some messages - * of the bus Ivy. Each information that is needed by the web server is put in an - * array. This array is sent to server. - */ - public void bindMsg2Ivy() throws IvyException { - for (int i = 0; i < countSettings.length; i++) { - countSettings[i] = 0; - } - - for (int i = 0; i < count.length; i++) { - count[i] = 0; - } - for (int i = 0; i < datagramMatrix.length; i++) { - for (int j = 0; j < datagramMatrix[i].length - 1; j++) { - datagramMatrix[i][j] = new String(" "); - } - } - for (int i = 0; i < aircraftAlive.length; i++) { - aircraftAlive[i] = true; - } - // fetch flight parameters - // see message feature in paparazzi folder - // file /conf/message.xml - // listen a specific message on the ivy bus and define a callback function - bindSet.add(bus.bindMsg("ground FLIGHT_PARAM ([^ ]*) [^ ]* [^ ]* [^ ]* ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) .*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - lastivymessage = System.currentTimeMillis(); - try { - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][3] = args[1]; - datagramMatrix[acIndex][4] = args[2]; - datagramMatrix[acIndex][5] = args[3]; - datagramMatrix[acIndex][6] = args[4]; - datagramMatrix[acIndex][7] = args[5]; - datagramMatrix[acIndex][8] = args[6]; - datagramMatrix[acIndex][9] = args[7]; - send(acIndex); - } - else // other states UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - - System.out.println("Can't process FLIGHT_PARAM information"); - ie.printStackTrace(); - } - - } - })); - - bindSet.add(bus.bindMsg("ground ENGINE_STATUS ([^ ]*) [^ ]* [^ ]* [^ ]* [^ ]* ([^ ]*).*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - lastivymessage = System.currentTimeMillis(); - try { - - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][10] = args[1]; - send(acIndex); - } - else // other states UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process ENGINE_STATUS information"); - } - - } - })); - - bindSet.add(bus.bindMsg("ground ENGINE_STATUS ([^ ]*) ([^ ]*) .*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - lastivymessage = System.currentTimeMillis(); - try { - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][12] = args[1]; - send(acIndex); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process AP_STATUS information"); - } - - } - })); - - - bindSet.add(bus.bindMsg("ground AP_STATUS ([^ ]*) [^ ]* [^ ]* [^ ]* [^ ]* ([^ ]*) .*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - lastivymessage = System.currentTimeMillis(); - try { - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][11] = args[1]; - send(acIndex); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process AP_STATUS information"); - } - - } - })); - - // when a JUMP_TO_BLOCK message is sent after a web user order - // we have to wait for this message to have a real acknowledgment of the order - bindSet.add(bus.bindMsg("ground NAV_STATUS ([^ ]*) ([^ ]*).*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - lastivymessage = System.currentTimeMillis(); - try { - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][13] = args[1]; - // - String j2b[] = new String[1]; - j2b[0] = args[1]; - String s = new String("NAV_STATUS"); - send(acIndex,s,j2b); - - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process NAV_STATUS information"); - } - - } - })); - // when a DL_SETTING message is sent after a web user order - // we have to wait for this message to have a real acknowledgment of the order - bindSet.add(bus.bindMsg("ground DL_VALUES ([^ ]*) ([^ ]*)", new IvyMessageListener(){ - public void receive(IvyClient client, String[] args){ - lastivymessage = System.currentTimeMillis(); - try{ - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - String[] settingSplited = args[1].split(","); - String settingId = new String (""); - settingId = settingId + countSettings[acIndex]; - datagramMatrix[acIndex][14] = settingId; - datagramMatrix[acIndex][15] = settingSplited[countSettings[acIndex]]; - send(acIndex); - countSettings[acIndex] = (countSettings[acIndex] + 1) % settingSplited.length; - // gestion de l'A/R de DL_SETTING - // on attend que la valeur du setting soit effectivement change pour envoyer l'A/R - if (settingsToBeChanged.containsKey(acIndex)){ - HashMap h = settingsToBeChanged.get(acIndex); - Set k = h.keySet(); - Iterator itr = k.iterator(); - - while(itr.hasNext()){ - int current_settingid = itr.next(); - float value = h.get(current_settingid); - if(value==Float.parseFloat(settingSplited[current_settingid])){ - h.remove(current_settingid); - String chgSet[] = new String[2]; - chgSet[0] = ""+current_settingid; - chgSet[1] = ""+value; - String s = new String("DL_SETTING_ACK"); - send(acIndex,s,chgSet); - System.out.print("%"); - } - } - } - // gestion de l'envoie de l'ensemble des valeurs de - // setting pour un drone , on envoie la trame par periode timeToSendValues - Long lasttime = lastvaluesMap.get(acIndex); - long nowtime = System.currentTimeMillis(); - boolean firsttime = false; - if (lasttime==null){ - lasttime = nowtime; - lastvaluesMap.put(acIndex,nowtime); - firsttime = true ; - } - - if (firsttime||((nowtime-lasttime)>timeToSendValues)){ - // on envoie la value - String csv[] = new String[1]; - csv[0] = args[1]; - String s = new String("SETTINGS_VALUES"); - send(acIndex,s,csv); - System.out.print("+"); - lastvaluesMap.put(acIndex,nowtime); - } - - - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch(Exception ie) { - System.out.println("Can't process DL_VALUES information"); - System.out.println("acid= "+args[0]); - System.out.println("csv= "+args[1]); - System.out.println("********************\n"+ie.toString()+"\n********************"); - } - } - })); - // when a MOVE_WAYPOINT message is sent after a web user order - // we have to wait for this message to have a real acknowledgment of the order - bindSet.add(bus.bindMsg("ground WAYPOINT_MOVED ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*)",new IvyMessageListener(){ - public void receive(IvyClient client, String[] args){ - lastivymessage = System.currentTimeMillis(); - try { - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - int i = a.getAcId(); - String mvWp[] = new String[4]; - for (int j = 0;j<4;j++){ - mvWp[j] = args[j+1]; - } - String s = new String("WAYPOINT_MOVED"); - send(i,s,mvWp); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - catch (Exception ie){ - System.out.println("Can't process MOVE_WAYPOINT information"); - } - } - })); - // as there are many DL_VALUES messages on ivy bus, when a DL_SETTING order is sent - // we have to keep a link between the order and the response we are waiting for having a real - // acknowledgment - bindSet.add(bus.bindMsg("DL_SETTING ([^ ]*) ([^ ]*) ([^ ]*)", new IvyMessageListener(){ - - public void receive(IvyClient client, String[] args){ - lastivymessage = System.currentTimeMillis(); - try{ - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - int indexAircraft = a.getAcId(); - int indexSetting = Integer.parseInt(args[1]); - float valueSetting = Float.parseFloat(args[2]); - // memorisation qu'une requete DL_SETTING a ete faire - // voir traitement dans ground DL_VALUES - if (!settingsToBeChanged.containsKey(indexAircraft)){ - settingsToBeChanged.put(indexAircraft, new HashMap()); - } - settingsToBeChanged.get(indexAircraft).put(indexSetting, valueSetting); - System.out.print("$"); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - catch (Exception ie){ - System.out.println("Can't process DL_SETTING information"); - } - } - })); - // allow to be sure that a drone is still alive - // this message is sent by ivy server to inform when the last message about a drone - // was sent - bindSet.add(bus.bindMsg("ground TELEMETRY_STATUS ([^ ]*) ([^ ]*)", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - lastivymessage = System.currentTimeMillis(); - try { - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - int i = a.getAcId(); - if (i != -1) { - float f = Float.parseFloat(args[1]); - if (aircraftAlive[i] && f > 30) { - aircraftAlive[i] = false; - String s = new String("Plane_Die"); - send(i, s); - } else { - if (!aircraftAlive[i] && f < 30) { - aircraftAlive[i] = true; - String s = new String("Plane_Resurect"); - send(i, s); - } - } - } - } - } catch (Exception ie) { - - System.out.println("Can't process TELEMETRY_STATUS information"); - } - - } - })); - - bus.start(null); - } - /** - * stop all the thread Ivy2Udp , HeartBeat and ivy2UdpWriting - */ - public void stop_thread(){ - - Iterator itr = bindSet.iterator(); - while(itr.hasNext()){ - try { - bus.unBindMsg(itr.next()); - } catch (IvyException e) { - System.out.println("unable to unbind ivy msg"); - } - } - bus.stop();bus=null; - System.out.println("link to bus ivy stopped !"); - if(this.heartbeatRun!=null) this.heartbeatRun.stop_thread(); - continueListening = false; - } - /** - * add usefull info to msg for storage in database - * web_id - * number the message if we want to order then on the server (because udp is not safe) - */ - private String add_info_msg(String msg){ - String monHeure = this.dateformat.format(new Date()); - String res = "" + this.webId+" " + this.num_msg + " " + monHeure +" " + msg; - this.num_msg++; - return res; - } - - /** - * This method send to the web server the datagram containing the informations - * about the aircraft - * @param acId Line of the matrix containing the informations about the plane - * @throws java.lang.Exception - */ - public void send(int acId){ - DatagramSocket socketUdp = null; - String s = ""; - if (count[acId] == 5) { - if (aircraftAlive[acId]) { - byte buffer[]; - s = ""; - for (int i = 1; i < 7; i++) { - s = s + datagramMatrix[acId][i] + " "; - } - for(int i = 7; i< 10;i++){ - StringBuffer str = new StringBuffer(datagramMatrix[acId][i]); - str.setLength(5); - s = s + str + " "; - } - for(int i = 10; itaille){System.out.println("Alerte taille trame udp:"+buffer.length+" !!!!");} - DatagramPacket dataUdp = new DatagramPacket(buffer, buffer.length, serveur, portUdpSend); - try{ - socketUdp = new DatagramSocket(); - try{ - socketUdp.send(dataUdp); - System.out.print("#"); - count[acId] = 0; - } - catch(IOException ex){System.out.print("datagram creation error : msg not sended");} - } - catch (SocketException ex){System.out.print("socket error : msg not sended");} - finally{if(socketUdp!=null){socketUdp.close();socketUdp=null;}} - - } - catch( IOException ex){System.out.print("cipher error : cannot encrypt msg : msg not sended to server");ex.printStackTrace();} - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - } - } else { - count[acId]++; - } - } - - - /** - * This method send to the web server a specific order with parameters - * @param acId : Line of the matrix containing the informations about the plane - * @param s : order - * @param as : parameters - */ - - public void send(int acId, String s, String[] as){ - String order = s; - DatagramSocket socketUdp=null; - s = s + " " + datagramMatrix[acId][1]+ " "; - for (int i =0; i< as.length;i++){ - s = s + as[i] + " "; - } - byte buffer[]; - // gestion de l'ecoute ou non des msg waypoint_moved et des autres msg speciaux - boolean isnew = true; - // on filtre certains messages - if (order.equals("WAYPOINT_MOVED") - ||order.equals("NAV_STATUS")) - { - elapsed_time = System.currentTimeMillis() - chrono_start; - if (elapsed_time>time2resetWptFilter) - { - waypointMsgFilter.resetfilter(); - chrono_start = System.currentTimeMillis(); - } - isnew = waypointMsgFilter.isNew(s); - } - if(isnew){ - System.out.print("!"); - s = this.add_info_msg(s); - buffer = s.getBytes(); - try{ - buffer = this.aesCipher.encrypt(buffer); - if (buffer.length>taille){System.out.println("Alerte taille trame udp:"+buffer.length+" !!!!");} - DatagramPacket dataUdp = new DatagramPacket(buffer, buffer.length, serveur, portUdpSend); - try{ - socketUdp = new DatagramSocket(); - try{ - socketUdp.send(dataUdp); - } - catch(IOException ex){System.out.print("datagram creation error : msg not sended");} - } - catch (SocketException ex){System.out.print("socket error : msg not sended");} - finally{if(socketUdp!=null){socketUdp.close();socketUdp=null;}} - } - catch (IOException ex){System.out.print("cipher error : cannot encrypt msg : msg not sended to server");ex.printStackTrace();} - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - } - } - - - - /** - * This method send a particular message about an aircraft - * @param acId line of the matrix containing the informations about the plane - * @param s message that is to be sent to send - */ - public void send(int acId, String s) { - DatagramSocket socketUdp= null; - s = s + " " + datagramMatrix[acId][1]; - byte buffer[] ; - s = this.add_info_msg(s); - buffer = s.getBytes(); - System.out.println(s); - try{ - buffer = this.aesCipher.encrypt(buffer); - if (buffer.length>taille){System.out.println("Alerte taille trame udp:"+buffer.length+" !!!!");} - DatagramPacket dataUdp = new DatagramPacket(buffer, buffer.length, serveur, portUdpSend); - try{ - socketUdp = new DatagramSocket(); - try{ - socketUdp.send(dataUdp); - } - catch(IOException ex){System.out.print("datagram creation error : msg not sended");} - } - catch (SocketException ex){System.out.print("socket error : msg not sended");} - finally{if(socketUdp!=null){socketUdp.close();socketUdp=null;}} - } - catch (IOException ex){System.out.print("cannot encrypt msg : msg not sended to server");ex.printStackTrace();} - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - } - - /** - * listen the udp socket to get orders from web clients and send them to ivy - */ - public void run() { - byte[] complete_data ; - int true_length_of_msg ; - int i; - long elapsed_ivy; - byte[] data_with_no_padding; - boolean heartbeat_is_running = false; - DatagramSocket socket = null; - // login procedure - setStorage(); - try{ - bindMsg2Ivy(); - this.startHeartBeat(); - // start the module which listens to the orders coming from web users - try - { - lastivymessage = System.currentTimeMillis(); - System.out.println("on lance udp writing "); - int portUdpReceive = 8536 ; - socket = new DatagramSocket(portUdpReceive); - socket.setSoTimeout(this.socketTimeOut); - while (continueListening) { - // check last ivy message - elapsed_ivy = System.currentTimeMillis()-lastivymessage; - /* - if(elapsed_ivy>10000) { this.heartbeatRun.stop_thread();heartbeat_is_running = false;} - else if (!heartbeat_is_running){ - //Reconnection - } - */ - //listening server (hertbeat and true messages - byte buffer[] = new byte[taille]; - DatagramPacket data = new DatagramPacket(buffer, buffer.length); - try{ - socket.receive(data); - String[] messageed; - try{ - complete_data = data.getData(); - // we have to remove the padding bytes present in the udp trame if the message is too short - true_length_of_msg = data.getLength(); - data_with_no_padding = new byte[true_length_of_msg]; - for(i=0;i< true_length_of_msg;i++){ - data_with_no_padding[i]=complete_data[i]; - } - byte[] decrypted_data = aesCipher.decrypt(data_with_no_padding); - String s = new String(decrypted_data); - if (!s.equals("SERVER_HEARTBEAT")){ - System.out.print("data received from server web : "); - System.out.println(s); - messageed = s.split(" "); - try{ - // creer un objet d'envoie qui connait la correspondance ivyid et webid pour chaque drone - new Ivy2UdpWriting(messageed, getStorage()); - } - catch(IvyException e1){ System.out.println("erreur sending msg to ivy : " + s);} - } - // else {System.out.println("\nHEARTBEAT FROM SERVER");} - } - catch(IOException ex){System.out.print("cipher error : cannot decrypt msg : msg not sended to ivy");ex.printStackTrace();} - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - } - catch(SocketTimeoutException ex){ - // no heartbeat - continueListening = false ; - this.stop_thread(); - reconnect = true; - ihm.setReLogged(true); - } - catch(IOException e){ e.printStackTrace();System.out.println("erreur socket when receive message");} - } - - System.out.println("Thread Ivy2Udp stopped !"); - } - catch(SocketException e){ System.out.println("erreur creation de socket server-->ivy ");} - finally{if (socket!=null){socket.close();socket=null;}} - - } - catch (IvyException e){ - System.out.println("unable to bind to ivy...connection failed"); - e.printStackTrace(); - System.exit(0); - } - - } - - - /** - * Inner class which manage to search in acNetIdStorage, the index of a plane according to its ivyid - * if the drone is unknown , an identifiant is requested to the server and its conf files are uploaded - */ - class aircraftIdSeeker { - private String droneId; - private int res; - - public aircraftIdSeeker(String s){ - - droneId = s; - res = -1; - } - - public int getAcId() {return res;} - - public void seek(){ - // seek if the drone status - AcStatus droneState = dronesStatus.get(droneId); - int i = 0; - // ALIVE means that the information about the drone were already fetched and so - // we can directly seek them on the datamatrix - if (droneState==AcStatus.ALIVE){ - while (i < maxAircrafts && !droneId.equals(datagramMatrix[i][0])) { - i++; - } - if (i < aircraftNumber) { - res = (i); - } - else { - // big error should not arrive - System.out.println("ERROR , ALIVE BUT NOT IN MATRIX !!!"); - } - }// - // if status in unknown we have to seek th information on the ivy bus and - //ask the server a new web id for the drone - else if (droneState==AcStatus.UNKNOWN) - { - acNetIds.seekAcNetId(droneId); - }// if conf is ok , we can fill the datamatrix and put the drone in ALIVE STATUS - // when the next message for this bus will arrive it will be processed normally - else if (droneState==AcStatus.CONF_OK) { - AcNetId ac = acNetIds.getAcNetId(droneId); - datagramMatrix[aircraftNumber][0] = ac.getIdOnIvy(); // id on IvyBus - datagramMatrix[aircraftNumber][1] = ac.getIdOnWeb(); // id on Web Client - datagramMatrix[aircraftNumber][2] = ac.getName(); // name - datagramMatrix[aircraftNumber][16] = ac.getColor(); - dronesStatus.replace(droneId,AcStatus.ALIVE); - // - if (datagramMatrix[aircraftNumber][0].equals(" ")) { - res= (-1); - } else { - aircraftNumber++; - String newPlane = new String("New_Plane"); - String name[] = new String[1]; - name[0] = ac.getName(); - send(aircraftNumber - 1, newPlane,name); - res= (aircraftNumber - 1); - } - } - else { // that means that the drone is in a intermediate status we have to wait that - // the status becomes CONF_OK to continue ( on the next ivy message) - // do nothing - } - } - } //fin class acId - -} // fin class ivy2udpreading - - - - - - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/Ivy2UdpWriting.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/Ivy2UdpWriting.java deleted file mode 100755 index 4bb15c6ca5..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/Ivy2UdpWriting.java +++ /dev/null @@ -1,62 +0,0 @@ -package pow.ivyclient; - -import fr.dgac.ivy.*; - -/** - * This class aims to give order to the drones according to the datagrams it - * receive from the web - * @author jabln - */ -public class Ivy2UdpWriting implements IvyMessageListener { - - - private Ivy bus; - private AcNetIdStorage netIdStorage; - private String[] message; //Array which contains the informations are to be sent on the bus - private String IvyAcId; //Identity of the aircraft on the bus Ivy - - /** - * This constructor of the class binds to the bus Ivy and implements the - * method receive to send on the bus the informations given in parametres - * in an array of string - * @param message Informations that is to be sent on the bus Ivy - * @param storage the object which to do the link between webid and ivyid for each drone - * @throws java.lang.Exception - */ - Ivy2UdpWriting(String[] message, AcNetIdStorage storage) throws IvyException { - this.message = message; - netIdStorage = storage; - int acwebid = Integer.parseInt(message[1]); - this.IvyAcId = netIdStorage.getAcIvyId(acwebid); - if ( this.IvyAcId != null) { - bus = new Ivy("Web Writing", "Web Writing ready", null); - bus.start(null); - - bus.bindMsg("FLIGHT_PARA.*", this); - } - else - { - System.out.println("enable to make the link between webid on ivyidy"); - } - } - - /** - * This method implements the method receive of the bus Ivy class. - * It sends the informations on the ivy bus and stop the binding - * @param client - * @param args - */ - public void receive(IvyClient client, String args[]) { - try { - String s = "WEB_MSG "; - s = s + message[0] + " " + IvyAcId + " "; - for (int i = 2; i < message.length; i++) { - s = s + message[i] + " "; - } - bus.sendMsg(s); - bus.stop(); - } catch (IvyException ie) { - System.out.println("can't send my message on the bus"); - } - } -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/IvyConnectionExeption.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/IvyConnectionExeption.java deleted file mode 100755 index 30d7ecb825..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/IvyConnectionExeption.java +++ /dev/null @@ -1,25 +0,0 @@ -package pow.ivyclient; - -public class IvyConnectionExeption extends Exception { - - /** - * create a specific exception linked with Ivy problem - */ - private static final long serialVersionUID = 1805159521752564076L; - private String reason; - - /** - * create an ivy exception with a particular message - * @param res the message - */ - public IvyConnectionExeption(String res){ - super(); - reason = res; - } - /** - * display the exception on stdout - */ - public String toString() { - return "IvyConnectionExeption : "+reason; - } -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/IvyIHM.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/IvyIHM.java deleted file mode 100755 index db22e05081..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/IvyIHM.java +++ /dev/null @@ -1,337 +0,0 @@ -package pow.ivyclient; - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -/** - * represent the interface for a ivy user who wants to connect a bus ivy to - * the web server - * @author genin - * - */ -public class IvyIHM implements Runnable{ - private JFrame glob_fenetre; - private JLabel login_lbl; - private JTextField login_txtfield; - private JLabel pwd_lbl; - private JPasswordField pwd_txtfield; - private JLabel url_lbl; - private JTextField url_txtfield; - - private Container contenuMore; - private boolean moreIsVisible ; - private JLabel protocol_lbl; - private JComboBox protocol_field; - private JLabel port_lbl; - private JComboBox port_field; - private JLabel site_lbl; - private JTextField site_txtfield; - private JLabel servlet_lbl; - private JTextField servlet_txtfield; - private String[] protocolsStrings = { "http", "https" }; - private String[] portsStrings = { "none", "80","8080","443" }; - private JButton log_btn; - private JButton quit_btn; - private JButton more_btn; - private JButton stop_btn; - private boolean logged ; - private boolean relogged ; - private static int taille_text = 20; - - private Ivy2Udp module; - /** - * construct the interface - */ - public IvyIHM(){ - module = null; - logged = false;relogged=false; - glob_fenetre = new JFrame("Connection to POW Server"); - glob_fenetre.setLocation(100,200); - - Container contenuTextField ; - //ensemble des textfiled - JPanel listTextField= new JPanel(); - listTextField.setLayout(new BoxLayout(listTextField, BoxLayout.PAGE_AXIS)); - contenuTextField = new JPanel(new FlowLayout()); - login_lbl = new JLabel("login"); - login_txtfield= new JTextField("your login",taille_text); - contenuTextField.add(login_lbl); - contenuTextField.add(login_txtfield); - listTextField.add(contenuTextField); - // - contenuTextField = new JPanel(new FlowLayout()); - pwd_lbl = new JLabel("password"); - pwd_txtfield= new JPasswordField("",taille_text); - contenuTextField.add(pwd_lbl); - contenuTextField.add(pwd_txtfield); - listTextField.add(contenuTextField); - // - contenuTextField = new JPanel(new FlowLayout()); - url_lbl = new JLabel("hostname"); - url_txtfield= new JTextField("blanc",taille_text); - contenuTextField.add(url_lbl); - contenuTextField.add(url_txtfield); - listTextField.add(contenuTextField); - // - listTextField.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); - // les trois boutons - more_btn = new JButton("More..."); - log_btn = new JButton("Log !"); - stop_btn = new JButton("Stop !"); - quit_btn = new JButton("Quit !"); - Container contenuButton = new JPanel(new FlowLayout()); - contenuButton.add(quit_btn); - contenuButton.add(log_btn); - contenuButton.add(stop_btn); - contenuButton.add(more_btn); - more_btn.addActionListener(new MoreAction(glob_fenetre)); - log_btn.addActionListener(new LogAction()); - stop_btn.addActionListener(new StopAction()); - quit_btn.addActionListener(new QuitAction()); - //le panneau more.... - contenuMore = new JPanel(); - contenuMore.setLayout(new BoxLayout(contenuMore, BoxLayout.PAGE_AXIS)); - - Container contenuMoreMore = new JPanel(new FlowLayout()); - - protocol_field = new JComboBox(protocolsStrings); - protocol_lbl = new JLabel("protocol"); - contenuMoreMore.add(protocol_lbl); - contenuMoreMore.add(protocol_field); - //contenuMore.add(contenuMoreMore); - - //contenuMoreMore = new JPanel(new FlowLayout()); - port_lbl = new JLabel("port"); - port_field = new JComboBox(portsStrings);; - contenuMoreMore.add(port_lbl); - contenuMoreMore.add(port_field); - contenuMore.add(contenuMoreMore); - - contenuMoreMore = new JPanel(new FlowLayout()); - site_lbl= new JLabel("site name"); - site_txtfield= new JTextField("ServletPow",taille_text); - contenuMoreMore.add(site_lbl); - contenuMoreMore.add(site_txtfield); - contenuMore.add(contenuMoreMore); - - contenuMoreMore = new JPanel(new FlowLayout()); - servlet_lbl= new JLabel("servlet name"); - servlet_txtfield= new JTextField("Ivy2TomcatHttpServer.srv",taille_text); - contenuMoreMore.add(servlet_lbl); - contenuMoreMore.add(servlet_txtfield); - contenuMore.add(contenuMoreMore); - moreIsVisible = false; - contenuMore.setVisible(moreIsVisible); - // - glob_fenetre.setLayout(new BorderLayout()); - Container contenu = glob_fenetre.getContentPane(); - contenu.add(listTextField,BorderLayout.NORTH); - contenu.add(contenuMore,BorderLayout.CENTER); - contenu.add(contenuButton,BorderLayout.SOUTH); - glob_fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - glob_fenetre.pack(); - glob_fenetre.setVisible(true); - } - /** - * specify whether the module should reconnected or not - * @param l true or false - */ - public void setReLogged(boolean l){ - relogged = l; - } - /** - * loop to perform a periodic check for automatic reconnection - */ - public void run(){ - while(true){ - try { - Thread.sleep(15000); - if(module !=null){ - - if(relogged){ - System.out.println("module auto reconnecting to server"); - module = null; - relogged=!connectModule(false); - - } - } - //check - } catch (InterruptedException e) {} - } - } - /** - * launch the interface to connect the ivy bus to POW server - * @param args - */ - public static void main(String[] args) - { - SwingUtilities.invokeLater(new Runnable() { - public void run() { - IvyIHM ivyihm = new IvyIHM(); - new Thread(ivyihm).start(); - } - }); - } - /** - * implements the action performed when the quit button is pressed - * @author genin - */ - class QuitAction implements ActionListener { - public void actionPerformed(ActionEvent e){ - Runnable code = new Runnable() { - public void run() { - System.exit(0); - } - }; - if (SwingUtilities.isEventDispatchThread()) { - code.run(); - } else { - SwingUtilities.invokeLater(code); - } - - } - } - /** - * implements the action performed when the stop button is pressed - * @author genin - */ - class StopAction implements ActionListener { - public void actionPerformed(ActionEvent e){ - - Runnable code = new Runnable() { - public void run() { - module.stop_thread(); - logged = false;relogged = false; - } - }; - - if (SwingUtilities.isEventDispatchThread()) { - code.run(); - } else { - SwingUtilities.invokeLater(code); - } - } - } - - /** - * implements the action performed when the log button is pressed - * @author genin - */ - class LogAction implements ActionListener { - public void actionPerformed(ActionEvent e){ - if(!logged){ - Runnable code = new Runnable() { - public void run() { - connectModule(true); - } - }; - if (SwingUtilities.isEventDispatchThread()) { - code.run(); - } else { - SwingUtilities.invokeLater(code); - } - } - else{ - JOptionPane.showMessageDialog(glob_fenetre, - "you are already logged and send information to server", - "Info",JOptionPane.WARNING_MESSAGE); - } - } - - } - /** - * performs all the step to run the ivy module - * @param displayWarning set if information about wrong login are displayed - * @return true if the https connection to the server is successful - */ - private boolean connectModule(boolean displayWarning){ - boolean res; - String login = login_txtfield.getText(); - String host = url_txtfield.getText(); - char[] pwd_array = pwd_txtfield.getPassword(); - String pwd = new String(pwd_array); - if (moreIsVisible){ - String siteName = site_txtfield.getText(); - String servletName = servlet_txtfield.getText(); - String strports ; - strports = portsStrings[port_field.getSelectedIndex()]; - int port=-1; - if (!strports.equals("none")){ - port = Integer.parseInt(strports); - } - String strProto = protocolsStrings[ protocol_field.getSelectedIndex()]; - System.out.println("port : "+port+"\tproto :"+ strProto); - PowUrl info = new PowUrl(strProto,host,port,siteName,servletName); - JOptionPane.showMessageDialog(glob_fenetre, - "you will be connected to "+ info.getWebUrl(), - "logging info", - JOptionPane.INFORMATION_MESSAGE); - module = new Ivy2Udp(this,info,login,pwd); - } - else{ - PowUrl info = new PowUrl("https",host,-1,site_txtfield.getText(), servlet_txtfield.getText()); - System.out.println("logging to : " + info.getWebUrl()); - module = new Ivy2Udp(this,info,login,pwd); - } - try { - module.getWebId(); - new Thread(module).start(); - logged = true; - res = true; - } catch (IvyConnectionExeption e) { - module.stop_thread(); - // echec du log - //custom title, error icon - System.out.println("erreur de connection : "+e.toString()); - if (displayWarning){ - JOptionPane.showMessageDialog(glob_fenetre, - "Your password or your login are not correct, retry please...\n"+ - "Be sure a valid SSL certificat exist in your $JAVA_HOME/jre/lib/security folder,\n"+ - "otherwise use InstallCert [hostname] java programm"+ - "\nit's possible also that server is not currenlty running", - "logging error", - JOptionPane.ERROR_MESSAGE); - } - logged = false; - res = false; - } - // clearing - for(int i = 0; i< pwd_array.length;i++){ - pwd_array[i]='0'; - } - return res; - } - - /** - * implements the action performed when the more button is pressed - * @author genin - */ - class MoreAction implements ActionListener { - JFrame globalFrame; - - MoreAction(JFrame g){ - globalFrame = g; - } - public void actionPerformed(ActionEvent e){ - Runnable code = new Runnable() { - public void run() { - if(moreIsVisible){ - contenuMore.setVisible(false);moreIsVisible=false;more_btn.setText("More...");} - else { - contenuMore.setVisible(true);moreIsVisible=true;more_btn.setText("Less..."); - } - globalFrame.pack(); - - } - }; - if (SwingUtilities.isEventDispatchThread()) { - code.run(); - } else { - SwingUtilities.invokeLater(code); - } - - } - } - -} - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/MsgFilter.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/MsgFilter.java deleted file mode 100755 index fbe63135dc..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/MsgFilter.java +++ /dev/null @@ -1,36 +0,0 @@ -package pow.ivyclient; -import java.util.HashSet; - -/** - * this class filters the message, thanks to their hash code - * it is used because Paparazzi send periodic messages that are often the same - * so we filter them to lighten the server load and the bandwidth of the udp channel - * @author genin - * - */ -public class MsgFilter { - - - private HashSet msgset; - /** - * create a message filter - */ - public MsgFilter(){ - msgset = new HashSet(); - } - /** - * inform whether the message is new or not - * @param msg - * @return true if the message is a new one and was added to the filter - */ - public boolean isNew(String msg){ - boolean res = msgset.add(msg); - return res; - } - /** - * empty the filter - */ - public void resetfilter(){ - msgset.clear(); - } -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/PowUrl.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/PowUrl.java deleted file mode 100755 index 62a3f19376..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/ivyclient/PowUrl.java +++ /dev/null @@ -1,40 +0,0 @@ -package pow.ivyclient; -/** - * object which store all information about the url to log on the server - * @author genin - * - */ -public class PowUrl { - private String protocole="http"; - private int port =-1; - private String serverName; - private String webAppName; - private String servletLoginName; - /** - * create all the information requested to connect the ivy module to the server - * when all parameters are correct can give an url like - * https://paparazzi.fr/ServletPow/Login.srv - * @param protocol the protocol used to log to the server (HTTP by default) - * @param server the server name (paparazzi.fr) for example - * @param port a specific protocol port ( -1 means that this parameter is not used ) - * @param webapp the name of the application on the server (ServletPow for example) - * @param servletName the name of the login servlet (Login.srv) - */ - public PowUrl(String protocol,String server,int port,String webapp,String servletName){ - if (protocol.equals("https")) this.protocole="https"; - this.port = port; - this.serverName =server; - this.webAppName = webapp; - this.servletLoginName = servletName; - } - /** provides the server name to which the module is connected - * @return server hostname*/ - public String getServerName() {return serverName;} - /** provides the complete URL to log on the POW server - * @return the complete url to log in as a string */ - public String getWebUrl() { - if (port==-1) return ""+protocole+"://"+serverName+"/"+webAppName+"/"+servletLoginName; - else - return ""+protocole+"://"+serverName+":"+port+"/"+webAppName+"/"+servletLoginName; - } -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/AjaxRqst.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/AjaxRqst.java deleted file mode 100755 index 8bffd549aa..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/AjaxRqst.java +++ /dev/null @@ -1,477 +0,0 @@ -package pow.webserver; - - -import java.io.*; -import java.net.*; -import java.util.Iterator; -import java.util.Map; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -// SEE http://java.developpez.com/faq/xml/?page=dom -import javax.xml.parsers.*; -import javax.xml.transform.*; -import javax.xml.transform.dom.*; -import javax.xml.transform.stream.*; - -import org.w3c.dom.*; -import org.xml.sax.*; - -import org.apache.commons.codec.binary.Hex; - -/*import org.jdom.*; -import org.jdom.input.*; -import org.jdom.output.Format; -import org.jdom.output.XMLOutputter; -import org.jdom.filter.*; -*/ -import java.util.*; - -import pow.AES; -import pow.ivyclient.BusIvy_; -import pow.webserver.Conf; - -/** - * Servlet implementation class ajaxRqst - * handles the different request from a web client which wants to give orders to a drone - * and it handles administrator queries to manage users' profiles - */ -public class AjaxRqst extends HttpServlet { - private static final long serialVersionUID = 1L; - private String default_folder="blabla"; - private ServletContext srvCtxt; - private Conf myConf; - /** - * @see HttpServlet#HttpServlet() - */ - public AjaxRqst() { - super(); - } - - /** - * init the servlet - */ - public void init(ServletConfig config) throws ServletException { - super.init(config); // necessaire sinon getServletContext renvoie null dans doPost - default_folder = config.getServletContext().getRealPath(""); - srvCtxt = config.getServletContext(); - myConf = new Conf(default_folder,"pow_conf.xml"); - } - - /** - * handles different request from web users : - * orders to send to ivy buses and admin request to deal with users' account as well - * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) - */ - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - HttpSession session = request.getSession(true); - // recupere les parametres - PrintWriter out = response.getWriter(); - String order = request.getParameter("order"); // fpl_update... - if(order!=null) { - if (order.equals("fpl_update")) - { - System.out.println("move waypoint requested !!!"); - String wpt_name = request.getParameter("wpt_name"); - String aircraft_id = request.getParameter("aircraft_id"); - String wpt_id = request.getParameter("wpt_id"); - String new_alt = request.getParameter("new_alt"); - String new_lat = request.getParameter("new_lat"); - String new_lon = request.getParameter("new_lon"); - String new_alt_for_fpl = request.getParameter("new_alt_for_fpl"); - String dragged = request.getParameter("dragged"); - doFplUpdate(wpt_name,aircraft_id, wpt_id,new_alt, new_lat, new_lon, new_alt_for_fpl); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - - } - else if (order.equals("activate_block")){ - System.out.println("block activation requested !!!"); - String block_id = request.getParameter("block_id"); - String aircraft_id = request.getParameter("aircraft_id"); - doActivateBlock(block_id ,aircraft_id); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } - else if (order.equals("modif_setting")){ - System.out.println("modif setting requested !!!"); - String aircraft_id = request.getParameter("aircraft_id"); - String setting_id = request.getParameter("setting_id"); - String newsetting_value = request.getParameter("value"); - doModifSetting(aircraft_id,setting_id,newsetting_value); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } - else if (order.equals("create_user")){ - String login = request.getParameter("login"); - String pwd = request.getParameter("pwd"); - String right = request.getParameter("right"); - HashSet set_of_drone = null; - if (right.equals("user")){ - String liste_drone = request.getParameter("immats"); - StringTokenizer st = new StringTokenizer(liste_drone,";"); - set_of_drone = new HashSet(); - try{ - while (st.hasMoreTokens()) { - set_of_drone.add( st.nextToken()); - } - } - catch (NoSuchElementException ex){} - } - boolean res = doCreateUser(login,pwd,right,set_of_drone); - response.setContentType("text/xml"); - out.println(""); - if(res){ - out.println(""); - } - else{ - out.println(""); - } - out.println(""); - } - else if (order.equals("delete_user")){ - String login = request.getParameter("login"); - boolean res = doDeleteUser(login); - response.setContentType("text/xml"); - out.println(""); - if(res){ - out.println(""); - } - else{ - out.println(""); - } - out.println(""); - } - else if (order.equals("info_user")){ - String login = request.getParameter("login"); - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl"); - User usr = logTab.seek(login); - String right = getRight(usr.getRights()); - String liste = usr.getListDrone(); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } - else if (order.equals("modify_user")){ - String login = request.getParameter("login"); - String pwd = request.getParameter("pwd"); - String right = request.getParameter("right"); - String liste_drone = request.getParameter("liste_drone"); - StringTokenizer st = new StringTokenizer(liste_drone,";"); - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl"); - User usr = logTab.seek(login); - if (!pwd.equals("")) {usr.setPwd(pwd);} - usr.setRights(getRight(right)); - usr.clearListDrone(); - try{ - while (st.hasMoreTokens()) { - usr.addDrone(st.nextToken()); - } - } - catch (NoSuchElementException ex){} - logTab.serialize(default_folder + "/conf/"+"userTable.tbl"); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } - else if (order.equals("delete_drone")){ - String name = request.getParameter("name"); - try{ - DocumentBuilderFactory fabrique = DocumentBuilderFactory.newInstance(); - DocumentBuilder constructeur = fabrique.newDocumentBuilder(); - // read an xml file and build DOM structure - File xml = new File(default_folder + "/conf/"+"immat.xml"); - Document document = constructeur.parse(xml); - NodeList dronenameList = document.getElementsByTagName("drone"); - Element root= (Element) document.getElementsByTagName("immat").item(0); - int i = 0; - boolean doIt = true; - // removing node - while(i"); - - if(!doIt) out.println(""); - else out.println(""); - - out.println(""); - }catch(ParserConfigurationException pce){ - System.out.println("Erreur de configuration du parseur DOM"); - System.out.println("lors de l'appel à fabrique.newDocumentBuilder();"); - }catch(SAXException se){ - System.out.println("Erreur lors du parsing du document"); - System.out.println("lors de l'appel à construteur.parse(xml)"); - }catch(IOException ioe){ - System.out.println("Erreur d'entrée/sortie"); - System.out.println("lors de l'appel à construteur.parse(xml)"); - } - } - else if (order.equals("add_drone")){ - String name = request.getParameter("name"); - try{ - DocumentBuilderFactory fabrique = DocumentBuilderFactory.newInstance(); - DocumentBuilder constructeur = fabrique.newDocumentBuilder(); - // read an xml file and build DOM structure - File xml = new File(default_folder + "/conf/"+"immat.xml"); - Document document = constructeur.parse(xml); - Element root= (Element) document.getElementsByTagName("immat").item(0); - // inserting node - Element dronename = document.createElement("drone"); - dronename.setAttribute("name",name); - root.appendChild(dronename); - // save - writeXmlFile(document, default_folder + "/conf/"+"immat.xml"); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } catch(ParserConfigurationException pce){ - System.out.println("Erreur de configuration du parseur DOM"); - System.out.println("lors de l'appel à fabrique.newDocumentBuilder();"); - }catch(SAXException se){ - System.out.println("Erreur lors du parsing du document"); - System.out.println("lors de l'appel à construteur.parse(xml)"); - }catch(IOException ioe){ - System.out.println("Erreur d'entrée/sortie"); - System.out.println("lors de l'appel à construteur.parse(xml)"); - } - - } - else if (order.equals("delete_ivyusr")){ - String name = request.getParameter("login"); - boolean res ; - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userIvyTable.tbl"); - logTab.remove(name); - res = !logTab.isInside(name); - logTab.serialize(default_folder + "/conf/"+"userIvyTable.tbl"); - - response.setContentType("text/xml"); - out.println(""); - if(res){ - out.println(""); - } - else{ - out.println(""); - } - out.println(""); - - } - else if (order.equals("add_ivyusr")){ - String login = request.getParameter("login"); - String pwd = request.getParameter("pwd"); - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userIvyTable.tbl"); - User n = new User(login,pwd,Rights.IVY); - try{ - logTab.insert(n); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } catch(AlreadyRegisteredUserException e){ - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } - logTab.serialize(default_folder + "/conf/"+"userIvyTable.tbl"); - } - } - out.close(); - } - /** - * translate the right from string to a class - */ - private Rights getRight(String r) - { - if (r.equals("admin")) {return Rights.ADMIN;} - else if (r.equals("user")) {return Rights.USER;} - else {return Rights.VISITOR;} - } - /** - * translate the right from a class to a string - */ - private String getRight(Rights r) - { - if (r== Rights.ADMIN) {return "admin";} - else if (r== Rights.USER) {return "user";} - else {return "visitor";} - } - /** - * delete an user from the file which stores the users - */ - private boolean doDeleteUser(String login){ - boolean res ; - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl"); - logTab.remove(login); - res = !logTab.isInside(login); - logTab.serialize(default_folder + "/conf/"+"userTable.tbl"); - return res; - } - /** - * create an user in the file which stores the users - */ - private boolean doCreateUser(String login, String pwd,String right,Set set_of_drone){ - boolean res; - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl"); - Rights rght = this.getRight(right); - User usr = new User(login,pwd,rght); - if (rght==Rights.USER){ - Iterator itr = set_of_drone.iterator(); - while (itr.hasNext()){ - usr.addDrone(itr.next()); - } - } - try{ - logTab.insert(usr); - res = true; - logTab.serialize(default_folder + "/conf/"+"userTable.tbl"); - } - catch (AlreadyRegisteredUserException ex){ // existe deja - res = false; - } - return res; - - } - /** - * send an order to modif a setting of a drone which belongs to a specific ivy bus - */ - private void doModifSetting(String aircraft_web_id,String setting_id,String newsetting_value){ - String order = "DL_SETTING "+ aircraft_web_id + " " + setting_id + " " + newsetting_value; - sendOrder2Ivy(Integer.parseInt(aircraft_web_id),order); - } - /** - * send an order to jump to a new block for a drone which belongs to a specific ivy bus - */ - private void doActivateBlock(String block_id,String aircraft_web_id){ - // send msg via serveur.java - String order = "JUMP_TO_BLOCK " + aircraft_web_id + " " + block_id ; - sendOrder2Ivy(Integer.parseInt(aircraft_web_id),order); - } - /** - * send an order to move to a new waypoint for a drone which belongs to a specific ivy bus - */ - private void doFplUpdate(String wpt_name,String aircraft_web_id, String wpt_id, - String new_alt, String new_lat, String new_lon,String new_alt_for_fpl) { - // send msg via serveur.java - String order = "MOVE_WAYPOINT " + aircraft_web_id + " " + wpt_id + " " + new_lat + " " + new_lon + " " + new_alt ; - sendOrder2Ivy(Integer.parseInt(aircraft_web_id),order); - }// end method - - - /**This method writes a DOM document to a file - * - * @param doc the xml Document - * @param filename the name of the file to write in - */ - private static void writeXmlFile(Document doc, String filename) - { - try { - // Prepare the DOM document for writing - Source source = new DOMSource(doc); - // Prepare the output file - File file = new File(filename); - Result result = new StreamResult(file); - // Write the DOM document to the file - Transformer xformer = TransformerFactory.newInstance().newTransformer(); - xformer.transform(source, result); } - catch (TransformerConfigurationException e) { } - catch (TransformerException e) { } - } - - - /** - * send an order to a specific ivybus via udp - * @param ac_web_id the id of the drone on the web - * @param order the message to send - */ - private void sendOrder2Ivy(int ac_web_id,String order) - { - DatagramSocket socket=null; - try { - System.out.println("attempt to send order to ivy"); - socket = new DatagramSocket(); - socket.setSoTimeout(myConf.getSocketTimeout()); - ServletContext srvCtxt = getServletContext(); - // retrieve in the servlet context (shared memory) the table where the ivy session are stored - HashMap tableIvySession = (HashMap) srvCtxt.getAttribute("ivySessionTable"); - if ((socket!=null)&&(tableIvySession!=null)){ - byte buffer[] = new byte[myConf.getUdpSize()]; - Iterator> itr = tableIvySession.entrySet().iterator(); - BusIvy_ checked_bus=null; - boolean doIt=true; - // search for the session which owns the drone - while(itr.hasNext()&&doIt){ - checked_bus = itr.next().getValue().getBusIvy(); - if(checked_bus.isOwnBy(ac_web_id)){ - doIt = false ; - } - } - if(!doIt){ - InetAddress address = checked_bus.getAddress(); - SessionIvy session = tableIvySession.get(address); - AES aesCipher = session.getCipher(); - try{ - buffer = aesCipher.encrypt(order.getBytes()); - DatagramPacket DataEmitted = new DatagramPacket(buffer, buffer.length, address, myConf.portWebToIvy()); - try { - socket.send(DataEmitted); - System.out.println("\tmsg sended to ivy "+ address.toString()+":"+myConf.portWebToIvy()); - System.out.println("\t"+order); - //System.out.print("*"); - } catch (IOException e) { - System.out.println("\terreur msg not sended to " +address.toString()+":"+myConf.portWebToIvy()); - e.printStackTrace(); - } - } catch (IOException e) { - System.out.println("\terreur in encryption, msg not sended to " +address.toString()+":"+myConf.portWebToIvy()); - e.printStackTrace(); - } - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("\torder := "+(new String(Hex.encodeHex(order.getBytes())))); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("\torder := "+(new String(Hex.encodeHex(order.getBytes())))); - } - } - } - else - { - // error - System.out.println("\tunable to know socket udp or session "); - } - socket.close(); - } catch (SocketException e1) { - System.out.println("\tunable to open socket webtoIvy for an user request"); - e1.printStackTrace(); - } - finally{if(socket!=null){socket.close();socket=null;}} - } - -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/AlreadyRegisteredUserException.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/AlreadyRegisteredUserException.java deleted file mode 100755 index 674a33ce3c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/AlreadyRegisteredUserException.java +++ /dev/null @@ -1,20 +0,0 @@ -package pow.webserver; -/** - * exception to inform that a user cannot be created in the users' file - * because it exists yet - * @author genin - * - */ -public class AlreadyRegisteredUserException extends Exception { - private static final long serialVersionUID = 1L; - private User usr; - - public AlreadyRegisteredUserException (User u){ - usr = u; - } - - public String toString() { - return "AlreadyRegisteredUserException : login " + usr.getLogin() + " is already used" ; - } - -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Conf.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Conf.java deleted file mode 100755 index c01259552f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Conf.java +++ /dev/null @@ -1,165 +0,0 @@ -package pow.webserver; -import java.io.*; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.SAXException; -/** - * - * store useful data about the server configuration - * and database connection by - * reading a specific file place in the 'conf' folder of - * the web application - */ -public class Conf { - /** The mail of the administrator to contact if any problems occurs - * (appears in the help.jsp page. */ - private String mailAdmin; - /** The administrator login (not used). */ - private String adminLogin; - /** The port in which the module listen to get udp trames from ivy buses. */ - private int portIvyToWeb; - /** The dimension of the datagrams received. */ - private int tailleUdpTrame; - /** The passWord of the database */ - private String dbPassword; - /** The userName of the dataBase */ - private String dbUserName; - /** The Name of the dataBase */ - private String dataBaseName; - /** The timeout of the connection */ - private int udpTimeout; - /** The port in which messages from web are sent to ivy buses */ - private int portWebToIvy ; - /** period of time in millisec to reset the filter of waypoint_moved messages */ - private long time2resetFilter; - /** period of time in millisec to send all the parameter values for a specific drone */ - private long timeToSendValues; - /** time to wait for the acknowledgement of an order */ - private int order_response_timeout; - /** time to wait after a die event to remove the drone */ - private int dieEventTimeoutTime; - /** time to wait after receiving no data for a drone to remove the drone */ - private int dataEventTimeoutTime; - /** period of time to check for dead ivy buses in serveur.java*/ - private long time2checkDeadBuses; - /** how the database work VERBOSE or SILENT*/ - private DbMode dbMode; - /** - * - * @param default_folder folder of the web application on the server - * @param conf_filename name of the configuration file placed in 'conf' folder of the web application - */ - public Conf(String default_folder,String conf_filename) - { - try{ - DocumentBuilderFactory fabrique = DocumentBuilderFactory.newInstance(); - // création d'un constructeur de documents - DocumentBuilder constructeur = fabrique.newDocumentBuilder(); - // lecture du contenu d'un fichier XML avec DOM - File xml = new File(default_folder + "/conf/"+conf_filename); - Document document = constructeur.parse(xml); - Element mailAdmin_node = (Element)document.getElementsByTagName("mailWebAdmin").item(0); - Element adminLogin_node = (Element)document.getElementsByTagName("webAdminLogin").item(0); - Element portIvyToWeb_node = (Element)document.getElementsByTagName("portIvyToWeb").item(0); - Element taille_node = (Element)document.getElementsByTagName("sizeUdpTrame").item(0); - Element passWord_node = (Element)document.getElementsByTagName("dbPassword").item(0); - Element userName_node = (Element)document.getElementsByTagName("dbUserName").item(0); - Element dataBaseName_node = (Element)document.getElementsByTagName("dataBaseName").item(0); - Element timeout_node = (Element)document.getElementsByTagName("udpSocketTimeout").item(0); - Element portWebToIvy_node = (Element)document.getElementsByTagName("portWebToIvy").item(0); - Element time2resetFilter_node = (Element)document.getElementsByTagName("time2resetFilter").item(0); - Element timeToSendValuesy_node = (Element)document.getElementsByTagName("timeToSendValues").item(0); - Element order_response_timeout_node = (Element)document.getElementsByTagName("order_response_timeout").item(0); - Element dieEventTimeoutTime_node = (Element)document.getElementsByTagName("dieEventTimeoutTime").item(0); - Element dataEventTimeoutTime_node = (Element)document.getElementsByTagName("dataEventTimeoutTime").item(0); - Element time2checkDeadBuses_node = (Element)document.getElementsByTagName("time2checkDeadBuses").item(0); - - Element dbMode_node = (Element)document.getElementsByTagName("dbMode").item(0); - String dbMode_str = dbMode_node.getTextContent(); - if (dbMode_str.equals("verbose")){dbMode = DbMode.VERBOSE;} - else {dbMode = DbMode.SILENT;} - mailAdmin=mailAdmin_node.getTextContent(); - adminLogin=adminLogin_node.getTextContent(); - portIvyToWeb=Integer.parseInt(portIvyToWeb_node.getTextContent()); - tailleUdpTrame=Integer.parseInt(taille_node.getTextContent()); - dbPassword=passWord_node.getTextContent(); - dbUserName=userName_node.getTextContent(); - dataBaseName=dataBaseName_node.getTextContent(); - udpTimeout=Integer.parseInt(timeout_node.getTextContent()); - portWebToIvy=Integer.parseInt(portWebToIvy_node.getTextContent()); - time2resetFilter=Long.parseLong(time2resetFilter_node.getTextContent()); - timeToSendValues=Long.parseLong(timeToSendValuesy_node.getTextContent()); - order_response_timeout=Integer.parseInt(order_response_timeout_node.getTextContent()); - dieEventTimeoutTime=Integer.parseInt(dieEventTimeoutTime_node.getTextContent()); - dataEventTimeoutTime=Integer.parseInt(dataEventTimeoutTime_node.getTextContent()); - time2checkDeadBuses =Integer.parseInt(time2checkDeadBuses_node.getTextContent()); - } catch(ParserConfigurationException pce){ - System.out.println("error in loading configuration file : "+default_folder + "/conf/"+conf_filename); - pce.printStackTrace(); - }catch(SAXException se){ - System.out.println("error in loading configuration file : "+default_folder + "/conf/"+conf_filename); - se.printStackTrace(); - }catch(IOException ioe){ - System.out.println("error in loading configuration file : "+default_folder + "/conf/"+conf_filename); - ioe.printStackTrace(); - } - } - /** @return the udp port on which the server receive data from ivy buses */ - public int portIvyToWeb() - { - return portIvyToWeb; - } - /** @return the udp port on which the server send data to ivy buses */ - public int portWebToIvy() - { - return portWebToIvy; - } - /** @return the max size of an udp trame */ - public int getUdpSize() - { - return tailleUdpTrame; - } - /** @return the password to connect to the database*/ - public String getDBPassword() - { - return dbPassword; - } - /** @return the login to connect to the database*/ - public String getDBUserName() - { - return dbUserName; - } - /** @return the database name*/ - public String getDataBaseName() - { - return dataBaseName; - } - /** @return a time after what an exception is thrown if no message has been received by server*/ - public int getSocketTimeout() - { - return udpTimeout; - } - /** @return the mail to contact if any problem occurs */ - public String mailAdmin(){return mailAdmin;} - /** @return the login of the administrator of the site */ - public String adminLogin(){return adminLogin;} - /**@return period of time in millisec to reset the filter of waypoint_moved messages */ - public long getTime2resetFilter(){return time2resetFilter;} - /**@return period of time in millisec to send all the parameter values for a specific drone */ - public long getTimeToSendValues(){return timeToSendValues;} - /**@return time to wait for the acknowledgement of an order */ - public int getOrderResponseTimeout(){return order_response_timeout;} - /**@return time to wait after a die event to remove the drone */ - public int getDieEventTimeoutTime(){return dieEventTimeoutTime;} - /**@return time to wait after receiving no data for a drone to remove the drone */ - public int getDataEventTimeoutTime(){return dataEventTimeoutTime;} - /**@return period of time to check for dead ivy buses in serveur.java*/ - public long getTime2checkDeadBuses(){return time2checkDeadBuses;} - /**@return SILENT or VERBOSE */ - public DbMode getDbMode(){return dbMode;} -} \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/DbMode.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/DbMode.java deleted file mode 100755 index e7b55cc8a0..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/DbMode.java +++ /dev/null @@ -1,11 +0,0 @@ -package pow.webserver; -/** - * specify how the database works - * @author genin - */ -public enum DbMode { - /** the database records all ivy messages the server receives */ - VERBOSE, - /** the database stores only connection activity of ivy client */ - SILENT -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/DbOrder.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/DbOrder.java deleted file mode 100755 index 8af9576f31..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/DbOrder.java +++ /dev/null @@ -1,18 +0,0 @@ -package pow.webserver; -/** - * represents 4 kind of message stored in database - * CONNECT first connection of an ivy bus --> inform db - * DECONNECT ivy bus deconnected --> inform db - * ADD add message to db - * @author genin - */ -public enum DbOrder { - /** store the message and create a record in the 'connexion' table */ - CONNECT, - /** store the message and complete the end field in the 'connexion' table */ - DECONNECT, - /** just store the data in the log table*/ - ADD_DATA, - /** the message is an order coming from a web user */ - ADD_ORDER -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Greeting.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Greeting.java deleted file mode 100755 index 00367b91d0..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Greeting.java +++ /dev/null @@ -1,101 +0,0 @@ -package pow.webserver; - -import java.io.File; -import java.io.PrintWriter; -import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.*; -import java.util.Iterator; - -/** - * Servlet implementation class Greeting - * Handles the connection request from a new web client - * check the login's information and rights - */ -public class Greeting extends HttpServlet { - private static final long serialVersionUID = 1L; - private String default_folder="blabla"; - - public void init(ServletConfig config) throws ServletException { - super.init(config); // needed otherwise getServletContext return null in doPost method - default_folder = config.getServletContext().getRealPath(""); - // create a default web user file if it does not exist - File def_user_file = new File(default_folder + "/conf/"+"userTable.tbl"); - if (!def_user_file.exists()){ - User usr0 = new User("admin","pwdadmin",Rights.ADMIN); - User usr1 = new User("user1","pwduser1",Rights.USER); - usr1.addDrone("MJ5"); - usr1.addDrone("TJ1"); - UserTab logTab = new UserTab(); - try{ - logTab.insert(usr0); - logTab.insert(usr1); - } - catch(AlreadyRegisteredUserException e) {} - logTab.serialize(default_folder + "/conf/"+"userTable.tbl"); - } - } - - public Greeting(){ - super(); - - } - - /** - * handles web user login request - */ - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - // jsp session - HttpSession session = request.getSession(true); - String login = request.getParameter("login"); - String password; - response.setContentType("text/html;charset=UTF-8"); - PrintWriter out = response.getWriter(); - if (login ==null) - { - login = "VISITOR"; - password=null; - session.setAttribute("login",login); - session.setAttribute("rights","visitor"); - // ok start the interface - out.println(""); - } - else { - // on verifie la validite du mot de passe - login = request.getParameter("login").toString(); - password = request.getParameter("password").toString(); - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl"); - if (logTab.checkUser(login, password)){ - - Rights r = logTab.seek(login).getRights(); - session.setAttribute("login",login); - if (r==Rights.ADMIN){ - session.setAttribute("rights","admin"); - } - else if (r==Rights.USER) { - session.setAttribute("rights","user"); - Iterator itr = logTab.getItrUsr(login); - String dronenameallowedtobectl=""; - if (itr!=null){ - while(itr.hasNext()){ - dronenameallowedtobectl+=itr.next()+";"; - // transmettre la liste des avions a la page web - } - } - session.setAttribute("dronectl",dronenameallowedtobectl); - } - else { - session.setAttribute("rights","visitor");// inutile normalement - } - // ok on lance l'interface - out.println(""); - } - else { - // we send the error page - out.println(""); - } - } - out.close(); - } -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/HeartBeat.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/HeartBeat.java deleted file mode 100755 index c7e6135892..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/HeartBeat.java +++ /dev/null @@ -1,84 +0,0 @@ -package pow.webserver; - -import java.io.IOException; -import java.net.DatagramPacket; -import java.net.DatagramSocket; -import java.net.InetAddress; -import java.net.SocketException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.servlet.ServletContext; - -import pow.AES; - -public class HeartBeat implements Runnable{ - /** to retrieve AES cipher and InetAddress for a specific ivy bus*/ - - private ServletContext srvCtxt; - private int heartPeriod; - private boolean doIt; - private int port; - /** - * - * @param s the object which stores ivysessions - * @param h the period of the heartbeats - * @param p the udp port to use to send heartbeat - */ - public HeartBeat( ServletContext s,int h,int p){ - srvCtxt = s; - heartPeriod = h ; - port = p; - doIt= true; - } - /** - * send a periodic heartbeat message to every connected ivy bus - */ - public void run(){ - - String msg = "SERVER_HEARTBEAT"; - byte[] buffer; - DatagramSocket socket=null; - AES cipher ; - InetAddress ip_addr; - while(doIt) - { - try { - Thread.sleep(heartPeriod); - socket = new DatagramSocket(); - HashMap tableIvySession = (HashMap) srvCtxt.getAttribute("ivySessionTable"); - if (tableIvySession!=null){ - Iterator> itr = tableIvySession.entrySet().iterator(); - while(itr.hasNext()){ - Map.Entry n= itr.next(); - cipher = n.getValue().getCipher(); - ip_addr = n.getKey();System.out.println("send heart to "+ ip_addr); - buffer = cipher.encrypt(msg.getBytes()); - DatagramPacket DataEmitted = new DatagramPacket(buffer, buffer.length, ip_addr, port); - try { - socket.send(DataEmitted); - //System.out.println("\nHeartbeat sended to "+ip_addr); - } catch (IOException e) { - System.out.println("\tHeartbeat pbm");e.printStackTrace(); - } - } - } - - } catch (InterruptedException e) {System.out.println("\tHeartbeat pbm");e.printStackTrace(); } - catch (SocketException ex) { System.out.println("\tHeartbeat pbm");ex.printStackTrace();} - catch(BadPaddingException ex){System.out.println("\tHeartbeat pbm");ex.printStackTrace();} - catch(IllegalBlockSizeException ex){System.out.println("\tHeartbeat pbm");ex.printStackTrace();} - catch(IOException ex){System.out.println("\tHeartbeat pbm");ex.printStackTrace();} - finally{if(socket!=null){socket.close();socket = null ;} } - } - } - /** - * stop the heartbeat process of the server - */ - public void stop_thread(){ - doIt=false; - } -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Ivy2TomcatHttpServer.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Ivy2TomcatHttpServer.java deleted file mode 100755 index a310d00187..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Ivy2TomcatHttpServer.java +++ /dev/null @@ -1,334 +0,0 @@ -package pow.webserver; - -import java.io.PrintWriter; -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.codec.binary.Hex; -import org.apache.commons.fileupload.*; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.apache.commons.fileupload.disk.DiskFileItemFactory; - -import pow.AES; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.Statement; -import java.sql.Timestamp; -import java.util.HashMap; -import java.util.List; -import java.util.Iterator; -import java.io.File; -import java.net.InetAddress; -/** - * Handles the connection request from a new ivy bus - * provide a unique id for the ivy bus - * provide a unique id for each new drone on a ivy bus - * handles the uploading of the configuration files for each new drone on a ivy bus - */ -public class Ivy2TomcatHttpServer extends HttpServlet { - private static final long serialVersionUID = 1L; - private static int webIdCount = 1; - private static int droneIdCount = 1; - private ServletContext srvCtxt = null; - private String default_folder="blabla"; - private HashMap tableIvySession ;// correspondance webid,session ivy - private Conf myConf; - - /** - * - */ - public Ivy2TomcatHttpServer() { - super(); - } - - public void init(ServletConfig config) throws ServletException { - - // TODO clear the upload folder ? - srvCtxt = config.getServletContext(); - default_folder = config.getServletContext().getRealPath(""); - // - myConf = new Conf(default_folder,"pow_conf.xml"); - // - String filepath = default_folder + "/upload"; - File repository = new File(filepath); - deleteDirectory(repository); - repository = new File(filepath); - if ((!repository.exists()) && (!repository.isDirectory())) { - repository.mkdir(); // exists isDirectory() - } - tableIvySession = new HashMap(); - // put the table in the memory shared by all the servlet of the web application (context) - config.getServletContext().setAttribute("ivySessionTable", tableIvySession); - // create a default ivy user file if it does not exist - File def_user_file = new File(default_folder + "/conf/"+"userIvyTable.tbl"); - if (!def_user_file.exists()){ - User usr0 = new User("admin_ivy","pwdadmin_ivy",Rights.IVY); - UserTab logTab = new UserTab(); - try{ - logTab.insert(usr0); - } - catch(AlreadyRegisteredUserException e) {} - logTab.serialize(default_folder + "/conf/"+"userIvyTable.tbl"); - } - } - /** - * delete recursivly a folder - * @param path the path of the folder to delete - * @return true if the folder is correctly deleted - */ - static private boolean deleteDirectory(File path) { - boolean resultat = true; - - if( path.exists() ) { - File[] files = path.listFiles(); - for(int i=0; i"); - out.println("1"); - out.println(""+newWebId+""); - out.println(""+aesKey+""); - out.println(""+aesIv+""); - out.println(""+myConf.getTime2resetFilter()+""); - out.println(""+myConf.getTimeToSendValues()+""); - out.println(""+myConf.getSocketTimeout()+""); - out.println(""); - InetAddress remoteClient = InetAddress.getByName(request.getRemoteAddr()); - SessionIvy session = new SessionIvy(login,newWebId,cipher_aes,remoteClient); - tableIvySession.put(remoteClient,session); - out.close(); - System.out.println("**************************************"); - System.out.println("Web Id sended = " + newWebId); - System.out.println("remote client = " + request.getRemoteAddr() + " host=" + request.getRemoteHost() + " port=" + request.getRemotePort()); - System.out.println("key sended = " + aesKey ); - System.out.println("iv parameter = " + aesIv ); - System.out.println("**************************************"); - } - catch (Exception ex){ - PrintWriter out = response.getWriter(); - out.println(""); - out.println("2"); - out.println(""); - out.close(); - System.out.println("AES encryption not supported by server!!!\n"); - ex.printStackTrace(); - } - } - else{ - PrintWriter out = response.getWriter(); - out.println(""); - out.println("3"); - out.println(""); - out.close(); - System.out.println("DataBase unable to give a webId!!!\n"); - } - } - else { - PrintWriter out = response.getWriter(); - out.println(""); - out.println("0"); - out.println(""); - out.close(); - System.out.println("Not authorized access attempt from an ivy client!!!"); - } - } - else if (order.equals("reconnect")) - { - - } - else if (order.equals("requestNewDroneWebId")) - {// client has a webId (not in multipart post) yet and wants to do somtheing else than uploading - System.out.println("Drone Web Id for new drone requested !!!"); - String ivyId = request.getParameter("ivyWebId"); - System.out.println("ivyId " + ivyId + " request new Drone Web Id for unknown ivy drone ");// + ivyDroneId); - int webidsession = Integer.parseInt(ivyId); - int newdroneWebId = droneIdCount;droneIdCount++; - PrintWriter out = response.getWriter(); - out.println(""); - out.close(); - System.out.println("new drone Web Id sended (dronewebid = "+newdroneWebId+") !!!"); - } - } - else // client has a webId ( in multipart post) yet and wants to upload conf files - { - System.out.println("uploading file requested..."); - String res = uploadFile(request); - PrintWriter out = response.getWriter(); - out.println(""); - out.println(res); - out.println(""); - out.close(); - }// end if check IvyId - - } - - - /** - * contact database if any to have a new webid - * @return a webid>0 or -1 if failed - */ - public int getWebId(String login){ - int res ; - Connection connection = null; - Statement stmt = null; - ResultSet rs = null; - // récupération du dbName,dbLogin et dbPwd - - String dbName = (String) srvCtxt.getAttribute("dbName"); - String dbUser = (String) srvCtxt.getAttribute("dbUser"); - String dbPwd = (String) srvCtxt.getAttribute("dbPwd"); - String url = "jdbc:mysql://localhost/"+dbName; - try{ - Class.forName("com.mysql.jdbc.Driver").newInstance(); - connection = DriverManager.getConnection(url,dbUser,dbPwd); - stmt = connection.createStatement(); - Timestamp t = new Timestamp(System.currentTimeMillis()); - String monHeure = t.toString(); - stmt.executeUpdate("INSERT INTO connexion (login,start) VALUES ('"+login+"','"+monHeure+"')"); - rs = stmt.executeQuery("SELECT MAX(webId) as nextwebid FROM connexion"); - rs.first(); - if (!rs.wasNull()) res = rs.getInt("nextwebid"); - else res = -1; - } - catch(Exception e){ - e.printStackTrace(); - System.out.println("attempt to get new web id from database failed"); - res= -1; - } - finally{ - if(connection!=null){try{connection.close();}catch(Exception e){e.printStackTrace();}} - webIdCount++; - } - return res; - } - - /* - * handles the upload of a file from a ivy bus to the server via http - */ - private String uploadFile(HttpServletRequest request){ - boolean isMultipart = ServletFileUpload.isMultipartContent(request); - String resu = "-1"; - List items=null; - String webid="zzz"; - String droneid = "yyy"; - String filepath=""; - - System.out.println("!!!def upload rep !!! " + default_folder); - File uploadedFile; - if (isMultipart) - { - - // Create a factory for disk-based file items - FileItemFactory factory = new DiskFileItemFactory(); - // Set factory constraints - // factory.setSizeThreshold(yourMaxMemorySize); - // factory.setRepository(yourTempDirectory); - // Create a new file upload handler - ServletFileUpload upload = new ServletFileUpload(factory); - // Set overall request size constraint - // upload.setSizeMax(yourMaxRequestSize); - // Parse the request - try { - items = upload.parseRequest(request); - // Process the uploaded items - // searching for the webId parameter - boolean doIt1 = true;boolean doIt2 = true; - Iterator iter = items.iterator(); - while ((doIt1||doIt2) && iter.hasNext()) { - FileItem item = (FileItem) iter.next(); - if (item.isFormField()) { - String fieldName = item.getFieldName(); - if (fieldName.equals("ivyWebId")){ - doIt1 = false ; - webid = item.getString(); - } - else if (fieldName.equals("droneWebId")){ - doIt2 = false; - droneid = item.getString(); - } - } - } - filepath = default_folder +"/upload/"+droneid; - File repository = new File(filepath); - if ((!repository.exists()) && (!repository.isDirectory())) { - boolean res=repository.mkdir(); // exists isDirectory() - System.out.println("repertoire "+filepath+" cree ? " + res); - } - if (!webid.equals("zzz")){ - // searching for file parameters - iter = items.iterator(); - while (iter.hasNext()) { - FileItem item = (FileItem) iter.next(); - if (!item.isFormField()) { // check the type of the item - String fileName = item.getName(); - //String contentType = item.getContentType(); - //boolean isInMemory = item.isInMemory(); - //long sizeInBytes = item.getSize(); - uploadedFile = new File(filepath+"/"+fileName); - try { - item.write(uploadedFile); - resu = "1"; - System.out.println("file: "+fileName+" for web drone "+droneid+" was uploaded successfully"); - } catch (Exception e) { - resu = "0"; - System.out.println("unable to write file on server : "+droneid+"/"+fileName); - e.printStackTrace(); - } - } //end if - } // end while - } - } catch (FileUploadException e) { - System.out.println("unable to parse client request "); - e.printStackTrace(); - } - } // end if multipart - return resu; - } -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/IvyMsg.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/IvyMsg.java deleted file mode 100755 index ecbbdea270..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/IvyMsg.java +++ /dev/null @@ -1,57 +0,0 @@ -package pow.webserver; - -/** - * represents information which are sended by the source event to the database on the queue fifo - * @author genin - * - */ -public class IvyMsg { - - private int webId; - private long num_msg; - private String timeMsg;//"d:M:y:HH:mm:ss" add 2000 to d - private String ivyMsg; - private DbOrder order; - - public IvyMsg(int wId,long num,String date,String msg,DbOrder order){ - webId = wId; - num_msg = num; - timeMsg = date; - ivyMsg = msg; - this.order = order; - } - - public IvyMsg(int wId,long num,String date,String msg){ - webId = wId; - num_msg = num; - timeMsg = date; - ivyMsg = msg; - this.order = null; - } - - public IvyMsg(int wId){ - webId = wId; - num_msg = -1; - timeMsg = "-1"; - ivyMsg = "deconnect all drone"; - this.order = DbOrder.DECONNECT; - } - /** @return the ivy web ivy which has sent the message */ - public int getWebId(){return webId;} - /** @return the number of the message */ - public long getNumMsg() {return num_msg;} - /** @return the time at which the message was sent*/ - public String getTimeMsg() {return timeMsg;} - /** @return the ivy message */ - public String getIvyMsg() {return ivyMsg;} - /** @return an order on how to store the ivy message in database */ - public DbOrder getOrder() {return order;} - /** - * specify how to store the message in database - * @see DbOrder - * @param o the way to store the message in database - */ - public void setOrder(DbOrder o ) { order=o;} - - -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Log.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Log.java deleted file mode 100755 index 9e22f610a9..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Log.java +++ /dev/null @@ -1,73 +0,0 @@ -package pow.webserver; -import java.io.*; -import java.util.Calendar; -/** - * Handles the writing of a log in a file - * @author from V1 - * @since V1 - */ -public class Log { - - private File oFile = null; - private FileWriter oFileWriter = null; - private BufferedWriter oBufferedWriter = null; - /** - * create a log file into the log floder of the web application - * @param path the complete path of the web application - */ - public Log(String path) - { - Calendar Today = Calendar.getInstance(); - String fileName = String.valueOf(Today.get(Calendar.DAY_OF_MONTH)) + - String.valueOf(Today.get(Calendar.MONTH)) + - String.valueOf(Today.get(Calendar.YEAR)) + - String.valueOf(Today.get(Calendar.HOUR_OF_DAY)) + - String.valueOf(Today.get(Calendar.MINUTE)) + - String.valueOf(Today.get(Calendar.SECOND)) + - ".log"; - - try - { - oFile = new File(path+"/log/" + fileName); - oFile.createNewFile(); - oFileWriter = new FileWriter(oFile); - oBufferedWriter = new BufferedWriter(oFileWriter); - - oBufferedWriter.write("##########################################"); oBufferedWriter.newLine(); - oBufferedWriter.write("########## PAPARAZZI ON THE WEB ##########"); oBufferedWriter.newLine(); - oBufferedWriter.write("##########################################"); oBufferedWriter.newLine(); - oBufferedWriter.newLine(); - oBufferedWriter.write("Beginning of log : "); oBufferedWriter.newLine(); - oBufferedWriter.newLine(); - oBufferedWriter.flush(); - } - catch(IOException ex) - { - System.out.println("No log file created "); - ex.printStackTrace(); - } - } - /** - * write a string in log file and on stdout - * @param writing the string to write in the log file - */ - public void write(String writing) - { - Calendar Now = Calendar.getInstance(); - String Time = String.valueOf(Now.get(Calendar.HOUR_OF_DAY)) + ":" + - String.valueOf(Now.get(Calendar.MINUTE)) + ":" + - String.valueOf(Now.get(Calendar.SECOND)); - writing = writing.trim(); - try - { - oBufferedWriter.write(Time + " -> " + writing); oBufferedWriter.newLine(); - oBufferedWriter.flush(); - System.out.println("\nlog at : " + Time + " -> " + writing); - } - catch(IOException ex) - { - System.out.println(ex.getMessage()); - } - - } -} \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Md5.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Md5.java deleted file mode 100755 index 95e2c840ba..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Md5.java +++ /dev/null @@ -1,90 +0,0 @@ -package pow.webserver; - -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -/** - * tool class to implemente MD5 encoding - * ( found on the web ) - */ -public class Md5 -{ - /** - * @param password the string to encode with MD5 algorithm - * @return the encoded string with MD5 algorithm - */ - public static String encode(String password) - { - byte[] uniqueKey = password.getBytes(); - byte[] hash = null; - - try - { - hash = MessageDigest.getInstance("MD5").digest(uniqueKey); - } - catch (NoSuchAlgorithmException e) - { - throw new Error("No MD5 support in this VM."); - } - - StringBuilder hashString = new StringBuilder(); - for (int i = 0; i < hash.length; i++) - { - String hex = Integer.toHexString(hash[i]); - if (hex.length() == 1) - { - hashString.append('0'); - hashString.append(hex.charAt(hex.length() - 1)); - } - else - hashString.append(hex.substring(hex.length() - 2)); - } - return hashString.toString(); - } -/* - // example to adapt for SHA encoding - public static String hash(String plaintext) { - MessageDigest md = null; - - try { - md = MessageDigest.getInstance("SHA-1"); // SHA-1 generator instance - } catch(NoSuchAlgorithmException e) { - return ""; - } - - try { - //8859_1 ou UTF-8 - md.update(plaintext.getBytes("UTF-8")); // Message summary generation - } catch(UnsupportedEncodingException e) { - return ""; - } - - byte raw[] = md.digest(); // Message summary reception - - try{ - String hash = new String(org.apache.commons.codec.binary.Base64.encodeBase64(raw),"UTF-8"); - //String hash = new String(raw); - return hash; - } - catch (UnsupportedEncodingException use){ - return ""; - } - } - - */ - /** - * example - */ - public static void main(String[] args) - { - if (args.length != 1) - { - System.out.println("Usage: java Md5 "); - return; - } - - String toEncode = args[0]; - - System.out.println("Original string ... " + toEncode); - System.out.println("String MD5 ........ " + encode(toEncode)); - } -} \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Rights.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Rights.java deleted file mode 100755 index b0fda632c2..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Rights.java +++ /dev/null @@ -1,16 +0,0 @@ -package pow.webserver; -/** - * describe the different rights a web user can have - * @author genin - * - */ -public enum Rights { - /** can only see the drones */ - VISITOR, - /** can pilot all the drones and manage user's account and create others administrators*/ - ADMIN, - /** can pilot only specific drones which are specified in its user account */ - USER, - /** specify an ivy user which send data to the server via UDP */ - IVY -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/SGBDfeeder.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/SGBDfeeder.java deleted file mode 100755 index fd566db8ef..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/SGBDfeeder.java +++ /dev/null @@ -1,154 +0,0 @@ -package pow.webserver; - -import java.sql.Connection; -import java.sql.DriverManager; -//import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; -import java.util.concurrent.LinkedBlockingQueue; - - -/** - * thread which waits for ivy messages sent by event source (serveur.java) - * and stores them into a mysql database - * the ivy messages are extracted from a blocking queue (fifo) - * parameter of the database are extracted from conf file - * @link http://dev.mysql.com/doc/refman/5.0/fr/sql-syntax.html - */ -public class SGBDfeeder implements Runnable { - - private String dbName; - private String dbLogin; - private String dbPwd; - private String url ; - private LinkedBlockingQueue fifo; - private boolean doIt; - private DbMode mode; - /** - * create a thread which fill the database with the message it extracts from the fifo - * @param dbname the name of the database - * @param dbuser the user login to connect to the database - * @param dbpwd the user password to connect to the database - */ - public SGBDfeeder(String dbname,String dbuser,String dbpwd,DbMode mode){ - //fifo = new ConcurrentLinkedQueue(); - fifo = new LinkedBlockingQueue(); - dbName = dbname; - dbLogin= dbuser; - dbPwd = dbpwd; - url = "jdbc:mysql://localhost/"+dbName; - doIt = true; - this.mode = mode; - } - /** - * - * @return the fifo to communicate with the database feeder - */ - public LinkedBlockingQueue getQueueFIFO(){ - return fifo; - } - /** - * stop the thread by ending run method - * used caused Thread.stop is now deprecated - */ - public void kill(){ - doIt= false; - } - /** - * listens fifo queue and stores ivy messages in database - * if the message has the DECONNECT type it also fills the end field corresponding - * to this ivy session into the 'connexion' table - */ - public void run() { - while(doIt){ - try { - IvyMsg msg = fifo.take(); // fetch an ivy message in the fifo or wait - // store it in db - DbOrder order = msg.getOrder(); - switch(order){ - case DECONNECT :{ - storeDeconnectionMsg(msg.getIvyMsg(), msg.getWebId()); - break; - } - default : { - if (mode == DbMode.VERBOSE) // if mode is silent, we don't store messages in db - { - storeMsg(msg.getIvyMsg(), msg.getWebId()); - } - break; - } - } - } catch (InterruptedException e) { - System.out.println("database exception : no receiving data"); - //e.printStackTrace(); - } - } - System.out.println("fin thread datafeeder ok"); - } - - /** - * connecting to db and store a no specific message - * @param msg - * @param webId - */ - private void storeMsg(String msg, int webId){ - Connection connection = null; - Statement stmt = null; - // ResultSet rs; - try { - Class.forName("com.mysql.jdbc.Driver").newInstance(); - connection = DriverManager.getConnection(url,dbLogin,dbPwd); - try{ - stmt = connection.createStatement(); - stmt.executeUpdate("INSERT INTO log (msg,webId) VALUES ('"+msg+"',"+webId+")"); - } - catch (SQLException ex) { - System.out.println("SQLException: " + ex.getMessage()); - System.out.println("SQLState: " + ex.getSQLState()); - System.out.println("VendorError: " + ex.getErrorCode()); - } - } - catch (SQLException ex) {System.out.println("unable to connect to db");} - catch (ClassNotFoundException ex) {ex.printStackTrace();} - catch (IllegalAccessException ex){ex.printStackTrace();} - catch ( InstantiationException ex){ex.printStackTrace();} - finally - { - if(connection!=null){try{connection.close();}catch(Exception e){e.printStackTrace();}} - } - } - /** - * deconnection message , fill the end field in connexion table - * and store the message in log table - */ - private void storeDeconnectionMsg(String msg, int webId){ - Connection connection = null; - Statement stmt = null; - Timestamp t = new Timestamp(System.currentTimeMillis()); - String monHeure = t.toString(); - try { - Class.forName("com.mysql.jdbc.Driver").newInstance(); - connection = DriverManager.getConnection(url,dbLogin,dbPwd); - try{ - stmt = connection.createStatement(); - stmt.executeUpdate("UPDATE connexion SET end='"+monHeure+"' WHERE webId="+webId); - stmt = connection.createStatement(); - stmt.executeUpdate("INSERT INTO log (msg,webId) VALUES ('"+msg+"',"+webId+")"); - } - catch (SQLException ex) { - System.out.println("SQLException: " + ex.getMessage()); - System.out.println("SQLState: " + ex.getSQLState()); - System.out.println("VendorError: " + ex.getErrorCode()); - } - } - catch (SQLException ex) {System.out.println("unable to connect to db");} - catch (ClassNotFoundException ex) {ex.printStackTrace();} - catch (IllegalAccessException ex){ex.printStackTrace();} - catch ( InstantiationException ex){ex.printStackTrace();} - finally - { - if(connection!=null){try{connection.close();}catch(Exception e){e.printStackTrace();}} - } - } -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/SSLUtilities.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/SSLUtilities.java deleted file mode 100755 index dc2cce1cfd..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/SSLUtilities.java +++ /dev/null @@ -1,322 +0,0 @@ -package pow.webserver; - -import java.security.GeneralSecurityException; -import java.security.SecureRandom; -import java.security.cert.X509Certificate; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; - -/** - * This class provide various static methods that relax X509 certificate and - * hostname verification while using the SSL over the HTTP protocol. - * call: - * SSLUtilities.trustAllHostnames() to turn off the default hostname verification on HTTPS connection; - * SSLUtilities.trustAllHttpsCertificates() to turn off the default certificate validation on HTTPS connection. - * - * @link http://en.wikibooks.org/wiki/WebObjects/Web_Services/How_to_Trust_Any_SSL_Certificate - * @author Francis Labrie - */ -public final class SSLUtilities { - - /** - * Hostname verifier for the Sun's deprecated API. - * - * @deprecated see {@link #_hostnameVerifier}. - */ - private static com.sun.net.ssl.HostnameVerifier __hostnameVerifier; - /** - * Thrust managers for the Sun's deprecated API. - * - * @deprecated see {@link #_trustManagers}. - */ - private static com.sun.net.ssl.TrustManager[] __trustManagers; - /** - * Hostname verifier. - */ - private static HostnameVerifier _hostnameVerifier; - /** - * Thrust managers. - */ - private static TrustManager[] _trustManagers; - - - /** - * Set the default Hostname Verifier to an instance of a fake class that - * trust all hostnames. This method uses the old deprecated API from the - * com.sun.ssl package. - * - * @deprecated see {@link #_trustAllHostnames()}. - */ - private static void __trustAllHostnames() { - // Create a trust manager that does not validate certificate chains - if(__hostnameVerifier == null) { - __hostnameVerifier = new _FakeHostnameVerifier(); - } // if - // Install the all-trusting host name verifier - com.sun.net.ssl.HttpsURLConnection. - setDefaultHostnameVerifier(__hostnameVerifier); - } // __trustAllHttpsCertificates - - /** - * Set the default X509 Trust Manager to an instance of a fake class that - * trust all certificates, even the self-signed ones. This method uses the - * old deprecated API from the com.sun.ssl package. - * - * @deprecated see {@link #_trustAllHttpsCertificates()}. - */ - private static void __trustAllHttpsCertificates() { - com.sun.net.ssl.SSLContext context; - - // Create a trust manager that does not validate certificate chains - if(__trustManagers == null) { - __trustManagers = new com.sun.net.ssl.TrustManager[] - {new _FakeX509TrustManager()}; - } // if - // Install the all-trusting trust manager - try { - context = com.sun.net.ssl.SSLContext.getInstance("SSL"); - context.init(null, __trustManagers, new SecureRandom()); - } catch(GeneralSecurityException gse) { - throw new IllegalStateException(gse.getMessage()); - } // catch - com.sun.net.ssl.HttpsURLConnection. - setDefaultSSLSocketFactory(context.getSocketFactory()); - } // __trustAllHttpsCertificates - - /** - * Return true if the protocol handler property java. - * protocol.handler.pkgs is set to the Sun's com.sun.net.ssl. - * internal.www.protocol deprecated one, false - * otherwise. - * - * @return true if the protocol handler - * property is set to the Sun's deprecated one, false - * otherwise. - */ - private static boolean isDeprecatedSSLProtocol() { - return("com.sun.net.ssl.internal.www.protocol".equals(System. - getProperty("java.protocol.handler.pkgs"))); - } // isDeprecatedSSLProtocol - - /** - * Set the default Hostname Verifier to an instance of a fake class that - * trust all hostnames. - */ - private static void _trustAllHostnames() { - // Create a trust manager that does not validate certificate chains - if(_hostnameVerifier == null) { - _hostnameVerifier = new FakeHostnameVerifier(); - } // if - // Install the all-trusting host name verifier: - HttpsURLConnection.setDefaultHostnameVerifier(_hostnameVerifier); - } // _trustAllHttpsCertificates - - /** - * Set the default X509 Trust Manager to an instance of a fake class that - * trust all certificates, even the self-signed ones. - */ - private static void _trustAllHttpsCertificates() { - SSLContext context; - - // Create a trust manager that does not validate certificate chains - if(_trustManagers == null) { - _trustManagers = new TrustManager[] {new FakeX509TrustManager()}; - } // if - // Install the all-trusting trust manager: - try { - context = SSLContext.getInstance("SSL"); - context.init(null, _trustManagers, new SecureRandom()); - } catch(GeneralSecurityException gse) { - throw new IllegalStateException(gse.getMessage()); - } // catch - HttpsURLConnection.setDefaultSSLSocketFactory(context. - getSocketFactory()); - } // _trustAllHttpsCertificates - - /** - * Set the default Hostname Verifier to an instance of a fake class that - * trust all hostnames. - */ - public static void trustAllHostnames() { - // Is the deprecated protocol setted? - if(isDeprecatedSSLProtocol()) { - __trustAllHostnames(); - } else { - _trustAllHostnames(); - } // else - } // trustAllHostnames - - /** - * Set the default X509 Trust Manager to an instance of a fake class that - * trust all certificates, even the self-signed ones. - */ - public static void trustAllHttpsCertificates() { - // Is the deprecated protocol setted? - if(isDeprecatedSSLProtocol()) { - __trustAllHttpsCertificates(); - } else { - _trustAllHttpsCertificates(); - } // else - } // trustAllHttpsCertificates - - /** - * This class implements a fake hostname verificator, trusting any host - * name. This class uses the old deprecated API from the com.sun. - * ssl package. - * - * @author Francis Labrie - * - * @deprecated see {@link SSLUtilities.FakeHostnameVerifier}. - */ - public static class _FakeHostnameVerifier - implements com.sun.net.ssl.HostnameVerifier { - - /** - * Always return true, indicating that the host name is an - * acceptable match with the server's authentication scheme. - * - * @param hostname the host name. - * @param session the SSL session used on the connection to - * host. - * @return the true boolean value - * indicating the host name is trusted. - */ - public boolean verify(String hostname, String session) { - return(true); - } // verify - } // _FakeHostnameVerifier - - - /** - * This class allow any X509 certificates to be used to authenticate the - * remote side of a secure socket, including self-signed certificates. This - * class uses the old deprecated API from the com.sun.ssl - * package. - * - * @author Francis Labrie - * - * @deprecated see {@link SSLUtilities.FakeX509TrustManager}. - */ - public static class _FakeX509TrustManager - implements com.sun.net.ssl.X509TrustManager { - - /** - * Empty array of certificate authority certificates. - */ - private static final X509Certificate[] _AcceptedIssuers = - new X509Certificate[] {}; - - - /** - * Always return true, trusting for client SSL - * chain peer certificate chain. - * - * @param chain the peer certificate chain. - * @return the true boolean value - * indicating the chain is trusted. - */ - public boolean isClientTrusted(X509Certificate[] chain) { - return(true); - } // checkClientTrusted - - /** - * Always return true, trusting for server SSL - * chain peer certificate chain. - * - * @param chain the peer certificate chain. - * @return the true boolean value - * indicating the chain is trusted. - */ - public boolean isServerTrusted(X509Certificate[] chain) { - return(true); - } // checkServerTrusted - - /** - * Return an empty array of certificate authority certificates which - * are trusted for authenticating peers. - * - * @return a empty array of issuer certificates. - */ - public X509Certificate[] getAcceptedIssuers() { - return(_AcceptedIssuers); - } // getAcceptedIssuers - } // _FakeX509TrustManager - - - /** - * This class implements a fake hostname verificator, trusting any host - * name. - * - * @author Francis Labrie - */ - public static class FakeHostnameVerifier implements HostnameVerifier { - - /** - * Always return true, indicating that the host name is - * an acceptable match with the server's authentication scheme. - * - * @param hostname the host name. - * @param session the SSL session used on the connection to - * host. - * @return the true boolean value - * indicating the host name is trusted. - */ - public boolean verify(String hostname, - javax.net.ssl.SSLSession session) { - return(true); - } // verify - } // FakeHostnameVerifier - - - /** - * This class allow any X509 certificates to be used to authenticate the - * remote side of a secure socket, including self-signed certificates. - * - * @author Francis Labrie - */ - public static class FakeX509TrustManager implements X509TrustManager { - - /** - * Empty array of certificate authority certificates. - */ - private static final X509Certificate[] _AcceptedIssuers = - new X509Certificate[] {}; - - - /** - * Always trust for client SSL chain peer certificate - * chain with any authType authentication types. - * - * @param chain the peer certificate chain. - * @param authType the authentication type based on the client - * certificate. - */ - public void checkClientTrusted(X509Certificate[] chain, - String authType) { - } // checkClientTrusted - - /** - * Always trust for server SSL chain peer certificate - * chain with any authType exchange algorithm types. - * - * @param chain the peer certificate chain. - * @param authType the key exchange algorithm used. - */ - public void checkServerTrusted(X509Certificate[] chain, - String authType) { - } // checkServerTrusted - - /** - * Return an empty array of certificate authority certificates which - * are trusted for authenticating peers. - * - * @return a empty array of issuer certificates. - */ - public X509Certificate[] getAcceptedIssuers() { - return(_AcceptedIssuers); - } // getAcceptedIssuers - } // FakeX509TrustManager -} // SSLUtilities diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Serveur.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Serveur.java deleted file mode 100755 index 6586210480..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/Serveur.java +++ /dev/null @@ -1,665 +0,0 @@ -package pow.webserver; - -import nl.justobjects.pushlet.core.Dispatcher; -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.EventSource; -import java.io.*; -import java.net.*; -import java.util.*; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.servlet.ServletContext; - -import org.apache.commons.codec.binary.Hex; -import org.jdom.*; -import org.jdom.input.*; -import org.jdom.output.Format; -import org.jdom.output.XMLOutputter; - -import pow.AES; -import pow.ivyclient.BusIvy_; - -import java.util.HashMap; -import java.util.List; -import java.util.Iterator; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Class which receive a datagramm from ivy bus via UDP - * transforms it into a Pushlet event and send it to the Pushlet server - * in order that it will be sent to web clients - * @author genin - */ -public class Serveur { -static public class IvyEventSource implements EventSource , Runnable { - - private ServletContext srvCtxt; - private String default_folder = "blabla"; - HeartBeat heartBeatRun; - Thread thread = null; - private boolean active = false; - private int restarts = 1; - /* *********************** */ - private static Log myLog; - private static Conf myConf; - /* *********************** */ - private DatagramSocket socket; - private String[] myDataSplited; // Tableau contenant toutes les donnees envoyees - /* *********************** */ - private static long time2checkDeadBuses = 30*1000; // period of time where dead bus are removed from bus list - /* *********************** */ - /* to retrieve AES cipher for a specific ivy bus*/ - private HashMap tableIvySession; - /* ********* */ - private IvyMsg currentIvyMsg=null; - /* ********* */ - private LinkedBlockingQueue fifoToDatabase; - private SGBDfeeder t_sgbd_feeder; - private Thread dbThread; - /* ********* */ - public IvyEventSource() { - System.out.println(" Thread de recuperation des données IVY"); - } - /* *********************************** */ - /* EventSource specific functions */ - /* *********************************** */ - /** - * Activate the event source. - * load configuration, create log and create link to database MySQL - * ! setServletContext method should be called before activating - * @see nl.justobjects.pushlet.core.EventSourceManager class - */ - synchronized public void activate() { - System.out.println("activating the event source...."); - // creating log - myLog = new Log(default_folder); - // loading configuration - try {loadingConfiguration();} catch (Exception e) { - System.out.println("erreur loading configuration"); - e.printStackTrace();} - // reading configuration - time2checkDeadBuses = myConf.getTime2checkDeadBuses(); - // get database configuration - // create object to communicate with database - - String dbname = myConf.getDataBaseName(); - String dbuser = myConf.getDBUserName(); - String dbpwd = myConf.getDBPassword(); - srvCtxt.setAttribute("dbName",dbname); - srvCtxt.setAttribute("dbUser",dbuser); - srvCtxt.setAttribute("dbPwd",dbpwd); - t_sgbd_feeder = new SGBDfeeder( dbname, dbuser, dbpwd,myConf.getDbMode()); - fifoToDatabase = t_sgbd_feeder.getQueueFIFO(); - dbThread = new Thread(t_sgbd_feeder); - dbThread.start(); - myLog.write("SGBD feeder started. mode = " + myConf.getDbMode().toString()); - // launch heartbeat process - heartBeatRun = new HeartBeat(srvCtxt,myConf.getSocketTimeout()/3,myConf.portWebToIvy()); - Thread heartThread = new Thread(heartBeatRun); - heartThread.start(); - myLog.write("heartbeat thread started"); - // Stop a possibly running thread - stopThread(); - // Start new thread and - thread = new Thread(this, "DATA FROM IVY " + (restarts++)); - active = true; - thread.start(); - System.out.println("event source activated !!!"); - } - - /** - * Desactivate the event source. - */ - synchronized public void passivate() { - - active = false; - stopThread(); - // stop data base feeder - t_sgbd_feeder.kill(); - System.out.println("database feeder stopped."); - // - heartBeatRun.stop_thread(); - System.out.println("heartbeat thread stopped."); - } - - /** - * Desactivate the event source. - */ - synchronized public void stop() { - } - - /** - * stop a eventually runnig thread - */ - private void stopThread() { - if (thread != null) { - thread.interrupt(); - thread = null; - } - } - /** - * load configuration from a specific configuration file on the server - * in tomcat6/../webapps/ServletPow/conf/pow_conf.xml - * and initiates a log file to. - */ - private void loadingConfiguration() throws Exception - { - myConf = new Conf(default_folder,"pow_conf.xml"); - myLog.write("Loading Configuration !"); - myLog.write(""); - myLog.write("Configuration Details :"); - myLog.write("Port : " + myConf.portIvyToWeb()); - myLog.write("Size of Datagrams : " + myConf.getUdpSize()); - myLog.write("DataBase used : " + myConf.getDataBaseName()); - myLog.write(""); - } - - /** - * This procedure convert the byte array into a String and returns an array containing all the - * the datas separately. - * extract also the information concerning the sender to send them to data base - * @param Data The raw of byte containing udp msg which will be processed - * @return An array containing all the datas separately - */ - private String[] dataProcessing(byte[] data) //throws Exception - { - // This array contain all the datas transmitted - String[] myDataSplited=null; - currentIvyMsg=null; - // Number of datas transmitted - int nbr_datas; - // Data separator - String sep_datas = " "; - // The datagram is converted into String - String myData = new String(data); - // check if format of message is correct ( see java.util.regex.Pattern for syntax) - Pattern p = Pattern.compile("\\d+ \\d+ (\\d+:){5}\\d+ .*"); //regular expression - Matcher m = p.matcher(myData); - boolean dataok = m.matches(); - if (dataok){ - // - myDataSplited = myData.split(sep_datas,4); // 4 = number of substring - int webId = Integer.parseInt(myDataSplited[0]); - long numMsg = Long.parseLong(myDataSplited[1]); - String timeMsg = myDataSplited[2]; - String ivyMsg = myDataSplited[3]; - currentIvyMsg = new IvyMsg(webId,numMsg,timeMsg,ivyMsg); //create a ivy msg - myDataSplited = myDataSplited[3].split(sep_datas); - nbr_datas = myDataSplited.length; - // The last data is trimed in order to erase all the space - myDataSplited[nbr_datas - 1] = myDataSplited[nbr_datas - 1].trim(); - } - // The array containing all the datas is return - return myDataSplited; - } - - /* Runnable specific functions*/ - /** - * main loop : - * listens to the udp channel - * deciphers the udp message - * checks if the sender is a new bus or not - * send the message to database through a fifo - * turns the ivy message into a pushlet event - * send the event to web users - * checks if there are some buses that doesn't send messages anymore - * removes drone which belonged to dead buses - */ - public void run() { - boolean decrypt_ok; - long chrono_start; - long elapsed_time; - byte[] complete_data ; - byte[] decrypted_data = null; - int true_length_of_msg ; - int i; - byte[] data_with_no_padding; - boolean firsttime=true; - System.out.println(" Thread lancé"); - //The server is launched and listen on port number 8535 - try{ - socket = new DatagramSocket(myConf.portIvyToWeb()); - socket.setSoTimeout(myConf.getSocketTimeout()); - myLog.write("Server launched !"); - //The module wait the reception of datagrams - chrono_start = System.currentTimeMillis(); - while(active) - { - // deciphering AES - // if I receive a udp packet that means that there was a ivy connection procedure before - // so I can fetch the table containing the ivy sessions - if (firsttime){ - tableIvySession = (HashMap) this.srvCtxt.getAttribute("ivySessionTable"); - } - if (tableIvySession!=null){ - firsttime =false; - }// end if tableSession!=null - byte buffer[] = new byte[myConf.getUdpSize()]; - DatagramPacket dataReceived = new DatagramPacket(buffer,buffer.length); - try - { - socket.receive(dataReceived); - if(dataReceived != null){ - if (firsttime){ // retrieve the table which store the ivy sessions in the servlet context (shared memory) - tableIvySession = (HashMap) this.srvCtxt.getAttribute("ivySessionTable"); - } - if (tableIvySession!=null){ - firsttime =false; - System.out.print("d"); - //The module checks if there is a new Bus Ivy incoming - SessionIvy clientIvy = tableIvySession.get(dataReceived.getAddress()); - if (clientIvy!=null){ - // decipher message - decrypt_ok = false; - AES cipher = clientIvy.getCipher(); - try{ - complete_data = dataReceived.getData(); - // we get the entire data field but as original message is short , - // the udp protocol has inserted a lot of zero byte to pad the data field - // we have to remove them - true_length_of_msg = dataReceived.getLength(); - data_with_no_padding = new byte[true_length_of_msg]; - // we retrieve real data - for(i=0;i< true_length_of_msg;i++){ - data_with_no_padding[i]=complete_data[i]; - } - try{ - decrypted_data = cipher.decrypt(data_with_no_padding); - decrypt_ok = true; - } - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("message length = " + true_length_of_msg); - System.out.println("msg no padding := "+(new String(Hex.encodeHex(data_with_no_padding)))); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("message length = " + true_length_of_msg); - System.out.println("msg no padding := "+(new String(Hex.encodeHex(data_with_no_padding)))); - } - } - catch(IOException ex){ - System.out.print("\npbm decrypting msg"); - System.out.print(ex.toString()); - } - if (decrypt_ok) - { - // extract data from message and create ivyMsg - myDataSplited = dataProcessing(decrypted_data); - if (myDataSplited!=null){ - // check if a new ivy bus is coming - BusIvy_ current_bus = clientIvy.getBusIvy(); - if (current_bus==null){ - current_bus = new BusIvy_(); - current_bus.setAddress(dataReceived.getAddress()); - current_bus.updateTime(); - clientIvy.setBusIvy(current_bus); - myLog.write("New Ivy Connection detected : " + dataReceived.getAddress()); - // send message de connection - currentIvyMsg.setOrder(DbOrder.CONNECT); - send2DateBase(currentIvyMsg); - } - else - { - current_bus.updateTime(); - } - // according to type of ivy message a specific event is created and sent to web clients - if((myDataSplited[0].equals("New_Plane")) - ||(myDataSplited[0].equals("Plane_Die")) - ||(myDataSplited[0].equals("Plane_Resurect")) - ||(myDataSplited[0].equals("DL_SETTING_ACK")) - ||(myDataSplited[0].equals("WAYPOINT_MOVED")) - ||(myDataSplited[0].equals("NAV_STATUS")) - ||(myDataSplited[0].equals("SETTINGS_VALUES"))) - { - myLog.write("Order Received From : " + dataReceived.getAddress() + " ---> " + new String(decrypted_data)); - sendOrderToServer(myDataSplited); - if(!(current_bus.isOwnBy(Integer.parseInt(myDataSplited[1])))) - { - current_bus.addDrones(Integer.parseInt(myDataSplited[1])); - } - currentIvyMsg.setOrder(DbOrder.ADD_ORDER); - send2DateBase(currentIvyMsg); - currentIvyMsg = null; - } - else if(myDataSplited[0].equals("HEARTBEAT")){ - myLog.write("HeartBeat From webID : " +myDataSplited[1] +" ip="+ dataReceived.getAddress()); - } - else - { - sendDataToServer(myDataSplited); - if(!(current_bus.isOwnBy(Integer.parseInt(myDataSplited[0])))) - { - current_bus.addDrones(Integer.parseInt(myDataSplited[0])); - } - currentIvyMsg.setOrder(DbOrder.ADD_DATA); - send2DateBase(currentIvyMsg); - currentIvyMsg = null; - } - System.out.print("."); - } - else - { - System.out.print("\ndata de crypted but does not fit appropriate format, message skipped."); - } - } - else - { - System.out.print("\nerror while decrypting data, message skipped."); - } - - }// fin if ivyclient != null - else - { - System.out.print("\nno ivy client stored for this datagramm from "+dataReceived.getAddress()); - } - // check dead buses (period of 30sec ) - elapsed_time =System.currentTimeMillis()- chrono_start; - if (elapsed_time>time2checkDeadBuses){ - chrono_start = System.currentTimeMillis(); - Iterator> itr = tableIvySession.entrySet().iterator(); - BusIvy_ checked_bus; - SessionIvy checked_session; - while(itr.hasNext()){ - checked_session = itr.next().getValue(); - checked_bus = checked_session.getBusIvy(); - if((checked_bus!=null)&&(!checked_bus.isAlive())){ - myLog.write("Ivy Bus not alive is deconnected : " + checked_bus.getAddress()); - for(Integer deadDrone : checked_bus.getDrones()) - { - deconnectDrone(deadDrone); - } - checked_session.setBusIvy(null); - // deconnect message sent to database - currentIvyMsg = new IvyMsg(checked_session.getWebId()); - send2DateBase(currentIvyMsg); - currentIvyMsg = null; - // - tableIvySession.remove(checked_session.getIvyInetAddress()); - } - } - } - } // fin if tablesession != null - else - { - // on a recu un diagramme mais il n'y a pas de session recorded donc on - // doit envoyer un message au sender comme quoi il doit se relogger - System.out.println("\nno session recorder "+dataReceived.getAddress()+ "should relog to server"); - } - }// fin if datareceived!=null - }// fin du try socket received - catch(SocketTimeoutException ex) - { - if(tableIvySession!=null){ - Iterator> itr = tableIvySession.entrySet().iterator(); - BusIvy_ checked_bus; - SessionIvy checked_session; - while(itr.hasNext()){ - checked_session = itr.next().getValue(); - checked_bus = checked_session.getBusIvy(); - if (checked_bus!=null){ - myLog.write("Socket TimeOut : Ivy bus at " + checked_bus.getAddress()+" deconnected"); - for(Integer deadDrone : checked_bus.getDrones()) - { - deconnectDrone(deadDrone); - } - // deconnect message sent to database - currentIvyMsg = new IvyMsg(checked_session.getWebId()); - send2DateBase(currentIvyMsg); - currentIvyMsg = null; - checked_session.setBusIvy(null); - tableIvySession.remove(checked_session.getIvyInetAddress()); - } - } - } - myLog.write("No Bus Ivy connected..."); - dataReceived = null; - } - catch(IOException ex){ - System.out.println("exception socket receive serveur.java"); - ex.printStackTrace(); - } - }// fin while true - } catch (SocketException soe){ - System.out.print("Socket Exception !"); - soe.printStackTrace(); - } - finally{ - if (socket!=null) { - socket.close(); - System.out.println("socket server closed"); - } - } - } - - /** - * send a iskill event when a drone has disappeared from an ivy bus - * @param droneId - * @throws Exception - */ - private void deconnectDrone(int droneId) - { - Event event = Event.createDataEvent("/data/drone/iskill"); - event.setField("aircraftId",droneId); - event.setField("iskill", 1 + "" ); // 1 ==true - Dispatcher.getInstance().multicast(event); - //TODO erasing the associated configuration files ???? - } - - /** - * send a IvyMsg to database through fifo buffer - */ - private void send2DateBase(IvyMsg m) - { - try{ - fifoToDatabase.put(m); - } - catch (InterruptedException e){ - System.out.println("message was not sent to database"); - } - } - /** - * send a datagramm containing all useful information on a drone - * @param myDataSplited - * @throws Exception - */ - private void sendDataToServer(String myDataSplited[])// throws Exception - { - int i; - int nbr_datas = myDataSplited.length; - String[] myDataName = new String[nbr_datas]; - // id of the drone - myDataName[0] = "id"; - // name of the drone - myDataName[1] = "dbName"; - // latitude - myDataName[2] = "dbLatitude"; - // longitude - myDataName[3] = "dbLongitude"; - // speed - myDataName[4] = "dbSpeed";// - // bearing - myDataName[5] = "dbCourse"; - // amsl - myDataName[6] = "dbAmsl";// - // vertical speed - myDataName[7] = "dbVert_speed";// - // agl - myDataName[8] = "dbAgl";// - // battery load - myDataName[9] = "dbStat_battery";// - // gps_status - myDataName[10] = "dbStat_gps";// - // Engine status - myDataName[11] = "dbEngine_status";// - // active block - myDataName[12] = "dbActive_block";// - // id of the setting - myDataName[13] = "dbId_Setting";// - // value of the setting - myDataName[14] = "dbSetting_Value";// - // color of the drone , rajout thomas - myDataName[15] = "drone_color";// - - Event event = Event.createDataEvent("/data/drones_maj"); - event.setField("aircraftId",myDataSplited[0]); - for(i=1;i. - * - * [Additional notices, if required by prior licensing conditions] - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Lesser General Public License Version 2 or later - * (the "LGPL"), in which case the provisions of the LGPL are - * applicable instead of those above. See terms of LGPL at - * . - * If you wish to allow use of your version of this file only under - * the terms of the LGPL and not to allow others to use your version - * of this file under the Apache Software License, indicate your - * decision by deleting the provisions above and replace them with - * the notice and other provisions required by the LGPL. If you do - * not delete the provisions above, a recipient may use your version - * of this file under either the Apache Software License or the LGPL. - */ - -package pow.webserver; - -import java.io.IOException; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.net.SocketAddress; -import java.net.UnknownHostException; - -import javax.net.SocketFactory; -import javax.net.ssl.SSLPeerUnverifiedException; -import javax.net.ssl.SSLSession; -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; -import javax.security.cert.X509Certificate; - -import org.apache.commons.httpclient.ConnectTimeoutException; -import org.apache.commons.httpclient.params.HttpConnectionParams; -import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * A SecureProtocolSocketFactory that uses JSSE to create - * SSL sockets. It will also support host name verification to help preventing - * man-in-the-middle attacks. Host name verification is turned on by - * default but one will be able to turn it off, which might be a useful feature - * during development. Host name verification will make sure the SSL sessions - * server host name matches with the the host name returned in the - * server certificates "Common Name" field of the "SubjectDN" entry. - * - * @author Sebastian Hauer - *

    - * DISCLAIMER: HttpClient developers DO NOT actively support this component. - * The component is provided as a reference material, which may be inappropriate - * for use without additional customization. - *

    - */ -public class StrictSSLProtocolSocketFactory - implements SecureProtocolSocketFactory { - - /** Log object for this class. */ - private static final Log LOG = LogFactory.getLog(StrictSSLProtocolSocketFactory.class); - - /** Host name verify flag. */ - private boolean verifyHostname = true; - - - /** - * Constructor for StrictSSLProtocolSocketFactory. - * @param verifyHostname The host name verification flag. If set to - * true the SSL sessions server host name will be compared - * to the host name returned in the server certificates "Common Name" - * field of the "SubjectDN" entry. If these names do not match a - * Exception is thrown to indicate this. Enabling host name verification - * will help to prevent from man-in-the-middle attacks. If set to - * false host name verification is turned off. - * - * Code sample: - * - *
    - * Protocol stricthttps = new Protocol( - * "https", new StrictSSLProtocolSocketFactory(true), 443); - * - * HttpClient client = new HttpClient(); - * client.getHostConfiguration().setHost("localhost", 443, stricthttps); - *
    - * - */ - public StrictSSLProtocolSocketFactory(boolean verifyHostname) { - super(); - this.verifyHostname = verifyHostname; - } - - /** - * Constructor for StrictSSLProtocolSocketFactory. - * Host name verification will be enabled by default. - */ - public StrictSSLProtocolSocketFactory() { - super(); - } - - /** - * Set the host name verification flag. - * - * @param verifyHostname The host name verification flag. If set to - * true the SSL sessions server host name will be compared - * to the host name returned in the server certificates "Common Name" - * field of the "SubjectDN" entry. If these names do not match a - * Exception is thrown to indicate this. Enabling host name verification - * will help to prevent from man-in-the-middle attacks. If set to - * false host name verification is turned off. - */ - public void setHostnameVerification(boolean verifyHostname) { - this.verifyHostname = verifyHostname; - } - - /** - * Gets the status of the host name verification flag. - * - * @return Host name verification flag. Either true if host - * name verification is turned on, or false if host name - * verification is turned off. - */ - public boolean getHostnameVerification() { - return verifyHostname; - } - - - /** - * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int,java.net.InetAddress,int) - */ - public Socket createSocket(String host, int port, - InetAddress clientHost, int clientPort) - throws IOException, UnknownHostException { - SSLSocketFactory sf = (SSLSocketFactory) SSLSocketFactory.getDefault(); - SSLSocket sslSocket = (SSLSocket) sf.createSocket(host, port, - clientHost, - clientPort); - verifyHostname(sslSocket); - - return sslSocket; - } - - /** - * Attempts to get a new socket connection to the given host within the given time limit. - *

    - * This method employs several techniques to circumvent the limitations of older JREs that - * do not support connect timeout. When running in JRE 1.4 or above reflection is used to - * call Socket#connect(SocketAddress endpoint, int timeout) method. When executing in older - * JREs a controller thread is executed. The controller thread attempts to create a new socket - * within the given limit of time. If socket constructor does not return until the timeout - * expires, the controller terminates and throws an {@link ConnectTimeoutException} - *

    - * - * @param host the host name/IP - * @param port the port on the host - * @param params {@link HttpConnectionParams Http connection parameters} - * - * @return Socket a new socket - * - * @throws IOException if an I/O error occurs while creating the socket - * @throws UnknownHostException if the IP address of the host cannot be - * determined - */ - public Socket createSocket( - final String host, - final int port, - final InetAddress localAddress, - final int localPort, - final HttpConnectionParams params - ) throws IOException, UnknownHostException, ConnectTimeoutException { - if (params == null) { - throw new IllegalArgumentException("Parameters may not be null"); - } - int timeout = params.getConnectionTimeout(); - Socket socket = null; - - SocketFactory socketfactory = SSLSocketFactory.getDefault(); - if (timeout == 0) { - socket = socketfactory.createSocket(host, port, localAddress, localPort); - } else { - socket = socketfactory.createSocket(); - SocketAddress localaddr = new InetSocketAddress(localAddress, localPort); - SocketAddress remoteaddr = new InetSocketAddress(host, port); - socket.bind(localaddr); - socket.connect(remoteaddr, timeout); - } - verifyHostname((SSLSocket)socket); - return socket; - } - - /** - * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int) - */ - public Socket createSocket(String host, int port) - throws IOException, UnknownHostException { - SSLSocketFactory sf = (SSLSocketFactory) SSLSocketFactory.getDefault(); - SSLSocket sslSocket = (SSLSocket) sf.createSocket(host, port); - verifyHostname(sslSocket); - - return sslSocket; - } - - /** - * @see SecureProtocolSocketFactory#createSocket(java.net.Socket,java.lang.String,int,boolean) - */ - public Socket createSocket(Socket socket, String host, int port, - boolean autoClose) - throws IOException, UnknownHostException { - SSLSocketFactory sf = (SSLSocketFactory) SSLSocketFactory.getDefault(); - SSLSocket sslSocket = (SSLSocket) sf.createSocket(socket, host, - port, autoClose); - verifyHostname(sslSocket); - - return sslSocket; - } - - - /** - * Describe verifyHostname method here. - * - * @param socket a SSLSocket value - * @exception SSLPeerUnverifiedException If there are problems obtaining - * the server certificates from the SSL session, or the server host name - * does not match with the "Common Name" in the server certificates - * SubjectDN. - * @exception UnknownHostException If we are not able to resolve - * the SSL sessions returned server host name. - */ - private void verifyHostname(SSLSocket socket) - throws SSLPeerUnverifiedException, UnknownHostException { - if (! verifyHostname) - return; - - SSLSession session = socket.getSession(); - String hostname = session.getPeerHost(); - try { - InetAddress addr = InetAddress.getByName(hostname); - } catch (UnknownHostException uhe) { - throw new UnknownHostException("Could not resolve SSL sessions " - + "server hostname: " + hostname); - } - - X509Certificate[] certs = session.getPeerCertificateChain(); - if (certs == null || certs.length == 0) - throw new SSLPeerUnverifiedException("No server certificates found!"); - - //get the servers DN in its string representation - String dn = certs[0].getSubjectDN().getName(); - - //might be useful to print out all certificates we receive from the - //server, in case one has to debug a problem with the installed certs. - if (LOG.isDebugEnabled()) { - LOG.debug("Server certificate chain:"); - for (int i = 0; i < certs.length; i++) { - LOG.debug("X509Certificate[" + i + "]=" + certs[i]); - } - } - //get the common name from the first cert - String cn = getCN(dn); - if (hostname.equalsIgnoreCase(cn)) { - if (LOG.isDebugEnabled()) { - LOG.debug("Target hostname valid: " + cn); - } - } else { - throw new SSLPeerUnverifiedException( - "HTTPS hostname invalid: expected '" + hostname + "', received '" + cn + "'"); - } - } - - - /** - * Parses a X.500 distinguished name for the value of the - * "Common Name" field. - * This is done a bit sloppy right now and should probably be done a bit - * more according to RFC 2253. - * - * @param dn a X.500 distinguished name. - * @return the value of the "Common Name" field. - */ - private String getCN(String dn) { - int i = 0; - i = dn.indexOf("CN="); - if (i == -1) { - return null; - } - //get the remaining DN without CN= - dn = dn.substring(i + 3); - // System.out.println("dn=" + dn); - char[] dncs = dn.toCharArray(); - for (i = 0; i < dncs.length; i++) { - if (dncs[i] == ',' && i > 0 && dncs[i - 1] != '\\') { - break; - } - } - return dn.substring(0, i); - } - - public boolean equals(Object obj) { - if ((obj != null) && obj.getClass().equals(StrictSSLProtocolSocketFactory.class)) { - return ((StrictSSLProtocolSocketFactory) obj).getHostnameVerification() - == this.verifyHostname; - } else { - return false; - } - } - - public int hashCode() { - return StrictSSLProtocolSocketFactory.class.hashCode(); - } - -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/User.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/User.java deleted file mode 100755 index 9f771179b1..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/User.java +++ /dev/null @@ -1,121 +0,0 @@ -package pow.webserver; -import java.util.HashSet; -import java.util.Iterator; - -/** - * represents a ivy or a web user account - * for the web user the account nest also the list of drones that the user can control - * the list contains the ivy name of the drone (MJ5, TJ1...). - * In Paparazzi a drone is not identified in a unique identifier, that means that if a user - * can pilot a drone MJ5, he can pilot all 'MJ5' drone - * @author genin - */ -public class User implements java.io.Serializable { - - private static final long serialVersionUID = 1L; - private String login = ""; - private String password = ""; - private HashSet dronesNamePermitted; - private Rights right; - /** - * create a user account - * @param log the login of the user - * @param pwd the password of the user - * @param rght the type of the user - */ - public User(String log, String pwd,Rights rght) { - this.login = log; - this.password = Md5.encode(pwd); - this.right = rght; - this.dronesNamePermitted = new HashSet(); - } - /** - * @return an iterator containing the list of all drone that the user can control - */ - public Iterator getSetItr(){ - return dronesNamePermitted.iterator(); - } - /** - * reset the list of drone that the web user can control - */ - public void clearListDrone(){ - dronesNamePermitted.clear(); - } - /** - * the list of drone that the web user can control - * @return a formatted string containing all the drone that the user can control separated by commas - */ - public String getListDrone(){ - Iterator itr = dronesNamePermitted.iterator(); - String res = ""; - while(itr.hasNext()){ - res = res + itr.next() + ";"; - } - return res; - } - /** - * add a drone name to the list of drones that the user can control - * @param d - */ - public void addDrone(String d){ - dronesNamePermitted.add(d); - } - /** - * inform whether the user can pilot a drone or not - * @param droneName the name of the drone - * @return true if the user can pilot the drones with this name - */ - public boolean canControl(String droneName) - { - if ((right == Rights.ADMIN)|| ((right==Rights.USER)&&dronesNamePermitted.contains(droneName))) - { return true; } - else - { return false; } - } - /** @return the type of right granted to the user*/ - public Rights getRights(){ - return this.right; - } - /** - * specify the type of right granted to the user - * @param r the right granted to the user - */ - public void setRights(Rights r){ - this.right=r; - } - /** - * @return the login of the user - */ - public String getLogin() { - return login; - } - /** - * specify the login of the user - * @param log the login of the user - */ - public void setNom(String log) { - this.login = log; - } - /** - * @return the password of the user encoded with md5 algorithm - */ - public String getPassword() { - return password; - } - /** - * specify the user password, it's not stored in clear (md5 hash) - * @param pwd the user password in clear - */ - public void setPwd(String pwd) { - this.password = Md5.encode(pwd); - } - /** - * check if the password given in argument corresponds to the password user - * @param pwd the password to check - * @return true if the password is correct - */ - public boolean IsPwdTrue(String pwd) { - return this.password.equals(Md5.encode(pwd)); - } -} - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/UserTab.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/UserTab.java deleted file mode 100755 index 4839d0ea36..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/src/pow/webserver/UserTab.java +++ /dev/null @@ -1,125 +0,0 @@ -package pow.webserver; - -import java.util.HashMap; -import java.util.Iterator; -import java.io.*; -/** - * User objects are stored in a UserTab object which can be serialized in a file on the server disk - * @see User - * @author genin - */ -public class UserTab implements java.io.Serializable { - - - private static final long serialVersionUID = 1L; - private HashMap tabUser; - /** - * create a empty list of users - */ - public UserTab(){ - tabUser = new HashMap(); - } - /** - * insert a user in the list - * @param u a user object to insert - * @throws AlreadyRegisteredUserException - */ - public void insert(User u) throws AlreadyRegisteredUserException { - String log = u.getLogin(); - if (!tabUser.containsKey(log)) tabUser.put(u.getLogin(),u); - else { throw new AlreadyRegisteredUserException(u) ;} - } - /** - * remove the user with the spefied login - * @param log the login of the user to remove - */ - public void remove(String log){ - tabUser.remove(log) ; - } - /** - * return the user corresponding to the given login - * @param log the login of the user to seek - * @return the user object corresponding to the login or null if it is not present - */ - public User seek(String log){ - return tabUser.get(log); - } - /** - * check if an user with this logging exists yet - * @param log the login of the user to check - * @return true if the user having the login exists - */ - public boolean isInside(String log){ - return tabUser.containsKey(log); - } - - /** - * Check if the password of the user having the specified login is correct - * @param log the login of the user - * @param pwd the password - * @return true if there is a user with this login and this password - */ - public boolean checkUser(String log,String pwd){ - boolean res = false; - User usr = tabUser.get(log); - if (usr!=null){ - res=usr.IsPwdTrue(pwd); - } - return res; - } - /** - * return the list of all drone which may be controlled by the user - * @param log the login of the user - * @return an iterator containing the list of drone or null is the user does not exist - */ - public Iterator getItrUsr(String log){ - Iterator res = null; - User usr = tabUser.get(log); - if (usr!=null){ - res=usr.getSetItr(); - } - return res; - } - /** - * @return an iterator on all login in the list - */ - public Iterator getLoginIterator(){ - return tabUser.keySet().iterator(); - } - /** - * Save the object in a file - * @param nomfichier the file where the user's accounts will be stored - */ - public void serialize(String nomfichier){ - try { - FileOutputStream fichier = new FileOutputStream(nomfichier); - ObjectOutputStream oos = new ObjectOutputStream(fichier); - oos.writeObject(this); - oos.flush(); - oos.close(); - } - catch (java.io.IOException e) { - e.printStackTrace(); - } - } - /** - * load the object from a file - * @param nomfichier the file where the user's accounts are stored - * @return an object containing the users list or null if the pathname is not correct - */ - public static UserTab unserialize(String nomfichier) { - try { - FileInputStream fichier = new FileInputStream(nomfichier); - ObjectInputStream ois = new ObjectInputStream(fichier); - UserTab usrtab = (UserTab) ois.readObject(); - return usrtab; - } - catch (java.io.IOException e) { - e.printStackTrace(); - } - catch (ClassNotFoundException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/Version.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/Version.java deleted file mode 100755 index a2563f7192..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/Version.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet; - -/** - * Version info class. - * - *

    Purpose

    - * Extract version info from jar manifest file. - * - * @author Just van den Broecke - * @version $Id: Version.java,v 1.4 2006/05/06 00:10:11 justb Exp $ - */ - -public class Version { - /** Version info extracted from the .jar manifest file (see build.xml and build.properties). */ - public static final String SOFTWARE_VERSION = Version.class.getPackage().getSpecificationVersion(); - public static final String BUILD_DATE = Version.class.getPackage().getImplementationVersion(); -} - -/* - * $Log: Version.java,v $ - * Revision 1.4 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.3 2004/02/08 16:07:55 justb - * *** empty log message *** - * - * Revision 1.2 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.1 2003/08/11 21:29:48 justb - * first checkin - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/client/PushletClient.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/client/PushletClient.java deleted file mode 100755 index e1c77ebcfa..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/client/PushletClient.java +++ /dev/null @@ -1,699 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.client; - -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.EventParser; -import nl.justobjects.pushlet.core.Protocol; -import nl.justobjects.pushlet.util.PushletException; - -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.OutputStream; -import java.net.*; -import java.util.Map; - -/** - * Client API for Java HTTP client applets or apps. - *

    - * Use this class within Java client applications or applets. - * Implement a PushletClientListener to receive callbacks for - * data-related Event objects pushed by the server. - *

    - * This class may also be used as a base class and be extended - * for custom clients, hence the presence of many proteced methods. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: PushletClient.java,v 1.19 2009/06/04 12:46:35 justb Exp $ - * @see PushletClientListener - * @see nl.justobjects.pushlet.test.PushletApplet - * @see nl.justobjects.pushlet.test.PushletPingApplication - */ -public class PushletClient implements Protocol { - /** - * Pushlet URL. - */ - private String pushletURL; - - /** - * Debug flag for verbose output. - */ - private boolean debug; - - /** - * Id gotten on join ack - */ - private String id; - - /** - * Internal listener for data events pushed by server. - */ - protected DataEventListener dataEventListener; - - /** - * Constructor with full pushlet URL. - */ - public PushletClient(String aPushletURL) { - pushletURL = aPushletURL; - } - - /** - * Constructor with host and port using default URI. - */ - public PushletClient(String aHost, int aPort) { - this("http://" + aHost + ":" + aPort + DEFAULT_SERVLET_URI); - } - - /** - * Set proxy options and optional proxy authentication. - *

    - * Contributed by Dele Olajide - * See http://groups.yahoo.com/group/pushlet/message/634 - *

    - * Usage: - * PushletClient pushletClient = new PushletClient("http:://www.domain.com/pushlet"); - * pushletClient.setProxyOptions("proxy.bla.com", "8080", ....); - *

    - * use pushletClient further as normal - */ - public void setProxyOptions(String aProxyHost, - String aProxyPort, String theNonProxyHosts, - String aUserName, String aPassword, String anNTLMDomain) { - - // Enable proxying - System.setProperty("http.proxySet", "true"); - System.setProperty("http.proxyHost", aProxyHost); - System.setProperty("http.proxyPort", aProxyPort); - - // Set optional non-proxy hosts - if (theNonProxyHosts != null) { - System.setProperty("http.nonProxyHosts", theNonProxyHosts); - } - - // If user name specified configure proxy authentication - if (aUserName != null) { - System.setProperty("http.proxyUser", aUserName); - System.setProperty("http.proxyPassword", aPassword); - - // See inner class below - Authenticator.setDefault(new HTTPAuthenticateProxy(aUserName, aPassword)); - - // Optional NT domain - if (anNTLMDomain != null) { - System.setProperty("http.auth.ntlm.domain", anNTLMDomain); - } - } - } - - /** - * Join server, starts session. - */ - public void join() throws PushletException { - Event event = new Event(E_JOIN); - event.setField(P_FORMAT, FORMAT_XML); - Event response = doControl(event); - throwOnNack(response); - - // Join Ack received - id = response.getField(P_ID); - } - - /** - * Leave server, stops session. - */ - public void leave() throws PushletException { - stopListen(); - throwOnInvalidSession(); - Event event = new Event(E_LEAVE); - event.setField(P_ID, id); - Event response = doControl(event); - - throwOnNack(response); - id = null; - } - - /** - * Open data channel. - */ - public void listen(PushletClientListener aListener) throws PushletException { - listen(aListener, MODE_STREAM); - } - - /** - * Open data channel in stream or push mode. - */ - public void listen(PushletClientListener aListener, String aMode) throws PushletException { - listen(aListener, aMode, null); - } - - /** - * Open data channel in stream or push mode with a subject. - */ - public void listen(PushletClientListener aListener, String aMode, String aSubject) throws PushletException { - throwOnInvalidSession(); - stopListen(); - - String listenURL = pushletURL - + "?" + P_EVENT + "=" + E_LISTEN - + "&" + P_ID + "=" + id - + "&" + P_MODE + "=" + aMode; - if (aSubject != null) { - listenURL = listenURL + "&" + P_SUBJECT + "=" + aSubject; - } - - // Start listener thread (sync call). - startDataEventListener(aListener, listenURL); - } - - /** - * Immediate listener: joins/subscribes and listens in one action. - */ - public void joinListen(PushletClientListener aListener, String aMode, String aSubject) throws PushletException { - stopListen(); - - String listenURL = pushletURL - + "?" + P_EVENT + "=" + E_JOIN_LISTEN - + "&" + P_FORMAT + "=" + FORMAT_XML - + "&" + P_MODE + "=" + aMode - + "&" + P_SUBJECT + "=" + aSubject; - - // Start listener thread (sync call). - startDataEventListener(aListener, listenURL); - } - - /** - * Publish an event through server. - */ - public void publish(String aSubject, Map theAttributes) throws PushletException { - throwOnInvalidSession(); - Event event = new Event(E_PUBLISH, theAttributes); - event.setField(P_SUBJECT, aSubject); - event.setField(P_ID, id); - Event response = doControl(event); - throwOnNack(response); - } - - /** - * Subscribes, returning subscription id. - */ - public String subscribe(String aSubject, String aLabel) throws PushletException { - throwOnInvalidSession(); - Event event = new Event(E_SUBSCRIBE); - event.setField(P_ID, id); - event.setField(P_SUBJECT, aSubject); - - // Optional label, is returned in data events - if (aLabel != null) { - event.setField(P_SUBSCRIPTION_LABEL, aLabel); - } - - // Send request - Event response = doControl(event); - throwOnNack(response); - - return response.getField(P_SUBSCRIPTION_ID); - } - - /** - * Subscribes, returning subscription id. - */ - public String subscribe(String aSubject) throws PushletException { - return subscribe(aSubject, null); - } - - /** - * Unsubscribes with subscription id. - */ - public void unsubscribe(String aSubscriptionId) throws PushletException { - throwOnInvalidSession(); - Event event = new Event(E_UNSUBSCRIBE); - event.setField(P_ID, id); - - // Optional subscription id - if (aSubscriptionId != null) { - event.setField(P_SUBSCRIPTION_ID, aSubscriptionId); - } - - Event response = doControl(event); - throwOnNack(response); - } - - /** - * Unsubscribes from all subjects. - */ - public void unsubscribe() throws PushletException { - unsubscribe(null); - } - - /** - * Stop the listener. - */ - public void stopListen() throws PushletException { - if (dataEventListener != null) { - unsubscribe(); - dataEventListener.stop(); - dataEventListener = null; - } - } - - public void setDebug(boolean b) { - debug = b; - } - - /** - * Starts default DataEventListener and waits for its thread to start. - */ - protected void startDataEventListener(PushletClientListener aListener, String aListenURL) { - // Suggestion by Jeff Nowakowski 29.oct.2006 - dataEventListener = new DataEventListener(aListener, aListenURL); - - synchronized (dataEventListener) { - dataEventListener.start(); - try { - // Wait for data event listener (thread) to start - dataEventListener.wait(); - } catch (InterruptedException e) { - } - } - } - - protected void throwOnNack(Event anEvent) throws PushletException { - if (anEvent.getEventType().equals(E_NACK)) { - throw new PushletException("Negative response: reason=" + anEvent.getField(P_REASON)); - } - } - - protected void throwOnInvalidSession() throws PushletException { - if (id == null) { - throw new PushletException("Invalid pushlet session"); - } - } - - protected Reader openURL(String aURL) throws PushletException { - // Open URL connection with server - try { - p("Connecting to " + aURL); - URL url = new URL(aURL); - URLConnection urlConnection = url.openConnection(); - - // Disable any kind of caching. - urlConnection.setUseCaches(false); - urlConnection.setDefaultUseCaches(false); - - // TODO: later version may use POST - // Enable HTTP POST - // urlConnection.setDoOutput(true); - - // Do the POST with Event in XML in body - // OutputStream os = urlConnection.getOutputStream(); - // os.write(anEvent.toXML().getBytes()); - // os.flush(); - // os.close(); - - // Get the stream from the server. - // reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); - // Note: somehow the client does not work with some JVMs when using - // BufferedInputStream... So do unbuffered input. - // p("Opening urlConnection inputstream"); - return new InputStreamReader(urlConnection.getInputStream()); - - } catch (Throwable t) { - warn("openURL() could not open " + aURL, t); - throw new PushletException(" could not open " + aURL, t); - } - } - - - /** - * Send control events to server and return response. - */ - protected Event doControl(Event aControlEvent) throws PushletException { - String controlURL = pushletURL + "?" + aControlEvent.toQueryString(); - - p("doControl to " + controlURL); - - // Open URL connection with server - Reader reader = openURL(controlURL); - - // Get Pushlet event from stream - Event event = null; - try { - p("Getting event..."); - // Get next event from server - event = EventParser.parse(reader); - p("Event received " + event); - return event; - } catch (Throwable t) { - // Stop and report error. - warn("doControl() exception", t); - throw new PushletException(" error parsing response from" + controlURL, t); - } - } - - /** - * Util: print. - */ - protected void p(String s) { - if (debug) { - System.out.println("[PushletClient] " + s); - } - } - - /** - * Util: warn. - */ - protected void warn(String s) { - warn(s, null); - } - - /** - * Util: warn with exception. - */ - protected void warn(String s, Throwable t) { - System.err.println("[PushletClient] - WARN - " + s + " ex=" + t); - - if (t != null) { - t.printStackTrace(); - } - } - - /** - * Internal (default) listener for the Pushlet data channel. - */ - protected class DataEventListener implements Runnable { - /** - * Client's listener that gets called back on events. - */ - private PushletClientListener listener; - - /** - * Receiver receiveThread. - */ - private Thread receiveThread = null; - private Reader reader; - private String refreshURL; - private String listenURL; - - public DataEventListener(PushletClientListener aListener, String aListenURL) { - listener = aListener; - listenURL = aListenURL; - } - - public void start() { - // All ok: start a receiver receiveThread - receiveThread = new Thread(this); - receiveThread.start(); - - } - - /** - * Stop listening; may restart later with start(). - */ - public void stop() { - p("In stop()"); - bailout(); - } - - /** - * Receive event objects from server and callback listener. - */ - public void run() { - p("Start run()"); - try { - while (receiveThread != null && receiveThread.isAlive()) { - // Connect to server - reader = openURL(listenURL); - - synchronized (this) { - // Inform the calling thread we're ready to receive events. - // Suggestion by Jeff Nowakowski 29.oct.2006 - this.notify(); - } - - // Get events while we're alive. - while (receiveThread != null && receiveThread.isAlive()) { - Event event = null; - try { - // p("Getting event..."); - // Get next event from server - event = EventParser.parse(reader); - p("Event received " + event); - } catch (Throwable t) { - - // Stop and report error. - // warn("Stop run() on exception", t); - if (listener != null) { - listener.onError("exception during receive: " + t); - } - - break; - } - - // Handle event by calling listener - if (event != null && listener != null) { - // p("received: " + event.toXML()); - String eventType = event.getEventType(); - if (eventType.equals(E_HEARTBEAT)) { - listener.onHeartbeat(event); - } else if (eventType.equals(E_DATA)) { - listener.onData(event); - } else if (eventType.equals(E_JOIN_LISTEN_ACK)) { - id = event.getField(P_ID); - } else if (eventType.equals(E_LISTEN_ACK)) { - p("Listen ack ok"); - } else if (eventType.equals(E_REFRESH_ACK)) { - // ignore - } else if (eventType.equals(E_ABORT)) { - listener.onAbort(event); - listener = null; - break; - } else if (eventType.equals(E_REFRESH)) { - refresh(event); - } else { - handleUnknownEventType(eventType, event, listener); - } - } - } - } - } catch (Throwable t) { - warn("Exception in run() ", t); - // bailout(); - } - } - - protected void disconnect() { - p("start disconnect()"); - if (reader != null) { - try { - // this blocks, find another way - // reader.close(); - p("Closed reader ok"); - } catch (Exception ignore) { - } finally { - reader = null; - } - } - p("end disconnect()"); - } - - /** - * Stop receiver receiveThread. - */ - public void stopThread() { - p("In stopThread()"); - - // Keep a reference such that we can kill it from here. - Thread targetThread = receiveThread; - - receiveThread = null; - - // This should stop the main loop for this receiveThread. - // Killing a receiveThread on a blcing read is tricky. - // See also http://gee.cs.oswego.edu/dl/cpj/cancel.html - if ((targetThread != null) && targetThread.isAlive()) { - - targetThread.interrupt(); - - try { - - // Wait for it to die - targetThread.join(500); - } catch (InterruptedException ignore) { - } - - // If current receiveThread refuses to die, - // take more rigorous methods. - if (targetThread.isAlive()) { - - // Not preferred but may be needed - // to stop during a blocking read. - targetThread.stop(); - - // Wait for it to die - try { - targetThread.join(500); - } catch (Throwable ignore) { - } - } - - p("Stopped receiveThread alive=" + targetThread.isAlive()); - - } - } - - /** - * Stop listening on stream from server. - */ - public void bailout() { - p("In bailout()"); - stopThread(); - disconnect(); - } - - /** - * Handle refresh, by pausing. - */ - protected void refresh(Event aRefreshEvent) throws PushletException { - try { - // Wait for specified time. - Thread.sleep(Long.parseLong(aRefreshEvent.getField(P_WAIT))); - } catch (Throwable t) { - warn("abort while refresing"); - refreshURL = null; - return; - } - - // If stopped during sleep, don't proceed - if (receiveThread == null) { - return; - } - - // Create url to refresh - refreshURL = pushletURL - + "?" + P_ID + "=" + id - + "&" + P_EVENT + "=" + E_REFRESH - ; - - if (reader != null) { - try { - reader.close(); - - } catch (IOException ignore) { - - } - reader = null; - } - - reader = openURL(refreshURL); - } - - /** - * Handle unknown Event (default behaviour). - */ - protected void handleUnknownEventType(String eventType, Event event, PushletClientListener listener) { - warn("unsupported event type received: " + eventType); - } - } - - /** - * Authenticator - */ - private static class HTTPAuthenticateProxy extends Authenticator { - - /** - * Contributed by Dele Olajide - * See http://groups.yahoo.com/group/pushlet/message/634 - */ - - private String thePassword = ""; - private String theUser = ""; - - public HTTPAuthenticateProxy(String username, String password) { - - thePassword = password; - theUser = username; - } - - protected PasswordAuthentication getPasswordAuthentication() { - // System.out.println("[HttpAuthenticateProxy] Username = " + theUser); - // System.out.println("[HttpAuthenticateProxy] Password = " + thePassword); - - return new PasswordAuthentication(theUser, thePassword.toCharArray()); - } - - } - -} - -/* - * $Log: PushletClient.java,v $ - * Revision 1.19 2009/06/04 12:46:35 justb - * PushletClient: add more hooks for extension (feat ID: 2799694 Craig M) - * - * Revision 1.18 2007/11/10 13:52:47 justb - * make startDataEventListener method protected to allow overriding - * - * Revision 1.17 2006/10/29 16:47:57 justb - * included patch from Jeff Nowakowski: wait until listener thread runs - * - * Revision 1.16 2005/05/06 20:08:20 justb - * client enhancements - * - * Revision 1.15 2005/03/27 17:42:27 justb - * enhancements - * - * Revision 1.14 2005/03/25 23:54:04 justb - * *** empty log message *** - * - * Revision 1.13 2005/02/28 16:59:40 justb - * fixes for leave and disconnect - * - * Revision 1.12 2005/02/28 15:57:54 justb - * added SimpleListener example - * - * Revision 1.11 2005/02/21 12:31:44 justb - * added proxy contribution from Dele Olajide - * - * Revision 1.10 2005/02/20 13:05:32 justb - * removed the Postlet (integrated in Pushlet protocol) - * - * Revision 1.9 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.8 2005/02/18 09:54:12 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.7 2005/02/15 15:46:30 justb - * client API improves - * - * Revision 1.6 2005/02/15 13:28:56 justb - * first quick rewrite adapt for v2 protocol - * - * Revision 1.5 2004/10/25 21:23:44 justb - * *** empty log message *** - * - * Revision 1.4 2004/10/24 13:52:51 justb - * small fixes in client lib - * - * Revision 1.3 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.2 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.1 2004/03/10 20:14:17 justb - * renamed all *JavaPushletClient* to *PushletClient* - * - * Revision 1.10 2004/03/10 15:45:55 justb - * many cosmetic changes - * - * Revision 1.9 2003/08/17 20:30:20 justb - * cosmetic changes - * - * Revision 1.8 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * - */ \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/client/PushletClient.java.patch b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/client/PushletClient.java.patch deleted file mode 100755 index 63d660354d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/client/PushletClient.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- PushletClient.java 6 May 2005 20:08:20 -0000 1.16 -+++ PushletClient.java 28 Oct 2006 23:19:12 -0000 -@@ -142,7 +142,13 @@ - } - - dataEventListener = new DataEventListener(aListener, listenURL); -- dataEventListener.start(); -+ synchronized (dataEventListener) { -+ dataEventListener.start(); -+ try { -+ dataEventListener.wait(); -+ } catch (InterruptedException e) { -+ } -+ } - } - - /** Immediate listener. */ -@@ -354,6 +360,11 @@ - // Connect to server - reader = openURL(listenURL); - -+ synchronized (this) { -+ // Inform the calling thread we're ready to receive events. -+ this.notify(); -+ } -+ - // Get events while we're alive. - while (receiveThread != null && receiveThread.isAlive()) { - Event event = null; diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/client/PushletClientListener.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/client/PushletClientListener.java deleted file mode 100755 index 864e2ef7dd..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/client/PushletClientListener.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.client; - -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.Protocol; - -/** - * Interface for listener of the PushletClient object. - * - * @version $Id: PushletClientListener.java,v 1.5 2005/02/21 11:50:37 justb Exp $ - * @author Just van den Broecke - Just Objects © - **/ -public interface PushletClientListener extends Protocol { - /** Abort event from server. */ - public void onAbort(Event theEvent); - - /** Data event from server. */ - public void onData(Event theEvent); - - /** Heartbeat event from server. */ - public void onHeartbeat(Event theEvent); - - /** Error occurred. */ - public void onError(String message); -} - -/* -* $Log: PushletClientListener.java,v $ -* Revision 1.5 2005/02/21 11:50:37 justb -* ohase1 of refactoring Subscriber into Session/Controller/Subscriber -* -* Revision 1.4 2005/02/15 15:46:31 justb -* client API improves -* -* Revision 1.3 2004/10/24 12:58:18 justb -* revised client and test classes for new protocol -* -* Revision 1.2 2004/09/03 22:35:37 justb -* Almost complete rewrite, just checking in now -* -* Revision 1.1 2004/03/10 20:14:17 justb -* renamed all *JavaPushletClient* to *PushletClient* -* -* Revision 1.3 2003/08/15 08:37:40 justb -* fix/add Copyright+LGPL file headers and footers -* -* -*/ \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/BrowserAdapter.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/BrowserAdapter.java deleted file mode 100755 index d523882f49..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/BrowserAdapter.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Iterator; - -/** - * Generic implementation of ClientAdapter for browser clients. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: BrowserAdapter.java,v 1.6 2007/11/09 13:15:35 justb Exp $ - */ -public class BrowserAdapter implements ClientAdapter, Protocol { - - public static final String START_DOCUMENT = - "" - + "" - + "\n"; - public static final String END_DOCUMENT = ""; - - private PrintWriter servletOut; - private HttpServletResponse servletRsp; - private int bytesSent; - - /** - * Constructor. - */ - public BrowserAdapter(HttpServletResponse aServletResponse) { - servletRsp = aServletResponse; - } - - /** - * Generic init. - */ - public void start() throws IOException { - // Keep servlet request/response objects until page ends in stop() - // Content type as HTML - servletRsp.setStatus(HttpServletResponse.SC_OK); - servletRsp.setContentType("text/html;charset=UTF-8"); - - // http://www.junlu.com/msg/45902.html - // Log.debug("bufsize=" + aRsp.getBufferSize()); - servletOut = servletRsp.getWriter(); - send(START_DOCUMENT); - } - - /** - * Push Event to client. - */ - public void push(Event anEvent) throws IOException { - Log.debug("BCA event=" + anEvent.toXML()); - - // Check if we should refresh - if (anEvent.getEventType().equals(Protocol.E_REFRESH)) { - // Append refresh and tail of HTML document - // Construct the JS callback line to be sent as last line of doc. - // This will refresh the request using the unique id to determine - // the subscriber instance on the server. The client will wait for - // a number of milliseconds. - long refreshWaitMillis = Long.parseLong(anEvent.getField(P_WAIT)); - - // Create servlet request for requesting next events (refresh) - String url = anEvent.getField(P_URL); - String jsRefreshTrigger = "\n"; - - - send(jsRefreshTrigger + END_DOCUMENT); - } else { - send(event2JavaScript(anEvent)); - } - } - - /** - * End HTML page in client browser. - */ - public void stop() { - // To be garbage collected if adapter remains active - servletOut = null; - } - - /** - * Send any string to browser. - */ - protected void send(String s) throws IOException { - // Send string to browser. - // Log.debug("Adapter: sending: " + s); - if (servletOut == null) { - throw new IOException("Client adapter was stopped"); - } - - servletOut.print(s); - - servletOut.flush(); - - // Note: this doesn't seem to have effect - // in Tomcat 4/5 if the client already disconnected. - servletRsp.flushBuffer(); - - bytesSent += s.length(); - Log.debug("bytesSent= " + bytesSent); - // Log.debug("BCA sent event: " + s); - } - - /** - * Converts the Java Event to a JavaScript function call in browser page. - */ - protected String event2JavaScript(Event event) throws IOException { - - // Convert the event to a comma-separated string. - String jsArgs = ""; - for (Iterator iter = event.getFieldNames(); iter.hasNext();) { - String name = (String) iter.next(); - String value = event.getField(name); - String nextArgument = (jsArgs.equals("") ? "" : ",") + "'" + name + "'" + ", \"" + value + "\""; - jsArgs += nextArgument; - } - - // Construct and return the function call */ - return ""; - } - -} - -/* - * $Log: BrowserAdapter.java,v $ - * Revision 1.6 2007/11/09 13:15:35 justb - * add charset=UTF-8 in returned HTTP content types - * - * Revision 1.5 2006/05/15 11:52:53 justb - * updates mainly for AJAX client - * - * Revision 1.4 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.3 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.2 2005/02/21 11:50:44 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.1 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.12 2005/02/15 13:30:23 justb - * changes for Tomcat buffering (now working in tc4 and 5.0) - * - * Revision 1.11 2005/01/24 22:45:58 justb - * getting safari to work - * - * Revision 1.10 2005/01/18 16:46:27 justb - * buffer size setting ignored by tomcat workings - * - * Revision 1.9 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.8 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.7 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.6 2004/08/15 16:00:15 justb - * enhancements to pull mode - * - * Revision 1.5 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.4 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.3 2003/08/12 09:57:05 justb - * replaced all print statements to Log.*() calls - * - * Revision 1.2 2003/05/18 16:15:07 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:30 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:02 justb - * first import into SF - * - * Revision 1.5 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.4 2000/12/27 22:39:35 just - * no message - * - * Revision 1.3 2000/10/30 14:15:47 just - * no message - * - * - */ - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/ClientAdapter.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/ClientAdapter.java deleted file mode 100755 index 4b187325ef..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/ClientAdapter.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import java.io.IOException; - -/** - * Adapter interface for encapsulation of specific HTTP clients. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: ClientAdapter.java,v 1.8 2007/11/23 14:33:07 justb Exp $ - */ -public interface ClientAdapter { - - /** - * Start event push. - */ - public void start() throws IOException; - - /** - * Push single Event to client. - */ - public void push(Event anEvent) throws IOException; - - /** - * Stop event push. - */ - public void stop() throws IOException; -} - -/* - * $Log: ClientAdapter.java,v $ - * Revision 1.8 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.7 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.6 2005/02/21 11:50:45 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.5 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.4 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.3 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:30 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Command.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Command.java deleted file mode 100755 index dbba4fae76..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Command.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Servlets; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * Wraps pushlet request/response data. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Command.java,v 1.4 2007/11/23 14:33:07 justb Exp $ - */ -public class Command implements Protocol { - - /** - * Pushlet request event. - */ - public final Event reqEvent; - - /** - * Pushlet response event. - */ - private Event rspEvent; - - /** - * HTTP Servlet GET/POST request. - */ - public final HttpServletRequest httpReq; - - /** - * HTTP Servlet GET/POST response. - */ - public final HttpServletResponse httpRsp; - - /** - * Pushlet session. - */ - public final Session session; - - /** - * Per-response client adapter. - */ - private ClientAdapter clientAdapter; - - /** - * Constructor. - */ - private Command(Session aSession, Event aRequestEvent, HttpServletRequest aHTTPReq, HttpServletResponse aHTTPRsp) { - session = aSession; - reqEvent = aRequestEvent; - httpReq = aHTTPReq; - httpRsp = aHTTPRsp; - } - - /** - * Create new Command object. - */ - public static Command create(Session aSession, Event aReqEvent, HttpServletRequest aHTTPReq, HttpServletResponse aHTTPRsp) { - return new Command(aSession, aReqEvent, aHTTPReq, aHTTPRsp); - } - - /** - * Set pushlet response event. - */ - public void setResponseEvent(Event aResponseEvent) { - rspEvent = aResponseEvent; - } - - /** - * Get pushlet response event. - */ - public Event getResponseEvent() { - return rspEvent; - } - - /** - * Get client adapter for request. - */ - public ClientAdapter getClientAdapter() throws PushletException { - if (clientAdapter == null) { - // Create and initialize client-specific adapter. - clientAdapter = createClientAdapter(); - } - return clientAdapter; - } - - /** - * Create client notifier based on "format" parameter passed in request. - */ - protected ClientAdapter createClientAdapter() throws PushletException { - - // Assumed to be set by parent. - String outputFormat = session.getFormat(); - - // Determine client adapter to create. - if (outputFormat.equals(FORMAT_JAVASCRIPT)) { - // Client expects to receive Events as JavaScript dispatch calls.. - return new BrowserAdapter(httpRsp); - } else if (outputFormat.equals(FORMAT_SERIALIZED_JAVA_OBJECT)) { - // Client expects to receive Events as Serialized Java Objects. - return new SerializedAdapter(httpRsp); - } else if (outputFormat.equals(FORMAT_XML)) { - // Client expects to receive Events as stream of XML docs. - return new XMLAdapter(httpRsp); - } else if (outputFormat.equals(FORMAT_XML_STRICT)) { - // Client expects to receive Events embedded in single XML doc. - return new XMLAdapter(httpRsp, true); - } else { - throw new PushletException("Null or invalid output format: " + outputFormat); - } - } - - /** - * Sends HTTP response headers. - */ - protected void sendResponseHeaders() { - // Just to try to prevent caching in any form. - Servlets.setNoCacheHeaders(httpRsp); - - // Close connection for Java enabled browsers - if (session.getUserAgent().indexOf("java") > 0) { - // The connection should be closed after this request - // NB: this allows sending a "long response". Some clients - // in particular java.net.URL in VMs > 1.1 that use HTTP/1.1 - // will block if - // - the content length is not sent - // - if Connection: close HTTP header is not sent. - // - // Since we don't know the content length we will assume - // the underlying servlet engine will use chunked encoding. - httpRsp.setHeader("Connection", "close"); - } - } - - -} - -/* - * $Log: Command.java,v $ - * Revision 1.4 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.3 2005/05/06 19:44:00 justb - * added xml-strict format - * - * Revision 1.2 2005/02/28 17:25:15 justb - * commented - * - * Revision 1.1 2005/02/28 12:45:59 justb - * introduced Command class - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Config.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Config.java deleted file mode 100755 index c598e033d7..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Config.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Sys; - -import java.io.File; -import java.util.Properties; - -/** - * Loads and maintains overall configuration. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Config.java,v 1.5 2007/11/23 21:10:17 justb Exp $ - */ -public class Config implements ConfigDefs { - private static final String PROPERTIES_FILE = "pushlet.properties"; - private static Properties properties; - - /** - * Factory method: create object from property denoting class name. - * - * @param aClassNameProp property name e.g. "session.class" - * @return an instance of class denoted by property - * @throws PushletException when class cannot be instantiated - */ - public static Object createObject(String aClassNameProp, String aDefault) throws PushletException { - Class clazz = getClass(aClassNameProp, aDefault); - try { - return clazz.newInstance(); - } catch (Throwable t) { - // Usually a misconfiguration - throw new PushletException("Cannot instantiate class for " + aClassNameProp + "=" + clazz, t); - } - } - - /** - * Factory method: create object from property denoting class name. - * - * @param aClassNameProp property name e.g. "session.class" - * @return a Class object denoted by property - * @throws PushletException when class cannot be instantiated - */ - public static Class getClass(String aClassNameProp, String aDefault) throws PushletException { - // Singleton + factory pattern: create object instance - // from configured class name - String clazz = (aDefault == null ? getProperty(aClassNameProp) : getProperty(aClassNameProp, aDefault)); - - try { - return Class.forName(clazz); - } catch (ClassNotFoundException t) { - // Usually a misconfiguration - throw new PushletException("Cannot find class for " + aClassNameProp + "=" + clazz, t); - } - } - - /** - * Initialize event sources from properties file. - */ - public static void load(String aDirPath) { - // Load Event sources using properties file. - try { - // Try loading through classpath first (e.g. in WEB-INF/classes or from .jar) - Log.info("Config: loading " + PROPERTIES_FILE + " from classpath"); - properties = Sys.loadPropertiesResource(PROPERTIES_FILE); - } catch (Throwable t) { - // Try from provided dir (e.g. WEB_INF/pushlet.properties) - String filePath = aDirPath + File.separator + PROPERTIES_FILE; - Log.info("Config: cannot load " + PROPERTIES_FILE + " from classpath, will try from " + filePath); - - try { - properties = Sys.loadPropertiesFile(filePath); - } catch (Throwable t2) { - Log.fatal("Config: cannot load properties file from " + filePath, t); - - // Give up - return; - } - } - - Log.info("Config: loaded values=" + properties); - } - - public static String getProperty(String aName, String aDefault) { - return properties.getProperty(aName, aDefault); - } - - public static String getProperty(String aName) { - String value = properties.getProperty(aName); - if (value == null) { - throw new IllegalArgumentException("Unknown property: " + aName); - } - return value; - } - - public static boolean getBoolProperty(String aName) { - String value = getProperty(aName); - try { - return value.equals("true"); - } catch (Throwable t) { - throw new IllegalArgumentException("Illegal property value: " + aName + " val=" + value); - } - } - - public static int getIntProperty(String aName) { - String value = getProperty(aName); - try { - return Integer.parseInt(value); - } catch (Throwable t) { - throw new IllegalArgumentException("Illegal property value: " + aName + " val=" + value); - } - } - - public static long getLongProperty(String aName) { - String value = getProperty(aName); - try { - return Long.parseLong(value); - } catch (Throwable t) { - throw new IllegalArgumentException("Illegal property value: " + aName + " val=" + value); - } - } - - public static boolean hasProperty(String aName) { - return properties.containsKey(aName); - } - - -} - -/* - * $Log: Config.java,v $ - * Revision 1.5 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.4 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.3 2007/11/10 13:44:02 justb - * pushlet.properties and sources.properties can now also be put under WEB-INF - * - * Revision 1.2 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.1 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/ConfigDefs.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/ConfigDefs.java deleted file mode 100755 index df00d41beb..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/ConfigDefs.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - - -/** - * Definition of config property strings. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: ConfigDefs.java,v 1.9 2007/12/07 12:57:40 justb Exp $ - */ -public interface ConfigDefs { - /** - * Class factory definitions, used to insert your custom classes. - */ - public static final String CONTROLLER_CLASS = "controller.class"; - public static final String DISPATCHER_CLASS = "dispatcher.class"; - public static final String LOGGER_CLASS = "logger.class"; - public static final String SESSION_MANAGER_CLASS = "sessionmanager.class"; - public static final String SESSION_CLASS = "session.class"; - public static final String SUBSCRIBER_CLASS = "subscriber.class"; - public static final String SUBSCRIPTION_CLASS = "subscription.class"; - - /** - * Session management. - */ - public static final String SESSION_ID_SIZE = "session.id.size"; - public static final String SESSION_ID_GENERATION = "session.id.generation"; - public static final String SESSION_ID_GENERATION_UUID = "uuid"; - public static final String SESSION_ID_GENERATION_RANDOMSTRING = "randomstring"; - public static final String SESSION_TIMEOUT_MINS = "session.timeout.mins"; - - public static final String SOURCES_ACTIVATE = "sources.activate"; - - /** - * Logging - */ - public static final String LOG_LEVEL = "log.level"; - public static final int LOG_LEVEL_FATAL = 1; - public static final int LOG_LEVEL_ERROR = 2; - public static final int LOG_LEVEL_WARN = 3; - public static final int LOG_LEVEL_INFO = 4; - public static final int LOG_LEVEL_DEBUG = 5; - public static final int LOG_LEVEL_TRACE = 6; - - /** - * Queues - */ - public static final String QUEUE_SIZE = "queue.size"; - public static final String QUEUE_READ_TIMEOUT_MILLIS = "queue.read.timeout.millis"; - public static final String QUEUE_WRITE_TIMEOUT_MILLIS = "queue.write.timeout.millis"; - - /** - * Listening modes. - */ - public static final String LISTEN_FORCE_PULL_ALL = "listen.force.pull.all"; - public static final String LISTEN_FORCE_PULL_AGENTS = "listen.force.pull.agents"; - - - public static final String PULL_REFRESH_TIMEOUT_MILLIS = "pull.refresh.timeout.millis"; - public static final String PULL_REFRESH_WAIT_MIN_MILLIS = "pull.refresh.wait.min.millis"; - public static final String PULL_REFRESH_WAIT_MAX_MILLIS = "pull.refresh.wait.max.millis"; - - - public static final String POLL_REFRESH_TIMEOUT_MILLIS = "poll.refresh.timeout.millis"; - public static final String POLL_REFRESH_WAIT_MIN_MILLIS = "poll.refresh.wait.min.millis"; - public static final String POLL_REFRESH_WAIT_MAX_MILLIS = "poll.refresh.wait.max.millis"; - -} - -/* - * $Log: ConfigDefs.java,v $ - * Revision 1.9 2007/12/07 12:57:40 justb - * added log4j and make it the default logging method - * - * Revision 1.8 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.7 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.6 2007/11/10 14:48:35 justb - * make session key generation configurable (can use uuid) - * - * Revision 1.5 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.4 2005/02/21 16:59:00 justb - * SessionManager and session lease introduced - * - * Revision 1.3 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.2 2005/02/21 11:16:44 justb - * add log level config prop - * - * Revision 1.1 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - * - * - */ - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Controller.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Controller.java deleted file mode 100755 index ca90b1539e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Controller.java +++ /dev/null @@ -1,502 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.PushletException; - -import java.io.IOException; - -/** - * Handles servlet requests from client. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Controller.java,v 1.9 2007/11/23 14:33:07 justb Exp $ - */ -public class Controller implements Protocol, ConfigDefs { - - private Session session; - - /** - * Protected constructor as we create through factory method. - */ - protected Controller() { - } - - /** - * Create instance through factory method. - * - * @param aSession the parent Session - * @return a Controller object (or derived) - * @throws PushletException exception, usually misconfiguration - */ - public static Controller create(Session aSession) throws PushletException { - Controller controller; - try { - controller = (Controller) Config.getClass(CONTROLLER_CLASS, "nl.justobjects.pushlet.core.Controller").newInstance(); - } catch (Throwable t) { - throw new PushletException("Cannot instantiate Controller from config", t); - } - controller.session = aSession; - return controller; - } - - /** - * Handle command. - */ - public void doCommand(Command aCommand) { - try { - // Update lease time to live - session.kick(); - - // Set remote IP address of client - session.setAddress(aCommand.httpReq.getRemoteAddr()); - - debug("doCommand() event=" + aCommand.reqEvent); - - // Get event type - String eventType = aCommand.reqEvent.getEventType(); - - // Determine action based on event type - if (eventType.equals(Protocol.E_REFRESH)) { - // Pull/poll mode clients that refresh - doRefresh(aCommand); - } else if (eventType.equals(Protocol.E_SUBSCRIBE)) { - // Subscribe - doSubscribe(aCommand); - } else if (eventType.equals(Protocol.E_UNSUBSCRIBE)) { - // Unsubscribe - doUnsubscribe(aCommand); - } else if (eventType.equals(Protocol.E_JOIN)) { - // Join - doJoin(aCommand); - } else if (eventType.equals(Protocol.E_JOIN_LISTEN)) { - // Join and listen (for simple and e.g. REST apps) - doJoinListen(aCommand); - } else if (eventType.equals(Protocol.E_LEAVE)) { - // Leave - doLeave(aCommand); - } else if (eventType.equals(Protocol.E_HEARTBEAT)) { - // Heartbeat mainly to do away with browser "busy" cursor - doHeartbeat(aCommand); - } else if (eventType.equals(Protocol.E_PUBLISH)) { - // Publish event - doPublish(aCommand); - } else if (eventType.equals(Protocol.E_LISTEN)) { - // Listen to pushed events - doListen(aCommand); - } - - // Handle response back to client - if (eventType.endsWith(Protocol.E_LISTEN) || - eventType.equals(Protocol.E_REFRESH)) { - // Data channel events - // Loops until refresh or connection closed - getSubscriber().fetchEvents(aCommand); - - } else { - // Send response for control commands - sendControlResponse(aCommand); - } - - } catch (Throwable t) { - warn("Exception in doCommand(): " + t); - t.printStackTrace(); - } - } - - public String toString() { - return session.toString(); - } - - /** - * Handle heartbeat event. - */ - protected void doHeartbeat(Command aCommand) { - - // Set heartbeat acknowledgement to client - aCommand.setResponseEvent(new Event(E_HEARTBEAT_ACK)); - } - - /** - * Handle Join request. - */ - protected void doJoin(Command aCommand) throws PushletException { - - Event responseEvent = null; - - try { - - session.start(); - - // Determine format for encoding Events to client. - // Default assume a userAgent window on the other end. - String format = aCommand.reqEvent.getField(P_FORMAT, FORMAT_JAVASCRIPT); - - session.setFormat(format); - responseEvent = new Event(E_JOIN_ACK); - - // Set unique subscriber id and encoding format - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_FORMAT, format); - info("joined"); - } catch (Throwable t) { - session.stop(); - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doJoin() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - - } - - /** - * Handle JoinListen request. - */ - protected void doJoinListen(Command aCommand) throws PushletException { - - // Basically bundles a join and a listen - // This request is handly for simple apps that - // need to do a single request to get events immediately - // For example in RESTful apps. - - // First do regular join - doJoin(aCommand); - if (!aCommand.getResponseEvent().getEventType().equals(E_NACK)) { - // If successful do the listen - doListen(aCommand); - if (!aCommand.getResponseEvent().getEventType().equals(E_NACK)) { - // If still ok do the listen ack - aCommand.getResponseEvent().setField(P_EVENT, E_JOIN_LISTEN_ACK); - } - } - } - - /** - * Handle Leave request. - */ - protected void doLeave(Command aCommand) throws IOException { - - Event responseEvent = null; - - try { - // Also removes all subscriptions - session.stop(); - - // Prepare acknowledgement - responseEvent = new Event(E_LEAVE_ACK); - - // Set unique subscriber id - responseEvent.setField(P_ID, session.getId()); - info("left"); - } catch (Throwable t) { - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doLeave() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - - } - - /** - * Handle Listen request. - */ - protected void doListen(Command aCommand) throws PushletException { - - - String mode = MODE_STREAM; - // Should we always force "pull" mode ? - if (Config.getBoolProperty(LISTEN_FORCE_PULL_ALL)) { - mode = MODE_PULL; - } else { - // Determine optimal mode determined by parameter and/or user agent - // Mode param determines how events are transfered to the client - - // In "stream" mode, a stream of events is sent, i.e. the document - // is neverending. In "pull" or "poll" mode a complete document is returned - // ending with a request to refresh. - mode = aCommand.reqEvent.getField(P_MODE, MODE_STREAM); - - String userAgent = aCommand.httpReq.getHeader("User-Agent"); - if (userAgent != null) { - userAgent = userAgent.toLowerCase(); - for (int i = 0; i < session.FORCED_PULL_AGENTS.length; i++) { - if ((userAgent.indexOf(session.FORCED_PULL_AGENTS[i]) != -1)) { - info("Forcing pull mode for agent=" + userAgent); - mode = MODE_PULL; - break; - } - } - } else { - userAgent = "unknown"; - } - } - - getSubscriber().setMode(mode); - - // Prepare acknowledgement - Event listenAckEvent = new Event(E_LISTEN_ACK); - - // Add subscription(s) if subject(s) specified - String subject = aCommand.reqEvent.getField(P_SUBJECT); - if (subject != null) { - // Optional label for subscription - String label = aCommand.reqEvent.getField(Protocol.P_SUBSCRIPTION_LABEL); - - // Add a subscription - Subscription subscription = getSubscriber().addSubscription(subject, label); - - // Add subscription id and optional label to listen-ack event - listenAckEvent.setField(P_SUBSCRIPTION_ID, subscription.getId()); - if (label != null) { - listenAckEvent.setField(P_SUBSCRIPTION_LABEL, label); - } - } - - // Set unique subscriber id, push mode and encoding format - listenAckEvent.setField(P_ID, session.getId()); - listenAckEvent.setField(P_MODE, mode); - listenAckEvent.setField(P_FORMAT, session.getFormat()); - - // Activate the subscriber - getSubscriber().start(); - - // Enqueue listen ack event on data channel - aCommand.setResponseEvent(listenAckEvent); - - info("Listening mode=" + mode + " userAgent=" + session.getUserAgent()); - - } - - /** - * Handle Publish request. - */ - protected void doPublish(Command aCommand) { - Event responseEvent = null; - - try { - String subject = aCommand.reqEvent.getField(Protocol.P_SUBJECT); - if (subject == null) { - // Return error response - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "no subject provided"); - } else { - aCommand.reqEvent.setField(P_FROM, session.getId()); - aCommand.reqEvent.setField(P_EVENT, E_DATA); - - // Event may be targeted to specific user (p_to field) - String to = aCommand.reqEvent.getField(P_TO); - if (to != null) { - Dispatcher.getInstance().unicast(aCommand.reqEvent, to); - } else { - // No to: multicast - debug("doPublish() event=" + aCommand.reqEvent); - Dispatcher.getInstance().multicast(aCommand.reqEvent); - } - - // Acknowledge - responseEvent = new Event(E_PUBLISH_ACK); - } - - } catch (Throwable t) { - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doPublish() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - } - - /** - * Handle refresh event. - */ - protected void doRefresh(Command aCommand) { - // Set ack - aCommand.setResponseEvent(new Event(E_REFRESH_ACK)); - } - - /** - * Handle Subscribe request. - */ - protected void doSubscribe(Command aCommand) throws IOException { - - Event responseEvent = null; - try { - String subject = aCommand.reqEvent.getField(Protocol.P_SUBJECT); - Subscription subscription = null; - if (subject == null) { - // Return error response - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "no subject provided"); - } else { - - String label = aCommand.reqEvent.getField(Protocol.P_SUBSCRIPTION_LABEL); - subscription = getSubscriber().addSubscription(subject, label); - - // Acknowledge - responseEvent = new Event(E_SUBSCRIBE_ACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_SUBJECT, subject); - responseEvent.setField(P_SUBSCRIPTION_ID, subscription.getId()); - if (label != null) { - responseEvent.setField(P_SUBSCRIPTION_LABEL, label); - } - info("subscribed to " + subject + " sid=" + subscription.getId()); - } - - } catch (Throwable t) { - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doSubscribe() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - } - - /** - * Handle Unsubscribe request. - */ - protected void doUnsubscribe(Command aCommand) throws IOException { - - - Event responseEvent = null; - try { - String subscriptionId = aCommand.reqEvent.getField(Protocol.P_SUBSCRIPTION_ID); - if (subscriptionId == null) { - // Unsuscbribe all - getSubscriber().removeSubscriptions(); - responseEvent = new Event(E_UNSUBSCRIBE_ACK); - responseEvent.setField(P_ID, session.getId()); - info("unsubscribed all"); - } else { - // Subscription id provided: remove Subscription - Subscription subscription = getSubscriber().removeSubscription(subscriptionId); - if (subscription == null) { - // Unknown subscription id: return error response - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "no subscription for sid=" + subscriptionId); - warn("unsubscribe: no subscription for sid=" + subscriptionId); - } else { - // OK return ack - responseEvent = new Event(E_UNSUBSCRIBE_ACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_SUBSCRIPTION_ID, subscription.getId()); - responseEvent.setField(P_SUBJECT, subscription.getSubject()); - if (subscription.getLabel() != null) { - responseEvent.setField(P_SUBSCRIPTION_LABEL, subscription.getLabel()); - } - info("unsubscribed sid= " + subscriptionId); - } - } - } catch (Throwable t) { - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doUnsubscribe() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - } - - public Subscriber getSubscriber() { - return session.getSubscriber(); - } - - /** - * Send response on the control channel. - */ - protected void sendControlResponse(Command aCommand) { - try { - - // Try to prevent caching in any form. - aCommand.sendResponseHeaders(); - - // Let clientAdapter determine how to send event - aCommand.getClientAdapter().start(); - - // Push to client through client adapter - aCommand.getClientAdapter().push(aCommand.getResponseEvent()); - - // One shot response - aCommand.getClientAdapter().stop(); - } catch (Throwable t) { - session.stop(); - } - } - - - /** - * Info. - */ - protected void info(String s) { - session.info("[Controller] " + s); - } - - /** - * Exceptional print util. - */ - protected void warn(String s) { - session.warn("[Controller] " + s); - } - - /** - * Exceptional print util. - */ - protected void debug(String s) { - session.debug("[Controller] " + s); - } - - -} - -/* - * $Log: Controller.java,v $ - * Revision 1.9 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.8 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * Revision 1.7 2005/02/28 13:05:59 justb - * introduced join-listen protocol service - * - * Revision 1.6 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.5 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.4 2005/02/25 15:13:00 justb - * session id generation more robust - * - * Revision 1.3 2005/02/21 16:59:06 justb - * SessionManager and session lease introduced - * - * Revision 1.2 2005/02/21 12:32:28 justb - * fixed publish event in Controller - * - * Revision 1.1 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Dispatcher.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Dispatcher.java deleted file mode 100755 index 83b402f693..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Dispatcher.java +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.PushletException; - -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; - -/** - * Routes Events to Subscribers. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Dispatcher.java,v 1.9 2007/12/04 13:55:53 justb Exp $ - */ -public class Dispatcher implements Protocol, ConfigDefs { - /** - * Singleton pattern: single instance. - */ - private static Dispatcher instance; - protected SessionManagerVisitor sessionManagerVisitor; - - static { - try { - instance = (Dispatcher) Config.getClass(DISPATCHER_CLASS, "nl.justobjects.pushlet.core.Dispatcher").newInstance(); - Log.info("Dispatcher created className=" + instance.getClass()); - } catch (Throwable t) { - Log.fatal("Cannot instantiate Dispatcher from config", t); - } - } - - /** - * Singleton pattern with factory method: protected constructor. - */ - protected Dispatcher() { - - } - - /** - * Singleton pattern: get single instance. - */ - public static Dispatcher getInstance() { - return instance; - } - - /** - * Send event to all subscribers. - */ - public synchronized void broadcast(Event anEvent) { - try { - // Let the SessionManager loop through Sessions, calling - // our Visitor Method for each Session. This is done to guard - // synchronization with SessionManager and to optimize by - // not getting an array of all sessions. - Object[] args = new Object[2]; - args[1] = anEvent; - Method method = sessionManagerVisitor.getMethod("visitBroadcast"); - SessionManager.getInstance().apply(sessionManagerVisitor, method, args); - } catch (Throwable t) { - Log.error("Error calling SessionManager.apply: ", t); - } - } - - /** - * Send event to subscribers matching Event subject. - */ - public synchronized void multicast(Event anEvent) { - try { - // Let the SessionManager loop through Sessions, calling - // our Visitor Method for each Session. This is done to guard - // synchronization with SessionManager and to optimize by - // not getting an array of all sessions. - Method method = sessionManagerVisitor.getMethod("visitMulticast"); - Object[] args = new Object[2]; - args[1] = anEvent; - SessionManager.getInstance().apply(sessionManagerVisitor, method, args); - } catch (Throwable t) { - Log.error("Error calling SessionManager.apply: ", t); - } - } - - - /** - * Send event to specific subscriber. - */ - public synchronized void unicast(Event event, String aSessionId) { - // Get subscriber to send event to - Session session = SessionManager.getInstance().getSession(aSessionId); - if (session == null) { - Log.warn("unicast: session with id=" + aSessionId + " does not exist"); - return; - } - - // Send Event to subscriber. - session.getSubscriber().onEvent((Event) event.clone()); - } - - /** - * Start Dispatcher. - */ - public void start() throws PushletException { - Log.info("Dispatcher started"); - - // Create callback for SessionManager visits. - sessionManagerVisitor = new SessionManagerVisitor(); - } - - /** - * Stop Dispatcher. - */ - public void stop() { - // Send abort control event to all subscribers. - Log.info("Dispatcher stopped: broadcast abort to all subscribers"); - broadcast(new Event(E_ABORT)); - } - - /** - * Supplies Visitor methods for callbacks from SessionManager. - */ - private class SessionManagerVisitor { - private final Map visitorMethods = new HashMap(2); - - SessionManagerVisitor() throws PushletException { - - try { - // Setup Visitor Methods for callback from SessionManager - // This is a slight opitmization over creating Method objects - // on each invokation. - Class[] argsClasses = {Session.class, Event.class}; - visitorMethods.put("visitMulticast", this.getClass().getMethod("visitMulticast", argsClasses)); - visitorMethods.put("visitBroadcast", this.getClass().getMethod("visitBroadcast", argsClasses)); - } catch (NoSuchMethodException e) { - throw new PushletException("Failed to setup SessionManagerVisitor", e); - } - } - - /** - * Return Visitor Method by name. - */ - public Method getMethod(String aName) { - return (Method) visitorMethods.get(aName); - - } - - /** - * Visitor method called by SessionManager. - */ - public void visitBroadcast(Session aSession, Event event) { - aSession.getSubscriber().onEvent((Event) event.clone()); - } - - /** - * Visitor method called by SessionManager. - */ - public void visitMulticast(Session aSession, Event event) { - Subscriber subscriber = aSession.getSubscriber(); - Event clonedEvent; - Subscription subscription; - - // Send only if the subscriber's criteria - // match the event. - if ((subscription = subscriber.match(event)) != null) { - // Personalize event - clonedEvent = (Event) event.clone(); - - // Set subscription id and optional label - clonedEvent.setField(P_SUBSCRIPTION_ID, subscription.getId()); - if (subscription.getLabel() != null) { - event.setField(P_SUBSCRIPTION_LABEL, subscription.getLabel()); - } - - subscriber.onEvent(clonedEvent); - } - } - } -} - -/* - * $Log: Dispatcher.java,v $ - * Revision 1.9 2007/12/04 13:55:53 justb - * reimplement SessionManager concurrency (prev version was not thread-safe!) - * - * Revision 1.8 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.7 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.6 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.5 2005/02/21 16:59:06 justb - * SessionManager and session lease introduced - * - * Revision 1.4 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.3 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - * Revision 1.2 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.1 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.14 2005/02/16 14:39:34 justb - * fixed leave handling and added "poll" mode - * - * Revision 1.13 2004/10/24 20:50:35 justb - * refine subscription with label and sending sid and label on events - * - * Revision 1.12 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.11 2004/09/26 21:39:43 justb - * allow multiple subscriptions and out-of-band requests - * - * Revision 1.10 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.9 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.8 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.7 2004/08/12 13:18:54 justb - * cosmetic changes - * - * Revision 1.6 2004/03/10 15:45:55 justb - * many cosmetic changes - * - * Revision 1.5 2004/03/10 13:59:28 justb - * rewrite using Collection classes and finer synchronization - * - * Revision 1.4 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.3 2003/08/12 08:54:40 justb - * added getSubscriberCount() and use Log - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:18 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:04 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Event.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Event.java deleted file mode 100755 index b74d3c9bab..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Event.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Sys; - -import java.io.Serializable; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -/** - * Represents the event data. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Event.java,v 1.13 2007/11/23 14:33:07 justb Exp $ - */ -public class Event implements Protocol, Serializable { - - protected Map attributes = new HashMap(3); - - public Event(String anEventType) { - this(anEventType, null); - } - - public Event(String anEventType, Map theAttributes) { - - if (theAttributes != null) { - setAttrs(theAttributes); - } - - // Set required field event type - setField(P_EVENT, anEventType); - - // Set time in seconds since 1970 - setField(P_TIME, System.currentTimeMillis() / 1000); - } - - public Event(Map theAttributes) { - if (!theAttributes.containsKey(P_EVENT)) { - throw new IllegalArgumentException(P_EVENT + " not found in attributes"); - } - setAttrs(theAttributes); - } - - public static Event createDataEvent(String aSubject) { - return createDataEvent(aSubject, null); - } - - public static Event createDataEvent(String aSubject, Map theAttributes) { - Event dataEvent = new Event(E_DATA, theAttributes); - dataEvent.setField(P_SUBJECT, aSubject); - return dataEvent; - } - - public String getEventType() { - return getField(P_EVENT); - } - - public String getSubject() { - return getField(P_SUBJECT); - } - - public void setField(String name, String value) { - attributes.put(name, value); - } - - public void setField(String name, int value) { - attributes.put(name, value + ""); - } - - public void setField(String name, long value) { - attributes.put(name, value + ""); - } - - public String getField(String name) { - return (String) attributes.get(name); - } - - /** - * Return field; if null return default. - */ - public String getField(String name, String aDefault) { - String result = getField(name); - return result == null ? aDefault : result; - } - - public Iterator getFieldNames() { - return attributes.keySet().iterator(); - } - - public String toString() { - return attributes.toString(); - } - - /** - * Convert to HTTP query string. - */ - public String toQueryString() { - String queryString = ""; - String amp = ""; - for (Iterator iter = getFieldNames(); iter.hasNext();) { - String nextAttrName = (String) iter.next(); - String nextAttrValue = getField(nextAttrName); - queryString = queryString + amp + nextAttrName + "=" + nextAttrValue; - // After first add "&". - amp = "&"; - } - - return queryString; - } - - public String toXML(boolean strict) { - String xmlString = " -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import java.io.*; -import java.util.HashMap; - -/** - * Parses XML into Event objects. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: EventParser.java,v 1.3 2007/11/23 14:33:07 justb Exp $ - */ -public class EventParser { - - - private EventParser() { - } - - /** - * Parse Event from a File. - */ - public static Event parse(File aFile) throws IOException { - BufferedReader br = new BufferedReader(new FileReader(aFile)); - return parse(br); - } - - /** - * Parse Event from input Reader. - */ - public static Event parse(Reader aReader) throws IOException { - StringBuffer preparsedString = new StringBuffer(24); - - // First find the opening tag ('<') - char nextChar; - while ((nextChar = (char) aReader.read()) != '<') ; - - // Append '<' - preparsedString.append(nextChar); - - // Then find end-tag ('>'), appending all chars to preparsed string. - do { - nextChar = (char) aReader.read(); - preparsedString.append(nextChar); - } while (nextChar != '>'); - - return parse(preparsedString.toString()); - } - - /** - * Parse Event from a String. - */ - public static Event parse(String aString) throws IOException { - aString = aString.trim(); - - if (!aString.startsWith("<") || !aString.endsWith("/>")) { - throw new IOException("No start or end tag found while parsing event [" + aString + "]"); - } - - // Create the attributes object. - HashMap properties = new HashMap(3); - - // Remove the start and end (< ... />) from the string - aString = aString.substring(1, aString.length() - 2).trim(); - - int index = 0; - - // Parse the tag - while (!Character.isWhitespace(aString.charAt(index)) - && (index < aString.length())) { - index++; - } - - // We don't use the tag: remove from string - aString = aString.substring(index).trim(); - index = 0; - - String attrName; - String attrValue; - - while (index < aString.length()) { - - // Parse attribute name - while ((aString.charAt(index) != '=') - && (index < aString.length())) { - index++; - } - - // Create attr name string - attrName = aString.substring(0, index).trim(); - - // remove the attributeName and the '=' from the string - aString = aString.substring(index + 1).trim(); - index = 1; // read past the first wrapping "\"" - - // Parse attribute value - while ((aString.charAt(index) != '\"') - && (index < aString.length())) { - - // bypass the special characters '\' and '"' inside the - // attributevalue itself which are deliniated with a preceding - // '\' - if (aString.charAt(index) == '\\') { - aString = aString.substring(0, index) - + aString.substring(index + 1); // remove the '\' - } - - index++; - } - - // create the attribute value; exclude the wrapping quote-characters - attrValue = aString.substring(1, index); - - // Set the attribute N/V - properties.put(attrName, attrValue); - - aString = aString.substring(index + 1).trim(); - index = 0; - } - - return new Event(properties); - } - - /** - * Test method: use files to test. - */ - public static void main(String[] args) { - try { - Event event = parse(new File(args[0])); - System.out.println("OK parsed Event file " + args[0]); - System.out.println(event.toXML()); - - event = parse(event.toXML()); - System.out.println("OK parsed Event string"); - System.out.println(event.toXML()); - } catch (Throwable t) { - System.out.println("Error parsing event file: " + args[0]); - t.printStackTrace(); - } - } -} - -/* - * $Log: EventParser.java,v $ - * Revision 1.3 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.2 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.1 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.3 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.2 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.1 2003/05/18 16:12:27 justb - * adding support for XML encoded Events - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/EventPullSource.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/EventPullSource.java deleted file mode 100755 index 0f183dba1b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/EventPullSource.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; - -/** - * Abstract Event source from which Events are pulled. - * - * @version $Id: EventPullSource.java,v 1.15 2007/11/23 14:33:07 justb Exp $ - * @author Just van den Broecke - Just Objects © - **/ - -/** - * ABC for specifc EventPullSources. - */ -abstract public class EventPullSource implements EventSource, Runnable { - private volatile boolean alive = false; - private volatile boolean active = false; - private static int threadNum = 0; - private Thread thread; - - public EventPullSource() { - } - - abstract protected long getSleepTime(); - - abstract protected Event pullEvent(); - - public void start() { - thread = new Thread(this, "EventPullSource-" + (++threadNum)); - thread.setDaemon(true); - thread.start(); - } - - public boolean isAlive() { - return alive; - } - - /** - * Stop the event generator thread. - */ - public void stop() { - alive = false; - - if (thread != null) { - thread.interrupt(); - thread = null; - } - - } - - /** - * Activate the event generator thread. - */ - synchronized public void activate() { - if (active) { - return; - } - active = true; - if (!alive) { - start(); - return; - } - Log.debug(getClass().getName() + ": notifying..."); - notifyAll(); - } - - /** - * Deactivate the event generator thread. - */ - public void passivate() { - if (!active) { - return; - } - active = false; - } - - /** - * Main loop: sleep, generate event and publish. - */ - public void run() { - Log.debug(getClass().getName() + ": starting..."); - alive = true; - while (alive) { - try { - - Thread.sleep(getSleepTime()); - - // Stopped during sleep: end loop. - if (!alive) { - break; - } - - // If passivated wait until we get - // get notify()-ied. If there are no subscribers - // it wasts CPU to remain producing events... - synchronized (this) { - while (!active) { - Log.debug(getClass().getName() + ": waiting..."); - wait(); - } - } - - } catch (InterruptedException e) { - break; - } - - try { - // Derived class should produce an event. - Event event = pullEvent(); - - // Let the publisher push it to subscribers. - Dispatcher.getInstance().multicast(event); - } catch (Throwable t) { - Log.warn("EventPullSource exception while multicasting ", t); - t.printStackTrace(); - } - } - Log.debug(getClass().getName() + ": stopped"); - } -} - -/* - * $Log: EventPullSource.java,v $ - * Revision 1.15 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.14 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.13 2005/02/21 16:59:08 justb - * SessionManager and session lease introduced - * - * Revision 1.12 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.11 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.10 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.9 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.8 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.7 2004/08/15 16:00:15 justb - * enhancements to pull mode - * - * Revision 1.6 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.5 2004/03/10 14:01:55 justb - * formatting and *Subscriber refactoring - * - * Revision 1.4 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.3 2003/08/12 09:57:05 justb - * replaced all print statements to Log.*() calls - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/EventQueue.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/EventQueue.java deleted file mode 100755 index 18fd52318d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/EventQueue.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -/** - * FIFO queue with guarded suspension. - * Purpose
    - *

    - * Implementation
    - * FIFO queue class implemented with circular array. The enQueue() and - * deQueue() methods use guarded suspension according to a readers/writers - * pattern, implemented with java.lang.Object.wait()/notify(). - *

    - * Examples
    - *

    - *
    - * - * @author Just van den Broecke - Just Objects © - * @version $Id: EventQueue.java,v 1.3 2007/11/23 14:33:07 justb Exp $ - */ -public class EventQueue { - /** - * Defines maximum queue size - */ - private int capacity = 8; - private Event[] queue = null; - private int front, rear; - - /** - * Construct queue with default (8) capacity. - */ - public EventQueue() { - this(8); - } - - /** - * Construct queue with specified capacity. - */ - public EventQueue(int capacity) { - this.capacity = capacity; - queue = new Event[capacity]; - front = rear = 0; - } - - /** - * Put item in queue; waits() indefinitely if queue is full. - */ - public synchronized boolean enQueue(Event item) throws InterruptedException { - return enQueue(item, -1); - } - - /** - * Put item in queue; if full wait maxtime. - */ - public synchronized boolean enQueue(Event item, long maxWaitTime) throws InterruptedException { - - // Wait (optional maxtime) as long as the queue is full - while (isFull()) { - if (maxWaitTime > 0) { - // Wait at most maximum time - wait(maxWaitTime); - - // Timed out or woken; if still full we - // had bad luck and return failure. - if (isFull()) { - return false; - } - } else { - wait(); - } - } - - // Put item in queue - queue[rear] = item; - rear = next(rear); - - // Wake up waiters; NOTE: first waiter will eat item - notifyAll(); - return true; - } - - /** - * Get head; if empty wait until something in queue. - */ - public synchronized Event deQueue() throws InterruptedException { - return deQueue(-1); - } - - /** - * Get head; if empty wait for specified time at max. - */ - public synchronized Event deQueue(long maxWaitTime) throws InterruptedException { - while (isEmpty()) { - if (maxWaitTime >= 0) { - wait(maxWaitTime); - - // Timed out or woken; if still empty we - // had bad luck and return failure. - if (isEmpty()) { - return null; - } - } else { - // Wait indefinitely for something in queue. - wait(); - } - } - - // Dequeue item - Event result = fetchNext(); - - // Notify possible wait()-ing enQueue()-ers - notifyAll(); - - // Return dequeued item - return result; - } - - /** - * Get all queued Events. - */ - public synchronized Event[] deQueueAll(long maxWaitTime) throws InterruptedException { - while (isEmpty()) { - if (maxWaitTime >= 0) { - wait(maxWaitTime); - - // Timed out or woken; if still empty we - // had bad luck and return failure. - if (isEmpty()) { - return null; - } - } else { - // Wait indefinitely for something in queue. - wait(); - } - } - - // Dequeue all items item - Event[] events = new Event[getSize()]; - for (int i = 0; i < events.length; i++) { - events[i] = fetchNext(); - } - - // Notify possible wait()-ing enQueue()-ers - notifyAll(); - - // Return dequeued item - return events; - } - - public synchronized int getSize() { - return (rear >= front) ? (rear - front) : (capacity - front + rear); - } - - /** - * Is the queue empty ? - */ - public synchronized boolean isEmpty() { - return front == rear; - } - - /** - * Is the queue full ? - */ - public synchronized boolean isFull() { - return (next(rear) == front); - } - - /** - * Circular counter. - */ - private int next(int index) { - return (index + 1 < capacity ? index + 1 : 0); - } - - /** - * Circular counter. - */ - private Event fetchNext() { - Event temp = queue[front]; - queue[front] = null; - front = next(front); - return temp; - } - - public static void p(String s) { - System.out.println(s); - } - - public static void main(String[] args) { - EventQueue q = new EventQueue(8); - Event event = new Event("t"); - try { - q.enQueue(event); - p("(1) size = " + q.getSize()); - q.enQueue(event); - p("(2) size = " + q.getSize()); - q.deQueue(); - p("(1) size = " + q.getSize()); - q.deQueue(); - p("(0) size = " + q.getSize()); - - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - p("(3) size = " + q.getSize()); - q.deQueue(); - p("(2) size = " + q.getSize()); - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - p("(5) size = " + q.getSize()); - q.enQueue(event); - q.enQueue(event); - p("(7) size = " + q.getSize()); - q.deQueue(); - q.deQueue(); - q.deQueue(); - p("(4) size = " + q.getSize()); - q.deQueue(); - q.deQueue(); - q.deQueue(); - ; - q.deQueue(); - p("(0) size = " + q.getSize()); - - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - p("(5) size = " + q.getSize()); - - q.deQueue(); - q.deQueue(); - q.deQueue(); - ; - q.deQueue(); - p("(1) size = " + q.getSize()); - } catch (InterruptedException ie) { - } - } -} - -/* -* $Log: EventQueue.java,v $ -* Revision 1.3 2007/11/23 14:33:07 justb -* core classes now configurable through factory -* -* Revision 1.2 2005/02/21 11:50:46 justb -* ohase1 of refactoring Subscriber into Session/Controller/Subscriber -* -* Revision 1.1 2005/02/18 10:07:23 justb -* many renamings of classes (make names compact) -* -* Revision 1.6 2005/02/16 12:16:16 justb -* added support for "poll" mode -* -* Revision 1.5 2005/01/13 14:47:15 justb -* control evt: send response on same (control) connection -* -* Revision 1.4 2004/09/03 22:35:37 justb -* Almost complete rewrite, just checking in now -* -* Revision 1.3 2003/08/15 08:37:40 justb -* fix/add Copyright+LGPL file headers and footers -* -* -*/ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/EventSource.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/EventSource.java deleted file mode 100755 index 89f8b2cd4d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/EventSource.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -/** - * Abstract Event source from which Events are pulled. - * - * @version $Id: EventSource.java,v 1.7 2007/11/23 14:33:07 justb Exp $ - * @author Just van den Broecke - Just Objects © - **/ - -/** - * Interface for specifc Event(Pull/Push)Sources. - */ -public interface EventSource { - /** - * Activate the event source. - */ - public void activate(); - - /** - * Deactivate the event source. - */ - public void passivate(); - - /** - * Halt the event source. - */ - public void stop(); -} - -/* - * $Log: EventSource.java,v $ - * Revision 1.7 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.6 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.5 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.4 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.3 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/EventSourceManager.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/EventSourceManager.java deleted file mode 100755 index 835b774daa..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/EventSourceManager.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.Sys; - -import java.util.Enumeration; -import java.util.Properties; -import java.util.Vector; -import java.io.File; - -/** - * Maintains lifecycle of event sources. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: EventSourceManager.java,v 1.14 2007/11/10 13:44:02 justb Exp $ - */ -public class EventSourceManager { - private static Vector eventSources = new Vector(0); - private static final String PROPERTIES_FILE = "sources.properties"; - - /** - * Initialize event sources from properties file. - */ - public static void start(String aDirPath) { - // Load Event sources using properties file. - Log.info("EventSourceManager: start"); - - Properties properties = null; - - try { - properties = Sys.loadPropertiesResource(PROPERTIES_FILE); - } catch (Throwable t) { - // Try from provided dir (e.g. WEB_INF/pushlet.properties) - String filePath = aDirPath + File.separator + PROPERTIES_FILE; - Log.info("EventSourceManager: cannot load " + PROPERTIES_FILE + " from classpath, will try from " + filePath); - - try { - properties = Sys.loadPropertiesFile(filePath); - } catch (Throwable t2) { - Log.fatal("EventSourceManager: cannot load properties file from " + filePath, t); - - // Give up - Log.warn("EventSourceManager: not starting local event sources (maybe that is what you want)"); - return; - } - } - - // Create event source collection - eventSources = new Vector(properties.size()); - - // Add the configured sources - for (Enumeration e = properties.keys(); e.hasMoreElements();) { - String nextKey = (String) e.nextElement(); - String nextClass = properties.getProperty(nextKey); - EventSource nextEventSource = null; - try { - nextEventSource = (EventSource) Class.forName(nextClass).newInstance(); - Log.info("created EventSource: key=" + nextKey + " class=" + nextClass); - eventSources.addElement(nextEventSource); - } catch (Exception ex) { - Log.warn("Cannot create EventSource: class=" + nextClass, ex); - } - } - - activate(); - } - - /** - * Activate all event sources. - */ - public static void activate() { - Log.info("Activating " + eventSources.size() + " EventSources"); - for (int i = 0; i < eventSources.size(); i++) { - ((EventSource) eventSources.elementAt(i)).activate(); - } - Log.info("EventSources activated"); - } - - /** - * Deactivate all event sources. - */ - public static void passivate() { - Log.info("Passivating " + eventSources.size() + " EventSources"); - for (int i = 0; i < eventSources.size(); i++) { - ((EventSource) eventSources.elementAt(i)).passivate(); - } - Log.info("EventSources passivated"); - } - - /** - * Halt event sources. - */ - public static void stop() { - Log.info("Stopping " + eventSources.size() + " EventSources..."); - for (int i = 0; i < eventSources.size(); i++) { - ((EventSource) eventSources.elementAt(i)).stop(); - } - Log.info("EventSources stopped"); - } - -} - -/* - * $Log: EventSourceManager.java,v $ - * Revision 1.14 2007/11/10 13:44:02 justb - * pushlet.properties and sources.properties can now also be put under WEB-INF - * - * Revision 1.13 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.12 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - * Revision 1.11 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.10 2005/02/15 13:29:49 justb - * use Sys.loadPropertiesResource() - * - * Revision 1.9 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.8 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.7 2004/08/15 16:00:15 justb - * enhancements to pull mode - * - * Revision 1.6 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.5 2004/08/12 13:18:54 justb - * cosmetic changes - * - * Revision 1.4 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.3 2003/08/12 09:41:35 justb - * replace static initalizer with explicit init() - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.5 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.4 2000/10/30 14:15:47 just - * no message - * - * Revision 1.3 2000/08/31 08:26:54 just - * Changed classloader that loads eventsources.properties to use EventSourceManager's classloader - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Protocol.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Protocol.java deleted file mode 100755 index 79c265f62f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Protocol.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) 2004 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - - -/** - * Constants for Pushlet protocols. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Protocol.java,v 1.15 2007/11/23 14:33:07 justb Exp $ - */ -public interface Protocol { - /** - * Default URI . - */ - public static final String DEFAULT_SERVLET_URI = "/pushlet/pushlet.srv"; - - // - // Common protocol header/parameter names - // - - /** - * Event type (join, leave, data, subscribe etc) . - */ - public static final String P_EVENT = "p_event"; - - /** - * Time in seconds since 1970 - */ - public static final String P_TIME = "p_time"; - - /** - * Event sequence number, numbers per-client. - */ - public static final String P_SEQ = "p_seq"; - - /** - * Subject (topic) of data event. - */ - public static final String P_SUBJECT = "p_subject"; - - /** - * Originator of Event. - */ - public static final String P_FROM = "p_from"; - - /** - * Addressee of Event, subject or client p_id. - */ - public static final String P_TO = "p_to"; - - /** - * Identifier for client instance within server. - */ - public static final String P_ID = "p_id"; - - /** - * Subscription id, identifies single subscription. - */ - public static final String P_SUBSCRIPTION_ID = "p_sid"; - - /** - * Format to receive events - */ - public static final String P_FORMAT = "p_format"; - - /** - * Protocol mode. - */ - public static final String P_MODE = "p_mode"; - - /** - * Reason for errors. - */ - public static final String P_REASON = "p_reason"; - - /** - * URL attribute. - */ - public static final String P_URL = "p_url"; - - /** - * Wait attribute. - */ - public static final String P_WAIT = "p_wait"; - - /** - * Subscription label, may be used to return user-specific - * token with a data event, e.g. the name of a function for a callback. - */ - public static final String P_SUBSCRIPTION_LABEL = "p_label"; - - // - // Event values with direction for P_EVENT (C=client, S=server) - // - - /** - * C-->S Request to join server. - */ - public static final String E_JOIN = "join"; - - /** - * S-->C Acknowledgement of join. - */ - public static final String E_JOIN_ACK = "join-ack"; - - /** - * C-->S Request to join server. - */ - public static final String E_JOIN_LISTEN = "join-listen"; - - /** - * S-->C Acknowledgement of join. - */ - public static final String E_JOIN_LISTEN_ACK = "join-listen-ack"; - - /** - * C-->S Client starts listening. - */ - public static final String E_LISTEN = "listen"; - - /** - * S-->C Ack of listen. - */ - public static final String E_LISTEN_ACK = "listen-ack"; - - /** - * C-->S Client leaves server. - */ - public static final String E_LEAVE = "leave"; - - /** - * S-->C Ack of leave. - */ - public static final String E_LEAVE_ACK = "leave-ack"; - - /** - * C-->S Publish to subject. - */ - public static final String E_PUBLISH = "publish"; - - /** - * S-->C Publish to subject acknowledge. - */ - public static final String E_PUBLISH_ACK = "publish-ack"; - - /** - * C-->S Subscribe to subject request. - */ - public static final String E_SUBSCRIBE = "subscribe"; - - /** - * S-->C Subscribe to subject acknowledge. - */ - public static final String E_SUBSCRIBE_ACK = "subscribe-ack"; - - /** - * C-->S Unsubscribe from subject request. - */ - public static final String E_UNSUBSCRIBE = "unsubscribe"; - - /** - * S--C Unsubscribe from subject acknowledge. - */ - public static final String E_UNSUBSCRIBE_ACK = "unsubscribe-ack"; - - /** - * S-->C Client error response, transitional error. - */ - public static final String E_NACK = "nack"; - - /** - * S-->C Client should abort, permanent error. - */ - public static final String E_ABORT = "abort"; - - /** - * S-->C Data. - */ - public static final String E_DATA = "data"; - - /** - * S-->C or C-->S Heartbeat. - */ - public static final String E_HEARTBEAT = "hb"; - - /** - * S-->C S-->C or C-->S Heartbeat confirmed. - */ - public static final String E_HEARTBEAT_ACK = "hb-ack"; - - /** - * S-->C or C-->S client refresh of data channel. - */ - public static final String E_REFRESH = "refresh"; - - /** - * S-->C client should refresh data channel. - */ - public static final String E_REFRESH_ACK = "refresh-ack"; - - // - // Values for P_FORMAT parameter - // - - /** - * JavaScript callback. - */ - public static String FORMAT_JAVASCRIPT = "js"; - - /** - * Java serialized object. - */ - public static String FORMAT_SERIALIZED_JAVA_OBJECT = "ser"; - - /** - * Stream of XML documents. - */ - public static String FORMAT_XML = "xml"; - - /** - * Single XML document containing zero or more events. - */ - public static String FORMAT_XML_STRICT = "xml-strict"; - - // - // Values for P_MODE parameter - // - public static final String MODE_STREAM = "stream"; - public static final String MODE_PULL = "pull"; - public static final String MODE_POLL = "poll"; - - // - // Values for special/reserved subjects - // TODO: use these to publish events when clients do these actions - // TODO: Dispatcher may intercept these subjects to send cached events - // - public static final String SUBJECT_META = "/meta"; - public static final String SUBJECT_META_SUBS = SUBJECT_META + "/subs"; - public static final String SUBJECT_META_JOINS = SUBJECT_META + "/joins"; - - -} - -/* - * $Log: Protocol.java,v $ - * Revision 1.15 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.14 2006/10/19 12:33:40 justb - * add atomic join-listen support (one request) - * - * Revision 1.13 2005/05/06 19:44:00 justb - * added xml-strict format - * - * Revision 1.12 2005/02/28 13:05:59 justb - * introduced join-listen protocol service - * - * Revision 1.11 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.10 2005/02/16 12:16:17 justb - * added support for "poll" mode - * - * Revision 1.9 2005/01/24 22:46:02 justb - * getting safari to work - * - * Revision 1.8 2005/01/24 13:42:00 justb - * new protocol changes (p_listen) - * - * Revision 1.7 2005/01/18 16:47:10 justb - * protocol changes for v2 and publishing from pushlet client - * - * Revision 1.6 2005/01/13 14:47:15 justb - * control evt: send response on same (control) connection - * - * Revision 1.5 2004/10/24 13:52:52 justb - * small fixes in client lib - * - * Revision 1.4 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.3 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.2 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.1 2004/09/03 21:02:20 justb - * make more formalized protocol - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/SerializedAdapter.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/SerializedAdapter.java deleted file mode 100755 index 501a6ba3ce..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/SerializedAdapter.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.ObjectOutputStream; - -/** - * Implementation of ClientAdapter that sends Events as serialized objects. - *

    - * NOTE: You are discouraged to use this adapter, since it is Java-only - * and may have JVM-specific problems. Far better choice is to use XML - * and the XMLAdapter. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: SerializedAdapter.java,v 1.4 2007/11/23 14:33:07 justb Exp $ - */ -class SerializedAdapter implements ClientAdapter { - private ObjectOutputStream out = null; - public static final String CONTENT_TYPE = "application/x-java-serialized-object"; - private HttpServletResponse servletRsp; - - /** - * Initialize. - */ - public SerializedAdapter(HttpServletResponse aServletResponse) { - servletRsp = aServletResponse; - } - - public void start() throws IOException { - - servletRsp.setContentType(CONTENT_TYPE); - - // Use a serialized object output stream - out = new ObjectOutputStream(servletRsp.getOutputStream()); - - // Don't need this further - servletRsp = null; - } - - /** - * Push Event to client. - */ - public void push(Event anEvent) throws IOException { - out.writeObject(anEvent); - - out.flush(); - } - - - public void stop() throws IOException { - } -} - -/* - * $Log: SerializedAdapter.java,v $ - * Revision 1.4 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.3 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.2 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.1 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.4 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.3 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:13:48 justb - * fixed blocking for java.net.URL with HTTP/1.1 (JVMs > 1.1) - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:18 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.5 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.4 2000/12/27 22:39:35 just - * no message - * - * Revision 1.3 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Session.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Session.java deleted file mode 100755 index 8adf9ba6f4..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Session.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.PushletException; - -/** - * Represents client pushlet session state. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Session.java,v 1.8 2007/11/23 14:33:07 justb Exp $ - */ -public class Session implements Protocol, ConfigDefs { - private Controller controller; - private Subscriber subscriber; - - private String userAgent; - private long LEASE_TIME_MILLIS = Config.getLongProperty(SESSION_TIMEOUT_MINS) * 60 * 1000; - private volatile long timeToLive = LEASE_TIME_MILLIS; - - public static String[] FORCED_PULL_AGENTS = Config.getProperty(LISTEN_FORCE_PULL_AGENTS).split(","); - - private String address = "unknown"; - private String format = FORMAT_XML; - - private String id; - - /** - * Protected constructor as we create through factory method. - */ - protected Session() { - } - - /** - * Create instance through factory method. - * - * @param anId a session id - * @return a Session object (or derived) - * @throws PushletException exception, usually misconfiguration - */ - public static Session create(String anId) throws PushletException { - Session session; - try { - session = (Session) Config.getClass(SESSION_CLASS, "nl.justobjects.pushlet.core.Session").newInstance(); - } catch (Throwable t) { - throw new PushletException("Cannot instantiate Session from config", t); - } - - // Init session - session.id = anId; - session.controller = Controller.create(session); - session.subscriber = Subscriber.create(session); - return session; - } - - /** - * Return (remote) Subscriber client's IP address. - */ - public String getAddress() { - return address; - } - - /** - * Return command controller. - */ - public Controller getController() { - return controller; - } - - /** - * Return Event format to send to client. - */ - public String getFormat() { - return format; - } - - /** - * Return (remote) Subscriber client's unique id. - */ - public String getId() { - return id; - } - - /** - * Return subscriber. - */ - public Subscriber getSubscriber() { - return subscriber; - } - - /** - * Return remote HTTP User-Agent. - */ - public String getUserAgent() { - return userAgent; - } - - /** - * Set address. - */ - protected void setAddress(String anAddress) { - address = anAddress; - } - - /** - * Set event format to encode. - */ - protected void setFormat(String aFormat) { - format = aFormat; - } - - /** - * Set client HTTP UserAgent. - */ - public void setUserAgent(String aUserAgent) { - userAgent = aUserAgent; - } - - /** - * Decrease time to live. - */ - public void age(long aDeltaMillis) { - timeToLive -= aDeltaMillis; - } - - /** - * Has session timed out? - */ - public boolean isExpired() { - return timeToLive <= 0; - } - - /** - * Keep alive by resetting TTL. - */ - public void kick() { - timeToLive = LEASE_TIME_MILLIS; - } - - public void start() { - SessionManager.getInstance().addSession(this); - } - - public void stop() { - subscriber.stop(); - SessionManager.getInstance().removeSession(this); - } - - /** - * Info. - */ - public void info(String s) { - Log.info("S-" + this + ": " + s); - } - - /** - * Exceptional print util. - */ - public void warn(String s) { - Log.warn("S-" + this + ": " + s); - } - - /** - * Exceptional print util. - */ - public void debug(String s) { - Log.debug("S-" + this + ": " + s); - } - - public String toString() { - return getAddress() + "[" + getId() + "]"; - } -} - -/* - * $Log: Session.java,v $ - * Revision 1.8 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.7 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * Revision 1.6 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.5 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.4 2005/02/25 15:13:01 justb - * session id generation more robust - * - * Revision 1.3 2005/02/21 16:59:08 justb - * SessionManager and session lease introduced - * - * Revision 1.2 2005/02/21 12:32:28 justb - * fixed publish event in Controller - * - * Revision 1.1 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/SessionManager.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/SessionManager.java deleted file mode 100755 index 7d3441dc7b..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/SessionManager.java +++ /dev/null @@ -1,386 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Rand; -import nl.justobjects.pushlet.util.Sys; - -import java.rmi.server.UID; -import java.util.*; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; - -/** - * Manages lifecycle of Sessions. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: SessionManager.java,v 1.12 2007/12/04 13:55:53 justb Exp $ - */ -public class SessionManager implements ConfigDefs { - - /** - * Singleton pattern: single instance. - */ - private static SessionManager instance; - - static { - // Singleton + factory pattern: create single instance - // from configured class name - try { - instance = (SessionManager) Config.getClass(SESSION_MANAGER_CLASS, "nl.justobjects.pushlet.core.SessionManager").newInstance(); - Log.info("SessionManager created className=" + instance.getClass()); - } catch (Throwable t) { - Log.fatal("Cannot instantiate SessionManager from config", t); - } - } - - /** - * Timer to schedule session leasing TimerTasks. - */ - private Timer timer; - private final long TIMER_INTERVAL_MILLIS = 60000; - - /** - * Map of active sessions, keyed by their id, all access is through mutex. - */ - private Map sessions = new HashMap(13); - - /** - * Cache of Sessions for iteration and to allow concurrent modification. - */ - private Session[] sessionCache = new Session[0]; - - /** - * State of SessionCache, becomes true whenever sessionCache out of sync with sessions Map. - */ - private boolean sessionCacheDirty = false; - - /** - * Lock for any operation on Sessions (Session Map and/or -cache). - */ - private final Object mutex = new Object(); - - /** - * Singleton pattern: protected constructor needed for derived classes. - */ - protected SessionManager() { - } - - /** - * Visitor pattern implementation for Session iteration. - *

    - * This method can be used to iterate over all Sessions in a threadsafe way. - * See Dispatcher.multicast and broadcast methods for examples. - * - * @param visitor the object that should implement method parm - * @param method the method to be called from visitor - * @param args arguments to be passed in visit method, args[0] will always be Session object - */ - public void apply(Object visitor, Method method, Object[] args) { - - synchronized (mutex) { - - // Refresh Session cache if required - // We use a cache for two reasons: - // 1. to prevent concurrent modification from within visitor method - // 2. some optimization (vs setting up Iterator for each apply() - if (sessionCacheDirty) { - // Clear out existing cache - for (int i = 0; i < sessionCache.length; i++) { - sessionCache[i] = null; - } - - // Refill cache and update state - sessionCache = (Session[]) sessions.values().toArray(sessionCache); - sessionCacheDirty = false; - } - - // Valid session cache: loop and call supplied Visitor method - Session nextSession; - for (int i = 0; i < sessionCache.length; i++) { - nextSession = sessionCache[i]; - - // Session cache may not be entirely filled - if (nextSession == null) { - break; - } - - try { - // First argument is always a Session object - args[0] = nextSession; - - // Use Java reflection to call the method passed by the Visitor - method.invoke(visitor, args); - } catch (IllegalAccessException e) { - Log.warn("apply: illegal method access: ", e); - } catch (InvocationTargetException e) { - Log.warn("apply: method invoke: ", e); - } - } - } - } - - /** - * Create new Session (but add later). - */ - public Session createSession(Event anEvent) throws PushletException { - // Trivial - return Session.create(createSessionId()); - } - - - /** - * Singleton pattern: get single instance. - */ - public static SessionManager getInstance() { - return instance; - } - - /** - * Get Session by session id. - */ - public Session getSession(String anId) { - synchronized (mutex) { - return (Session) sessions.get(anId); - } - } - - /** - * Get copy of listening Sessions. - */ - public Session[] getSessions() { - synchronized (mutex) { - return (Session[]) sessions.values().toArray(new Session[0]); - } - } - - /** - * Get number of listening Sessions. - */ - public int getSessionCount() { - synchronized (mutex) { - return sessions.size(); - } - } - - /** - * Get status info. - */ - public String getStatus() { - Session[] sessions = getSessions(); - StringBuffer statusBuffer = new StringBuffer(); - statusBuffer.append("SessionMgr: " + sessions.length + " sessions \\n"); - for (int i = 0; i < sessions.length; i++) { - statusBuffer.append(sessions[i] + "\\n"); - } - return statusBuffer.toString(); - } - - /** - * Is Session present?. - */ - public boolean hasSession(String anId) { - synchronized (mutex) { - return sessions.containsKey(anId); - } - } - - /** - * Add session. - */ - public void addSession(Session session) { - synchronized (mutex) { - sessions.put(session.getId(), session); - sessionCacheDirty = true; - } - // log(session.getId() + " at " + session.getAddress() + " adding "); - info(session.getId() + " at " + session.getAddress() + " added "); - } - - /** - * Register session for removal. - */ - public Session removeSession(Session aSession) { - synchronized (mutex) { - Session session = (Session) sessions.remove(aSession.getId()); - if (session != null) { - info(session.getId() + " at " + session.getAddress() + " removed "); - } - sessionCacheDirty = true; - return session; - } - } - - - /** - * Starts us. - */ - public void start() throws PushletException { - if (timer != null) { - stop(); - } - timer = new Timer(false); - timer.schedule(new AgingTimerTask(), TIMER_INTERVAL_MILLIS, TIMER_INTERVAL_MILLIS); - info("started; interval=" + TIMER_INTERVAL_MILLIS + "ms"); - } - - /** - * Stopis us. - */ - public void stop() { - if (timer != null) { - timer.cancel(); - timer = null; - } - synchronized (mutex) { - sessions.clear(); - } - info("stopped"); - } - - /** - * Create unique Session id. - */ - protected String createSessionId() { - // Use UUID if specified in config (thanks Uli Romahn) - if (Config.hasProperty(SESSION_ID_GENERATION) && Config.getProperty(SESSION_ID_GENERATION).equals(SESSION_ID_GENERATION_UUID)) { - // We want to be Java 1.4 compatible so use UID class (1.5+ we may use java.util.UUID). - return new UID().toString(); - } - - // Other cases use random name - - // Create a unique session id - // In 99.9999 % of the cases this should be generated at once - // We need the mutext to prevent the chance of creating - // same-valued ids (thanks Uli Romahn) - synchronized (mutex) { - String id; - while (true) { - id = Rand.randomName(Config.getIntProperty(SESSION_ID_SIZE)); - if (!hasSession(id)) { - // Created unique session id - break; - } - } - return id; - } - } - - /** - * Util: stdout printing. - */ - protected void info(String s) { - Log.info("SessionManager: " + new Date() + " " + s); - } - - /** - * Util: stdout printing. - */ - protected void warn(String s) { - Log.warn("SessionManager: " + s); - } - - /** - * Util: stdout printing. - */ - protected void debug(String s) { - Log.debug("SessionManager: " + s); - } - - /** - * Manages Session timeouts. - */ - private class AgingTimerTask extends TimerTask { - private long lastRun = Sys.now(); - private long delta; - private Method visitMethod; - - public AgingTimerTask() throws PushletException { - try { - // Setup Visitor Methods for callback from SessionManager - Class[] argsClasses = {Session.class}; - visitMethod = this.getClass().getMethod("visit", argsClasses); - } catch (NoSuchMethodException e) { - throw new PushletException("Failed to setup AgingTimerTask", e); - } - } - - /** - * Clock tick callback from Timer. - */ - public void run() { - long now = Sys.now(); - delta = now - lastRun; - lastRun = now; - debug("AgingTimerTask: tick"); - - // Use Visitor pattern to loop through Session objects (see visit() below) - getInstance().apply(this, visitMethod, new Object[1]); - } - - /** - * Callback from SessionManager during apply() - */ - public void visit(Session aSession) { - try { - // Age the lease - aSession.age(delta); - debug("AgingTimerTask: visit: " + aSession); - - // Stop session if lease expired - if (aSession.isExpired()) { - info("AgingTimerTask: Session expired: " + aSession); - aSession.stop(); - } - } catch (Throwable t) { - warn("AgingTimerTask: Error in timer task : " + t); - } - } - } -} - -/* - * $Log: SessionManager.java,v $ - * Revision 1.12 2007/12/04 13:55:53 justb - * reimplement SessionManager concurrency (prev version was not thread-safe!) - * - * Revision 1.11 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.10 2007/11/10 14:47:45 justb - * make session key generation configurable (can use uuid) - * - * Revision 1.9 2007/11/10 14:17:18 justb - * minor cosmetic changes just commit now - * - * Revision 1.8 2007/07/02 08:12:16 justb - * redo to original version of session cache (with break, but nullify array first) - * - * Revision 1.7 2007/07/02 07:33:02 justb - * small fix in sessionmgr for holes in sessioncache array (continue i.s.o. break) - * - * Revision 1.6 2006/11/18 12:13:47 justb - * made SessionManager constructor protected to allow constructing derived classes - * - * Revision 1.5 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * Revision 1.4 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.3 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.2 2005/02/25 15:13:01 justb - * session id generation more robust - * - * Revision 1.1 2005/02/21 16:59:09 justb - * SessionManager and session lease introduced - * - - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Subscriber.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Subscriber.java deleted file mode 100755 index dca30b6bfd..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Subscriber.java +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Rand; -import nl.justobjects.pushlet.util.Sys; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.net.URLEncoder; - -/** - * Handles data channel between dispatcher and client. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Subscriber.java,v 1.26 2007/11/23 14:33:07 justb Exp $ - */ -public class Subscriber implements Protocol, ConfigDefs { - private Session session; - - /** - * Blocking queue. - */ - private EventQueue eventQueue = new EventQueue(Config.getIntProperty(QUEUE_SIZE)); - - /** - * URL to be used in refresh requests in pull/poll modes. - */ - private long queueReadTimeoutMillis = Config.getLongProperty(QUEUE_READ_TIMEOUT_MILLIS); - private long queueWriteTimeoutMillis = Config.getLongProperty(QUEUE_WRITE_TIMEOUT_MILLIS); - private long refreshTimeoutMillis = Config.getLongProperty(PULL_REFRESH_TIMEOUT_MILLIS); - volatile long lastAlive = Sys.now(); - - /** - * Map of active subscriptions, keyed by their subscription id. - */ - private Map subscriptions = Collections.synchronizedMap(new HashMap(3)); - - /** - * Are we able to accept/send events ?. - */ - private volatile boolean active; - - /** - * Transfer mode (stream, pull, poll). - */ - private String mode; - - - /** - * Protected constructor as we create through factory method. - */ - protected Subscriber() { - } - - /** - * Create instance through factory method. - * - * @param aSession the parent Session - * @return a Subscriber object (or derived) - * @throws PushletException exception, usually misconfiguration - */ - public static Subscriber create(Session aSession) throws PushletException { - Subscriber subscriber; - try { - subscriber = (Subscriber) Config.getClass(SUBSCRIBER_CLASS, "nl.justobjects.pushlet.core.Subscriber").newInstance(); - } catch (Throwable t) { - throw new PushletException("Cannot instantiate Subscriber from config", t); - } - - subscriber.session = aSession; - return subscriber; - } - - public void start() { - active = true; - } - - public void stop() { - removeSubscriptions(); - active = false; - } - - public void bailout() { - session.stop(); - } - - /** - * Are we still active to handle events. - */ - public boolean isActive() { - return active; - } - - /** - * Return client session. - */ - public Session getSession() { - return session; - } - - /** - * Get (session) id. - */ - public String getId() { - return session.getId(); - } - - /** - * Return subscriptions. - */ - public Subscription[] getSubscriptions() { - // todo: Optimize - return (Subscription[]) subscriptions.values().toArray(new Subscription[0]); - } - - /** - * Add a subscription. - */ - public Subscription addSubscription(String aSubject, String aLabel) throws PushletException { - Subscription subscription = Subscription.create(aSubject, aLabel); - subscriptions.put(subscription.getId(), subscription); - info("Subscription added subject=" + aSubject + " sid=" + subscription.getId() + " label=" + aLabel); - return subscription; - } - - /** - * Remove a subscription. - */ - public Subscription removeSubscription(String aSubscriptionId) { - Subscription subscription = (Subscription) subscriptions.remove(aSubscriptionId); - if (subscription == null) { - warn("No subscription found sid=" + aSubscriptionId); - return null; - } - info("Subscription removed subject=" + subscription.getSubject() + " sid=" + subscription.getId() + " label=" + subscription.getLabel()); - return subscription; - } - - /** - * Remove all subscriptions. - */ - public void removeSubscriptions() { - subscriptions.clear(); - } - - public String getMode() { - return mode; - } - - public void setMode(String aMode) { - mode = aMode; - } - - public long getRefreshTimeMillis() { - String minWaitProperty = PULL_REFRESH_WAIT_MIN_MILLIS; - String maxWaitProperty = PULL_REFRESH_WAIT_MAX_MILLIS; - if (mode.equals((MODE_POLL))) { - minWaitProperty = POLL_REFRESH_WAIT_MIN_MILLIS; - maxWaitProperty = POLL_REFRESH_WAIT_MAX_MILLIS; - - } - return Rand.randomLong(Config.getLongProperty(minWaitProperty), - Config.getLongProperty(maxWaitProperty)); - } - - /** - * Get events from queue and push to client. - */ - public void fetchEvents(Command aCommand) throws PushletException { - - String refreshURL = aCommand.httpReq.getRequestURI() + "?" + P_ID + "=" + session.getId() + "&" + P_EVENT + "=" + E_REFRESH; - - // This is the only thing required to support "poll" mode - if (mode.equals(MODE_POLL)) { - queueReadTimeoutMillis = 0; - refreshTimeoutMillis = Config.getLongProperty(POLL_REFRESH_TIMEOUT_MILLIS); - } - - // Required for fast bailout (tomcat) - aCommand.httpRsp.setBufferSize(128); - - // Try to prevent caching in any form. - aCommand.sendResponseHeaders(); - - // Let clientAdapter determine how to send event - ClientAdapter clientAdapter = aCommand.getClientAdapter(); - Event responseEvent = aCommand.getResponseEvent(); - try { - clientAdapter.start(); - - // Send first event (usually hb-ack or listen-ack) - clientAdapter.push(responseEvent); - - // In pull/poll mode and when response is listen-ack or join-listen-ack, - // return and force refresh immediately - // such that the client recieves response immediately over this channel. - // This is usually when loading the browser app for the first time - if ((mode.equals(MODE_POLL) || mode.equals(MODE_PULL)) - && responseEvent.getEventType().endsWith(Protocol.E_LISTEN_ACK)) { - sendRefresh(clientAdapter, refreshURL); - - // We should come back later with refresh event... - return; - } - } catch (Throwable t) { - bailout(); - return; - } - - - Event[] events = null; - - // Main loop: as long as connected, get events and push to client - long eventSeqNr = 1; - while (isActive()) { - // Indicate we are still alive - lastAlive = Sys.now(); - - // Update session time to live - session.kick(); - - // Get next events; blocks until timeout or entire contents - // of event queue is returned. Note that "poll" mode - // will return immediately when queue is empty. - try { - // Put heartbeat in queue when starting to listen in stream mode - // This speeds up the return of *_LISTEN_ACK - if (mode.equals(MODE_STREAM) && eventSeqNr == 1) { - eventQueue.enQueue(new Event(E_HEARTBEAT)); - } - - events = eventQueue.deQueueAll(queueReadTimeoutMillis); - } catch (InterruptedException ie) { - warn("interrupted"); - bailout(); - } - - // Send heartbeat when no events received - if (events == null) { - events = new Event[1]; - events[0] = new Event(E_HEARTBEAT); - } - - // ASSERT: one or more events available - - // Send events to client using adapter - // debug("received event count=" + events.length); - for (int i = 0; i < events.length; i++) { - // Check for abort event - if (events[i].getEventType().equals(E_ABORT)) { - warn("Aborting Subscriber"); - bailout(); - } - - // Push next Event to client - try { - // Set sequence number - events[i].setField(P_SEQ, eventSeqNr++); - - // Push to client through client adapter - clientAdapter.push(events[i]); - } catch (Throwable t) { - bailout(); - return; - } - } - - // Force client refresh request in pull or poll modes - if (mode.equals(MODE_PULL) || mode.equals(MODE_POLL)) { - sendRefresh(clientAdapter, refreshURL); - - // Always leave loop in pull/poll mode - break; - } - } - } - - /** - * Determine if we should receive event. - */ - public Subscription match(Event event) { - Subscription[] subscriptions = getSubscriptions(); - for (int i = 0; i < subscriptions.length; i++) { - if (subscriptions[i].match(event)) { - return subscriptions[i]; - } - } - return null; - } - - /** - * Event from Dispatcher: enqueue it. - */ - public void onEvent(Event theEvent) { - if (!isActive()) { - return; - } - - // p("send: queue event: "+theEvent.getSubject()); - - // Check if we had any active continuation for at - // least 'timeOut' millisecs. If the client has left this - // instance there would be no way of knowing otherwise. - long now = Sys.now(); - if (now - lastAlive > refreshTimeoutMillis) { - warn("not alive for at least: " + refreshTimeoutMillis + "ms, leaving..."); - bailout(); - return; - } - - // Put event in queue; leave if queue full - try { - if (!eventQueue.enQueue(theEvent, queueWriteTimeoutMillis)) { - warn("queue full, bailing out..."); - bailout(); - } - - // ASSERTION : Event in queue. - // see fetchEvents() where Events are dequeued and pushed to the client. - } catch (InterruptedException ie) { - bailout(); - } - - } - - /** - * Send refresh command to pull/poll clients. - */ - protected void sendRefresh(ClientAdapter aClientAdapter, String aRefreshURL) { - Event refreshEvent = new Event(E_REFRESH); - - // Set wait time and url for refresh - refreshEvent.setField(P_WAIT, "" + getRefreshTimeMillis()); - refreshEvent.setField(P_URL, aRefreshURL); - - try { - // Push to client through client adapter - aClientAdapter.push(refreshEvent); - - // Stop this round until refresh event - aClientAdapter.stop(); - } catch (Throwable t) { - // Leave on any exception - bailout(); - } - } - - /** - * Info. - */ - protected void info(String s) { - session.info("[Subscriber] " + s); - } - - /** - * Exceptional print util. - */ - protected void warn(String s) { - session.warn("[Subscriber] " + s); - } - - /** - * Exceptional print util. - */ - protected void debug(String s) { - session.debug("[Subscriber] " + s); - } - - - public String toString() { - return session.toString(); - } -} - -/* - * $Log: Subscriber.java,v $ - * Revision 1.26 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.25 2007/11/10 15:53:15 justb - * put heartbeat in queue when start fetching events in stream-mode - * - * Revision 1.24 2006/10/19 12:33:40 justb - * add atomic join-listen support (one request) - * - * Revision 1.22 2006/05/06 00:06:28 justb - * first rough version AJAX client - * - * Revision 1.21 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.20 2005/02/21 16:59:09 justb - * SessionManager and session lease introduced - * - * Revision 1.19 2005/02/21 12:32:28 justb - * fixed publish event in Controller - * - * Revision 1.18 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.17 2005/02/20 13:05:32 justb - * removed the Postlet (integrated in Pushlet protocol) - * - * Revision 1.16 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - * Revision 1.15 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.14 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.13 2005/02/16 14:39:34 justb - * fixed leave handling and added "poll" mode - * - * Revision 1.12 2005/01/24 13:42:00 justb - * new protocol changes (p_listen) - * - * Revision 1.11 2005/01/13 14:47:15 justb - * control evt: send response on same (control) connection - * - * Revision 1.10 2004/10/24 20:50:35 justb - * refine subscription with label and sending sid and label on events - * - * Revision 1.9 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.8 2004/09/26 21:39:43 justb - * allow multiple subscriptions and out-of-band requests - * - * Revision 1.7 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.6 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.5 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.4 2004/03/10 14:01:55 justb - * formatting and *Subscriber refactoring - * - * Revision 1.3 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:32 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:18 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:04 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Subscription.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Subscription.java deleted file mode 100755 index c6f88bd597..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/Subscription.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Rand; -import nl.justobjects.pushlet.util.PushletException; - - -/** - * Represents single subject subscription - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Subscription.java,v 1.5 2007/11/23 14:33:07 justb Exp $ - */ -public class Subscription implements ConfigDefs { - public static final int ID_SIZE = 5; - public static final String SUBJECT_SEPARATOR = ","; - private String id = Rand.randomName(ID_SIZE); - private String subject; - private String[] subjects; - - /** - * Optional label, a user supplied token. - */ - private String label; - - - /** - * Protected constructor as we create through factory method. - */ - protected Subscription() { - } - - /** - * Create instance through factory method. - * - * @param aSubject the subject (topic). - * @return a Subscription object (or derived) - * @throws nl.justobjects.pushlet.util.PushletException - * exception, usually misconfiguration - */ - public static Subscription create(String aSubject) throws PushletException { - return create(aSubject, null); - } - - /** - * Create instance through factory method. - * - * @param aSubject the subject (topic). - * @param aLabel the subject label (optional). - * @return a Subscription object (or derived) - * @throws nl.justobjects.pushlet.util.PushletException - * exception, usually misconfiguration - */ - public static Subscription create(String aSubject, String aLabel) throws PushletException { - if (aSubject == null || aSubject.length() == 0) { - throw new IllegalArgumentException("Null or emtpy subject"); - } - - Subscription subscription; - try { - subscription = (Subscription) Config.getClass(SUBSCRIPTION_CLASS, "nl.justobjects.pushlet.core.Subscription").newInstance(); - } catch (Throwable t) { - throw new PushletException("Cannot instantiate Subscriber from config", t); - } - - // Init - subscription.subject = aSubject; - - // We may subscribe to multiple subjects by separating - // them with SUBJECT_SEPARATOR, e.g. "/stocks/aex,/system/memory,.."). - subscription.subjects = aSubject.split(SUBJECT_SEPARATOR); - - subscription.label = aLabel; - return subscription; - } - - - public String getId() { - return id; - } - - public String getLabel() { - return label; - } - - public String getSubject() { - return subject; - } - - /** - * Determine if Event matches subscription. - */ - public boolean match(Event event) { - String eventSubject = event.getSubject(); - - // Silly case but check anyway - if (eventSubject == null || eventSubject.length() == 0) { - return false; - } - - // Test if one of the subjects matches - for (int i = 0; i < subjects.length; i++) { - if (eventSubject.startsWith(subjects[i])) { - return true; - } - } - - // No match - return false; - } -} - -/* - * $Log: Subscription.java,v $ - * Revision 1.5 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.4 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.3 2005/02/16 15:23:10 justb - * multiple subject (, separated) support - * - * Revision 1.2 2005/01/18 16:47:10 justb - * protocol changes for v2 and publishing from pushlet client - * - * Revision 1.1 2004/09/26 21:39:43 justb - * allow multiple subscriptions and out-of-band requests - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/XMLAdapter.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/XMLAdapter.java deleted file mode 100755 index 70a9c3c47d..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/core/XMLAdapter.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * ClientAdapter that sends Events as XML. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: XMLAdapter.java,v 1.7 2007/11/09 13:15:35 justb Exp $ - */ -class XMLAdapter implements ClientAdapter { - /** - * Header for strict XML - */ - // public static final String XML_HEAD = "\n"; - private String contentType = "text/plain;charset=UTF-8"; - private ServletOutputStream out = null; - private HttpServletResponse servletRsp; - private boolean strictXML; - - /** - * Initialize. - */ - public XMLAdapter(HttpServletResponse aServletResponse) { - this(aServletResponse, false); - } - - /** - * Initialize. - */ - public XMLAdapter(HttpServletResponse aServletResponse, boolean useStrictXML) { - servletRsp = aServletResponse; - - // Strict XML implies returning a complete XML document - strictXML = useStrictXML; - if (strictXML) { - contentType = "text/xml;charset=UTF-8"; - } - } - - public void start() throws IOException { - - // If content type is plain text - // then this is not a complete XML document, but rather - // a stream of XML documents where each document is - // an Event. In strict XML mode a complete document is returned. - servletRsp.setContentType(contentType); - - out = servletRsp.getOutputStream(); - - // Don't need this further - servletRsp = null; - - // Start XML document if strict XML mode - if (strictXML) { - out.print(""); - } - } - - /** - * Force client to refresh the request. - */ - public void push(Event anEvent) throws IOException { - debug("event=" + anEvent); - - // Send the event as XML to the client and flush. - out.print(anEvent.toXML(strictXML)); - out.flush(); - } - - /** - * No action. - */ - public void stop() throws IOException { - // Close XML document if strict XML mode - if (strictXML) { - out.print(""); - out.flush(); - } - } - - private void debug(String s) { - Log.debug("[XMLAdapter]" + s); - } -} - -/* - * $Log: XMLAdapter.java,v $ - * Revision 1.7 2007/11/09 13:15:35 justb - * add charset=UTF-8 in returned HTTP content types - * - * Revision 1.6 2006/05/15 11:52:53 justb - * updates mainly for AJAX client - * - * Revision 1.5 2006/05/06 00:06:28 justb - * first rough version AJAX client - * - * Revision 1.4 2005/05/06 19:44:00 justb - * added xml-strict format - * - * Revision 1.3 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.2 2005/02/21 11:50:47 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.1 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.7 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.6 2004/03/10 14:01:55 justb - * formatting and *Subscriber refactoring - * - * Revision 1.5 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.4 2003/08/13 14:00:00 justb - * some testing for applets; no real change - * - * Revision 1.3 2003/08/12 09:57:06 justb - * replaced all print statements to Log.*() calls - * - * Revision 1.2 2003/05/19 21:56:29 justb - * various fixes for applet clients - * - * Revision 1.1 2003/05/18 16:12:28 justb - * adding support for XML encoded Events - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/servlet/Pushlet.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/servlet/Pushlet.java deleted file mode 100755 index 5177c5cc72..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/servlet/Pushlet.java +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.servlet; - -import nl.justobjects.pushlet.core.*; -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.Servlets; -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.Version; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.Enumeration; - -/** - * Servlet runs a Subscriber per request. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Pushlet.java,v 1.23 2007/12/04 13:55:53 justb Exp $ - */ -public class Pushlet extends HttpServlet implements Protocol { - - public void init() throws ServletException { - try { - // Load configuration (from classpath or WEB-INF root path) - String webInfPath = getServletContext().getRealPath("/") + "/WEB-INF"; - Config.load(webInfPath); - - Log.init(); - - // Start - Log.info("init() Pushlet Webapp - version=" + Version.SOFTWARE_VERSION + " built=" + Version.BUILD_DATE); - - // Start session manager - SessionManager.getInstance().start(); - - // Start event Dispatcher - Dispatcher.getInstance().start(); - - - if (Config.getBoolProperty(Config.SOURCES_ACTIVATE)) { - EventSourceManager.start(webInfPath); - } else { - Log.info("Not starting local event sources"); - } - } catch (Throwable t) { - throw new ServletException("Failed to initialize Pushlet framework " + t, t); - } - } - - public void destroy() { - Log.info("destroy(): Exit Pushlet webapp"); - - if (Config.getBoolProperty(Config.SOURCES_ACTIVATE)) { - // Stop local event sources - EventSourceManager.stop(); - } else { - Log.info("No local event sources to stop"); - } - - // Should abort all subscribers - Dispatcher.getInstance().stop(); - - // Should stop all sessions - SessionManager.getInstance().stop(); - } - - /** - * Servlet GET request: handles event requests. - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - Event event = null; - - try { - // Event parm identifies event type from the client - String eventType = Servlets.getParameter(request, P_EVENT); - - // Always must have an event type - if (eventType == null) { - Log.warn("Pushlet.doGet(): bad request, no event specified"); - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "No eventType specified"); - return; - } - - // Create Event and set attributes from parameters - event = new Event(eventType); - for (Enumeration e = request.getParameterNames(); e.hasMoreElements();) { - String nextAttribute = (String) e.nextElement(); - event.setField(nextAttribute, request.getParameter(nextAttribute)); - } - - - } catch (Throwable t) { - // Error creating event - Log.warn("Pushlet: Error creating event in doGet(): ", t); - response.setStatus(HttpServletResponse.SC_BAD_REQUEST); - return; - } - - // Handle parsed request - doRequest(event, request, response); - - } - - /** - * Servlet POST request: extracts event data from body. - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - Event event = null; - try { - // Create Event by parsing XML from input stream. - event = EventParser.parse(new InputStreamReader(request.getInputStream())); - - // Always must have an event type - if (event.getEventType() == null) { - Log.warn("Pushlet.doPost(): bad request, no event specified"); - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "No eventType specified"); - return; - } - - - } catch (Throwable t) { - // Error creating event - Log.warn("Pushlet: Error creating event in doPost(): ", t); - response.setStatus(HttpServletResponse.SC_BAD_REQUEST); - return; - } - - // Handle parsed request - doRequest(event, request, response); - - } - - /** - * Generic request handler (GET+POST). - */ - protected void doRequest(Event anEvent, HttpServletRequest request, HttpServletResponse response) { - // Must have valid event type. - String eventType = anEvent.getEventType(); - try { - - // Get Session: either by creating (on Join eventType) - // or by id (any other eventType, since client is supposed to have joined). - Session session = null; - if (eventType.startsWith(Protocol.E_JOIN)) { - // Join request: create new subscriber - session = SessionManager.getInstance().createSession(anEvent); - - String userAgent = request.getHeader("User-Agent"); - if (userAgent != null) { - userAgent = userAgent.toLowerCase(); - } else { - userAgent = "unknown"; - } - session.setUserAgent(userAgent); - - } else { - // Must be a request for existing Session - - // Get id - String id = anEvent.getField(P_ID); - - // We must have an id value - if (id == null) { - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "No id specified"); - Log.warn("Pushlet: bad request, no id specified event=" + eventType); - return; - } - - // We have an id: get the session object - session = SessionManager.getInstance().getSession(id); - - // Check for invalid id - if (session == null) { - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid or expired id: " + id); - Log.warn("Pushlet: bad request, no session found id=" + id + " event=" + eventType); - return; - } - } - - // ASSERTION: we have a valid Session - - // Let Controller handle request further - // including exceptions - Command command = Command.create(session, anEvent, request, response); - session.getController().doCommand(command); - } catch (Throwable t) { - // Hmm we should never ever get here - Log.warn("Pushlet: Exception in doRequest() event=" + eventType, t); - t.printStackTrace(); - response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); - } - - } -} - -/* - * $Log: Pushlet.java,v $ - * Revision 1.23 2007/12/04 13:55:53 justb - * reimplement SessionManager concurrency (prev version was not thread-safe!) - * - * Revision 1.22 2007/11/24 10:29:36 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.21 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.20 2007/11/10 13:44:02 justb - * pushlet.properties and sources.properties can now also be put under WEB-INF - * - * Revision 1.19 2006/05/15 11:52:53 justb - * updates mainly for AJAX client - * - * Revision 1.18 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * Revision 1.17 2005/02/28 13:06:01 justb - * introduced join-listen protocol service - * - * Revision 1.16 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.15 2005/02/28 09:14:56 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.14 2005/02/25 15:13:04 justb - * session id generation more robust - * - * Revision 1.13 2005/02/21 17:19:21 justb - * move init()/destroy() to Pushlet servlet - * - * Revision 1.12 2005/02/21 16:59:17 justb - * SessionManager and session lease introduced - * - * Revision 1.11 2005/02/21 11:50:47 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.10 2005/02/20 13:05:32 justb - * removed the Postlet (integrated in Pushlet protocol) - * - * Revision 1.9 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.8 2005/01/13 14:47:15 justb - * control evt: send response on same (control) connection - * - * Revision 1.7 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.6 2004/09/26 21:39:44 justb - * allow multiple subscriptions and out-of-band requests - * - * Revision 1.5 2004/09/20 22:01:40 justb - * more changes for new protocol - * - * Revision 1.4 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.3 2004/08/13 23:36:06 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.2 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.1 2003/08/13 13:26:57 justb - * moved all servlets to servlet package - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:32 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:18 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:04 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/PushletApplet.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/PushletApplet.java deleted file mode 100755 index 5e06ba258c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/PushletApplet.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.test; - -import nl.justobjects.pushlet.client.PushletClient; -import nl.justobjects.pushlet.client.PushletClientListener; -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.Protocol; -import nl.justobjects.pushlet.util.PushletException; - -import java.applet.Applet; -import java.awt.*; - -/** - * Tester for applet clients; displays incoming events in text area. - * - * @version $Id: PushletApplet.java,v 1.16 2005/02/18 09:54:15 justb Exp $ - * @author Just van den Broecke - Just Objects © - **/ -public class PushletApplet extends Applet implements PushletClientListener, Protocol { - private TextArea textArea; - private String host = "localhost"; - private int port = 8080; - private String subject; - private PushletClient pushletClient; - private String VERSION = "15.feb.05 #5"; - private String PUSH_MODE = Protocol.MODE_PULL; - - /** One-time setup. */ - public void init() { - // Subject to subscribe to - subject = getParameter(P_SUBJECT); - - host = getDocumentBase().getHost(); - port = getDocumentBase().getPort(); - - // Hmm sometimes this value is -1...(Mozilla with Java 1.3.0 on Win) - if (port == -1) { - port = 80; - } - - setLayout(new GridLayout(1, 1)); - textArea = new TextArea(15, 40); - textArea.setForeground(Color.yellow); - textArea.setBackground(Color.gray); - textArea.setEditable(false); - add(textArea); - p("PushletApplet - " + VERSION); - } - - public void start() { - dbg("start()"); - bailout(); - - try { - pushletClient = new PushletClient(host, port); - p("Created PushletClient"); - - pushletClient.join(); - p("Joined server"); - - pushletClient.listen(this, PUSH_MODE); - p("Listening in mode=" + PUSH_MODE); - - pushletClient.subscribe(subject); - p("Subscribed to=" + subject); - } catch (PushletException pe) { - p("Error exception=" + pe); - bailout(); - } - } - - public void stop() { - dbg("stop()"); - bailout(); - } - - /** Abort event from server. */ - public void onAbort(Event theEvent) { - p(theEvent.toXML()); - bailout(); - } - - /** Data event from server. */ - public void onData(Event theEvent) { - p(theEvent.toXML()); - } - - /** Heartbeat event from server. */ - public void onHeartbeat(Event theEvent) { - p(theEvent.toXML()); - } - - /** Error occurred. */ - public void onError(String message) { - p(message); - bailout(); - } - - private void bailout() { - if (pushletClient != null) { - p("Stopping PushletClient"); - try { - pushletClient.leave(); - } catch (PushletException ignore) { - p("Error during leave pe=" + ignore); - - } - pushletClient = null; - } - } - - /** Generic print. */ - private void p(String s) { - dbg("event: " + s); - synchronized (textArea) { - textArea.append(s + "\n"); - } - } - - /** Generic print. */ - private void dbg(String s) { - System.out.println("[PushletApplet] " + s); - } -} - -/* - * $Log: PushletApplet.java,v $ - * Revision 1.16 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.15 2005/02/15 15:46:36 justb - * client API improves - * - * Revision 1.14 2005/02/15 13:28:33 justb - * use new PushletClient lib - * - * Revision 1.13 2004/10/25 21:22:26 justb - * *** empty log message *** - * - * Revision 1.12 2004/10/24 13:52:52 justb - * small fixes in client lib - * - * Revision 1.11 2004/10/24 12:58:19 justb - * revised client and test classes for new protocol - * - * Revision 1.10 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.9 2004/08/12 13:18:54 justb - * cosmetic changes - * - * Revision 1.8 2003/08/17 21:06:37 justb - * version info change - * - * Revision 1.7 2003/08/15 08:37:41 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.6 2003/08/14 21:43:10 justb - * improved Java client lifecycle; notably stopping listener thread - * - * Revision 1.5 2003/08/13 14:00:00 justb - * some testing for applets; no real change - * - * Revision 1.4 2003/05/19 22:53:33 justb - * more fixes for applets - * - * Revision 1.3 2003/05/19 21:56:29 justb - * various fixes for applet clients - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:33 justb - * import to sourceforge - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/PushletPingApplication.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/PushletPingApplication.java deleted file mode 100755 index eb47610715..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/PushletPingApplication.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.test; - -import nl.justobjects.pushlet.client.PushletClient; -import nl.justobjects.pushlet.client.PushletClientListener; -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.Protocol; -import nl.justobjects.pushlet.util.PushletException; - -import java.util.HashMap; -import java.util.Map; - -/** - * Tester to demonstrate Pushlet use in Java applications. - * - * This program does two things: - * (1) it subscribes to the subject "test/ping" - * (2) it publishes an Event with subject "/test/ping" every few seconds. - * - * @version $Id: PushletPingApplication.java,v 1.15 2005/02/21 16:59:17 justb Exp $ - * @author Just van den Broecke - Just Objects © - **/ -public class PushletPingApplication extends Thread implements PushletClientListener, Protocol { - private PushletClient pushletClient; - private String host; - private int port; - private static final String SUBJECT = "/test/ping"; - private static final long PUBLISH_INTERVAL_MILLIS = 3000; - - public PushletPingApplication(String aHost, int aPort) { - host = aHost; - port = aPort; - } - - public void run() { - // Create and start a Pushlet client; we receive callbacks - // through onHeartbeat() and onData(). - try { - pushletClient = new PushletClient(host, port); - pushletClient.setDebug(true); - pushletClient.join(); - pushletClient.listen(this, Protocol.MODE_STREAM); - - // Test subscribe/unsubscribe - String subscriptionId = pushletClient.subscribe(SUBJECT); - pushletClient.unsubscribe(subscriptionId); - - // The real subscribe - pushletClient.subscribe(SUBJECT); - p("pushletClient started"); - } catch (PushletException pe) { - p("Error in setting up pushlet session pe=" + pe); - return; - } - - // Publish an event to the server every N seconds. - Map eventData = new HashMap(2); - int seqNr = 1; - while (true) { - try { - // Create event data - eventData.put("seqNr", "" + seqNr++); - eventData.put("time", "" + System.currentTimeMillis()); - - // POST event to pushlet server - pushletClient.publish(SUBJECT, eventData); - - p("published ping # " + (seqNr - 1) + " - sleeping..."); - Thread.sleep(PUBLISH_INTERVAL_MILLIS); - } catch (Exception e) { - p("Postlet exception: " + e); - System.exit(-1); - } - } - } - - /** Error occurred. */ - public void onError(String message) { - p(message); - } - - /** Abort event from server. */ - public void onAbort(Event theEvent) { - p("onAbort received: " + theEvent); - } - - /** Data event from server. */ - public void onData(Event theEvent) { - // Calculate round trip delay - long then = Long.parseLong(theEvent.getField("time")); - long delay = System.currentTimeMillis() - then; - p("onData: ping #" + theEvent.getField("seqNr") + " in " + delay + " ms"); - } - - /** Heartbeat event from server. */ - public void onHeartbeat(Event theEvent) { - p("onHeartbeat received: " + theEvent); - } - - /** Generic print. */ - public void p(String s) { - System.out.println("[PushletPing] " + s); - } - - /** Main program. */ - public static void main(String args[]) { - for (int i = 0; i < 1; i++) { - if (args.length == 0) { - new PushletPingApplication("localhost", 8080).start(); - } else { - // Supply a host and port - new PushletPingApplication(args[0], Integer.parseInt(args[1])).start(); - } - } - - } -} - - -/* - * $Log: PushletPingApplication.java,v $ - * Revision 1.15 2005/02/21 16:59:17 justb - * SessionManager and session lease introduced - * - * Revision 1.14 2005/02/21 11:50:48 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.13 2005/02/20 13:05:33 justb - * removed the Postlet (integrated in Pushlet protocol) - * - * Revision 1.12 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.11 2005/02/15 15:46:37 justb - * client API improves - * - * Revision 1.10 2005/02/15 13:28:08 justb - * use new protocol lib and publish with PushletClient - * - * Revision 1.9 2004/10/24 13:52:52 justb - * small fixes in client lib - * - * Revision 1.8 2004/10/24 12:58:19 justb - * revised client and test classes for new protocol - * - * Revision 1.7 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.6 2004/08/12 13:18:54 justb - * cosmetic changes - * - * Revision 1.5 2004/03/10 14:53:10 justb - * new - * - * Revision 1.4 2003/08/17 20:30:20 justb - * cosmetic changes - * - * Revision 1.3 2003/08/15 08:37:41 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:33 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:19 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:02 justb - * first import into SF - * - * Revision 1.3 2000/08/31 12:49:50 just - * added CVS comment tags for log and copyright - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/SimpleListener.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/SimpleListener.java deleted file mode 100755 index b42c38818e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/SimpleListener.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.test; - -import nl.justobjects.pushlet.client.PushletClient; -import nl.justobjects.pushlet.client.PushletClientListener; -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.Protocol; -import nl.justobjects.pushlet.util.PushletException; - -import java.util.HashMap; -import java.util.Map; - -/** - * Demonstrates join-listen service. - * - * The pushlet protocol supports the "join-listen" service - * which allows stateless (e.g. RESTful) clients to join/subscribe/listen - * using a single HTTP request. - * - * @version $Id: SimpleListener.java,v 1.3 2005/03/14 14:07:23 justb Exp $ - * @author Just van den Broecke - Just Objects © - **/ -public class SimpleListener implements PushletClientListener, Protocol { - private static String SUBJECT = "/temperature"; - private static final String MODE = MODE_STREAM; - - public SimpleListener(String aHost, int aPort) { - // Create and start a Pushlet client; we receive callbacks - // through onHeartbeat() and onData(). - try { - PushletClient pushletClient = new PushletClient(aHost, aPort); - pushletClient.setDebug(false); - pushletClient.join(); - pushletClient.listen(this, MODE, SUBJECT); - p("pushletClient started"); - } catch (PushletException pe) { - p("Error in setting up pushlet session pe=" + pe); - } - } - - /** Error occurred. */ - public void onError(String message) { - p(message); - } - - /** Abort event from server. */ - public void onAbort(Event theEvent) { - p("onAbort received: " + theEvent); - } - - /** Data event from server. */ - public void onData(Event theEvent) { - // Calculate round trip delay - System.out.println(theEvent.toXML()); - } - - /** Heartbeat event from server. */ - public void onHeartbeat(Event theEvent) { - p("onHeartbeat received: " + theEvent); - } - - /** Generic print. */ - public void p(String s) { - System.out.println("[SimpleListener] " + s); - } - - /** Main program. */ - public static void main(String args[]) { - if (args.length == 0) { - new SimpleListener("localhost", 8080); - } - else if (args.length == 1) { - SUBJECT = args[0]; - new SimpleListener("localhost", 8080); - } else { - SUBJECT = args[0]; - // args[1] and [2] should be host and port - new SimpleListener(args[1], Integer.parseInt(args[2])); - } - } -} - - -/* - * $Log: SimpleListener.java,v $ - * Revision 1.3 2005/03/14 14:07:23 justb - * addded subject arg - * - * Revision 1.2 2005/02/28 21:21:32 justb - * no chg - * - * Revision 1.1 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/StressTester.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/StressTester.java deleted file mode 100755 index 616e06fe09..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/StressTester.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.test; - -import nl.justobjects.pushlet.client.PushletClient; -import nl.justobjects.pushlet.client.PushletClientListener; -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.Protocol; -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Rand; - -import java.util.HashMap; -import java.util.Map; - -/** - * Tester to demonstrate Pushlet use in Java applications. - *

    - * This program does two things: - * (1) it subscribes to the subject "test/ping" - * (2) it publishes an Event with subject "/test/ping" every few seconds. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: StressTester.java,v 1.2 2007/11/09 13:16:57 justb Exp $ - */ -public class StressTester implements Protocol { - static private String host = "localhost"; - static private int port = 8080; - static private int TESTER_COUNT = 10; - private static final String SUBJECT = "/test/ping"; - private static final long MIN_PUBLISH_INTERVAL_MILLIS = 200; - private static final long MAX_PUBLISH_INTERVAL_MILLIS = 1000; - private static final long MIN_SUBSCRIBER_INTERVAL_MILLIS = 500; - private static final long MAX_SUBSCRIBER_INTERVAL_MILLIS = 1000; - - public StressTester() { - } - - public void run() { - new EventPublisher().start(); - new EventSubscriber().start(); - } - - /** - * Generic print. - */ - public void err(String s) { - System.out.println("[StressTester] ERROR" + s); - } - - /** - * Generic print. - */ - public void p(String s) { - System.out.println("[StressTester] " + s); - } - - private class EventSubscriber extends Thread implements PushletClientListener { - private PushletClient pushletClient; - - public void run() { - while (true) { - // Create and start a Pushlet client; we receive callbacks - // through onHeartbeat() and onData(). - try { - pushletClient = new PushletClient(host, port); - // pushletClient.setDebug(true); - pushletClient.join(); - pushletClient.listen(this, Protocol.MODE_STREAM); - //p("listening"); - // Test subscribe/unsubscribe - String subscriptionId = pushletClient.subscribe(SUBJECT); - pushletClient.unsubscribe(subscriptionId); - - // The real subscribe - subscriptionId = pushletClient.subscribe(SUBJECT); - //p("sleeping"); - sleepRandom(); - //p("leaving"); - pushletClient.unsubscribe(subscriptionId); - pushletClient.leave(); - - } catch (Throwable t) { - err("Error in EventSubscriber t=" + t); - return; - } - } - } - - /** - * Error occurred. - */ - public void onError(String message) { - // p(message); - } - - /** - * Abort event from server. - */ - public void onAbort(Event theEvent) { - //p("onAbort received: " + theEvent); - } - - /** - * Data event from server. - */ - public void onData(Event theEvent) { - // Calculate round trip delay - long then = Long.parseLong(theEvent.getField("time")); - long delay = System.currentTimeMillis() - then; - //p("onData: ping #" + theEvent.getField("seqNr") + " in " + delay + " ms"); - } - - /** - * Heartbeat event from server. - */ - public void onHeartbeat(Event theEvent) { - //p("onHeartbeat received: " + theEvent); - } - - private void sleepRandom() throws InterruptedException { - Thread.sleep(Rand.randomLong(MIN_SUBSCRIBER_INTERVAL_MILLIS, MAX_SUBSCRIBER_INTERVAL_MILLIS)); - } - } - - private class EventPublisher extends Thread { - private PushletClient pushletClient; - - public void run() { - // Create and start a Pushlet client; we receive callbacks - // through onHeartbeat() and onData(). - try { - pushletClient = new PushletClient(host, port); - pushletClient.join(); - - // p("pushletClient started"); - } catch (PushletException pe) { - err("Error in EventPublisher pe=" + pe); - return; - } - - // Publish an event to the server every N seconds. - Map eventData = new HashMap(2); - int seqNr = 1; - while (true) { - try { - // Create event data - eventData.put("seqNr", "" + seqNr++); - eventData.put("time", "" + System.currentTimeMillis()); - - // POST event to pushlet server - pushletClient.publish(SUBJECT, eventData); - - Thread.sleep(Rand.randomLong(MIN_PUBLISH_INTERVAL_MILLIS, MAX_PUBLISH_INTERVAL_MILLIS)); - } catch (Exception e) { - p("EventPublisher exception: " + e); - return; - } - } - } - - } - - /** - * Main program. - */ - public static void main(String args[]) { - if (args.length > 0) { - TESTER_COUNT = Integer.parseInt(args[0]); - } - if (args.length == 3) { - host = args[1]; - port = Integer.parseInt(args[2]); - } - - for (int i = 0; i < TESTER_COUNT; i++) { - new StressTester().run(); - } - - } -} - -/* - * $Log: StressTester.java,v $ - * Revision 1.2 2007/11/09 13:16:57 justb - * use Rand from util package (and and Rand.java to pushlet client jar - * - * Revision 1.1 2005/02/28 17:16:58 justb - * simple stress tester - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/TestEventPullSources.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/TestEventPullSources.java deleted file mode 100755 index d9b4d7774e..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/TestEventPullSources.java +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.test; - -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.EventPullSource; -import nl.justobjects.pushlet.core.SessionManager; -import nl.justobjects.pushlet.util.Rand; - - -/** - * Event sources for testing. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: TestEventPullSources.java,v 1.10 2007/11/09 13:16:57 justb Exp $ - */ -public class TestEventPullSources { - - /** - * Produces a fake temparature event. - */ - static public class TemperatureEventPullSource extends EventPullSource { - String[] cities = {"amsterdam", null, "rotterdam", null, - "leeuwarden", null, "twente", null, "limburg", null}; - - public long getSleepTime() { - return Rand.randomLong(3000, 5000); - } - - public Event pullEvent() { - int cityNumber = Rand.randomInt(0, (cities.length) / 2 - 1); - int nextCityIndex = 2 * cityNumber; - - Event event = Event.createDataEvent("/temperature"); - - event.setField("number", "" + cityNumber); - event.setField("city", cities[nextCityIndex]); - if (cities[nextCityIndex + 1] == null) { - cities[nextCityIndex + 1] = "" + Rand.randomInt(5, 10); - } - int currentCityValue = new Integer(cities[nextCityIndex + 1]).intValue(); - int newCityValue = currentCityValue + Rand.randomInt(-2, 2); - - event.setField("value", "" + newCityValue); - return event; - } - } - - /** - * Produces a ping event. - */ - static public class PingEventPullSource extends EventPullSource { - public long getSleepTime() { - return 3000; - } - - public Event pullEvent() { - - return Event.createDataEvent("/pushlet/ping"); - } - } - - /** - * Produces an event related to the JVM status. - */ - static public class SystemStatusEventPullSource extends EventPullSource { - Runtime runtime = Runtime.getRuntime(); - - public long getSleepTime() { - return 4000; - } - - public Event pullEvent() { - Event event = Event.createDataEvent("/system/jvm"); - event.setField("totalMemory", "" + runtime.totalMemory()); - event.setField("freeMemory", "" + runtime.freeMemory()); - event.setField("maxMemory", "" + runtime.maxMemory()); - int activeCount = Thread.activeCount(); - event.setField("threads", "" + activeCount); - - return event; - } - } - - /** - * Produces an event related to the Dispatcher.getInstance(). status. - */ - static public class PushletStatusEventPullSource extends EventPullSource { - - public long getSleepTime() { - return 5000; - } - - public Event pullEvent() { - Event event = Event.createDataEvent("/system/pushlet"); - // p(Dispatcher.getStatus()); - event.setField("publisher", "" + SessionManager.getInstance().getStatus()); - return event; - } - } - - - /** - * Produces events simulating stocks from the AEX. - */ - static public class AEXStocksEventPullSource extends EventPullSource { - - String[] stocks = {"abn amro", "26", - "aegon", "38", - "ahold", "34", - "akzo nobel", "51", - "asm lith h", "26", - "corus plc", "2", - "dsm", "40", - "elsevier", "14", - "fortis (nl)", "32", - "getronics", "6", - "gucci", "94", - "hagemeyer", "25", - "heineken", "61", - "ing c", "78", - "klm", "66", - "kon olie", "66", - "kpn", "13", - "numico c", "44", - "philips, kon", "38", - "tnt", "26", - "unilever c", "62", - "vendex kbb", "16", - "vnu", "49", - "wolt-kluw c", "25"}; - - public long getSleepTime() { - return Rand.randomLong(2000, 4000); - } - - public Event pullEvent() { - Event event = Event.createDataEvent("/stocks/aex"); - int stockNumber = Rand.randomInt(0, (stocks.length) / 2 - 1); - int nextStockIndex = 2 * stockNumber; - - event.setField("number", "" + stockNumber); - event.setField("name", stocks[nextStockIndex]); - if (stocks[nextStockIndex + 1] == null) { - stocks[nextStockIndex + 1] = "" + Rand.randomInt(50, 150); - } - int currentStockValue = new Integer(stocks[nextStockIndex + 1]).intValue(); - int newStockValue = currentStockValue + Rand.randomInt(-2, 2); - - event.setField("rate", "" + newStockValue + "." + Rand.randomInt(0, 99)); - return event; - } - - } - - /** - * Produces an URL event for automatic webpresentation. - */ - static public class WebPresentationEventPullSource extends EventPullSource { - String slideRootDir = "http://www.justobjects.org/cowcatcher/browse/j2ee/slides/"; - String[] slideURLs = { - "ejb/j2ee/ejbover/slide.0.0.html", - "ejb/j2ee/ejbover/slide.0.1.html", - "ejb/j2ee/ejbover/slide.0.2.html", - "ejb/j2ee/ejbover/slide.0.3.html", - "ejb/j2ee/ejbover/slide.0.4.html" - }; - - int nextSlideNumber = 0; - - public long getSleepTime() { - return 5000; - } - - public Event pullEvent() { - Event event = Event.createDataEvent("/webpres/auto"); - event.setField("url", slideRootDir + slideURLs[nextSlideNumber++]); - if (nextSlideNumber == slideURLs.length) { - nextSlideNumber = 0; - } - // Log.debug("Sending next slide url=" + event.getField("url")); - return event; - } - } - - /** - * Produces an event related to the Dispatcher.getInstance(). status. - */ - static public class TestEventPullSource extends EventPullSource { - private int number = 0; - - public long getSleepTime() { - return 2000; - } - - public Event pullEvent() { - Event event = Event.createDataEvent("/system/test"); - // p(Dispatcher.getInstance()..getStatus()); - event.setField("nr", "" + (number++)); - event.setField("time", "" + System.currentTimeMillis()); - return event; - } - - } - - /** - * Util: stderr print method. - */ - public static void e(String s) { - System.out.println(s); - } - - /** - * Util: stdout print method. - */ - public static void p(String s) { - // System.out.println(s); - } -} - -/* - * $Log: TestEventPullSources.java,v $ - * Revision 1.10 2007/11/09 13:16:57 justb - * use Rand from util package (and and Rand.java to pushlet client jar - * - * Revision 1.9 2005/02/28 09:14:56 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.8 2005/02/21 16:59:17 justb - * SessionManager and session lease introduced - * - * Revision 1.7 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.6 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher.getInstance(). and single Subscriber class - * - * Revision 1.5 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.4 2003/12/03 21:16:58 justb - * *** empty log message *** - * - * Revision 1.3 2003/08/15 08:37:41 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:33 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:19 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:01 justb - * first import into SF - * - * Revision 1.6 2002/07/29 10:17:22 just - * no message - * - * Revision 1.5 2001/02/18 23:45:13 just - * fixes for AEX - * - * Revision 1.4 2000/10/30 14:16:09 just - * no message - * - * Revision 1.3 2000/08/31 12:49:50 just - * added CVS comment tags for log and copyright - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/TestEventPushSources.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/TestEventPushSources.java deleted file mode 100755 index ba52d29c8f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/test/TestEventPushSources.java +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.test; - -import nl.justobjects.pushlet.core.Dispatcher; -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.EventSource; -import nl.justobjects.pushlet.util.Rand; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URL; -import java.util.StringTokenizer; -import java.util.Vector; - -/** - * Event sources that push events (for testing). - * - * @author Just van den Broecke - Just Objects © - * @version $Id: TestEventPushSources.java,v 1.10 2007/11/09 13:16:57 justb Exp $ - */ -public class TestEventPushSources { - - static public class AEXStocksEventPushSourceABN { - String pageURL = "http://ri2.rois.com/E36msPtnZC0e15CVb4KT97JAGfGSfCcrvv6*FcyZIoNyh/CTIB/RI2APISNAP?RIC=0%23.AEX&FORMAT=XML"; - // This could be further expanded: getting the Reuters AEX stocks - // as XML from ABN with this URL, but we may get into legal problems... - } - - /** - * Produces events from REAL stocks from the AEX. - */ - static public class AEXStocksEventPushSource implements EventSource, Runnable { - /** - * Here we get our stocks from. - */ - String pageURL = "http://www.debeurs.nl/koersen/aex.asp"; - Thread thread = null; - volatile boolean active = false; - - // Since Baan has been thrown out... - public final static int NR_OF_STOCKS = 24; - - public final static String EMPTY = "wait..."; - private int restarts = 1; - - class Stock { - public String name = EMPTY; - public String rate = EMPTY; - volatile public boolean modified = false; - } - - Vector stocksCache = new Vector(NR_OF_STOCKS); - - public AEXStocksEventPushSource() { - for (int i = 0; i < NR_OF_STOCKS; i++) { - stocksCache.addElement(new Stock()); - } - // updateCache(); - } - - /** - * Activate the event source. - */ - synchronized public void activate() { - e("activating..."); - // Stop a possibly running thread - stopThread(); - - // Start new thread and - thread = new Thread(this, "AEXStocksPublisher-" + (restarts++)); - active = true; - thread.start(); - e("activated"); - } - - /** - * Deactivate the event source. - */ - synchronized public void passivate() { - e("passivating..."); - active = false; - stopThread(); - - // Mark the cache modified so we'll send the contents - // on the next activation. - for (int i = 0; i < NR_OF_STOCKS; i++) { - ((Stock) stocksCache.elementAt(i)).modified = true; - } - - e("passivated"); - } - - - /** - * Deactivate the event source. - */ - synchronized public void stop() { - } - - public void run() { - // Publish cache content (if any) first. - publishStocks(); - - int count = 5; // enforce update first - while (active) { - - // Only do work if active - // Update cache every 10 secs. - if (count == 5) { - updateCache(); - count = 0; - } - count++; - - // Do updates for changed stock rates - sendUpdates(); - - // If we were interrupted just return. - if (thread == null || thread.isInterrupted()) { - break; - } - - // Sleep 2 secs before sending next updates - try { - thread.sleep(2000); - } catch (InterruptedException ie) { - break; - } - } - - // Loop terminated: reset vars - thread = null; - active = false; - } - - private String getStocksLine() { - BufferedReader br = null; - InputStream is = null; - String nextLine = ""; - - // Read line from server - try { - is = new URL(pageURL).openStream(); - br = new BufferedReader(new InputStreamReader(is)); - boolean foundLine = false; - while (!foundLine) { - nextLine = br.readLine(); - if (nextLine == null) { - return ""; - } - foundLine = (nextLine.indexOf("details.asp?iid=14053&parent=aex") != -1); - } - } catch (Exception e) { - e("could not open or read URL pageURL=" + pageURL + " ex=" + e); - return ""; - } finally { - try { - if (is != null) is.close(); - } catch (IOException ignore) { - } - } - return nextLine; - } - - private void publishStocks() { - // Publish only modified stocks from the cache - for (int i = 0; i < NR_OF_STOCKS; i++) { - Stock nextStock = (Stock) stocksCache.elementAt(i); - - // Publish modified stocks - if (nextStock.modified) { - publishStock(i, nextStock.name, nextStock.rate); - nextStock.modified = false; - try { - Thread.sleep(400); - } catch (InterruptedException ie) { - return; - } - } - } - } - - private void publishStock(int index, String name, String rate) { - Event event = Event.createDataEvent("/stocks/aex"); - event.setField("number", index + ""); - event.setField("name", name); - event.setField("rate", rate); - p("publish: nr=" + index + " name=" + name + " rate=" + rate); - Dispatcher.getInstance().multicast(event); - } - - private void sendUpdates() { - p("sending updates"); - // In any case send a random stock value by - // making it modified, just to see something moving... - int randomIndex = Rand.randomInt(0, NR_OF_STOCKS - 1); - Stock randomStock = (Stock) stocksCache.elementAt(randomIndex); - randomStock.modified = true; - - publishStocks(); - } - - private void stopThread() { - if (thread != null) { - thread.interrupt(); - thread = null; - } - } - - private void updateCache() { - p("updating Cache"); - - // Get the line with all stocks from HTML page - String stocksLine = getStocksLine(); - if ("".equals(stocksLine)) { - e("updateCache: stocksLine == null"); - return; - } - - // Parse the stocksline and put in cache. - // Beware: this is the messy part!! - // We assume that stock/names and rates are located at - // regular positions in the line. - String delim = "<>"; - StringTokenizer st = new StringTokenizer(stocksLine, delim); - String nextToken = ""; - int count = 0; - String nextStock = ""; - String nextQuote = ""; - String currentQuote = null; - int index = -1; - while (st.hasMoreTokens()) { - nextToken = st.nextToken(); - count++; - // The with the stock name - if ((count - 5) % 57 == 0) { - p("c=" + count + " s=" + nextToken); - nextStock = nextToken; - } - - // The with the stock rate - if ((count - 10) % 57 == 0) { - nextQuote = nextToken; - index++; - p("c=" + count + " val=" + nextQuote); - Stock currentStock = (Stock) stocksCache.elementAt(index); - - // Only update new or modified stocks - if (EMPTY.equals(currentStock.rate) || !currentStock.rate.equals(nextQuote)) { - p("modified: " + nextStock); - currentStock.name = nextStock; - currentStock.rate = nextQuote; - currentStock.modified = true; - } - } - } - } - } - - - /** - * Util: stderr print method. - */ - public static void e(String s) { - System.out.println("AEXStocksEventPushSource: " + s); - } - - /** - * Util: stdout print method. - */ - public static void p(String s) { - // System.out.println(s); - } - - - public static void main(String[] args) { - // new TestEventPushSources$AEXStocksEventPushSource(); - } -} - -/* - * $Log: TestEventPushSources.java,v $ - * Revision 1.10 2007/11/09 13:16:57 justb - * use Rand from util package (and and Rand.java to pushlet client jar - * - * Revision 1.9 2005/02/28 09:14:56 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.8 2005/02/21 16:59:17 justb - * SessionManager and session lease introduced - * - * Revision 1.7 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.6 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.5 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.4 2004/03/10 15:45:55 justb - * many cosmetic changes - * - * Revision 1.3 2003/08/15 08:37:41 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:33 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:20 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:02 justb - * first import into SF - * - * Revision 1.6 2001/02/18 23:45:13 just - * fixes for AEX - * - * Revision 1.5 2000/10/30 14:16:09 just - * no message - * - * Revision 1.4 2000/09/24 21:02:43 just - * chnages due to changed webpage in debeurs.nl - * - * Revision 1.3 2000/08/31 12:49:50 just - * added CVS comment tags for log and copyright - * - * - */ diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/DefaultLogger.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/DefaultLogger.java deleted file mode 100755 index bc0648c9a1..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/DefaultLogger.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -/** - * Default logger. - *

    - * Logs to stdout. Override this class by setting "logger.class" in pushlet.properties to your own logger - * to integrate your own logging library. - * - * @author Just van den Broecke - * @version $Id: DefaultLogger.java,v 1.2 2007/12/07 12:57:40 justb Exp $ - */ -public class DefaultLogger implements PushletLogger { - - - /** - * Level intialized with default. - */ - private int level = LOG_LEVEL_INFO; - - public DefaultLogger() { - } - - public void init() { - - } - - /** - * Log message for trace level. - * - * @param aMessage the message to be logged - */ - public void trace(String aMessage) { - if (level < LOG_LEVEL_TRACE) { - return; - } - print("TRACE", aMessage); - } - - /** - * Log message for debug level. - * - * @param aMessage the message to be logged - */ - public void debug(String aMessage) { - if (level < LOG_LEVEL_DEBUG) { - return; - } - print("DEBUG", aMessage); - } - - /** - * Log message for info level. - * - * @param aMessage the message to be logged - */ - public void info(String aMessage) { - if (level < LOG_LEVEL_INFO) { - return; - } - print("INFO", aMessage); - } - - /** - * Log message for warning level. - * - * @param aMessage the message to be logged - */ - public void warn(String aMessage) { - if (level < LOG_LEVEL_WARN) { - return; - } - print("WARN", aMessage); - } - - /** - * Log message for warning level with exception. - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void warn(String aMessage, Throwable aThrowable) { - warn(aMessage + " exception=" + aThrowable); - } - - /** - * Log message for error level. - * - * @param aMessage the message to be logged - */ - public void error(String aMessage) { - if (level < LOG_LEVEL_ERROR) { - return; - } - print("FATAL", aMessage); - } - - /** - * Log message (error level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void error(String aMessage, Throwable aThrowable) { - error(aMessage + " exception=" + aThrowable); - } - - /** - * Log message for fatal level. - * - * @param aMessage the message to be logged - */ - public void fatal(String aMessage) { - if (level < LOG_LEVEL_FATAL) { - return; - } - print("FATAL", aMessage); - } - - /** - * Log message (fatal level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void fatal(String aMessage, Throwable aThrowable) { - fatal(aMessage + " exception=" + aThrowable); - } - - /** - * Set log level - * - * @param aLevel the message to be logged - */ - public void setLevel(int aLevel) { - level = aLevel; - } - - /** - * Print message. - * - * @param aTag the log type - * @param aMessage the message to be logged - */ - private void print(String aTag, String aMessage) { - // SImple std out e.g. to catalina.out in Tomcat - System.out.println("Pushlet[" + aTag + "] " + aMessage); - } - -} - -/* -* $Log: DefaultLogger.java,v $ -* Revision 1.2 2007/12/07 12:57:40 justb -* added log4j and make it the default logging method -* -* Revision 1.1 2007/11/23 21:10:17 justb -* add hooks for custom logging (you can override DefaultLogger in pushlet.properties) -* -* -* -*/ \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Log.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Log.java deleted file mode 100755 index ee6bd254d4..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Log.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -import nl.justobjects.pushlet.core.Config; -import nl.justobjects.pushlet.core.ConfigDefs; - -/** - * Logging wrapper. - *

    - * Provides a hook to direct logging to your own logging library. Override the DefaultLogger class by setting - * "logger.class" in pushlet.properties to your own logger - * to integrate your own logging library. - * - * @author Just van den Broecke - * @version $Id: Log.java,v 1.5 2007/12/07 12:57:40 justb Exp $ - */ -public class Log implements ConfigDefs { - /** - * Init with default to have at least some logging. - */ - private static PushletLogger logger = new DefaultLogger(); - - /** - * General purpose initialization. - */ - static public void init() { - try { - logger = (PushletLogger) Config.getClass(LOGGER_CLASS, "nl.justobjects.pushlet.util.DefaultLogger").newInstance(); - } catch (Throwable t) { - // Hmmm cannot log this since we don't have a log... - System.out.println("Cannot instantiate Logger from config ex=" + t); - return; - } - - logger.init(); - - // Set log level - logger.setLevel(Config.getIntProperty(Config.LOG_LEVEL)); - - logger.info("Logging intialized logger class=" + logger.getClass()); - } - - /** - * Log message for trace level. - * - * @param aMessage the message to be logged - */ - static public void trace(String aMessage) { - logger.debug(aMessage); - } - - /** - * Log message for debug level. - * - * @param aMessage the message to be logged - */ - static public void debug(String aMessage) { - logger.debug(aMessage); - } - - /** - * Log message for info level. - * - * @param aMessage the message to be logged - */ - static public void info(String aMessage) { - logger.info(aMessage); - } - - /** - * Log message for warning level. - * - * @param aMessage the message to be logged - */ - static public void warn(String aMessage) { - logger.warn(aMessage); - } - - /** - * Log message for warning level with exception. - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - static public void warn(String aMessage, Throwable aThrowable) { - logger.warn(aMessage, aThrowable); - } - - /** - * Log message for error level. - * - * @param aMessage the message to be logged - */ - static public void error(String aMessage) { - logger.error(aMessage); - } - - /** - * Log message (error level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - static public void error(String aMessage, Throwable aThrowable) { - logger.error(aMessage, aThrowable); - } - - /** - * Log message for fatal level. - * - * @param aMessage the message to be logged - */ - static public void fatal(String aMessage) { - logger.fatal(aMessage); - } - - /** - * Log message (fatal level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - static public void fatal(String aMessage, Throwable aThrowable) { - logger.fatal(aMessage, aThrowable); - } - - /** - * Set log level - * - * @param aLevel the message to be logged - */ - static public void setLevel(int aLevel) { - logger.setLevel(aLevel); - } -} - -/* -* $Log: Log.java,v $ -* Revision 1.5 2007/12/07 12:57:40 justb -* added log4j and make it the default logging method -* -* Revision 1.4 2007/11/23 21:29:43 justb -* add hooks for custom logging (you can override DefaultLogger in pushlet.properties) -* -* Revision 1.3 2007/11/23 21:10:17 justb -* add hooks for custom logging (you can override DefaultLogger in pushlet.properties) -* -* Revision 1.2 2005/02/21 11:15:59 justb -* support log levels -* -* Revision 1.1 2005/02/18 10:07:23 justb -* many renamings of classes (make names compact) -* -* Revision 1.7 2004/09/03 22:35:37 justb -* Almost complete rewrite, just checking in now -* -* Revision 1.6 2004/08/12 13:16:08 justb -* make debug flag false -* -* Revision 1.5 2004/03/10 14:01:55 justb -* formatting and *Subscriber refactoring -* -* Revision 1.4 2003/08/15 09:54:46 justb -* fix javadoc warnings -* -* Revision 1.3 2003/08/15 08:37:40 justb -* fix/add Copyright+LGPL file headers and footers -* -* Revision 1.2 2003/08/12 09:42:47 justb -* enhancements -* -* Revision 1.1 2003/08/12 08:46:00 justb -* cvs comment tags added -* -* -*/ \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Log4jLogger.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Log4jLogger.java deleted file mode 100755 index ca96762621..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Log4jLogger.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -import org.apache.log4j.Level; -import org.apache.log4j.LogManager; -import org.apache.log4j.Logger; - -/** - * Logger to use Log4j for logging. - *

    - * Logs using Log4j. - * This class will require a log4j library in the classpath of the Pushlet. - * - * @author Uli Romahn - * @version $Id: Log4jLogger.java,v 1.1 2007/12/07 12:57:40 justb Exp $ - */ -public class Log4jLogger implements PushletLogger { - - /** - * Level intialized with default. - */ - private Logger logger = LogManager.getLogger("pushlet"); - - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#init() - */ - public void init() { - setLevel(LOG_LEVEL_INFO); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#debug(java.lang.String) - */ - public void debug(String aMessage) { - if (!logger.isDebugEnabled()) { - return; - } - logger.debug(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#error(java.lang.String) - */ - public void error(String aMessage) { - logger.error(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#error(java.lang.String, java.lang.Throwable) - */ - public void error(String aMessage, Throwable aThrowable) { - logger.error(aMessage, aThrowable); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#fatal(java.lang.String) - */ - public void fatal(String aMessage) { - logger.fatal(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#fatal(java.lang.String, java.lang.Throwable) - */ - public void fatal(String aMessage, Throwable aThrowable) { - logger.fatal(aMessage, aThrowable); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#info(java.lang.String) - */ - public void info(String aMessage) { - if (!logger.isInfoEnabled()) { - return; - } - logger.info(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#trace(java.lang.String) - */ - public void trace(String aMessage) { - logger.trace(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#warn(java.lang.String) - */ - public void warn(String aMessage) { - logger.warn(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#warn(java.lang.String, java.lang.Throwable) - */ - public void warn(String aMessage, Throwable aThrowable) { - logger.warn(aMessage, aThrowable); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#setLevel(int) - */ - public void setLevel(int aLevel) { - if (aLevel < LOG_LEVEL_FATAL) { - logger.setLevel(Level.OFF); - } else { - switch (aLevel) { - case LOG_LEVEL_FATAL: - logger.setLevel(Level.FATAL); - break; - case LOG_LEVEL_ERROR: - logger.setLevel(Level.ERROR); - break; - case LOG_LEVEL_WARN: - logger.setLevel(Level.WARN); - break; - case LOG_LEVEL_INFO: - logger.setLevel(Level.INFO); - break; - case LOG_LEVEL_DEBUG: - logger.setLevel(Level.DEBUG); - break; - case LOG_LEVEL_TRACE: - logger.setLevel(Level.TRACE); - break; - default: - logger.setLevel(Level.INFO); - } - } - } -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/PushletException.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/PushletException.java deleted file mode 100755 index 09ecd3176c..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/PushletException.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -/** - * Generic exception wrapper. - * - * @author Just van den Broecke - * @version $Id: PushletException.java,v 1.1 2005/02/15 15:14:34 justb Exp $ - */ -public class PushletException extends Exception { - - private PushletException() { - } - - public PushletException(String aMessage, Throwable t) { - super(aMessage + "\n embedded exception=" + t.toString()); - } - - public PushletException(String aMessage) { - super(aMessage); - } - - public PushletException(Throwable t) { - this("PushletException: ", t); - } - - public String toString() { - return "PushletException: " + getMessage(); - } -} - -/* - * $Log: PushletException.java,v $ - * Revision 1.1 2005/02/15 15:14:34 justb - * *** empty log message *** - * - - * - */ \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/PushletLogger.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/PushletLogger.java deleted file mode 100755 index e70bc68703..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/PushletLogger.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -import nl.justobjects.pushlet.core.ConfigDefs; - -/** - * Logger interface to allow different logging providers. - *

    - * - * @author Ulrich Romahn - * @version $Id: PushletLogger.java,v 1.1 2007/12/07 12:57:40 justb Exp $ - */ -public interface PushletLogger extends ConfigDefs { - - /** - * Method allowing to initialize our logger - */ - public void init(); - - /** - * Log message for trace level. - * - * @param aMessage the message to be logged - */ - public void trace(String aMessage); - - /** - * Log message for debug level. - * - * @param aMessage the message to be logged - */ - public void debug(String aMessage); - - /** - * Log message for info level. - * - * @param aMessage the message to be logged - */ - public void info(String aMessage); - - /** - * Log message for warning level. - * - * @param aMessage the message to be logged - */ - public void warn(String aMessage); - - /** - * Log message for warning level with exception. - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void warn(String aMessage, Throwable aThrowable); - - /** - * Log message for error level. - * - * @param aMessage the message to be logged - */ - public void error(String aMessage); - - /** - * Log message (error level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void error(String aMessage, Throwable aThrowable); - - /** - * Log message for fatal level. - * - * @param aMessage the message to be logged - */ - public void fatal(String aMessage); - - /** - * Log message (fatal level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void fatal(String aMessage, Throwable aThrowable); - - /** - * Set log level - * - * @param aLevel a valid Level from ConfigDefs - */ - public void setLevel(int aLevel); -} diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Rand.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Rand.java deleted file mode 100755 index 041970941f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Rand.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. -package nl.justobjects.pushlet.util; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.PrintWriter; -import java.util.Random; - -/** - * Randomizing routines. - * - * @author Just van den Broecke - * @version $Id: Rand.java,v 1.4 2007/12/07 12:57:40 justb Exp $ - */ -public class Rand { - private static char CHARS[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'v', 'w', 'y', 'z'}; - private static char NON_VOWELS[] = {'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'z'}; - private static char VOWELS[] = {'a', 'e', 'i', 'o', 'u', 'y'}; - private static Random random = new Random(); - - public static char randomChar() { - return CHARS[randomInt(0, CHARS.length - 1)]; - } - - public static char randomVowel() { - return VOWELS[randomInt(0, VOWELS.length - 1)]; - } - - public static char randomNonVowel() { - return NON_VOWELS[randomInt(0, NON_VOWELS.length - 1)]; - } - - public static File randomTempDir() throws Exception { - File file = new File(System.getProperty("java.io.tmpdir") + File.separator + "oasetest" + File.separator + randomString(12)); - file.mkdirs(); - file.deleteOnExit(); - return file; - } - - public static File randomTempFile() throws Exception { - File file = new File(System.getProperty("java.io.tmpdir") + File.separator + "oase-" + randomString(6)); - file.createNewFile(); - file.deleteOnExit(); - return file; - } - - public static File randomBinaryFile(int aSize) throws Exception { - File file = randomTempFile(); - FileOutputStream fos = new FileOutputStream(file); - fos.write(randomBytes(aSize)); - fos.close(); - return file; - } - - public static File randomTextFile(int aSize) throws Exception { - File file = randomTempFile(); - PrintWriter pw = new PrintWriter(new FileOutputStream(file)); - pw.write(randomString(aSize)); - pw.close(); - return file; - } - - public static byte[] randomBytes(int aSize) { - return randomBlob(aSize); - } - - public static byte[] randomBlob(int aSize) { - byte[] retval = new byte[aSize]; - for (int i = 0; i < retval.length; i++) { - retval[i] = randomByte(); - } - return retval; - } - - public static byte randomByte() { - return (byte) random.nextInt(); - } - - public static double randomDouble() { - return random.nextLong(); - } - - - public static int randomInt() { - return random.nextInt(); - } - - public static int randomInt(int min, int max) { - return (int) ((Math.random() * (double) (max + 1 - min)) + min); - } - - public static long randomLong() { - return random.nextLong(); - } - - public static long randomLong(long min, long max) { - return (long) ((Math.random() * (double) (max + 1L - min)) + min); - } - - public static String randomName(int aLength) { - StringBuffer sb = new StringBuffer(aLength); - for (int i = 0; i < aLength; i++) { - sb.append(i % 2 == 0 ? randomNonVowel() : randomVowel()); - } - return sb.toString(); - } - - public static void randomSleep(long min, long max) { - try { - Thread.sleep(randomLong(min, max)); - } catch (InterruptedException ie) { - - } - } - - public static String randomString(int aLength) { - StringBuffer sb = new StringBuffer(aLength); - for (int i = 0; i < aLength; i++) { - sb.append(randomChar()); - } - return sb.toString(); - } - - public static String randomString() { - return "" + randomLong(); - } - - -} - -/* - * $Log: Rand.java,v $ - * Revision 1.4 2007/12/07 12:57:40 justb - * added log4j and make it the default logging method - * - * Revision 1.3 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.2 2004/09/03 22:35:38 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.1 2004/03/10 12:21:27 justb - * *** empty log message *** - * - * - */ \ No newline at end of file diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Servlets.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Servlets.java deleted file mode 100755 index 3b0f20c89f..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Servlets.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - - -/** - * Servlet utilities. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Servlets.java,v 1.2 2007/11/23 21:10:17 justb Exp $ - */ -public class Servlets { - - /** - * Get parameter; if not set or empty return null. - */ - public static String getParameter(HttpServletRequest aRequest, String aName) { - return getParameter(aRequest, aName, null); - } - - /** - * Get parameter; if not set or empty return specified default value. - */ - public static String getParameter(HttpServletRequest aRequest, String aName, String aDefault) { - String value = aRequest.getParameter(aName); - if (value == null || value.length() == 0) { - value = aDefault; - } - return value; - } - - /** - * Set HTTP headers to prevent caching. - */ - public static void setNoCacheHeaders(HttpServletResponse aResponse) { - // Set to expire far in the past. - aResponse.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT"); - - // Set standard HTTP/1.1 no-cache headers. - aResponse.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); - - // Set IE extended HTTP/1.1 no-cache headers (use addHeader). - aResponse.addHeader("Cache-Control", "post-check=0, pre-check=0"); - - // Set standard HTTP/1.0 no-cache header. - aResponse.setHeader("Pragma", "no-cache"); - - } - -} - -/* - * $Log: Servlets.java,v $ - * Revision 1.2 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.1 2004/09/20 22:01:40 justb - * more changes for new protocol - * - * - */ - - diff --git a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Sys.java b/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Sys.java deleted file mode 100755 index 2b72ab55e1..0000000000 --- a/sw/in_progress/pow/ServletPow/eclipse ServletPow/users/genin/pushlet-2.0.4/src/nl/justobjects/pushlet/util/Sys.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - - -import java.io.FileInputStream; -import java.io.IOException; -import java.text.CharacterIterator; -import java.text.StringCharacterIterator; -import java.util.Properties; - -/** - * Utilities that interact with the underlying OS/JVM. - * - * @author Just van den Broecke - * @version $Id: Sys.java,v 1.4 2007/11/10 14:17:18 justb Exp $ - */ -public class Sys { - - /** - * Replace characters having special meaning inside HTML tags - * with their escaped equivalents, using character entities such as '&'. - *

    - *

    The escaped characters are : - *

      - *
    • < - *
    • > - *
    • " - *
    • ' - *
    • \ - *
    • & - *
    - *

    - *

    This method ensures that arbitrary text appearing inside a tag does not "confuse" - * the tag. For example, HREF='Blah.do?Page=1&Sort=ASC' - * does not comply with strict HTML because of the ampersand, and should be changed to - * HREF='Blah.do?Page=1&Sort=ASC'. This is commonly seen in building - * query strings. (In JSTL, the c:url tag performs this task automatically.) - */ - static public String forHTMLTag(String aTagFragment) { - final StringBuffer result = new StringBuffer(); - - final StringCharacterIterator iterator = new StringCharacterIterator(aTagFragment); - char character = iterator.current(); - while (character != CharacterIterator.DONE) { - if (character == '<') { - result.append("<"); - } else if (character == '>') { - result.append(">"); - } else if (character == '\"') { - result.append("""); - } else if (character == '\'') { - result.append("'"); - } else if (character == '\\') { - result.append("\"); - } else if (character == '&') { - result.append("&"); - } else { - //the char is not a special one - //add it to the result as is - result.append(character); - } - character = iterator.next(); - } - return result.toString(); - } - - /** - * Load properties file from classpath. - */ - static public Properties loadPropertiesResource(String aResourcePath) throws IOException { - try { - // Use the class loader that loaded our class. - // This is required where for reasons like security - // multiple class loaders exist, e.g. BEA WebLogic. - // Thanks to Lutz Lennemann 29-aug-2000. - ClassLoader classLoader = Sys.class.getClassLoader(); - - Properties properties = new Properties(); - - // Try loading it. - properties.load(classLoader.getResourceAsStream(aResourcePath)); - return properties; - } catch (Throwable t) { - throw new IOException("failed loading Properties resource from " + aResourcePath); - } - } - - /** - * Load properties file from file path. - */ - static public Properties loadPropertiesFile(String aFilePath) throws IOException { - try { - - Properties properties = new Properties(); - - // Try loading it. - properties.load(new FileInputStream(aFilePath)); - return properties; - } catch (Throwable t) { - throw new IOException("failed loading Properties file from " + aFilePath); - } - } - - /** - * Shorthand for current time. - */ - static public long now() { - return System.currentTimeMillis(); - } - -} diff --git a/sw/in_progress/pow/ServletPow/pow_sql_maker.sql b/sw/in_progress/pow/ServletPow/pow_sql_maker.sql deleted file mode 100755 index 7886a2515a..0000000000 --- a/sw/in_progress/pow/ServletPow/pow_sql_maker.sql +++ /dev/null @@ -1,49 +0,0 @@ - - -SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; - - --- --- Base de données: `pow_sql` --- -CREATE DATABASE pow_sql; --- -------------------------------------------------------- - -GRANT ALL PRIVILEGES ON pow_sql.* TO pow_user@localhost IDENTIFIED BY 'pwdpow_user'; - -use pow_sql; --- --- Structure de la table `connexion` --- - -CREATE TABLE IF NOT EXISTS `connexion` ( - `webId` int(11) NOT NULL AUTO_INCREMENT, - `login` varchar(50) NOT NULL, - `start` date NOT NULL, - `end` date DEFAULT NULL, - PRIMARY KEY (`webId`) -) TYPE=INNODB AUTO_INCREMENT=1 ; - --- --- Contenu de la table `connexion` --- - - --- -------------------------------------------------------- - --- --- Structure de la table `log` --- - -CREATE TABLE IF NOT EXISTS `log` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `msg` varchar(300) DEFAULT NULL, - `webId` int(11) NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`webId`) REFERENCES connexion(webId) ON DELETE CASCADE -) TYPE=INNODB AUTO_INCREMENT=1 ; - --- --- Contenu de la table `log` --- - diff --git a/sw/in_progress/pow/ivy-1.2.13.jar b/sw/in_progress/pow/ivy-1.2.13.jar deleted file mode 100644 index be51c0e1f0..0000000000 Binary files a/sw/in_progress/pow/ivy-1.2.13.jar and /dev/null differ diff --git a/sw/in_progress/pow/jssecacerts b/sw/in_progress/pow/jssecacerts deleted file mode 100644 index d646d45830..0000000000 Binary files a/sw/in_progress/pow/jssecacerts and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/design.css b/sw/in_progress/pow/pow/WebContent/CSS/design.css deleted file mode 100644 index 42197afc7f..0000000000 --- a/sw/in_progress/pow/pow/WebContent/CSS/design.css +++ /dev/null @@ -1,210 +0,0 @@ -body -{ - background-color: #CCFFCC; - margin: 0%; - padding: 0%; - outline: 0%; - height: 100%; - overflow:hidden; - max-width:2048px; - font-size : 11; -} - -select{ - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; - vertical-align: middle; - background-color: #F5F5DC; -} -input { - background-color:#F5F5DC; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 10px; -} - -label { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -#welcome -{ - position:absolute; - top:0; - left:0; - height:3%; - width: 100%; - background-color: #EEEEEE; - text-align: center; - font-weight:bold; - font-size : 12; -} -#usr -{ - position:absolute; - top:0; - right:6%; - height:3%; - width:25%; - background-color: #EEEEEE; - text-align: right; - white-space:nowrap; -} -#page -{ -position:absolute; -top:3%; -left:0; -height:97%; -width: 100%; -} - - -#choicePanel{ - position:absolute; - top:0%; - left:0%; - height: 13%; - width : 15%; - background-color: #EEEEEE; - border: 1px solid black; -} - -#aircraftSelector -{ - text-align: center; - background-color: #EEEEEE; -} - -#trackdiv -{ - text-align: center; - background-color: #EEEEEE; -} - -#active_block -{ - font-size:11; - text-align: center; -} - -#FlightPlan -{ - overflow:auto; - position:absolute; - top:0%; - left:15%; - height: 40%; - width : 14.9%; - background-color: #EEEEEE; - border: 1px solid black; -} - -#FlightParams -{ - position:absolute; - top:13%; - left :0% - text-align: center; - height: 27%; - width : 14.9%; - border: 1px solid black; - background-color: #EEEEEE; -} - -#map_canvas -{ - position:absolute; - top:0; - left:30%; - width:70%; - height: 95%; - border:1px solid black; -} - - -#Settings -{ - overflow:auto; - position:absolute; - left:0%; - top:40%; - text-align: left; - height: 55%; - width: 29.9%; - background-color: #EEEEEE; - border: 1px solid black; -} - -#page_setting { - -} - -#setting { - width: 400px; - height: 250px; - padding: 0.5em; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 8; -} -#param -{ - overflow:auto; -} - -#NewsDiv -{ - position:absolute; - overflow:auto; - left:0%; - top:95%; - height: 5%; - width: 100%; - text-align: left; - vertical-align:top; - background-color: #EEEEEE; - border: 1px solid black; -} - -#info -{ - text-align: left; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -#Debug -{ - overflow:auto; - position:absolute; - left:65%; - top:50%; - text-align: center; - height: 50%; - width: 35%; - background-color: #EEEEEE; - border: 1px solid black; - padding-top:20px; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -#title{ - font-weight:bold; - font-size:18; - text-align:center; -} - -table.param { -border:3px solid #6495ed; -border-collapse:collapse; -width:90%; -margin:auto; -} -td.param { -font-family:sans-serif; -font-size:11px; -border:1px solid #6495ed; -padding:5px; -text-align:left; -} diff --git a/sw/in_progress/pow/pow/WebContent/CSS/design2.css b/sw/in_progress/pow/pow/WebContent/CSS/design2.css deleted file mode 100644 index 893a523f96..0000000000 --- a/sw/in_progress/pow/pow/WebContent/CSS/design2.css +++ /dev/null @@ -1,50 +0,0 @@ -body { - background-color: #EEEEEE; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -select{ - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; - vertical-align: middle; - background-color: #F5F5DC; -} -input { - border:1px solid black; - background-color:#F5F5DC; - font-size: 11px; -} - - -#modifImmat { - position : absolute; - top : 0; -} - - -#modifPwd { - position : absolute; - top : 0; -} - - -#modifRight { - position : absolute; - top : 0; -} - -#modifyUser { - position : absolute; - top : 0; -} - -#createUser { - position : absolute; - top : 0; -} - -#mainForm { - position : absolute; - top : 0; -} diff --git a/sw/in_progress/pow/pow/WebContent/CSS/designHelp.css b/sw/in_progress/pow/pow/WebContent/CSS/designHelp.css deleted file mode 100644 index e8fcfd7a3d..0000000000 --- a/sw/in_progress/pow/pow/WebContent/CSS/designHelp.css +++ /dev/null @@ -1,21 +0,0 @@ -body -{ - width: 90%; - margin-top: 5px; - margin-bottom: 5px; - margin-left:5%; - margin-reight:5%; - background-color: #CCFFCC; - text-align:justify; -} - -h3,h2 -{ - color : navy; - text-align:center; - text-decoration:underline; -} -#problem -{ - color:red; -} \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/CSS/designLogOut.css b/sw/in_progress/pow/pow/WebContent/CSS/designLogOut.css deleted file mode 100644 index c6ce91f1e9..0000000000 --- a/sw/in_progress/pow/pow/WebContent/CSS/designLogOut.css +++ /dev/null @@ -1,12 +0,0 @@ -body -{ - background-color: #CCFFCC; - margin-top: 2%; - padding: 0%; - outline: 0%; - height: 100%; - overflow:hidden; - max-width:2048px; - text-align:center; - font-size:24px; -} \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/CSS/designWelcome.css b/sw/in_progress/pow/pow/WebContent/CSS/designWelcome.css deleted file mode 100644 index fe096f7074..0000000000 --- a/sw/in_progress/pow/pow/WebContent/CSS/designWelcome.css +++ /dev/null @@ -1,30 +0,0 @@ -body -{ - width: 960px; - margin-top: 100px; - margin-bottom: 5px; - background-image: url("Icons/logo.png"); - background-repeat:no-repeat; - background-color: #CCFFCC; - -} - -#signIn -{ - margin: auto; - width: 300px; - height: 140px; - border: 1px solid black; -} - -#log -{ - margin-left: 30px; -} - -a -{ - position:absolute; - right:1%; - top:80%; -} \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/CSS/design_admin.css b/sw/in_progress/pow/pow/WebContent/CSS/design_admin.css deleted file mode 100644 index 867056a7a6..0000000000 --- a/sw/in_progress/pow/pow/WebContent/CSS/design_admin.css +++ /dev/null @@ -1,99 +0,0 @@ -body { - background-color: #EEEEEE; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -select{ - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; - vertical-align: middle; - background-color: #F5F5DC; -} -input { - border:1px solid black; - background-color:#F5F5DC; - font-size: 11px; -} - -label { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -span { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -td { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -#title { - position : absolute; - top : 0%; - left : 0%; - height : 5%; - width : 100%; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - text-align : right; - font-size : 11px; - background-color: #BC8F8F; - border: 1px solid black; -} - -#page { - position : absolute; - top : 15%; - left : 15%; - width : 70%; - height : 65%; - border: 1px solid black; - background-color: #EEEEEE; -} - - -#modifImmat { - position : absolute; - top : 15%; -} - - -#modifPwd { - position : absolute; - top : 15%; -} - - -#modifRight { - position : absolute; - top : 15%; -} - -#modifyUser { - position : absolute; - top : 15%; -} - -#createUser { - position : absolute; - top : 15%; -} - -#mainForm { - position : absolute; - top : 15%; -} - - -#createIvyUser { - position : absolute; - top : 15%; -} - -#listIvyUser { - position : absolute; - top : 15%; -} diff --git a/sw/in_progress/pow/pow/WebContent/CSS/designbackup.css b/sw/in_progress/pow/pow/WebContent/CSS/designbackup.css deleted file mode 100644 index b00585c71d..0000000000 --- a/sw/in_progress/pow/pow/WebContent/CSS/designbackup.css +++ /dev/null @@ -1,87 +0,0 @@ -body -{ - background-color: #CCFFCC; - margin: 0%; - padding: 0%; - outline: 0%; - height: 95%; -} -#page -{ - width: 100%; - height: 95%; -} - -#logo -{ - width: 960px; - height: 100px; - background-image: url("banniere.jpg"); - background-repeat: repeat-x; - margin-bottom: 10px; -} - -#leftmenu -{ - /* float: left; /* Le menu flottera à gauche */ - /* width: 120px; *//* Très important : donner une taille au menu */ -} -#welcome -{ - text-align: center; - background-color: #EEEEEE; - border: 2px solid black; - margin-bottom: 10px; /* Pour éviter que les éléments du menu ne soient trop collés */ -} -#choice -{ -float: left; - text-align: center; - background-color: #EEEEEE; - border: 2px solid black; - height: 190px; - width: 20px; -} -#map_canvas -{ - width: 690px; - height: 350px; - margin-left: 125px; -} - -#FlightPlan -{ - float: right; - width: 135px; /* Très important : donner une taille au menu */ - height: 345px; - border: 2px solid black; - background-color: #EEEEEE; -} - - - -#ControlPanel -{ - float: left; - text-align: center; - height: 150px; - width: 600px; - border: 2px solid black; - background-color: #EEEEEE; -} -#FlightParams -{ - text-align: center; - float: right; - height: 150px; - width: 350px; - border: 2px solid black; - background-color: #EEEEEE; -} -table -{ - margin-left: 20px; - margin-bottom: 20px; -} - - \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/CSS/dtree.css b/sw/in_progress/pow/pow/WebContent/CSS/dtree.css deleted file mode 100644 index b201c2fd60..0000000000 --- a/sw/in_progress/pow/pow/WebContent/CSS/dtree.css +++ /dev/null @@ -1,34 +0,0 @@ -/*--------------------------------------------------| -| dTree 2.05 | www.destroydrop.com/javascript/tree/ | -|---------------------------------------------------| -| Copyright (c) 2002-2003 Geir Landrö | -|--------------------------------------------------*/ - -.dtree { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; - color: #666; - white-space: nowrap; -} -.dtree img { - border: 0px; - vertical-align: middle; -} -.dtree a { - color: #333; - text-decoration: none; -} -.dtree a.node, .dtree a.nodeSel { - white-space: nowrap; - padding: 1px 2px 1px 2px; -} -.dtree a.node:hover, .dtree a.nodeSel:hover { - color: #333; - text-decoration: underline; -} -.dtree a.nodeSel { - background-color: #c0d2ec; -} -.dtree .clip { - overflow: hidden; -} \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/CSS/tab.css b/sw/in_progress/pow/pow/WebContent/CSS/tab.css deleted file mode 100644 index 2e9043ed76..0000000000 --- a/sw/in_progress/pow/pow/WebContent/CSS/tab.css +++ /dev/null @@ -1,110 +0,0 @@ -/* $Id: example.css,v 1.5 2006/03/27 02:44:36 pat Exp $ */ - -/*-------------------------------------------------- - REQUIRED to hide the non-active tab content. - But do not hide them in the print stylesheet! - --------------------------------------------------*/ -.tabberlive .tabbertabhide { - display:none; -} - -/*-------------------------------------------------- - .tabber = before the tabber interface is set up - .tabberlive = after the tabber interface is set up - --------------------------------------------------*/ -.tabber { -} -.tabberlive { - margin-top:1em; -} - -/*-------------------------------------------------- - ul.tabbernav = the tab navigation list - li.tabberactive = the active tab - --------------------------------------------------*/ -ul.tabbernav -{ - margin:0; - padding: 3px 0; - border-bottom: 1px solid #778; - font: bold 12px Verdana, sans-serif; -} - -ul.tabbernav li -{ - list-style: none; - margin: 0; - display: inline; -} - -ul.tabbernav li a -{ - padding: 3px 0.5em; - margin-left: 3px; - border: 1px solid #778; - border-bottom: none; - background: #DDE; - text-decoration: none; -} - -ul.tabbernav li a:link { color: #448; } -ul.tabbernav li a:visited { color: #667; } - -ul.tabbernav li a:hover -{ - color: #000; - background: #AAE; - border-color: #227; -} - -ul.tabbernav li.tabberactive a -{ - background-color: #fff; - border-bottom: 1px solid #fff; -} - -ul.tabbernav li.tabberactive a:hover -{ - color: #000; - background: white; - border-bottom: 1px solid white; -} - -/*-------------------------------------------------- - .tabbertab = the tab content - Add style only after the tabber interface is set up (.tabberlive) - --------------------------------------------------*/ -.tabberlive .tabbertab { - padding:5px; - border:1px solid #aaa; - border-top:0; - - /* If you don't want the tab size changing whenever a tab is changed - you can set a fixed height */ - - /* height:200px; */ - - /* If you set a fix height set overflow to auto and you will get a - scrollbar when necessary */ - - /* overflow:auto; */ -} - -/* If desired, hide the heading since a heading is provided by the tab */ -.tabberlive .tabbertab h2 { - display:none; -} -.tabberlive .tabbertab h3 { - display:none; -} - -/* Example of using an ID to set different styles for the tabs on the page */ -.tabberlive#tab1 { -} -.tabberlive#tab2 { -} -.tabberlive#tab2 .tabbertab { - height:200px; - overflow:auto; -} - diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-anim_basic_16x16.gif b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-anim_basic_16x16.gif deleted file mode 100644 index 085ccaecaf..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-anim_basic_16x16.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png deleted file mode 100644 index 954e22dbd9..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png deleted file mode 100644 index 64ece5707d..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_flat_10_000000_40x100.png deleted file mode 100644 index abdc01082b..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_flat_10_000000_40x100.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png deleted file mode 100644 index 9b383f4d2e..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png deleted file mode 100644 index a23baad25b..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png deleted file mode 100644 index 42ccba269b..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png deleted file mode 100644 index 39d5824d6a..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png deleted file mode 100644 index f1273672d2..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png deleted file mode 100644 index 359397acff..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_222222_256x240.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_222222_256x240.png deleted file mode 100644 index b273ff111d..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_222222_256x240.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_228ef1_256x240.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_228ef1_256x240.png deleted file mode 100644 index c357355aa7..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_228ef1_256x240.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_ef8c08_256x240.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_ef8c08_256x240.png deleted file mode 100644 index 85e63e9f60..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_ef8c08_256x240.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_ffd27a_256x240.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_ffd27a_256x240.png deleted file mode 100644 index e117effa3d..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_ffd27a_256x240.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_ffffff_256x240.png b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_ffffff_256x240.png deleted file mode 100644 index 42f8f992c7..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/images/ui-icons_ffffff_256x240.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/jquery-ui-1.8.2.custom.css b/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/jquery-ui-1.8.2.custom.css deleted file mode 100644 index 312dd8043e..0000000000 --- a/sw/in_progress/pow/pow/WebContent/CSS/ui-lightness/jquery-ui-1.8.2.custom.css +++ /dev/null @@ -1,489 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } -.ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } -.ui-widget-content a { color: #333333; } -.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -.ui-widget-header a { color: #ffffff; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; } -.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; } -.ui-widget :active { outline: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } -.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } - -/* Overlays */ -.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } -.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Selectable -----------------------------------*/ -.ui-selectable-helper { border:1px dotted black } -/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } -/* IE7-/Win - Fix extra vertical space in lists */ -.ui-accordion a { zoom: 1; } -.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } -.ui-accordion .ui-accordion-content-active { display: block; }/* Autocomplete -----------------------------------*/ -.ui-autocomplete { position: absolute; cursor: default; } -.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; } - -/* workarounds */ -* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ - -/* Menu -----------------------------------*/ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; -} -/* Button -----------------------------------*/ - -.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ -.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ -button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ -.ui-button-icons-only { width: 3.4em; } -button.ui-button-icons-only { width: 3.7em; } - -/*button text element */ -.ui-button .ui-button-text { display: block; line-height: 1.4; } -.ui-button-text-only .ui-button-text { padding: .4em 1em; } -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } -.ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } -.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } -/* no icon support for input elements, provide padding by default */ -input.ui-button { padding: .4em 1em; } - -/*button icon element(s) */ -.ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } -.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } -.ui-button-text-icon .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } -.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } - -/*button sets*/ -.ui-buttonset { margin-right: 7px; } -.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } - -/* workarounds */ -button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ - - - - - -/* Dialog -----------------------------------*/ -.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 0.8em; height: 0.8em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs -----------------------------------*/ -.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ -.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } -.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } -/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/Icons/E.png b/sw/in_progress/pow/pow/WebContent/Icons/E.png deleted file mode 100644 index c54150820a..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/E.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/N (copie).png b/sw/in_progress/pow/pow/WebContent/Icons/N (copie).png deleted file mode 100644 index b7a747cd39..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/N (copie).png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/N.png b/sw/in_progress/pow/pow/WebContent/Icons/N.png deleted file mode 100644 index b7a747cd39..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/N.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/NE.png b/sw/in_progress/pow/pow/WebContent/Icons/NE.png deleted file mode 100644 index 14d39ae0f0..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/NE.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/NW.png b/sw/in_progress/pow/pow/WebContent/Icons/NW.png deleted file mode 100644 index e57382d0d4..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/NW.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/S.png b/sw/in_progress/pow/pow/WebContent/Icons/S.png deleted file mode 100644 index edeabb494d..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/S.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/SE.png b/sw/in_progress/pow/pow/WebContent/Icons/SE.png deleted file mode 100644 index e2e35ba552..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/SE.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/SW.png b/sw/in_progress/pow/pow/WebContent/Icons/SW.png deleted file mode 100644 index 71f3be47ae..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/SW.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/W.png b/sw/in_progress/pow/pow/WebContent/Icons/W.png deleted file mode 100644 index baa74b59ad..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/W.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/arrow.png b/sw/in_progress/pow/pow/WebContent/Icons/arrow.png deleted file mode 100644 index 3a004f60b5..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/arrow.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/arrow2.png b/sw/in_progress/pow/pow/WebContent/Icons/arrow2.png deleted file mode 100644 index d2cae73712..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/arrow2.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/blue-dot.png b/sw/in_progress/pow/pow/WebContent/Icons/blue-dot.png deleted file mode 100644 index 98b280d301..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/blue-dot.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/favicon.ico b/sw/in_progress/pow/pow/WebContent/Icons/favicon.ico deleted file mode 100644 index 7cd42a2755..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/favicon.ico and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/logo.png b/sw/in_progress/pow/pow/WebContent/Icons/logo.png deleted file mode 100644 index 032f6d16e7..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/logo.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/losange.gif b/sw/in_progress/pow/pow/WebContent/Icons/losange.gif deleted file mode 100644 index dfadf2d823..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/losange.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/losange.png b/sw/in_progress/pow/pow/WebContent/Icons/losange.png deleted file mode 100644 index 0786209c39..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/losange.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Icons/red-dot.png b/sw/in_progress/pow/pow/WebContent/Icons/red-dot.png deleted file mode 100644 index b0f3f0e928..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/Icons/red-dot.png and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/Interface.jsp b/sw/in_progress/pow/pow/WebContent/Interface.jsp deleted file mode 100644 index 25e31cdd09..0000000000 --- a/sw/in_progress/pow/pow/WebContent/Interface.jsp +++ /dev/null @@ -1,2015 +0,0 @@ -<%@page import="pow.ConfJSP,java.util.StringTokenizer,java.util.NoSuchElementException" %> - -<% - if (session.getAttribute("login")==null) { - out.println(""); - } -%> - - - - - - - - POW - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "); - } - else { - String login = ((String) (session.getAttribute("login"))).toString(); - String right = ((String) (session.getAttribute("rights"))).toString(); - if (right.equals("visitor")) - { out.println("var usr_right=\"visitor\";"); - out.println("var usr_login=\"nologged\";"); - } - else if (right.equals("admin")) - { - out.println("var usr_right=\"admin\";"); - out.println("var usr_login=\""+login+"\";"); - } - else if (right.equals("user")){ // gestion de la liste des drones controlables - out.println("var usr_right=\"user\";"); - out.println("var usr_login=\""+login+"\";"); - out.println("var drone_ctl=new Array();"); - String droneCtl = ((String) (session.getAttribute("dronectl"))).toString(); - StringTokenizer st = new StringTokenizer(droneCtl,";"); - String d; - for(int i = 0 ; i< st.countTokens() ;i++){ - d=st.nextToken(); - out.println("drone_ctl[\""+ d +"\"]=1;"); - } - try{ - while (st.hasMoreTokens()) { - d=st.nextToken(); - } - } - catch (NoSuchElementException ex){} - - } - } - %> - var noPlaneBefore=true; // pour initialiser au premier push flight param - var ajax_url = "ajaxRqst.srv"; -/* ********** drone state timeout ******** */ - var droneStateDieEvent = new Array(); // timeout en cas d'event die - var droneStateDataEvent = new Array(); // timeout en cas de non evenement data - var dieEventTimeoutTime = 10000; //10sec after plane_die event remove drone - var dataEventTimeoutTime = 5000; //5sec without any position data about a drone remove drone - var waypoint_modif = new Array(); // - var block_jump_timeout=-1; - var setting_change_timeout=-1; - var order_response_timeout = 30000; // 30 secondes - var setting_to_change_id=-1; -/* *************************************************************************** Global variables *************************************************************************************** */ - var map; - - var planes = new Array(); - var nb_planes =0; - var markers = new Array(); - var markers_color = new Array(); // stock les balises de couleurs de chaque drone - var diametre_drone_balise = 50; //50m de base - var selected_plane = ""; - var selected_plane_id = 0; - var selected_index=0; - var tracking = false; - -/* *******************Flight Plan variables :******************** */ - var waypoints = new Array(); - var waypoint_tmp = null; - var index_wpt = 0; - var blocks= new Array(); - var index_block = 0; - var active_block_id=0; - var active_block_name=""; - var fpl_name=""; - var lat0=0; - var lon0=0; - var fpl_alt=0; - var security_height=0; - var fpl_ground_alt=0; - var max_dist=0; - - -/* ********************Planes and waypoints icons******************** */ - var plane_icons = new Array(); - for (var i=0;i<8;i++){ - plane_icons[i] = new GIcon(); - plane_icons[i].shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; - plane_icons[i].iconSize = new GSize(60,60); - plane_icons[i].shadowSize = new GSize(22, 20); - plane_icons[i].infoWindowAnchor = new GPoint(50, 1); - plane_icons[i].iconAnchor = new GPoint(30, 30); - } - plane_icons[0].image="Icons/N.png"; - plane_icons[1].image="Icons/NE.png"; - plane_icons[2].image="Icons/E.png"; - plane_icons[3].image="Icons/SE.png"; - plane_icons[4].image="Icons/S.png"; - plane_icons[5].image="Icons/SW.png"; - plane_icons[6].image="Icons/W.png"; - plane_icons[7].image="Icons/NW.png"; - - var wpt_icon=new GIcon(); - wpt_icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; - wpt_icon.iconSize = new GSize(20,20); - wpt_icon.shadowSize = new GSize(22, 20); - wpt_icon.infoWindowAnchor = new GPoint(8, 1); - wpt_icon.iconAnchor = new GPoint(6, 20); - //wpt_icon.image="Icons/losange.png"; - wpt_icon.image="Icons/blue-dot.png"; - - var iconMarkerTemp=new GIcon(); - iconMarkerTemp.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; - iconMarkerTemp.iconSize = new GSize(20,20); - iconMarkerTemp.shadowSize = new GSize(22, 20); - iconMarkerTemp.infoWindowAnchor = new GPoint(8, 1); - iconMarkerTemp.iconAnchor = new GPoint(6, 20); - iconMarkerTemp.image="Icons/red-dot.png"; -/* *************************************************************************** Functions **************************************************************************************************** */ - -/* ************ prevent user from going back to this page by browser's forward button****************************** */ - -function backButtonOverride() -{ - // Work around a Safari bug - // that sometimes produces a blank page - setTimeout("backButtonOverrideBody()", 1); - -} - -function backButtonOverrideBody() -{ - // Works if we backed up to get here - try { - history.forward(); - } catch (e) { - // OK to ignore - } - // Every quarter-second, try again. The only - // guaranteed method for Opera, Firefox, - // and Safari, which don't always call - // onLoad but *do* resume any timers when - // returning to a page - setTimeout("backButtonOverrideBody()", 500); -} -/* ******************* Useful functions ******************** */ -// Gets an element of the html document by its class name - function getElementsByClass(tag, className){ - var elements = document.getElementsByTagName(tag); - var results = new Array(); - for(var i=0; i< elements.length; i++){ - if(elements[i].className == className){ - results[results.length] = elements[i]; - } - } - return results; - } - - - function pause(time){ - d=new Date(); - diff=0; - while(diff < time){ - n=new Date(); - diff=n-d; - } - } - - - //Creates a GoogleMaps marker - - - - - function createMarker(point, legend, icon){ - var marker = new GMarker(point, icon); - GEvent.addListener(marker, 'click', function() { - marker.openInfoWindowHtml(legend); - }); - return marker; - } - - var old_lat; - var old_lon; - //Creates a draggable marker with an EventListener - function createDraggableMarker(point,namewpt,wpt_icon,index_wpt, bool){ - var fpl_file_name="upload/"+planes[selected_index]["id"]+"/flight_plan.xml"; - var marker = new GMarker(point,{legend: namewpt,icon: wpt_icon,draggable: bool,bouncy:true}); - //var marker = new GMarker(point,{title: name,draggable: bool}); - //var marker = new GMarker(point,{draggable: bool}); - GEvent.addListener(marker, 'click', function() { - marker.openInfoWindowHtml(namewpt); - }); - if (bool){ - GEvent.addListener(marker, 'dragend', function(latlng) { - if (latlng){ - //alert("id wpt="+index_wpt+" name=" +namewpt+" lat="+latlng.lat()+" lon="+latlng.lng()); - var lat = latlng.lat(); - var lon = latlng.lng(); - moveWpt(selected_plane_id,namewpt,lat,lon,false,true,index_wpt); - } - }); - - GEvent.addListener(marker, 'dragstart', function(latlng) { - if (latlng){ - old_lat=latlng.lat(); - old_lon=latlng.lng(); - } - }); - } - - return marker; - } - - - - - -//Converts ditances from (lat0,lon0) given in meters into latitudes or longitudes, and vice versa - function xMetersToDegrees(x,lat0){ - return (x/1852/60+parseFloat(lat0)); - } - function yMetersToDegrees(y,lat,lon0){ - return (y/1852/60*Math.cos(lat)+parseFloat(lon0)); - } - - function xDegreesToMeters(lat,lat0){ - return((lat-lat0)*1852*60); - } - function yDegreesToMeters(lat,lon,lon0){ - return(lat!=0?(lon-lon0)/Math.cos(lat)*1852*60:0); - } - - - function name_from_id(id){ - var match=false; - for (var i=0;i< planes.length;i++){ - if(planes[i]["id"]==id){match=true;break;} - } - if (match){ - return (planes[i]["name"]); - }else{ - return (null); - } - } - /* *************** JQUERY stuffs ***************************** */ - $(function(){ - //init(); - //$("#Settings").draggable();$("#Settings").resizable(); - //$("#map_canvas").draggable();$("#map_canvas").resizable(); - //$("#Debug").draggable();$("#Debug").resizable(); - //$("#choicePanel").draggable();$("#choicePanel").resizable(); - //$("#FlightPlan").draggable();$("#FlightPlan").resizable(); - //$("#FlightParams").draggable();$("#FlightParams").resizable(); - }); -/* ********************* Fonctions de Push ******************** */ - - function initialize_push() { - // alert('go'); - p_join_listen(null, 'stream'); - // TODO il faudra gerer le cas ou cela bloque !!!! et passer en pull - // p_join_listen(null, 'pull'); - p_subscribe('/data/drone/iskill', 'msg from serveur'); - p_subscribe('/data/drones_maj', 'msg from serveur'); - p_subscribe('/data/order/waypoint_moved', 'msg from serveur'); - p_subscribe('/data/order/change_setting', 'msg from serveur'); - p_subscribe('/data/order/plane_die', 'msg from serveur'); - p_subscribe('/data/order/plane_resurect', 'msg from serveur'); - p_subscribe('/data/order/new_plane', 'msg from serveur'); - p_subscribe('/data/order/block_changed', 'msg from serveur'); - p_subscribe('/data/order/other', 'msg from serveur'); - p_subscribe('/data/order/settings', 'msg from serveur'); - - p_subscribe('/chat','msg from web client'); - p_subscribe('/client_action','action from web client'); - } - - function initialize_push_pullmode() { - - p_join_listen(null, 'pull'); - p_subscribe('/data/drone/iskill', 'msg from serveur'); - p_subscribe('/data/drones_maj', 'msg from serveur'); - p_subscribe('/data/order/waypoint_moved', 'msg from serveur'); - p_subscribe('/data/order/change_setting', 'msg from serveur'); - p_subscribe('/data/order/plane_die', 'msg from serveur'); - p_subscribe('/data/order/plane_resurect', 'msg from serveur'); - p_subscribe('/data/order/new_plane', 'msg from serveur'); - p_subscribe('/data/order/block_changed', 'msg from serveur'); - p_subscribe('/data/order/other', 'msg from serveur'); - p_subscribe('/data/order/settings', 'msg from serveur'); - - p_subscribe('/chat','msg from web client'); - p_subscribe('/client_action','action from web client'); - } - - function displayControl(aString) { - document.debugEventDisplay.event.value = aString; - } - // callback on data Events - // call apropirate function according to the received event - - function onData(event) { - var subject = event.get('p_subject'); - - // displayControl(""+ event.toString()); - - if (subject=="/data/drones_maj") { handleDronePositionUpsate(event);} - else if (subject =="/data/order/waypoint_moved") {orderprocessing_waypoint(event);} - else if (subject =="/data/order/block_changed") {orderprocessing_jump2block(event);} - else if (subject =="/data/order/change_setting") {orderprocessing_setting(event);} - else if (subject =="/data/order/plane_die") {orderprocessing_planedie(event);} - else if (subject =="/data/order/plane_resurect"){orderprocessing_planeressurect(event);} - else if (subject =="/data/order/new_plane") {orderprocessing_newplane(event);} - else if (subject =="/data/drone/iskill") {orderprocessing_planekilled(event);} - else if (subject =="/data/order/settings") {orderprocessing_csv_settings(event);} - else if (subject =="/chat") {orderprocessing_chat(event);} - else if (subject =="/client_action") {orderprocessing_client_action(event);} - } - - // callback on all other kind of Events - - <%--function onEvent(event) { - var subject = event.get('p_subject'); - displayControl("EVENT CALLBACK "+subject+"\n" + event.toString()); - - - } - --%> -/* ********************* initilization de l'interface ******************* */ - function initialize_display(){ - var aircraftList = document.getElementById("aircraftForm").aircraftList; - if (nb_planes ==0)//If there is no active aircraft, the list only has one option : No aircraft - {aircraftList.options[0]=new Option("No aircraft");} -} - -/* *********************functions to check airplanes ******************* */ - -/* *********************Processing events ******************* */ - // recherche si l'id de l'avion est deja present dans le tableau des drones deja - function handleDronePositionUpsate(event){ - if (planes.length==0) {noPlaneBefore=true;} - var id = parseInt(event.get('aircraftId')); - var match=false; - var insert=false; - var aircraftList = document.getElementById("aircraftForm").aircraftList; - nb_planes=planes.length; - for (var i=0;i< nb_planes;i++){ - if(planes[i]["id"]> id){insert=true;break;} // on garde le tableau trié - if (planes[i]["id"]==id){match=true;break;} // on recupere en i le drone correspondant à id - } - if(!match){ - var k=0; - if(insert){ // on insert au milieu - k=i; - planes.splice(i,0,new Array()); - markers.splice(i,0,null); - markers_color.splice(i,0,null); - // on insere l'aircraft dan sla liste deroulante - //see http://www.mredkj.com/tutorials/tutorial005.html - var elOptNew = document.createElement('option'); - elOptNew.text = event.get('dbName') - var elOptOld = aircraftList.options[i]; - try { - aircraftList.add(elOptNew, elOptOld); // standards compliant; doesn't work in IE - } - catch(ex) { - aircraftList.add(elOptNew, i); // IE only - } - }else{ // on met à la fin du tableau - k=planes.length; - planes[k] = new Array(); - markers[k]= null; // inutile - markers_color[k]=null; - aircraftList.options[k]=new Option(event.get('dbName')); - } - droneStateDieEvent[k] = -1; // init un timeout vide - - //alert('new plane !!!!'); - // on ajoute l'aircraft à la liste des drones selectionnables - - //aircraftList.options[k]=new Option(event.get('dbName')); - // - planes[k]["id"]=id; - planes[k]["name"] =event.get('dbName'); - planes[k]["lat"] = event.get('dbLatitude'); - planes[k]["lon"] = event.get('dbLongitude'); - planes[k]["heading"]= event.get('dbCourse'); - // maj des param pour selected acrf - planes[k]["speed"]= event.get('dbSpeed'); - planes[k]["altitude"]= event.get('dbAmsl'); - planes[k]["vspeed"]= event.get('dbVert_speed'); - planes[k]["height"]= event.get('dbAgl'); - planes[k]["battery"]= event.get('dbStat_battery'); - planes[k]["GPS"]= event.get('dbStat_gps'); - planes[k]["activeBlock"]= event.get('dbActive_block'); - planes[k]["engine"]= event.get('dbEngine_status'); - planes[k]["setting_id"]= event.get('dbId_Setting'); - planes[k]["setting_value"]= event.get('dbSetting_Value'); - planes[k]["drone_color"]= event.get('drone_color'); - // gere si le drone peut etre controlé ou non - if ((usr_right=="admin")||((usr_right=="user")&&(drone_ctl[event.get('dbName')]!=null))){ - planes[k]["rights"]= 1; - } - else - {planes[k]["rights"]=0;} - - var icon; - if (planes[k]["heading"]>=338 || planes[i]["heading"]< 23){ - icon = plane_icons[0]; - }else if (planes[k]["heading"]>=23 && planes[i]["heading"]<68){ - icon = plane_icons[1]; - }else if (planes[k]["heading"]>=68 && planes[i]["heading"]<113){ - icon = plane_icons[2]; - }else if (planes[k]["heading"]>=113 && planes[i]["heading"]<158){ - icon = plane_icons[3]; - }else if (planes[k]["heading"]>=158 && planes[i]["heading"]<203){ - icon = plane_icons[4]; - }else if (planes[k]["heading"]>=203 && planes[i]["heading"]<248){ - icon = plane_icons[5]; - }else if (planes[k]["heading"]>=248 && planes[i]["heading"]<293){ - icon = plane_icons[6]; - }else if (planes[k]["heading"]>=293 && planes[i]["heading"]<337){ - icon = plane_icons[7]; - } - //A marker is created and added on the map - var pos = new GLatLng(planes[k]["lat"],planes[k]["lon"]); - markers[k]=createMarker(pos,planes[k]["name"],icon); - markers_color[k] = GPolygon.Circle(pos,diametre_drone_balise,"#000000",1,1,planes[i]["drone_color"],0.5) - map.addOverlay(markers[k]); - map.addOverlay(markers_color[k]); - droneStateDataEvent[k] = setTimeout("nodataEventCallBack("+id+")",dataEventTimeoutTime); - } - else // l event envoyé correspond à un drone deja dans le tableau - { - if (droneStateDataEvent[i]!=-1) {clearTimeout(droneStateDataEvent[i]);} - var heading_changed; - //Update of the planes array - planes[i]["lat"] = event.get('dbLatitude'); - planes[i]["lon"] = event.get('dbLongitude'); - // maj des param pour selected acrf - planes[i]["speed"]= event.get('dbSpeed'); - planes[i]["altitude"]= event.get('dbAmsl'); - planes[i]["vspeed"]= event.get('dbVert_speed'); - planes[i]["height"]= event.get('dbAgl'); - planes[i]["battery"]= event.get('dbStat_battery'); - planes[i]["GPS"]= event.get('dbStat_gps'); - planes[i]["activeBlock"]= event.get('dbActive_block'); - planes[i]["engine"]= event.get('dbEngine_status'); - planes[i]["setting_id"]= event.get('dbId_Setting'); - planes[i]["setting_value"]= event.get('dbSetting_Value'); - planes[i]["drone_color"]= event.get('drone_color'); - // - var new_heading = event.get('dbCourse'); - var old_heading = planes[i]["heading"]; - //Update of the icons if the heading has changed - if (Math.abs(new_heading-old_heading)>2){ - var image; - if (new_heading>=338 || new_heading< 23){ - image = plane_icons[0].image; - }else if (new_heading>=23 && new_heading<68){ - image = plane_icons[1].image; - }else if (new_heading>=68 && new_heading<113){ - image = plane_icons[2].image; - }else if (new_heading>=113 && new_heading<158){ - image = plane_icons[3].image; - }else if (new_heading>=158 && new_heading<203){ - image = plane_icons[4].image; - }else if (new_heading>=203 && new_heading<248){ - image = plane_icons[5].image; - }else if (new_heading>=248 && new_heading<293){ - image = plane_icons[6].image; - }else if (new_heading>=293 && new_heading<337){ - image = plane_icons[7].image; - } - markers[i].setImage(image); - } - planes[i]["heading"] = new_heading; - //Setting the marker to its new position - var new_pos = new GLatLng(planes[i]["lat"],planes[i]["lon"]); - markers[i].setLatLng(new_pos); - //see http://econym.org.uk/gmap/eshapes.htm - map.removeOverlay(markers_color[i]); - markers_color[i] = GPolygon.Circle(new_pos,diametre_drone_balise,"#000000",1,1,planes[i]["drone_color"],0.5); - map.addOverlay(markers_color[i]); - droneStateDataEvent[i] = setTimeout("nodataEventCallBack("+id+")",dataEventTimeoutTime); - } - nb_planes=planes.length; - - document.getElementById("aircraftList").options.length=planes.length; - if (tracking&&nb_planes!=0){//If tracking is activated, the map is centered on the aircraft - var zoom = map.getZoom(); - var plane_number = aircraftList.selectedIndex; - map.setCenter(new GLatLng(planes[plane_number]["lat"],planes[plane_number]["lon"]),zoom); - } - - if (noPlaneBefore==true){ - noPlaneBefore=false;// !!! interruption possible - active_block_id=planes[0]["activeBlock"]; - aircraftList.options[0].selected=true; - selected_plane = planes[0]["name"]; - selected_plane_id = planes[0]["id"]; - DOMImplementation("upload/"+planes[0]["id"]+"/flight_plan.xml",fplDisplay); - DOMImplementation("upload/"+planes[0]["id"]+"/settings.xml",settingsDisplay); - } - selected_plane_update(selected_plane_id); - } - - -/* ******************** affichage log ******************* */ - -var coloryellow = true; -function addMsgLog(msg) -{ - var element = document.getElementById("info"); - //var element = document.getElementsByTagName("info"); - var newinfodiv = document.createElement("div"); - var newinfotxt = document.createTextNode(msg); - if (coloryellow) {newinfodiv.style.background = '#FFE4B5';coloryellow=false;} - else {newinfodiv.style.background = '#D2B48C';coloryellow=true;} - newinfodiv.appendChild(newinfotxt); - //element[0].appendChild(newinfodiv); - element.appendChild(newinfodiv); -} -/* ******************** Initialization of the page ******************* */ - -/* Initialization of the page : map, markers, aircraft list... */ - - - function initialize() { - - if (GBrowserIsCompatible()) { - // initialize_planes_data(); - initialize_display(); - initialize_push(); - map = new GMap2(document.getElementById("map_canvas"));//Map creation - // map.setZoom(8); - map.setMapType(G_HYBRID_MAP); - var point= new GLatLng(43.46223, 1.27289); - map.setCenter(point,15);//Center the map on a temporary point - map.setUIToDefault(); - // - GEvent.addListener(map, "zoomend", function(oldlevel,newlevel) { - var d = newlevel-oldlevel; - if (d<0) { - diametre_drone_balise=diametre_drone_balise*(-2*d); - } - else - { - diametre_drone_balise=diametre_drone_balise/(2*d); - } - //addMsgLog("d="+diametre_drone_balise+" oldz="+oldlevel+" newz=" +newlevel); - }); - }else{ - alert("Your browser is not compatible with Google Maps !"); - } - } - - - -/* Updating of the selected aircraft flight parameters */ -// recherche la place de l'avion dans le tableau - function seekIndex(plane_id) - { - var i = 0; - var trouve = false; - var res=-1; - while ((ilat y->lon !'); - x = parseFloat(childXML.getAttribute("x")); - y = parseFloat(childXML.getAttribute("y")); - lat=xMetersToDegrees(x,lat0); - lon=yMetersToDegrees(y,lat,lon0); - } - else - { - lat=parseFloat(childXML.getAttribute("lat")); - lon=parseFloat(childXML.getAttribute("long")); - } - var right=planes[selected_index]["rights"]; - waypoints[index_wpt]["marker"]=null; - - if (right==1){ - waypoints[index_wpt]["marker"]=createDraggableMarker(new GLatLng(lat,lon),nameWpt,wpt_icon,index_wpt, true); - }else { - waypoints[index_wpt]["marker"]=createDraggableMarker(new GLatLng(lat,lon),nameWpt,wpt_icon,index_wpt, false); - } - map.addOverlay(waypoints[index_wpt]["marker"]); - - var alt=false; - if (childXML.getAttribute("alt")!=null){ - alt=childXML.getAttribute("alt"); - waypoints[index_wpt]["alt"]=parseFloat(childXML.getAttribute("alt")); - } - var node_url=""; - if (right==1){ - node_url = "javascript:moveWpt("+selected_index+",'"+nameWpt+"',"+lat+","+lon+","+alt+",false,"+(index_wpt)+")"; - } - ///// - index_wpt++; - var newindex = index++; - fpl_tree.add(newindex,index_pere,nameWpt,node_url); - for(var k =0;k< nbr_attrib;k++){ - var newindex_attrib_name = index++; - var newindex_attrib_value = index++; - fpl_tree.add(newindex_attrib_name,newindex,childXML.attributes[k].nodeName); - fpl_tree.add(newindex_attrib_value,newindex_attrib_name,childXML.attributes[k].nodeValue); - //txt = txt + childXML.attributes[k].nodeName + "=" + childXML.attributes[k].nodeValue +" "; - } - } - } - else if (childXML.nodeName=="block") - { var node_url="";var txt_block_name=""; - if(childXML.attributes!=null){ - var block_name=childXML.getAttribute("name");//.replace(/ /g, '_'); - blocks[index_block]=new Array(); - blocks[index_block]["name"]=block_name; - if (active_block_id==index_block){ - active_block_name=block_name; - txt_block_name = ""+block_name+""; - } - else - { - txt_block_name = block_name; - } - var right=planes[selected_index]["rights"]; - - if (right==1){ - node_url="javascript:activateBlock("+selected_index+",'"+block_name+"',"+index_block+")"; - } - index_block++; - var txt = txt_block_name+ " : "; - var nbr_attrib = childXML.attributes.length; - for(var k =0;k< nbr_attrib;k++){ - if (childXML.attributes[k].nodeName!="name"){ - var newindex_attrib_name = index++; - var newindex_attrib_value = index++; - //d.add(newindex_attrib_name,newindex,childXML.attributes[k].nodeName); - //d.add(newindex_attrib_value,newindex_attrib_name,childXML.attributes[k].nodeValue); - txt = txt + childXML.attributes[k].nodeName + "=" + childXML.attributes[k].nodeValue +" "; - } - } - } - var newindex = index++; - fpl_tree.add(newindex,index_pere,txt,node_url); - } - // recursion - if(childXML.hasChildNodes()) { - var nodes=childXML.childNodes.length; - for(var i=0; i90.0)||(l<-90.0)||isNaN(new_lat)) { - alert('wrong format for a latitude... should be within [-90:+90]'); - return; - } - new_lon=prompt("longitude=",mylon); - if ((new_lon==null)){ - return; - } - l = parseFloat(new_lon); - if ((l>180.0)||(l<-180.0)||isNaN(new_lon)) { - alert('wrong format for a longitude... should be within [-180:+180]'); - return; - } - if (alt){ - new_alt=prompt("altitude=",alt); - if ((new_alt==null)){ - return; - } - l = parseFloat(new_alt); - if ((l<=0.0)||isNaN(new_alt)) { - alert('wrong format for an altitude... should be positive'); - return; - } - } - // - old_lat = waypoints[idwpt]["lat"]; - old_lon = waypoints[idwpt]["lon"]; - }else{ - new_lat=mylat; - new_lon=mylon; - //alert("acid="+ac_webid+" wptid="+idwpt+" lat="+mylat+"lon="+mylon+"alt="+alt); - //new_lat = waypoints[idwpt]["marker"].getLatLng().lat(); - //new_lon = waypoints[idwpt]["marker"].getLatLng().lat(); - } - - - //Ajax request to edit the flight plan xml file - var xhr = getXMLHttpRequest(); - xhr.onreadystatechange = function() { - if (xhr.readyState == 4 && xhr.status == 200) { - // maj de l'affichage fpl - var xmlResponse = xhr.responseXML.documentElement; - var rep = xmlResponse.getElementsByTagName("waypoint_to_move")[0]; - var idwpt_requested = parseInt(rep.getAttribute("idwpt"))-1;// cf waypoint fictif ivy - var acid_requested = parseInt(rep.getAttribute("acid")); - var lat_requested = parseFloat(rep.getAttribute("newlat")); - var lon_requested = parseFloat(rep.getAttribute("newlon")); - var was_dragged = rep.getAttribute("dragged"); - var name_drone = planes[seekIndex(acid_requested)]["name"]; - // on ne met à jour visuellement que si le focus est sur le drone selecté - if (acid_requested==selected_plane_id){ - // mettre le waypoint dans un etat intermediaire - // en attendant l'accuse de reception - var right=planes[selected_index]["rights"]; - var marker_tmp; - if (right==1){ - marker_tmp=createDraggableMarker(new GLatLng(old_lat,old_lon),waypoints[idwpt_requested]["name"],wpt_icon,idwpt_requested, true); - }else { - marker_tmp=createDraggableMarker(new GLatLng(old_lat,old_lon),waypoints[idwpt_requested]["name"],wpt_icon,idwpt_requested, false); - } - var name_wpt = waypoints[idwpt_requested]["name"]; - var timer=setTimeout("callback_waypoint("+acid_requested+","+idwpt_requested+")",order_response_timeout); - waypoint_modif[idwpt_requested] = new createWaypoint(acid_requested,idwpt_requested,name_wpt,marker_tmp,timer); - // on efface le marker courant - // meme si elle a ete deplacé par drag & drop - // on cree un marker non draggable avec une icone temporaire - map.removeOverlay(waypoints[idwpt_requested]["marker"]); - waypoints[idwpt_requested]["marker"] = createMarker(new GLatLng(lat_requested,lon_requested),name_wpt,iconMarkerTemp); - if (waypoints[idwpt_requested]["marker"]!=null) map.addOverlay(waypoints[idwpt_requested]["marker"]); - else alert('echec creation wpt tmp'); - addMsgLog("waypoint "+ name_wpt +" for drone " + name_drone +" will be moved"); - } - else - { - addMsgLog("waypoint "+ idwpt_requested +" for drone " + name_drone +" will be moved"); - } - - } - }; - xhr.open("POST",ajax_url,true); - xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - // on informe les autres clients de ne pas modifier le waypoint en cours (via pushlet) - p_publish('/client_action', 'login',usr_login,'action', 'lock', 'type_obj', 'waypoint', 'id_obj',idwpt,'webiddrone',selected_plane_id); - // on passe en parametre le index_wpt+1 car dans paparazzi il y a un wpt predefini a zero - - if(alt!=false){ - xhr.send("order=fpl_update&wpt_name="+name+"&aircraft_id=" +selected_plane_id+"&wpt_id="+(idwpt+1)+"&new_lat="+new_lat+"&new_lon="+new_lon+"&new_alt="+new_alt+"&dragged="+dragged+"&new_alt_for_fpl=1"); - //alert("wptid="+i+" lat="+new_lat+"lon="+new_lon+"alt="+new_alt); - }else{ - var alti=document.getElementById("altitude");var h=parseFloat(alti.innerHTML); - xhr.send("order=fpl_update&wpt_name="+name+"&aircraft_id=" +selected_plane_id+"&wpt_id="+(idwpt+1)+"&new_lat="+new_lat+"&new_lon="+new_lon+"&new_alt="+parseFloat(alti.innerHTML)+"&dragged="+dragged+"&new_alt_for_fpl=0"); - //alert("wptid="+i+" lat="+new_lat+"lon="+new_lon+"alt="+h); - } -} - - -/* ******** Activate a flight plan block ******** */ - - - - function activateBlock(ac_webid,blockname,block_id){ - // verifie qu'il n'y pas pas un verrou sur le block posé par un autre client - var k=0; - var trouve = false; - while ((!trouve)&&(k= parseFloat(min)) ){ - correct=true; - var xhr = getXMLHttpRequest(); - xhr.onreadystatechange = function() { - if (xhr.readyState == 4 && xhr.status == 200) { - var xmlResponse = xhr.responseXML.documentElement; - var rep = xmlResponse.getElementsByTagName("setting_to_change")[0]; - var idsetting_requested = parseInt(rep.getAttribute("setting_id")); - var acid_requested = parseInt(rep.getAttribute("acid")); - var name_drone = planes[seekIndex(acid_requested)]["name"]; - addMsgLog("request change setting "+ idsetting_requested +" for drone " + name_drone +" has been sent"); - // mise en place d'un timer d'accusé reception - if(acid_requested==planes[selected_index]["id"]){ - setting_change_timeout=setTimeout("callback_setting("+acid_requested+","+idsetting_requested+")",order_response_timeout); - setting_to_change_id = idsetting_requested; - } - } - }; - xhr.open("POST",ajax_url,true); - xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - //Send the parameters to the php page : - xhr.send("order=modif_setting&aircraft_id=" +selected_plane_id+"&setting_id="+idsetting+"&value="+new_value); - - }else{ - new_value=prompt("Wrong value, please enter a value between "+min+" and "+max+" with a step of "+step+" :"); - if (new_value==null){return;} - } - } - } - - function changeSetting2(idsetting,new_value){ - - var xhr = getXMLHttpRequest(); - xhr.onreadystatechange = function() { - if (xhr.readyState == 4 && xhr.status == 200) { - var xmlResponse = xhr.responseXML.documentElement; - var rep = xmlResponse.getElementsByTagName("setting_to_change")[0]; - var idsetting_requested = parseInt(rep.getAttribute("setting_id")); - var acid_requested = parseInt(rep.getAttribute("acid")); - var name_drone = planes[seekIndex(acid_requested)]["name"]; - addMsgLog("request change setting "+ idsetting_requested +" for drone " + name_drone +" has been sent"); - // mise en place d'un timer d'accusé reception - if(acid_requested==planes[selected_index]["id"]){ - setting_change_timeout=setTimeout("callback_setting("+acid_requested+","+idsetting_requested+")",order_response_timeout); - setting_to_change_id = idsetting_requested; - } - } - }; - // on informe les autres clients de ne pas modifier le setting en cours (via pushlet) - p_publish('/client_action', 'login',usr_login,'action', 'lock', 'type_obj', 'setting', 'id_obj',idsetting,'webiddrone',selected_plane_id); - // - xhr.open("POST",ajax_url,true); - xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - //Send the parameters to the servlet : - xhr.send("order=modif_setting&aircraft_id=" +selected_plane_id+"&setting_id="+idsetting+"&value="+new_value); - - } - -/* ************************* handle event orders from server ********************************************* */ - - function orderprocessing_waypoint(event){ - - var acft_id = parseInt(event.get('aircraftId')); - var wpt_id = parseInt(event.get('waypointId'))-1; // cf indentation des waypoint sous ivy - var lat = event.get('latitude'); - var lon = event.get('longitude'); - var alt = event.get('altitude'); - var name=name_from_id(acft_id); - //alert('drone=' +name+' wpt = '+wpt_id); - if ((wpt_id>=0)&&(acft_id==selected_plane_id)) { - //alert('drone=' +name+' wpt = '+wpt_id); - if (waypoint_modif[wpt_id]!=null) - { - addMsgLog('waypoint ' + wpt_id+' for drone '+name+ ' has been moved to '+lat+"//"+lon+' !'); - clearTimeout(waypoint_modif[wpt_id].timer) - waypoint_modif[wpt_id] = null; - DOMImplementation("upload/"+planes[selected_index]["id"]+"/flight_plan.xml",fplDisplay); - // inform other web client that waypoint can be changed - p_publish('/client_action', 'login',usr_login,'action', 'unlock', 'type_obj', 'waypoint', 'id_obj',wpt_id,'webiddrone',acft_id); - } - } - //document.getElementById("info").innerHTML='waypoint' + wpt_id+' for drone '+name+ ' has been moved !'; - //addMsgLog('waypoint' + wpt_id+' for drone '+name+ ' has been moved !'); - //alert('
    waypoint' + wpt_id+' for drone '+name+ ' has been moved !'); - } - - function orderprocessing_jump2block(event) { - var acft_id = event.get('aircraftId'); - var current_block_id = event.get('currentBlockId'); - if (acft_id==selected_plane_id){ - /// maj de l'affichage fpl - var name_block=blocks[current_block_id]["name"]; - var name_drone=name_from_id(acft_id); - clearTimeout(block_jump_timeout); - active_block_id = current_block_id; - active_block_name =name_block; - // inform other web client that block can be changed - p_publish('/client_action', 'login',usr_login,'action', 'unlock', 'type_obj', 'block', 'id_obj',current_block_id,'webiddrone',acft_id); - addMsgLog('drone '+ name_drone + ' has jump to block '+ name_block +' !'); - DOMImplementation("upload/"+planes[selected_index]["id"]+"/flight_plan.xml",fplDisplay); - } - } - - function orderprocessing_setting(event) { - var acft_id = event.get('aircraftId'); - var setting_id = parseInt(event.get('settingId')); - var value = event.get('settingValue'); - if ((acft_id==selected_plane_id)&&(setting_to_change_id==setting_id)){ - clearTimeout(setting_change_timeout); - setting_to_change_id = -1; // reset - var name=name_from_id(acft_id); - //DOMImplementation("upload/"+planes[selected_index]["id"]+"/settings.xml",settingsDisplay); - selected_plane_update(acft_id); - addMsgLog('setting ' + setting_id +' for drone '+ name + ' has been changed to value '+ value +' !'); - // inform other web client that block can be changed - p_publish('/client_action', 'login',usr_login,'action', 'unlock', 'type_obj', 'setting', 'id_obj',setting_id,'webiddrone',acft_id); - } - } - - - function orderprocessing_planedie(event){ - var acft_id = event.get('aircraftId'); - var order_string = event.get('order'); - var name=name_from_id(acft_id); - //document.getElementById('info').innerHTML='drone ' + name+' is not alive !'; - addMsgLog('drone ' + name+' is not alive !'); - var drone_index = seekIndex(acft_id); - if(drone_index!=-1) - { - droneStateDieEvent[drone_index] = setTimeout ( "droneDieCallback("+acft_id+")", dieEventTimeoutTime ); - // on grise l'aircraft sur l'interface - } - } - - function orderprocessing_planeressurect(event){ - var acft_id = event.get('aircraftId'); - var order_string = event.get('order'); - var name=name_from_id(acft_id); - //document.getElementById('info').innerHTML='drone ' +name+' has been resurrected !'; - addMsgLog('drone ' +name+' has been resurrected !'); - var drone_index = seekIndex(acft_id); - if(drone_index!=-1) - { - clearTimeout ( droneStateDieEvent[drone_index] ); - // on remet l'aircraft en couleur - } - } - - function orderprocessing_newplane(event){ - var acft_id = event.get('aircraftId'); - var order_string = event.get('order'); - var name= event.get('aircraftName'); - //document.getElementById('info').innerHTML='drone ' +name+' has been connected !'; - addMsgLog('drone ' +name+' has been connected !'); - } - - - function orderprocessing_planekilled(event){ - var acft_id = event.get('aircraftId'); - var name=name_from_id(acft_id); - addMsgLog("drone " + name + " deconnection caused by death of ivy bus..."); - //document.getElementById('info').innerHTML="drone " + name + " deconnection caused by death of ivy bus..."; - // remove drone...markers.... - removeDroneDisplay(acft_id); - } - - function orderprocessing_csv_settings(event){ - var acft_id = event.get('aircraftId'); - var csv = event.get('csv'); - var index_drone = seekIndex(acft_id); - var name=name_from_id(acft_id); - if (index_drone!=-1) { - planes[index_drone]["csv"]= csv; - //addMsgLog("settings updated for drone " + name); - if(index_drone==selected_index) - { - DOMImplementation("upload/"+planes[selected_index]["id"]+"/settings.xml",settingsDisplay); - } - } - } - - function orderprocessing_chat(event){ - } - - function createLock(id_drone,typ_obj,id_obj,login){ - this.id_drone = id_drone; - this.type_object = typ_obj; - this.id_object = id_obj; - this.request_login = login; - this.lockmsg = function() - {return ("user "+this.request_login+ " has locked "+this.type_object +" " +this.id_object);} - this.unlockmsg = function() - {return ("user "+this.request_login+ " has unlocked "+this.type_object +" " +this.id_object);} - } - - var external_waypoint_lock = new Array(); - var external_block_lock = new Array(); - var external_setting_lock = new Array(); - // set or remove a lock to prevent user to change sthg taht is to be changed by another user - function orderprocessing_client_action(event){ - var rqst_login = event.get('login'); - var rqst_action = event.get('action'); - var rqst_obj_type = event.get('type_obj'); - var rqst_obj_id = event.get('id_obj'); - var rqst_id_drone = event.get('webiddrone'); - if (rqst_action=='lock'){ - var lock_obj = new createLock(rqst_id_drone,rqst_obj_type,rqst_obj_id,rqst_login); - if (rqst_obj_type=='waypoint') {external_waypoint_lock.push(lock_obj);} - else if (rqst_obj_type=='block') {external_block_lock.push(lock_obj);} - else if (rqst_obj_type=='setting') {external_setting_lock.push(lock_obj);} - addMsgLog(lock_obj.lockmsg()); - } - else if (rqst_action =='unlock'){ - var trouve = false; - var cur_id_obj=-1; - var i=0; - if (rqst_obj_type=='waypoint') - { - while((!trouve)&&(i - - - - - - - -

    --------- Paparazzi On the Web ! -------- -
    -Welcome, -<% - String log = (String) session.getAttribute("login"); - if(log != null) { - out.print(log + "!"); - String rights = (String) session.getAttribute("rights"); - if (rights.equals("admin")){ - out.println(" | admin page"); - } - out.println(" | \"pull\" mode"); - out.println(" | log out"); - } - else - { - out.println(""); - } - -%> - -
    -
    - -
    - -
    - -
    -
    - - -
    -
    - -
    -
    -

    - -
    -

    -
    -
    - -
    loading...
    - -
    - -
    -loading... -
    - - - -
    -
    Flight Parameters
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    altitude (m)0
    height0 m
    battery level0V
    speed0 km/h
    GPS statusOFF
    vertical speed0 m/s
    engine power0%
    -
    - - - - -
    -
    - -
    -
    -
    -
    -
      -
    -
    -
    -
    -
    - -
    -
    no news..
    -
    - - - -
    - - - - - -<% - out.println(""); -%> - - -<%-- --%> - - \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/META-INF/MANIFEST.MF b/sw/in_progress/pow/pow/WebContent/META-INF/MANIFEST.MF deleted file mode 100644 index 254272e1c0..0000000000 --- a/sw/in_progress/pow/pow/WebContent/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - diff --git a/sw/in_progress/pow/pow/WebContent/WEB-INF/classes/pushlet.properties b/sw/in_progress/pow/pow/WebContent/WEB-INF/classes/pushlet.properties deleted file mode 100644 index ba656e138f..0000000000 --- a/sw/in_progress/pow/pow/WebContent/WEB-INF/classes/pushlet.properties +++ /dev/null @@ -1,128 +0,0 @@ -# -# Pushlet configuration. -# Place this file in the CLASSPATH (e.g. WEB-INF/classes) or directly under WEB-INF. -# -# $Id: pushlet.properties,v 1.13 2007/12/07 12:57:40 justb Exp $ -# - -# -# -# -config.version=1.0.2 - -# -# CLASS FACTORY SPECIFICATION -# -# Change these if you want to override any of the core classes -# within the Pushlet framework with your own custom classes. -# -# Examples: -# - custom SessionManager for authorisation -# - maintain lists of active subjects (topics) -# - send events on subscription -# - plug in custom logging like log4j -# Note that you must maintain the semantics of each class ! -# Below are the default properties for the core classes. -controller.class=nl.justobjects.pushlet.core.Controller -dispatcher.class=nl.justobjects.pushlet.core.Dispatcher -logger.class=nl.justobjects.pushlet.util.Log4jLogger -# logger.class=nl.justobjects.pushlet.util.DefaultLogger -sessionmanager.class=nl.justobjects.pushlet.core.SessionManager -session.class=nl.justobjects.pushlet.core.Session -subscriber.class=nl.justobjects.pushlet.core.Subscriber -subscription.class=nl.justobjects.pushlet.core.Subscription - -# sessionmanager.maxsessions=200 - -# -# DISPATCHER -# - - -# TODO: allow properties to be maintained in -# a user dir -# config.redirect=/etc/pushlet.properties - -# -# LOGGING -# - -# log level (trace(6) debug(5) info (4), warn(3), error(2), fatal(1)) -# default is info(4) -log.level=4 - -# -# LOCAL EVENT SOURCES -# - -# should local sources be loaded ? -sources.activate=true - -# -# SESSION -# - - -# algoritm to generate session key: -# values: "randomstring" (default) or "uuid". -# session.id.generation=uuid -session.id.generation=randomstring - -# length of generated session key when using "randomstring" generation -session.id.size=10 - -# Overall session lease time in minutes -# Mainly used for clients that do not perform -# listening, e.g. when publishing only. -session.timeout.mins=5 - -# -# EVENT QUEUE -# -# Properties for per-client data event queue - -# Size for -queue.size=24 -queue.read.timeout.millis=20000 -queue.write.timeout.millis=20 - -# -# LISTENING MODE -# - -# You may force all clients to use pull mode -# for scalability -listen.force.pull.all=false - -# -# Comma-separated list of User Agent substrings. -# Force these browsers to use pull mode, since they -# don't support JS streaming, matching is done using -# String.indexOf() with lowercased agent strings -# use multiple criteria with &. -# -listen.force.pull.agents=safari - -# -# PULL MODE -# - -# time server should wait on refresing pull client -pull.refresh.timeout.millis=45000 - -# minimum/maximum wait time client should wait before refreshing -# server provides a random time between these values -pull.refresh.wait.min.millis=2000 -pull.refresh.wait.max.millis=6000 - -# -# POLL MODE -# - -# time server should wait on refresing poll client -poll.refresh.timeout.millis=60000 - -# minimum/maximum wait time client should wait before refreshing -# server provides a random time between these values -poll.refresh.wait.min.millis=6000 -poll.refresh.wait.max.millis=10000 diff --git a/sw/in_progress/pow/pow/WebContent/WEB-INF/classes/sources.properties b/sw/in_progress/pow/pow/WebContent/WEB-INF/classes/sources.properties deleted file mode 100644 index c51dc942e3..0000000000 --- a/sw/in_progress/pow/pow/WebContent/WEB-INF/classes/sources.properties +++ /dev/null @@ -1,28 +0,0 @@ -# -# Properties file for EventSource objects to be instantiated. -# -# Place this file in the CLASSPATH (e.g. WEB-INF/classes) or directly under WEB-INF. -# -# $Id: sources.properties,v 1.2 2007/11/10 14:12:16 justb Exp $ -# -# Each EventSource is defined as = -# 1. should be unique within this file but may be any name -# 2. is the full class name -# -# -# Define Pull Sources here. These classes must be derived from -# nl.justobjects.pushlet.core.EventPullSource -# Inner classes are separated with a $ sign from the outer class. -#source1=nl.justobjects.pushlet.test.TestEventPullSources$TemperatureEventPullSource -#source2=nl.justobjects.pushlet.test.TestEventPullSources$SystemStatusEventPullSource -#source3=nl.justobjects.pushlet.test.TestEventPullSources$PushletStatusEventPullSource -#source4=nl.justobjects.pushlet.test.TestEventPullSources$AEXStocksEventPullSource -#source5=nl.justobjects.pushlet.test.TestEventPullSources$WebPresentationEventPullSource -#source6=nl.justobjects.pushlet.test.TestEventPullSources$PingEventPullSource - -source1=pow.Serveur$IvyEventSource - -# TO BE DONE IN NEXT VERSION -# define Push Sources here. These must implement the interface -# nl.justobjects.pushlet.core.EventSource - diff --git a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-codec-1.4.jar b/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-codec-1.4.jar deleted file mode 100644 index 458d432da8..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-codec-1.4.jar and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar b/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar deleted file mode 100644 index aa209b3887..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-httpclient-3.1.jar b/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-httpclient-3.1.jar deleted file mode 100644 index 7c59774aed..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-httpclient-3.1.jar and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-io-1.4.jar b/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-io-1.4.jar deleted file mode 100644 index 133dc6cb35..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-io-1.4.jar and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-logging-1.1.1.jar b/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-logging-1.1.1.jar deleted file mode 100644 index 8758a96b70..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/commons-logging-1.1.1.jar and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/jdom.jar b/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/jdom.jar deleted file mode 100644 index 65a1b3f737..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/jdom.jar and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/pushlet.jar b/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/pushlet.jar deleted file mode 100644 index 6dc1c22e21..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/WEB-INF/lib/pushlet.jar and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/WEB-INF/web.xml b/sw/in_progress/pow/pow/WebContent/WEB-INF/web.xml deleted file mode 100644 index 9bd50e4b01..0000000000 --- a/sw/in_progress/pow/pow/WebContent/WEB-INF/web.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - TestServletPow - - index.html - index.htm - index.jsp - default.html - default.htm - default.jsp - - - - Greeting - Greeting - pow.Greeting - - - Greeting - /Greeting.srv - - - - Pushlet - Pushlet - nl.justobjects.pushlet.servlet.Pushlet - 1 - - - Pushlet - /pushlet.srv - - - - Ivy2TomcatHttpServer - Ivy2TomcatHttpServer - pow.Ivy2TomcatHttpServer - - - Ivy2TomcatHttpServer - /Ivy2TomcatHttpServer.srv - - - - ajaxRqst - ajaxRqst - pow.ajaxRqst - - - ajaxRqst - /ajaxRqst.srv - - \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/admin.jsp b/sw/in_progress/pow/pow/WebContent/admin.jsp deleted file mode 100644 index 94657a9011..0000000000 --- a/sw/in_progress/pow/pow/WebContent/admin.jsp +++ /dev/null @@ -1,790 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> -<%@page import="java.util.*,pow.UserTab,pow.User,javax.xml.parsers.*, org.w3c.dom.*,org.xml.sax.*,java.io.*" %> -<% -// recuperation des données sur le serveur - String default_folder = this.getServletContext().getRealPath(""); - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl"); - Iterator itr=logTab.getLoginIterator(); - // - UserTab logIvyTab = UserTab.unserialize(default_folder + "/conf/"+"userIvyTable.tbl"); - Iterator itrIvy=logIvyTab.getLoginIterator(); - // lecture liste des noms de drones ds immat.xml - DocumentBuilderFactory fabrique = DocumentBuilderFactory.newInstance(); - // création d'un constructeur de documents - DocumentBuilder constructeur = fabrique.newDocumentBuilder(); - // lecture du contenu d'un fichier XML avec DOM - File xml = new File(default_folder + "/conf/"+"immat.xml"); - Document document = constructeur.parse(xml); - - -%> - - - - - - - -Administration page - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    Select an item - - - - - - - - -
    - -
    -
    -
    -
    - - - - - - - - - - - -
    -
    -
    -
    -
    - Add or Remove a name among drones which may be controlled by users - - - - - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - Add or Remove an Ivy User - - - - - - -
    - -
    -
    -
    -
    - - -
    - -
    -
    - - \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/conf/immat.xml b/sw/in_progress/pow/pow/WebContent/conf/immat.xml deleted file mode 100644 index 42965d30c1..0000000000 --- a/sw/in_progress/pow/pow/WebContent/conf/immat.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/sw/in_progress/pow/pow/WebContent/conf/pow.conf b/sw/in_progress/pow/pow/WebContent/conf/pow.conf deleted file mode 100644 index dfcfb615e6..0000000000 --- a/sw/in_progress/pow/pow/WebContent/conf/pow.conf +++ /dev/null @@ -1,41 +0,0 @@ -########################################## -########## PAPARAZZI ON THE WEB ########## -########################################## - -#Beginning of configuration file : - -###################################### - -# The port on which msg from ivy are sended to web server - - -# The port in which msg from web server are sended to ivy - - -# The size of the udp datagram (1024 recommanded) - - -# The name of the dataBase - - -# The userName used in the dataBase on the server - - -# The password of the dataBase on the server - - -# The timeout of the udp connection (in millisecond) - - -# The location of the flightPlan Repertory (finish it with "/") - - -# The administrator's login of POW WEB site - - -# The administrator's mail of POW WEB site - - - -###################################### - diff --git a/sw/in_progress/pow/pow/WebContent/help.jsp b/sw/in_progress/pow/pow/WebContent/help.jsp deleted file mode 100644 index dab613dc65..0000000000 --- a/sw/in_progress/pow/pow/WebContent/help.jsp +++ /dev/null @@ -1,55 +0,0 @@ -<%@page import="pow.ConfJSP" %> - - - - - - Welcome to Paparazzi On the Web - - - - - - - - - -

    Welcome on Paparazzi On the Web help page.

    -

    This page is here to help you to use the Paparazzi On the Web (POW) application. POW is a part of Paparazzi which is a open-project of civil UAV control. With Paparazzi On the Web, you are able to observe and eventually control the UAVs of the system Paparazzi thanks to a browser with your internet connexion. To learn more about Paparazzi project, click here.

    -

    Paparazzi On the Web is optimised for Firefox browser. If you want to have a better performance, you can dowload Firefox here.

    -

    Start page

    -

    If you have a login and a password on Paparazzi On the Web, you can use them to enter the application. Else, click on enter as a guest.

    - -

    Main page

    -

    You are now on Paparazzi On the Web main page. You can see several boxes. We will describe all those boxes and show you the interactions you can have with them.

    - -

    Choose an aircraft

    -

    Here you can select the aircraft you want to observe or control. Click on the arrow to see the list of the aircrafts that are available. Click on the aircraft you want to interacte with.

    -

    You can also choose to activate or desactivate tracking. When tracking is activated, the map is always centered on the selected aircraft.

    - - - -

    The map

    -

    On the map, you can see all the aircrafts that are available. If tracking is activated, the map will be centered on the selected aircraft. There are also red lozenges which are the waypoints of the selected UAV. If you are autentified on Paparazzi On the Web and if your profile gives you the authorization, you can move those waypoints with drag and drop.

    - -

    The flight plan

    -

    Through this box, you can obtain some informations on the flight plan that is followed by the selected plane. If you move your cursor on the informations tab, you obtain informations on the flightplan. If you put your cursor on the "active block" tab, you can see the list of the flight plan blocks that the plane can follow. The active block is in red. If you are authentified and if you have the authorization, you can change the active block by clicking on its name. The waypoints tab gives you informations on the different waypoints. If you are authentified and if you have the authorization, you can move those waypoints by clicking on "move waypoint". In this case, a new windows is openned where you indicate where you want to move the waypoint. -You can also move a waypoint by dragging the icon on the map to its new position.

    - -

    The flight parameters

    -

    This box displays the flight parameters of the selected aircraft. When a value is out of its normal range, it becomes red.

    - -

    The settings

    -

    In this box you can, if you are allowed to control the selected aircraft, you change some settings of this aircraft by clicking on the name of the setting.

    - -

    Any problem ?

    -

    If you have any display problem, such as a ghost aircraft icon, or an aircraft that is not displayed in the aircrafts list, you might resolve it by reloading the page by pressing F5 key. -For any other problem, please inform -<%out.print(" -<%out.print(ConfJSP.getAdminMail()); %> -<%out.print("\">the administrator"); %>.

    -Click here to return to the homepage. - - - diff --git a/sw/in_progress/pow/pow/WebContent/idError.html b/sw/in_progress/pow/pow/WebContent/idError.html deleted file mode 100644 index a15edb3f6d..0000000000 --- a/sw/in_progress/pow/pow/WebContent/idError.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Welcome to Paparazzi On the Web - - - - - -

    Sorry, an error occured during your identification. Click here to return on the homepage.

    - - \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/img/base.gif b/sw/in_progress/pow/pow/WebContent/img/base.gif deleted file mode 100644 index 9ac0b117b0..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/base.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/cd.gif b/sw/in_progress/pow/pow/WebContent/img/cd.gif deleted file mode 100644 index 7503819404..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/cd.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/empty.gif b/sw/in_progress/pow/pow/WebContent/img/empty.gif deleted file mode 100644 index b5cf52378f..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/empty.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/folder.gif b/sw/in_progress/pow/pow/WebContent/img/folder.gif deleted file mode 100644 index eb129763dc..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/folder.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/folderopen.gif b/sw/in_progress/pow/pow/WebContent/img/folderopen.gif deleted file mode 100644 index c5c31102d5..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/folderopen.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/globe.gif b/sw/in_progress/pow/pow/WebContent/img/globe.gif deleted file mode 100644 index 57123d0e69..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/globe.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/imgfolder.gif b/sw/in_progress/pow/pow/WebContent/img/imgfolder.gif deleted file mode 100644 index e6d880347f..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/imgfolder.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/join.gif b/sw/in_progress/pow/pow/WebContent/img/join.gif deleted file mode 100644 index 34dd47610a..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/join.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/joinbottom.gif b/sw/in_progress/pow/pow/WebContent/img/joinbottom.gif deleted file mode 100644 index 48b81c80a9..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/joinbottom.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/line.gif b/sw/in_progress/pow/pow/WebContent/img/line.gif deleted file mode 100644 index 1a259eea00..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/line.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/minus.gif b/sw/in_progress/pow/pow/WebContent/img/minus.gif deleted file mode 100644 index 3d212a97ae..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/minus.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/minusbottom.gif b/sw/in_progress/pow/pow/WebContent/img/minusbottom.gif deleted file mode 100644 index dc3198be27..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/minusbottom.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/musicfolder.gif b/sw/in_progress/pow/pow/WebContent/img/musicfolder.gif deleted file mode 100644 index f620789feb..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/musicfolder.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/nolines_minus.gif b/sw/in_progress/pow/pow/WebContent/img/nolines_minus.gif deleted file mode 100644 index 2592ac20f3..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/nolines_minus.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/nolines_plus.gif b/sw/in_progress/pow/pow/WebContent/img/nolines_plus.gif deleted file mode 100644 index f258ce211a..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/nolines_plus.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/page.gif b/sw/in_progress/pow/pow/WebContent/img/page.gif deleted file mode 100644 index 42d7318c5d..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/page.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/plus.gif b/sw/in_progress/pow/pow/WebContent/img/plus.gif deleted file mode 100644 index b2c997233b..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/plus.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/plusbottom.gif b/sw/in_progress/pow/pow/WebContent/img/plusbottom.gif deleted file mode 100644 index b5671d891a..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/plusbottom.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/question.gif b/sw/in_progress/pow/pow/WebContent/img/question.gif deleted file mode 100644 index dd4e685078..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/question.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/img/trash.gif b/sw/in_progress/pow/pow/WebContent/img/trash.gif deleted file mode 100644 index cfa0f000e1..0000000000 Binary files a/sw/in_progress/pow/pow/WebContent/img/trash.gif and /dev/null differ diff --git a/sw/in_progress/pow/pow/WebContent/index.jsp b/sw/in_progress/pow/pow/WebContent/index.jsp deleted file mode 100644 index aad5c605b5..0000000000 --- a/sw/in_progress/pow/pow/WebContent/index.jsp +++ /dev/null @@ -1,69 +0,0 @@ - - - - - Welcome to Paparazzi On the Web - - - - - - - - - - - -

    Welcome to Paparazzi On The Web !

    - -

    - -

    -
    -
    -

    Login :

    -

    Password :

    - -
    -

    - - -
    -

    -
    -

    or

    - -

    -

    - -
    -

    -help ? - - \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/js/DOMImplementation.js b/sw/in_progress/pow/pow/WebContent/js/DOMImplementation.js deleted file mode 100644 index 75c17e11d6..0000000000 --- a/sw/in_progress/pow/pow/WebContent/js/DOMImplementation.js +++ /dev/null @@ -1,24 +0,0 @@ -function DOMImplementation(sUrl, fCallback) { - var dom; - if(window.ActiveXObject) { - dom = new ActiveXObject("Microsoft.XMLDOM"); - dom.onreadystatechange = function() { - if(dom.readyState == 4) { - //alert("win "+sUrl+" loaded"); - fCallback(dom); - } - }; - } - else if(document.implementation && document.implementation.createDocument) { - dom = document.implementation.createDocument("", "", null); - dom.onload = function() { - //alert("other "+sUrl+" loaded"); - fCallback(dom); - } - } - else { - alert("Votre navigateur ne gère pas l'importation de fichiers XML"); - return; - } - dom.load(sUrl); -} diff --git a/sw/in_progress/pow/pow/WebContent/js/XHR_object.js b/sw/in_progress/pow/pow/WebContent/js/XHR_object.js deleted file mode 100644 index 8f3f022733..0000000000 --- a/sw/in_progress/pow/pow/WebContent/js/XHR_object.js +++ /dev/null @@ -1,20 +0,0 @@ -function getXMLHttpRequest() { - var xhr = null; - - if (window.XMLHttpRequest || window.ActiveXObject) { - if (window.ActiveXObject) { - try { - xhr = new ActiveXObject("Msxml2.XMLHTTP"); - } catch(e) { - xhr = new ActiveXObject("Microsoft.XMLHTTP"); - } - } else { - xhr = new XMLHttpRequest(); - } - } else { - alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest..."); - return null; - } - - return xhr; -} diff --git a/sw/in_progress/pow/pow/WebContent/js/browserdetect.js b/sw/in_progress/pow/pow/WebContent/js/browserdetect.js deleted file mode 100644 index a8674db57f..0000000000 --- a/sw/in_progress/pow/pow/WebContent/js/browserdetect.js +++ /dev/null @@ -1,97 +0,0 @@ -// Browser Detect Lite v2.1.4 -// http://www.dithered.com/javascript/browser_detect/index.html -// modified by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM) - - -function BrowserDetectLite() { - var ua = navigator.userAgent.toLowerCase(); - - // browser name - this.isGecko = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1); - this.isMozilla = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length); - this.isNS = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) ); - this.isIE = ( (ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) ); - this.isSafari = (ua.indexOf('safari') != - 1); - this.isOpera = (ua.indexOf('opera') != -1); - this.isKonqueror = (ua.indexOf('konqueror') != -1 && !this.isSafari); - this.isIcab = (ua.indexOf('icab') != -1); - this.isAol = (ua.indexOf('aol') != -1); - - // spoofing and compatible browsers - this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE); - this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla); - - // browser version - this.versionMinor = parseFloat(navigator.appVersion); - - // correct version number - if (this.isNS && this.isGecko) { - this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) ); - } - else if (this.isIE && this.versionMinor >= 4) { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) ); - } - else if (this.isMozilla) { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ); - } - else if (this.isSafari) { - this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) ); - } - else if (this.isOpera) { - if (ua.indexOf('opera/') != -1) { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) ); - } - else { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) ); - } - } - else if (this.isKonqueror) { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) ); - } - else if (this.isIcab) { - if (ua.indexOf('icab/') != -1) { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) ); - } - else { - this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) ); - } - } - - this.versionMajor = parseInt(this.versionMinor); - this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 ); - - // dom support - this.isDOM1 = (document.getElementById); - this.isDOM2Event = (document.addEventListener && document.removeEventListener); - - // css compatibility mode - this.mode = document.compatMode ? document.compatMode : 'BackCompat'; - - // platform - this.isWin = (ua.indexOf('win') != -1); - this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) ); - this.isMac = (ua.indexOf('mac') != -1); - this.isUnix = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1) - this.isLinux = (ua.indexOf('linux') != -1); - - // specific browser shortcuts - this.isNS4x = (this.isNS && this.versionMajor == 4); - this.isNS40x = (this.isNS4x && this.versionMinor < 4.5); - this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7); - this.isNS4up = (this.isNS && this.versionMinor >= 4); - this.isNS6x = (this.isNS && this.versionMajor == 6); - this.isNS6up = (this.isNS && this.versionMajor >= 6); - this.isNS7x = (this.isNS && this.versionMajor == 7); - this.isNS7up = (this.isNS && this.versionMajor >= 7); - - this.isIE4x = (this.isIE && this.versionMajor == 4); - this.isIE4up = (this.isIE && this.versionMajor >= 4); - this.isIE5x = (this.isIE && this.versionMajor == 5); - this.isIE55 = (this.isIE && this.versionMinor == 5.5); - this.isIE5up = (this.isIE && this.versionMajor >= 5); - this.isIE6x = (this.isIE && this.versionMajor == 6); - this.isIE6up = (this.isIE && this.versionMajor >= 6); - - this.isIE4xMac = (this.isIE4x && this.isMac); -} -var browser = new BrowserDetectLite(); diff --git a/sw/in_progress/pow/pow/WebContent/js/dtree.js b/sw/in_progress/pow/pow/WebContent/js/dtree.js deleted file mode 100644 index 266779206c..0000000000 --- a/sw/in_progress/pow/pow/WebContent/js/dtree.js +++ /dev/null @@ -1,347 +0,0 @@ -/*--------------------------------------------------| -| dTree 2.05 | www.destroydrop.com/javascript/tree/ | -|---------------------------------------------------| -| Copyright (c) 2002-2003 Geir Landrö | -| | -| This script can be used freely as long as all | -| copyright messages are intact. | -| | -| Updated: 17.04.2003 | -|--------------------------------------------------*/ - -// Node object -function Node(id, pid, name, url, title, target, icon, iconOpen, open) { - this.id = id; - this.pid = pid; - this.name = name; - this.url = url; - this.title = title; - this.target = target; - this.icon = icon; - this.iconOpen = iconOpen; - this._io = open || false; - this._is = false; - this._ls = false; - this._hc = false; - this._ai = 0; - this._p; -}; - -// Tree object -function dTree(objName) { - this.config = { - target : null, - folderLinks : true, - useSelection : true, - useCookies : true, - useLines : true, - useIcons : true, - useStatusText : false, - closeSameLevel : false, - inOrder : false - } - this.icon = { - root : 'img/base.gif', - folder : 'img/folder.gif', - folderOpen : 'img/folderopen.gif', - node : 'img/page.gif', - empty : 'img/empty.gif', - line : 'img/line.gif', - join : 'img/join.gif', - joinBottom : 'img/joinbottom.gif', - plus : 'img/plus.gif', - plusBottom : 'img/plusbottom.gif', - minus : 'img/minus.gif', - minusBottom : 'img/minusbottom.gif', - nlPlus : 'img/nolines_plus.gif', - nlMinus : 'img/nolines_minus.gif' - }; - this.obj = objName; - this.aNodes = []; - this.aIndent = []; - this.root = new Node(-1); - this.selectedNode = null; - this.selectedFound = false; - this.completed = false; -}; - -// Adds a new node to the node array -dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) { - this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open); -}; - -// Open/close all nodes -dTree.prototype.openAll = function() { - this.oAll(true); -}; -dTree.prototype.closeAll = function() { - this.oAll(false); -}; - -// Outputs the tree to the page -dTree.prototype.toString = function() { - var str = '
    \n'; - if (document.getElementById) { - if (this.config.useCookies) this.selectedNode = this.getSelected(); - str += this.addNode(this.root); - } else str += 'Browser not supported.'; - str += '
    '; - if (!this.selectedFound) this.selectedNode = null; - this.completed = true; - return str; -}; - -// Creates the tree structure -dTree.prototype.addNode = function(pNode) { - var str = ''; - var n=0; - if (this.config.inOrder) n = pNode._ai; - for (n; n'; - } - if (node.url) { - str += ''; - str += node.name; - if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += ''; - str += ''; - if (node._hc) { - str += '
    '; - str += this.addNode(node); - str += '
    '; - } - this.aIndent.pop(); - return str; -}; - -// Adds the empty and line icons -dTree.prototype.indent = function(node, nodeId) { - var str = ''; - if (this.root.id != node.pid) { - for (var n=0; n'; - (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1); - if (node._hc) { - str += ''; - } else str += ''; - } - return str; -}; - -// Checks if a node has any children and if it is the last sibling -dTree.prototype.setCS = function(node) { - var lastId; - for (var n=0; n)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, -Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& -(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, -a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== -"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, -function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
    a"; -var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, -parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= -false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= -s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, -applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; -else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, -a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== -w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, -cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= -c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); -a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, -function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); -k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), -C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= -e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& -f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; -if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", -e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, -"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, -d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, -e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); -t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| -g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, -CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, -g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, -text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, -setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= -h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== -"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, -h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& -q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; -if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

    ";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); -(function(){var g=s.createElement("div");g.innerHTML="
    ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: -function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= -{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== -"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", -d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? -a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== -1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
    ","
    "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, -""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); -return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", -""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= -c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? -c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= -function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= -Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, -"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= -a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= -a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== -"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
    ").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, -serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), -function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, -global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& -e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? -"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== -false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= -false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", -c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| -d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); -g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== -1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== -"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; -if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== -"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| -c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; -this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= -this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, -e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
    "; -a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); -c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, -d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- -f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": -"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in -e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/sw/in_progress/pow/pow/WebContent/js/jquery-ui-1.8.2.custom.min.js b/sw/in_progress/pow/pow/WebContent/js/jquery-ui-1.8.2.custom.min.js deleted file mode 100644 index c11e844f9b..0000000000 --- a/sw/in_progress/pow/pow/WebContent/js/jquery-ui-1.8.2.custom.min.js +++ /dev/null @@ -1,1012 +0,0 @@ -/*! - * jQuery UI 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - */ -(function(c){c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.2",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=0)&&c(a).is(":focusable")}})}})(jQuery); -;/*! - * jQuery UI Widget 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Widget - */ -(function(b){var j=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return j.call(b(this),a,c)})};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend({},c.options);b[e][a].prototype= -b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==undefined){h=i;return false}}):this.each(function(){var g= -b.data(this,a);if(g){d&&g.option(d);g._init()}else b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create(); -this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===undefined)return this.options[a];d={};d[a]=c}b.each(d,function(f, -h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a= -b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery); -;/*! - * jQuery UI Mouse 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Mouse - * - * Depends: - * jquery.ui.widget.js - */ -(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&& -this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault(); -return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&& -this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX- -a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -;/* - * jQuery UI Position 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Position - */ -(function(c){c.ui=c.ui||{};var m=/left|center|right/,n=/top|center|bottom/,p=c.fn.position,q=c.fn.offset;c.fn.position=function(a){if(!a||!a.of)return p.apply(this,arguments);a=c.extend({},a);var b=c(a.of),d=(a.collision||"flip").split(" "),e=a.offset?a.offset.split(" "):[0,0],g,h,i;if(a.of.nodeType===9){g=b.width();h=b.height();i={top:0,left:0}}else if(a.of.scrollTo&&a.of.document){g=b.width();h=b.height();i={top:b.scrollTop(),left:b.scrollLeft()}}else if(a.of.preventDefault){a.at="left top";g=h= -0;i={top:a.of.pageY,left:a.of.pageX}}else{g=b.outerWidth();h=b.outerHeight();i=b.offset()}c.each(["my","at"],function(){var f=(a[this]||"").split(" ");if(f.length===1)f=m.test(f[0])?f.concat(["center"]):n.test(f[0])?["center"].concat(f):["center","center"];f[0]=m.test(f[0])?f[0]:"center";f[1]=n.test(f[1])?f[1]:"center";a[this]=f});if(d.length===1)d[1]=d[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(a.at[0]==="right")i.left+=g;else if(a.at[0]==="center")i.left+= -g/2;if(a.at[1]==="bottom")i.top+=h;else if(a.at[1]==="center")i.top+=h/2;i.left+=e[0];i.top+=e[1];return this.each(function(){var f=c(this),k=f.outerWidth(),l=f.outerHeight(),j=c.extend({},i);if(a.my[0]==="right")j.left-=k;else if(a.my[0]==="center")j.left-=k/2;if(a.my[1]==="bottom")j.top-=l;else if(a.my[1]==="center")j.top-=l/2;j.left=parseInt(j.left);j.top=parseInt(j.top);c.each(["left","top"],function(o,r){c.ui.position[d[o]]&&c.ui.position[d[o]][r](j,{targetWidth:g,targetHeight:h,elemWidth:k, -elemHeight:l,offset:e,my:a.my,at:a.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(j,{using:a.using}))})};c.ui.position={fit:{left:function(a,b){var d=c(window);b=a.left+b.elemWidth-d.width()-d.scrollLeft();a.left=b>0?a.left-b:Math.max(0,a.left)},top:function(a,b){var d=c(window);b=a.top+b.elemHeight-d.height()-d.scrollTop();a.top=b>0?a.top-b:Math.max(0,a.top)}},flip:{left:function(a,b){if(b.at[0]!=="center"){var d=c(window);d=a.left+b.elemWidth-d.width()-d.scrollLeft();var e=b.my[0]==="left"? --b.elemWidth:b.my[0]==="right"?b.elemWidth:0,g=-2*b.offset[0];a.left+=a.left<0?e+b.targetWidth+g:d>0?e-b.targetWidth+g:0}},top:function(a,b){if(b.at[1]!=="center"){var d=c(window);d=a.top+b.elemHeight-d.height()-d.scrollTop();var e=b.my[1]==="top"?-b.elemHeight:b.my[1]==="bottom"?b.elemHeight:0,g=b.at[1]==="top"?b.targetHeight:-b.targetHeight,h=-2*b.offset[1];a.top+=a.top<0?e+b.targetHeight+h:d>0?e+g+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(a,b){if(/static/.test(c.curCSS(a,"position")))a.style.position= -"relative";var d=c(a),e=d.offset(),g=parseInt(c.curCSS(a,"top",true),10)||0,h=parseInt(c.curCSS(a,"left",true),10)||0;e={top:b.top-e.top+g,left:b.left-e.left+h};"using"in b?b.using.call(a,e):d.css(e)};c.fn.offset=function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(){c.offset.setOffset(this,a)});return q.call(this)}}})(jQuery); -;/* - * jQuery UI Draggable 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= -this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- -this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); -d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| -this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element, -b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== -a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| -0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], -this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- -(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== -"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&& -a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"), -10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], -this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft(): -f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options; -if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!= -"HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>=i&& -e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), -top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= -this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!d(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", -nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var e=0;e');/sw|se|ne|nw/.test(g)&&f.css({zIndex:++a.zIndex});"se"==g&&f.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[g]=".ui-resizable-"+g;this.element.append(f)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== -String)this.handles[i]=d(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=d(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}d(this.handles[i])}};this._renderAxis(this.element);this._handles=d(".ui-resizable-handle",this.element).disableSelection(); -this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();d(this.element).addClass("ui-resizable-autohide").hover(function(){d(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){d(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){d(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; -if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(d(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), -e=this.element;this.resizing=true;this.documentScroll={top:d(document).scrollTop(),left:d(document).scrollLeft()};if(e.is(".ui-draggable")||/absolute/.test(e.css("position")))e.css({position:"absolute",top:c.top,left:c.left});d.browser.opera&&/relative/.test(e.css("position"))&&e.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var g=m(this.helper.css("top"));if(a.containment){c+=d(a.containment).scrollLeft()||0;g+=d(a.containment).scrollTop()||0}this.offset= -this.helper.offset();this.position={left:c,top:g};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:c,top:g};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: -this.originalSize.width/this.originalSize.height||1;a=d(".ui-resizable-"+this.axis).css("cursor");d("body").css("cursor",a=="auto"?this.axis+"-resize":a);e.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,e=this._change[this.axis];if(!e)return false;c=e.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", -b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var e=this._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName);e=g&&d.ui.hasScroll(e[0],"left")?0:c.sizeDiff.height; -g={width:c.size.width-(g?0:c.sizeDiff.width),height:c.size.height-e};e=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var f=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(d.extend(g,{top:f,left:e}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}d("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop", -b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,e=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(e=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(e=="nw"){b.top= -a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,e=k(b.width)&&a.maxWidth&&a.maxWidthb.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(f)b.width=a.minWidth;if(h)b.height=a.minHeight;if(e)b.width=a.maxWidth;if(g)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height, -l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(f&&l)b.left=i-a.minWidth;if(e&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(g&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=d.browser.msie&&d.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+ -a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return d.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return d.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return d.extend(this._change.n.apply(this, -arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return d.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){d.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});d.extend(d.ui.resizable, -{version:"1.8.2"});d.ui.plugin.add("resizable","alsoResize",{start:function(){var b=d(this).data("resizable").options,a=function(c){d(c).each(function(){d(this).data("resizable-alsoresize",{width:parseInt(d(this).width(),10),height:parseInt(d(this).height(),10),left:parseInt(d(this).css("left"),10),top:parseInt(d(this).css("top"),10)})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else d.each(b.alsoResize,function(c){a(c)}); -else a(b.alsoResize)},resize:function(){var b=d(this).data("resizable"),a=b.options,c=b.originalSize,e=b.originalPosition,g={height:b.size.height-c.height||0,width:b.size.width-c.width||0,top:b.position.top-e.top||0,left:b.position.left-e.left||0},f=function(h,i){d(h).each(function(){var j=d(this),l=d(this).data("resizable-alsoresize"),p={};d.each((i&&i.length?i:["width","height","top","left"])||["width","height","top","left"],function(n,o){if((n=(l[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(/relative/.test(j.css("position"))&& -d.browser.opera){b._revertToRelativePosition=true;j.css({position:"absolute",top:"auto",left:"auto"})}j.css(p)})};typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?d.each(a.alsoResize,function(h,i){f(h,i)}):f(a.alsoResize)},stop:function(){var b=d(this).data("resizable");if(b._revertToRelativePosition&&d.browser.opera){b._revertToRelativePosition=false;el.css({position:"relative"})}d(this).removeData("resizable-alsoresize-start")}});d.ui.plugin.add("resizable","animate",{stop:function(b){var a= -d(this).data("resizable"),c=a.options,e=a._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName),f=g&&d.ui.hasScroll(e[0],"left")?0:a.sizeDiff.height;g={width:a.size.width-(g?0:a.sizeDiff.width),height:a.size.height-f};f=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(d.extend(g,h&&f?{top:h,left:f}:{}),{duration:c.animateDuration,easing:c.animateEasing, -step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};e&&e.length&&d(e[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});d.ui.plugin.add("resizable","containment",{start:function(){var b=d(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof d?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= -d(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:d(document),left:0,top:0,width:d(document).width(),height:d(document).height()||document.body.parentNode.scrollHeight}}else{var e=d(a),g=[];d(["Top","Right","Left","Bottom"]).each(function(i,j){g[i]=m(e.css("padding"+j))});b.containerOffset=e.offset();b.containerPosition=e.position();b.containerSize={height:e.innerHeight()-g[3],width:e.innerWidth()-g[1]};c=b.containerOffset; -var f=b.containerSize.height,h=b.containerSize.width;h=d.ui.hasScroll(a,"left")?a.scrollWidth:h;f=d.ui.hasScroll(a)?a.scrollHeight:f;b.parentData={element:a,left:c.left,top:c.top,width:h,height:f}}}},resize:function(b){var a=d(this).data("resizable"),c=a.options,e=a.containerOffset,g=a.position;b=a._aspectRatio||b.shiftKey;var f={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))f=e;if(g.left<(a._helper?e.left:0)){a.size.width+=a._helper?a.position.left-e.left: -a.position.left-f.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?e.left:0}if(g.top<(a._helper?e.top:0)){a.size.height+=a._helper?a.position.top-e.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?e.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-f.left:a.offset.left-f.left)+a.sizeDiff.width);e=Math.abs((a._helper?a.offset.top-f.top:a.offset.top- -e.top)+a.sizeDiff.height);g=a.containerElement.get(0)==a.element.parent().get(0);f=/relative|absolute/.test(a.containerElement.css("position"));if(g&&f)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(e+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-e;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=d(this).data("resizable"),a=b.options,c=b.containerOffset,e=b.containerPosition, -g=b.containerElement,f=d(b.helper),h=f.offset(),i=f.outerWidth()-b.sizeDiff.width;f=f.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(g.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:i,height:f});b._helper&&!a.animate&&/static/.test(g.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:i,height:f})}});d.ui.plugin.add("resizable","ghost",{start:function(){var b=d(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, -display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=d(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=d(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});d.ui.plugin.add("resizable","grid",{resize:function(){var b= -d(this).data("resizable"),a=b.options,c=b.size,e=b.originalSize,g=b.originalPosition,f=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-e.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-e.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(f)){b.size.width=e.width+h;b.size.height=e.height+a}else if(/^(ne)$/.test(f)){b.size.width=e.width+h;b.size.height=e.height+a;b.position.top=g.top-a}else{if(/^(sw)$/.test(f)){b.size.width=e.width+h;b.size.height= -e.height+a}else{b.size.width=e.width+h;b.size.height=e.height+a;b.position.top=g.top-a}b.position.left=g.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); -; -/* - * jQuery UI Selectable 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Selectables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function($) { - -$.widget("ui.selectable", $.ui.mouse, { - options: { - appendTo: 'body', - autoRefresh: true, - distance: 0, - filter: '*', - tolerance: 'touch' - }, - _create: function() { - var self = this; - - this.element.addClass("ui-selectable"); - - this.dragged = false; - - // cache selectee children based on filter - var selectees; - this.refresh = function() { - selectees = $(self.options.filter, self.element[0]); - selectees.each(function() { - var $this = $(this); - var pos = $this.offset(); - $.data(this, "selectable-item", { - element: this, - $element: $this, - left: pos.left, - top: pos.top, - right: pos.left + $this.outerWidth(), - bottom: pos.top + $this.outerHeight(), - startselected: false, - selected: $this.hasClass('ui-selected'), - selecting: $this.hasClass('ui-selecting'), - unselecting: $this.hasClass('ui-unselecting') - }); - }); - }; - this.refresh(); - - this.selectees = selectees.addClass("ui-selectee"); - - this._mouseInit(); - - this.helper = $("
    "); - }, - - destroy: function() { - this.selectees - .removeClass("ui-selectee") - .removeData("selectable-item"); - this.element - .removeClass("ui-selectable ui-selectable-disabled") - .removeData("selectable") - .unbind(".selectable"); - this._mouseDestroy(); - - return this; - }, - - _mouseStart: function(event) { - var self = this; - - this.opos = [event.pageX, event.pageY]; - - if (this.options.disabled) - return; - - var options = this.options; - - this.selectees = $(options.filter, this.element[0]); - - this._trigger("start", event); - - $(options.appendTo).append(this.helper); - // position helper (lasso) - this.helper.css({ - "z-index": 100, - "position": "absolute", - "left": event.clientX, - "top": event.clientY, - "width": 0, - "height": 0 - }); - - if (options.autoRefresh) { - this.refresh(); - } - - this.selectees.filter('.ui-selected').each(function() { - var selectee = $.data(this, "selectable-item"); - selectee.startselected = true; - if (!event.metaKey) { - selectee.$element.removeClass('ui-selected'); - selectee.selected = false; - selectee.$element.addClass('ui-unselecting'); - selectee.unselecting = true; - // selectable UNSELECTING callback - self._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - }); - - $(event.target).parents().andSelf().each(function() { - var selectee = $.data(this, "selectable-item"); - if (selectee) { - var doSelect = !event.metaKey || !selectee.$element.hasClass('ui-selected'); - selectee.$element - .removeClass(doSelect ? "ui-unselecting" : "ui-selected") - .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); - selectee.unselecting = !doSelect; - selectee.selecting = doSelect; - selectee.selected = doSelect; - // selectable (UN)SELECTING callback - if (doSelect) { - self._trigger("selecting", event, { - selecting: selectee.element - }); - } else { - self._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - return false; - } - }); - - }, - - _mouseDrag: function(event) { - var self = this; - this.dragged = true; - - if (this.options.disabled) - return; - - var options = this.options; - - var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; - if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } - if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } - this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); - - this.selectees.each(function() { - var selectee = $.data(this, "selectable-item"); - //prevent helper from being selected if appendTo: selectable - if (!selectee || selectee.element == self.element[0]) - return; - var hit = false; - if (options.tolerance == 'touch') { - hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); - } else if (options.tolerance == 'fit') { - hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); - } - - if (hit) { - // SELECT - if (selectee.selected) { - selectee.$element.removeClass('ui-selected'); - selectee.selected = false; - } - if (selectee.unselecting) { - selectee.$element.removeClass('ui-unselecting'); - selectee.unselecting = false; - } - if (!selectee.selecting) { - selectee.$element.addClass('ui-selecting'); - selectee.selecting = true; - // selectable SELECTING callback - self._trigger("selecting", event, { - selecting: selectee.element - }); - } - } else { - // UNSELECT - if (selectee.selecting) { - if (event.metaKey && selectee.startselected) { - selectee.$element.removeClass('ui-selecting'); - selectee.selecting = false; - selectee.$element.addClass('ui-selected'); - selectee.selected = true; - } else { - selectee.$element.removeClass('ui-selecting'); - selectee.selecting = false; - if (selectee.startselected) { - selectee.$element.addClass('ui-unselecting'); - selectee.unselecting = true; - } - // selectable UNSELECTING callback - self._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - } - if (selectee.selected) { - if (!event.metaKey && !selectee.startselected) { - selectee.$element.removeClass('ui-selected'); - selectee.selected = false; - - selectee.$element.addClass('ui-unselecting'); - selectee.unselecting = true; - // selectable UNSELECTING callback - self._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - } - } - }); - - return false; - }, - - _mouseStop: function(event) { - var self = this; - - this.dragged = false; - - var options = this.options; - - $('.ui-unselecting', this.element[0]).each(function() { - var selectee = $.data(this, "selectable-item"); - selectee.$element.removeClass('ui-unselecting'); - selectee.unselecting = false; - selectee.startselected = false; - self._trigger("unselected", event, { - unselected: selectee.element - }); - }); - $('.ui-selecting', this.element[0]).each(function() { - var selectee = $.data(this, "selectable-item"); - selectee.$element.removeClass('ui-selecting').addClass('ui-selected'); - selectee.selecting = false; - selectee.selected = true; - selectee.startselected = true; - self._trigger("selected", event, { - selected: selectee.element - }); - }); - this._trigger("stop", event); - - this.helper.remove(); - - return false; - } - -}); - -$.extend($.ui.selectable, { - version: "1.8.2" -}); - -})(jQuery); -(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), -selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
    ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, -c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting"); -b.unselecting=true;f._trigger("unselecting",c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f= -this;this.dragged=true;if(!this.options.disabled){var d=this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, -arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= -c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, -{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); -if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", -a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); -if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, -c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== -document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate", -null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem): -d(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c}, -_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a= -this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)? -h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"), -b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)? -i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement, -c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height= -this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()- -parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0], -this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b= -1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update", -g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity", -this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},_create:function(){var a=this.options,b=this;this.running=0;this.element.addClass("ui-accordion ui-widget ui-helper-reset"); -this.element.children("li").addClass("ui-accordion-li-fix");this.headers=this.element.find(a.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); -if(a.navigation){var d=this.element.find("a").filter(a.navigationFilter);if(d.length){var f=d.closest(".ui-accordion-header");this.active=f.length?f:d.closest(".ui-accordion-content").prev()}}this.active=this._findActive(this.active||a.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");this._createIcons();this.resize();this.element.attr("role","tablist");this.headers.attr("role", -"tab").bind("keydown",function(g){return b._keydown(g)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();this.active.length?this.active.attr("aria-expanded","true").attr("tabIndex","0"):this.headers.eq(0).attr("tabIndex","0");c.browser.safari||this.headers.find("a").attr("tabIndex","-1");a.event&&this.headers.bind(a.event+".accordion",function(g){b._clickHandler.call(b,g,this);g.preventDefault()})},_createIcons:function(){var a= -this.options;if(a.icons){c("").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion"); -this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex");this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(a.autoHeight||a.fillHeight)b.css("height", -"");return this},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();b&&this._createIcons()}},_keydown:function(a){var b=c.ui.keyCode;if(!(this.options.disabled||a.altKey||a.ctrlKey)){var d=this.headers.length,f=this.headers.index(a.target),g=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:g=this.headers[(f+1)%d];break;case b.LEFT:case b.UP:g=this.headers[(f-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target}, -a.target);a.preventDefault()}if(g){c(a.target).attr("tabIndex","-1");c(g).attr("tabIndex","0");g.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0, -b-c(this).innerHeight()+c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a=="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d= -this.options;if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]==this.active[0];d.active=d.collapsible&&b?false:c(".ui-accordion-header",this.element).index(a);if(!(this.running||!d.collapsible&&b)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected); -a.next().addClass("ui-accordion-content-active")}e=a.next();f=this.active.next();g={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):e,oldContent:f};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(e,f,g,b,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); -this.active.next().addClass("ui-accordion-content-active");var f=this.active.next(),g={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:f},e=this.active=c([]);this._toggle(e,f,g)}},_toggle:function(a,b,d,f,g){var e=this.options,k=this;this.toShow=a;this.toHide=b;this.data=d;var i=function(){if(k)return k._completed.apply(k,arguments)};this._trigger("changestart",null,this.data);this.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:c([]), -toHide:b,complete:i,down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:i,down:g,autoHeight:e.autoHeight||e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=c.ui.accordion.animations;var h=e.duration,j=e.animated;if(j&&!f[j]&&!c.easing[j])j="slide";f[j]||(f[j]=function(l){this.slide(l,{easing:j, -duration:h||700})});f[j](d)}else{if(e.collapsible&&f)a.toggle();else{b.hide();a.show()}i(true)}b.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();a.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(a){var b=this.options;this.running=a?0:--this.running;if(!this.running){b.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion, -{version:"1.8.2",animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),f=0,g={},e={},k;b=a.toShow;k=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(i,h){e[h]="hide";i=(""+c.css(a.toShow[0], -h)).match(/^([\d+-.]+)(.*)$/);g[h]={value:i[1],unit:i[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(e,{step:function(i,h){if(h.prop=="height")f=h.end-h.start===0?0:(h.now-h.start)/(h.end-h.start);a.toShow[0].style[h.prop]=f*g[h.prop].value+g[h.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css("width",k);a.toShow.css({overflow:d});a.complete()}})}else a.toHide.animate({height:"hide"}, -a);else a.toShow.animate({height:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); -;/* - * jQuery UI Autocomplete 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Autocomplete - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.position.js - */ -(function(e){e.widget("ui.autocomplete",{options:{minLength:1,delay:300},_create:function(){var a=this,c=this.element[0].ownerDocument;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(d){var b=e.ui.keyCode;switch(d.keyCode){case b.PAGE_UP:a._move("previousPage",d);break;case b.PAGE_DOWN:a._move("nextPage",d);break;case b.UP:a._move("previous",d);d.preventDefault(); -break;case b.DOWN:a._move("next",d);d.preventDefault();break;case b.ENTER:case b.NUMPAD_ENTER:a.menu.active&&d.preventDefault();case b.TAB:if(!a.menu.active)return;a.menu.select(d);break;case b.ESCAPE:a.element.val(a.term);a.close(d);break;case b.LEFT:case b.RIGHT:case b.SHIFT:case b.CONTROL:case b.ALT:case b.COMMAND:case b.COMMAND_RIGHT:case b.INSERT:case b.CAPS_LOCK:case b.END:case b.HOME:break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){a.search(null,d)},a.options.delay); -break}}).bind("focus.autocomplete",function(){a.selectedItem=null;a.previous=a.element.val()}).bind("blur.autocomplete",function(d){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(d);a._change(d)},150)});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=e("
      ").addClass("ui-autocomplete").appendTo("body",c).mousedown(function(){setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(d,b){b=b.item.data("item.autocomplete"); -false!==a._trigger("focus",null,{item:b})&&/^key/.test(d.originalEvent.type)&&a.element.val(b.value)},selected:function(d,b){b=b.item.data("item.autocomplete");false!==a._trigger("select",d,{item:b})&&a.element.val(b.value);a.close(d);d=a.previous;if(a.element[0]!==c.activeElement){a.element.focus();a.previous=d}a.selectedItem=b},blur:function(){a.menu.element.is(":visible")&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");e.fn.bgiframe&&this.menu.element.bgiframe()}, -destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();e.Widget.prototype.destroy.call(this)},_setOption:function(a){e.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource()},_initSource:function(){var a,c;if(e.isArray(this.options.source)){a=this.options.source;this.source=function(d,b){b(e.ui.autocomplete.filter(a,d.term))}}else if(typeof this.options.source=== -"string"){c=this.options.source;this.source=function(d,b){e.getJSON(c,d,b)}}else this.source=this.options.source},search:function(a,c){a=a!=null?a:this.element.val();if(a.length").data("item.autocomplete", -c).append(""+c.label+"").appendTo(a)},_move:function(a,c){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](c);else this.search(null,c)},widget:function(){return this.menu.element}});e.extend(e.ui.autocomplete,{escapeRegex:function(a){return a.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")},filter:function(a,c){var d=new RegExp(e.ui.autocomplete.escapeRegex(c), -"i");return e.grep(a,function(b){return d.test(b.label||b.value||b)})}})})(jQuery); -(function(e){e.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(e(c.target).closest(".ui-menu-item a").length){c.preventDefault();a.select(c)}});this.refresh()},refresh:function(){var a=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", --1).mouseenter(function(c){a.activate(c,e(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,c){this.deactivate();if(this.hasScroll()){var d=c.offset().top-this.element.offset().top,b=this.element.attr("scrollTop"),f=this.element.height();if(d<0)this.element.attr("scrollTop",b+d);else d>f&&this.element.attr("scrollTop",b+d-f+c.height())}this.active=c.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:c})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); -this._trigger("blur");this.active=null}},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prev().length},last:function(){return this.active&&!this.active.next().length},move:function(a,c,d){if(this.active){a=this.active[a+"All"](".ui-menu-item").eq(0);a.length?this.activate(d,a):this.activate(d,this.element.children(c))}else this.activate(d,this.element.children(c))},nextPage:function(a){if(this.hasScroll())if(!this.active|| -this.last())this.activate(a,this.element.children(":first"));else{var c=this.active.offset().top,d=this.element.height(),b=this.element.children("li").filter(function(){var f=e(this).offset().top-c-d+e(this).height();return f<10&&f>-10});b.length||(b=this.element.children(":last"));this.activate(a,b)}else this.activate(a,this.element.children(!this.active||this.last()?":first":":last"))},previousPage:function(a){if(this.hasScroll())if(!this.active||this.first())this.activate(a,this.element.children(":last")); -else{var c=this.active.offset().top,d=this.element.height();result=this.element.children("li").filter(function(){var b=e(this).offset().top-c+d-e(this).height();return b<10&&b>-10});result.length||(result=this.element.children(":first"));this.activate(a,result)}else this.activate(a,this.element.children(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()
      ").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary;if(d.primary||d.secondary){b.addClass("ui-button-text-icon"+(e?"s":""));d.primary&&b.prepend("");d.secondary&&b.append("");if(!this.options.text){b.addClass(e?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon"); -this.hasTitle||b.attr("title",c)}}else b.addClass("ui-button-text-only")}}});a.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init()},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()}, -destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery); -;/* - * jQuery UI Dialog 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Dialog - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.button.js - * jquery.ui.draggable.js - * jquery.ui.mouse.js - * jquery.ui.position.js - * jquery.ui.resizable.js - */ -(function(c){c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");var a=this,b=a.options,d=b.title||a.originalTitle||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
      ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ -b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
      ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), -h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id", -e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); -a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== -b.uiDialog[0])d=Math.max(d,c(this).css("z-index"))});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index", -c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;d.next().length&&d.appendTo("body");a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== -f[0]&&e.shiftKey){g.focus(1);return false}}});c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();a._trigger("open");a._isOpen=true;return a}},_createButtons:function(a){var b=this,d=false,e=c("
      ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a, -function(g,f){g=c('').text(g).click(function(){f.apply(b.element[0],arguments)}).appendTo(e);c.fn.button&&g.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging"); -b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,originalSize:f.originalSize,position:f.position,size:f.size}}a=a===undefined?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position"); -a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop", -f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0];a=a||c.ui.dialog.prototype.options.position;if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(e,g){if(+b[e]===b[e]){d[e]=b[e];b[e]= -g}})}else if(typeof a==="object"){if("left"in a){b[0]="left";d[0]=a.left}else if("right"in a){b[0]="right";d[0]=-a.right}if("top"in a){b[1]="top";d[1]=a.top}else if("bottom"in a){b[1]="bottom";d[1]=-a.bottom}}(a=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position({my:b.join(" "),at:b.join(" "),offset:d.join(" "),of:window,collision:"fit",using:function(e){var g=c(this).css(e).offset().top;g<0&&c(this).css("top",e.top-g)}});a||this.uiDialog.hide()},_setOption:function(a, -b){var d=this,e=d.uiDialog,g=e.is(":data(resizable)"),f=false;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled");break;case "draggable":b?d._makeDraggable():e.draggable("destroy");break; -case "height":f=true;break;case "maxHeight":g&&e.resizable("option","maxHeight",b);f=true;break;case "maxWidth":g&&e.resizable("option","maxWidth",b);f=true;break;case "minHeight":g&&e.resizable("option","minHeight",b);f=true;break;case "minWidth":g&&e.resizable("option","minWidth",b);f=true;break;case "position":d._position(b);break;case "resizable":g&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title", -d.uiDialogTitlebar).html(""+(b||" "));break;case "width":f=true;break}c.Widget.prototype._setOption.apply(d,arguments);f&&d._size()},_size:function(){var a=this.options,b;this.element.css({width:"auto",minHeight:0,height:0});b=this.uiDialog.css({height:"auto",width:a.width}).height();this.element.css(a.height==="auto"?{minHeight:Math.max(a.minHeight-b,0),height:"auto"}:{minHeight:0,height:Math.max(a.height-b,0)}).show();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight", -this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.2",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&& -c(document).bind(c.ui.dialog.overlay.events,function(d){return c(d.target).zIndex()>=c.ui.dialog.overlay.maxZ})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("
      ").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&& -b.bgiframe();this.instances.push(b);return b},destroy:function(a){this.oldInstances.push(this.instances.splice(c.inArray(a,this.instances),1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var b=0;c.each(this.instances,function(){b=Math.max(b,this.css("z-index"))});this.maxZ=b},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight, -document.body.offsetHeight);return a");if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}else this.range=d("
      ");this.range.appendTo(this.element).addClass("ui-slider-range");if(b.range==="min"||b.range==="max")this.range.addClass("ui-slider-range-"+b.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("").appendTo(this.element).addClass("ui-slider-handle"); -if(b.values&&b.values.length)for(;d(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur(); -else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),g,h,i;if(!a.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e= -false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");g=a._start(c,f);if(g===false)return}break}i=a.options.step;g=a.options.values&&a.options.values.length?(h=a.values(f)):(h=a.value());switch(c.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(g+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(g-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(g=== -a._valueMax())return;h=a._trimAlignValue(g+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(g===a._valueMin())return;h=a._trimAlignValue(g-i);break}a._slide(c,f,h);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(c,e);a._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); -this._mouseDestroy();return this},_mouseCapture:function(a){var b=this.options,c,e,f,g,h,i;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c={x:a.pageX,y:a.pageY};e=this._normValueFromMouse(c);f=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(j){var k=Math.abs(e-h.values(j));if(f>k){f=k;g=d(this);i=j}});if(b.range===true&&this.values(1)===b.min){i+=1;g=d(this.handles[i])}if(this._start(a, -i)===false)return false;this._mouseSliding=true;h._handleIndex=i;g.addClass("ui-state-active").focus();b=g.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-g.width()/2,top:a.pageY-b.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};e=this._normValueFromMouse(c);this._slide(a,i,e);return this._animateOff=true},_mouseStart:function(){return true}, -_mouseDrag:function(a){var b=this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b; -if(this.orientation==="horizontal"){b=this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value= -this.values(b);c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var e;if(this.options.values&&this.options.values.length){e=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>e||b===1&&c1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;fthis._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=a%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a= -this.options.range,b=this.options,c=this,e=!this._animateOff?b.animate:false,f,g={},h,i,j,k;if(this.options.values&&this.options.values.length)this.handles.each(function(l){f=(c.values(l)-c._valueMin())/(c._valueMax()-c._valueMin())*100;g[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](g,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(l===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},b.animate);if(l===1)c.range[e?"animate":"css"]({width:f- -h+"%"},{queue:false,duration:b.animate})}else{if(l===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},b.animate);if(l===1)c.range[e?"animate":"css"]({height:f-h+"%"},{queue:false,duration:b.animate})}h=f});else{i=this.value();j=this._valueMin();k=this._valueMax();f=k!==j?(i-j)/(k-j)*100:0;g[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](g,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"}, -b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.2"})})(jQuery); -;/* - * jQuery UI Tabs 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(d){function s(){return++u}function v(){return++w}var u=0,w=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
      ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:'
    • #{label}
    • '},_create:function(){this._tabify(true)},_setOption:function(c,e){if(c=="selected")this.options.collapsible&& -e==this.options.selected||this.select(e);else{this.options[c]=e;this._tabify()}},_tabId:function(c){return c.title&&c.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+s()},_sanitizeSelector:function(c){return c.replace(/:/g,"\\:")},_cookie:function(){var c=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+v());return d.cookie.apply(null,[c].concat(d.makeArray(arguments)))},_ui:function(c,e){return{tab:c,panel:e,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var c= -d(this);c.html(c.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function e(g,f){g.css({display:""});!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}this.list=this.element.find("ol,ul").eq(0);this.lis=d("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);var a=this,b=this.options,h=/^#.+/;this.anchors.each(function(g,f){var j=d(f).attr("href"),l=j.split("#")[0],p;if(l&&(l===location.toString().split("#")[0]|| -(p=d("base")[0])&&l===p.href)){j=f.hash;f.href=j}if(h.test(j))a.panels=a.panels.add(a._sanitizeSelector(j));else if(j!="#"){d.data(f,"href.tabs",j);d.data(f,"load.tabs",j.replace(/#.*$/,""));j=a._tabId(f);f.href="#"+j;f=d("#"+j);if(!f.length){f=d(b.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else b.disabled.push(g)});if(c){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(b.selected===undefined){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){b.selected=g;return false}});if(typeof b.selected!="number"&&b.cookie)b.selected=parseInt(a._cookie(),10);if(typeof b.selected!="number"&&this.lis.filter(".ui-tabs-selected").length)b.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));b.selected=b.selected||(this.lis.length?0:-1)}else if(b.selected===null)b.selected=-1;b.selected=b.selected>=0&&this.anchors[b.selected]||b.selected<0?b.selected:0;b.disabled=d.unique(b.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(b.selected,b.disabled)!=-1&&b.disabled.splice(d.inArray(b.selected,b.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(b.selected>=0&&this.anchors.length){this.panels.eq(b.selected).removeClass("ui-tabs-hide");this.lis.eq(b.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[b.selected],a.panels[b.selected]))});this.load(b.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else b.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));this.element[b.collapsible?"addClass": -"removeClass"]("ui-tabs-collapsible");b.cookie&&this._cookie(b.selected,b.cookie);c=0;for(var i;i=this.lis[c];c++)d(i)[d.inArray(c,b.disabled)!=-1&&!d(i).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");b.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(b.event!="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+g)};this.lis.bind("mouseover.tabs", -function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(b.fx)if(d.isArray(b.fx)){m=b.fx[0];o=b.fx[1]}else m=o=b.fx;var q=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",function(){e(f,o);a._trigger("show", -null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},r=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};this.anchors.bind(b.event+".tabs", -function(){var g=this,f=d(this).closest("li"),j=a.panels.filter(":not(.ui-tabs-hide)"),l=d(a._sanitizeSelector(this.hash));if(f.hasClass("ui-tabs-selected")&&!b.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}b.selected=a.anchors.index(this);a.abort();if(b.collapsible)if(f.hasClass("ui-tabs-selected")){b.selected=-1;b.cookie&&a._cookie(b.selected,b.cookie);a.element.queue("tabs",function(){r(g, -j)}).dequeue("tabs");this.blur();return false}else if(!j.length){b.cookie&&a._cookie(b.selected,b.cookie);a.element.queue("tabs",function(){q(g,l)});a.load(a.anchors.index(this));this.blur();return false}b.cookie&&a._cookie(b.selected,b.cookie);if(l.length){j.length&&a.element.queue("tabs",function(){r(g,j)});a.element.queue("tabs",function(){q(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";d.browser.msie&&this.blur()});this.anchors.bind("click.tabs", -function(){return false})},destroy:function(){var c=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(b,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this, -"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});c.cookie&&this._cookie(null,c.cookie);return this},add:function(c,e,a){if(a===undefined)a=this.anchors.length;var b=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,e));c=!c.indexOf("#")?c.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs", -true);var i=d("#"+c);i.length||(i=d(h.panelTemplate).attr("id",c).data("destroy.tabs",true));i.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);i.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);i.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");i.removeClass("ui-tabs-hide"); -this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(c){var e=this.options,a=this.lis.eq(c).remove(),b=this.panels.eq(c).remove();if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(c+(c+1=c?--h:h});this._tabify();this._trigger("remove", -null,this._ui(a.find("a")[0],b[0]));return this},enable:function(c){var e=this.options;if(d.inArray(c,e.disabled)!=-1){this.lis.eq(c).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=c});this._trigger("enable",null,this._ui(this.anchors[c],this.panels[c]));return this}},disable:function(c){var e=this.options;if(c!=e.selected){this.lis.eq(c).addClass("ui-state-disabled");e.disabled.push(c);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}return this}, -select:function(c){if(typeof c=="string")c=this.anchors.index(this.anchors.filter("[href$="+c+"]"));else if(c===null)c=-1;if(c==-1&&this.options.collapsible)c=this.options.selected;this.anchors.eq(c).trigger(this.options.event+".tabs");return this},load:function(c){var e=this,a=this.options,b=this.anchors.eq(c)[0],h=d.data(b,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(b,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(c).addClass("ui-state-processing"); -if(a.spinner){var i=d("span",b);i.data("label.tabs",i.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){d(e._sanitizeSelector(b.hash)).html(k);e._cleanup();a.cache&&d.data(b,"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[c],e.panels[c]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[c],e.panels[c]));try{a.ajaxOptions.error(k,n,c,b)}catch(m){}}}));e.element.dequeue("tabs");return this}}, -abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(c,e){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.2"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(c,e){var a=this,b=this.options,h=a._rotate||(a._rotate= -function(i){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=b.selected;a.select(++k')}function E(a,b){d.extend(a, -b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.2"}});var y=(new Date).getTime();d.extend(J.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]= -f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('
      ')}}, -_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&& -b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f== -""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a, -c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b), -true);this._updateDatepicker(b);this._updateAlternate(b)}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{});b=b&&b.constructor== -Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]); -d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}}, -_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b= -d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false; -for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target|| -a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a); -d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&& -d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=d.datepicker._getBorders(b.dpDiv);b.dpDiv.find("iframe.ui-datepicker-cover").css({left:-i[0],top:-i[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f, -h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover"); -this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover"); -this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);var e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"); -a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus()},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(), -k=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>k&&k>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"]; -a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val(): -"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&& -!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth; -b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){a=this._getInst(d(a)[0]); -a.input&&a._selectingMonthYear&&!d.browser.msie&&a.input.focus();a._selectingMonthYear=!a._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a, -"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")|| -this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null; -for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,k=c=-1,l=-1,u=-1,j=false,o=function(p){(p=z+1-1){k=1;l=u;do{e=this._getDaysInMonth(c,k-1);if(l<=e)break;k++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c, -k-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=k||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c? -c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=j+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear|| -a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),k=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay? -new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),j=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=j&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-k,1)),this._getFormatConfig(a)); -n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m, -g+k,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";k=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&& -a.currentDay?u:b;k=!h?k:this.formatDate(k,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
      '+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
      ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;k=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),w=this._get(a,"showOtherMonths"),G=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var K=this._getDefaultDate(a),H="",C=0;C1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='
      '+(/all|left/.test(t)&&C==0?c? -f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,j,o,C>0||D>0,z,v)+'
      ';var A=k?'":"";for(t=0;t<7;t++){var q=(t+h)%7;A+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}x+=A+"";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, -A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var N=0;N";var O=!k?"":'";for(t=0;t<7;t++){var F=p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,I=B&&!G||!F[0]||j&&qo;O+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=O+""}g++;if(g>11){g=0;m++}x+="
      '+this._get(a,"weekHeader")+"
      '+this._get(a,"calculateWeek")(q)+""+(B&&!w?" ":I?''+q.getDate()+ -"":''+q.getDate()+"")+"
      "+(l?""+(i[0]>0&&D==i[1]-1?'
      ':""):"");L+=x}H+=L}H+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'': -"");a._keyEvent=false;return H},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var k=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),j='
      ',o="";if(h||!k)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(j+=o+(h||!(k&&l)?" ":""));if(h||!l)j+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b, -i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(j+='"}j+=this._get(a,"yearSuffix");if(u)j+=(h||!(k&&l)?" ":"")+o;j+="
      ";return j},_adjustInstDate:function(a,b,c){var e= -a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, -"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); -c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, -"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= -function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)); -return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new J;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.2";window["DP_jQuery_"+y]=d})(jQuery); -;/* - * jQuery UI Progressbar 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(b){b.widget("ui.progressbar",{options:{value:0},_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=b("
      ").appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); -this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===undefined)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){switch(a){case "value":this.options.value=c;this._refreshValue();this._trigger("change");break}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;if(athis._valueMax())a=this._valueMax();return a}, -_valueMin:function(){return 0},_valueMax:function(){return 100},_refreshValue:function(){var a=this.value();this.valueDiv[a===this._valueMax()?"addClass":"removeClass"]("ui-corner-right").width(a+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.2"})})(jQuery); -;/* - * jQuery UI Effects 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/ - */ -jQuery.effects||function(f){function k(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], -16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return l.transparent;return l[f.trim(c).toLowerCase()]}function q(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return k(b)}function m(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, -a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function n(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in r||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function s(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function j(c,a,b,d){if(typeof c=="object"){d= -a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(f.isFunction(b)){d=b;b=null}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:f.fx.speeds[b]||f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=q(b.elem,a);b.end=k(b.end);b.colorInit= -true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var l={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189, -183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255, -165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},o=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){var e=f(this),g=e.attr("style")||" ",h=n(m.call(this)),p,t=e.attr("className");f.each(o,function(u, -i){c[i]&&e[i+"Class"](c[i])});p=n(m.call(this));e.attr("className",t);e.animate(s(h,p),a,b,function(){f.each(o,function(u,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a? -f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===undefined?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.2",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"}); -c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=j.apply(this,arguments);a={options:a[1],duration:a[2],callback:a[3]};var b=f.effects[c];return b&&!f.fx.off?b.call(this,a):this},_show:f.fn.show,show:function(c){if(!c|| -typeof c=="number"||f.fx.speeds[c])return this._show.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(!c||typeof c=="number"||f.fx.speeds[c])return this._hide.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||typeof c=="boolean"||f.isFunction(c))return this.__toggle.apply(this, -arguments);else{var a=j.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c, -a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+ -b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2, -10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)* -a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ -e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); -;/* - * jQuery UI Effects Fold 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * jquery.effects.core.js - */ -(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","left"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],10)/100* -f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); -;/* - * jQuery UI Effects Highlight 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * jquery.effects.core.js - */ -(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& -this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); -;/* - * jQuery UI Effects Pulsate 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * jquery.effects.core.js - */ -(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); -b.dequeue()})})}})(jQuery); -; \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/js/menu1.js b/sw/in_progress/pow/pow/WebContent/js/menu1.js deleted file mode 100644 index 74abcbc61a..0000000000 --- a/sw/in_progress/pow/pow/WebContent/js/menu1.js +++ /dev/null @@ -1,155 +0,0 @@ -/* -Author : bieler batiste -Company : doSimple : http://www.dosimple.ch -send me a mail for more informations : faden@PASDEPOURRIELaltern.org - remove ( PASDEPOURRIEL ) - -Short javascript function to create and handle a CSS navigation menu - -Copyright (C) 2004 Bieler Batiste - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library 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 -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -// the timeout for the menu -var timeout = 100; - -// not very clean but simple -// the function can be run in the HTML for faster display -// window.onload=initMenu; - -// creat timeout variables for list item -// it's for avoid some warning with IE -for( var i = 0; i < 100; i++ ) -{ - eval("var timeoutli" + i + " = false;"); -} - -// this fonction apply the CSS style and the event -function initMenu() -{ - // a test to avoid some browser like IE4, Opera 6, and IE Mac - if ( browser.isDOM1 - && !( browser.isMac && browser.isIE ) - && !( browser.isOpera && browser.versionMajor < 7 ) - && !( browser.isIE && browser.versionMajor < 5 ) ) - { - // get some element - var menu = document.getElementById('menu'); // the root element - var lis = menu.getElementsByTagName('li'); // all the li - - // change the class name of the menu, - // it's usefull for compatibility with old browser - menu.className='menu'; - // i am searching for ul element in li element - for ( var i=0; i 0 ) - { - // improve IE key navigation - if ( browser.isIE ) - { - addAnEvent(lis.item(i),'keyup',show); - } - // link events to list item - addAnEvent(lis.item(i),'mouseover',show); - addAnEvent(lis.item(i),'mouseout',timeoutHide); - addAnEvent(lis.item(i),'blur',timeoutHide); - addAnEvent(lis.item(i),'focus',show); - - // add an id to list item - lis.item(i).setAttribute( 'id', "li"+i ); - } - } - } -} - - - - -function addAnEvent( target, eventName, functionName ) -{ - // apply the method to IE - if ( browser.isIE ) - { - //attachEvent dont work properly with this - eval('target.on'+eventName+'=functionName'); - } - // apply the method to DOM compliant browsers - else - { - target.addEventListener( eventName , functionName , true ); // true is important for Opera7 - } -} - -// hide the first ul element of the current element -function timeoutHide() -{ - // start the timeout - eval( "timeout" + this.id + " = window.setTimeout('hideUlUnder( \"" + this.id + "\" )', " + timeout + " );"); -} - -// hide the ul elements under the element identified by id -function hideUlUnder( id ) -{ - document.getElementById(id).getElementsByTagName('ul')[0].style['visibility'] = 'hidden'; -} - -// show the first ul element found under this element -function show() -{ - // show the sub menu - this.getElementsByTagName('ul')[0].style['visibility'] = 'visible'; - var currentNode=this; - while(currentNode) - { - if( currentNode.nodeName=='LI') - { - // currentNode.getElementsByTagName('a')[0].className = 'linkOver'; - } - currentNode=currentNode.parentNode; - } - // clear the timeout - eval ( "clearTimeout( timeout"+ this.id +");" ); - hideAllOthersUls( this ); -} - -// hide all ul on the same level of this list item -function hideAllOthersUls( currentLi ) -{ - var lis = currentLi.parentNode; - for ( var i=0; i 0 ) - { - if ( browser.isIE ) - { - addAnEvent(lis2.item(i),'keyup',show); - } - - addAnEvent(lis2.item(i),'mouseover',show); - addAnEvent(lis2.item(i),'mouseout',timeoutHide); - addAnEvent(lis2.item(i),'blur',timeoutHide); - addAnEvent(lis2.item(i),'focus',show); - - lis2.item(i).setAttribute( 'id', "li2"+i ); - } - } - } -} - - - -function addAnEvent( target, eventName, functionName ) -{ - if ( browser.isIE ) - { - eval('target.on'+eventName+'=functionName'); - } - else - { - target.addEventListener( eventName , functionName , true ); - } -} - -function timeoutHide() -{ - eval( "timeout" + this.id + " = window.setTimeout('hideUlUnder( \"" + this.id + "\" )', " + timeout + " );"); -} - -// hide the ul elements under the element identified by id -function hideUlUnder( id ) -{ - document.getElementById(id).getElementsByTagName('ul')[0].style['visibility'] = 'hidden'; -} - -// show the first ul element found under this element -function show() -{ - // show the sub menu - this.getElementsByTagName('ul')[0].style['visibility'] = 'visible'; - var currentNode=this; - while(currentNode) - { - if( currentNode.nodeName=='LI') - { - // currentNode.getElementsByTagName('a')[0].className = 'linkOver'; - } - currentNode=currentNode.parentNode; - } - // clear the timeout - eval ( "clearTimeout( timeout"+ this.id +");" ); - hideAllOthersUls( this ); -} - -// hide all ul on the same level of this list item -function hideAllOthersUls( currentLi ) -{ - var lis = currentLi.parentNode; - for ( var i=0; i -1, - Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1, - MobileSafari: /Apple.*Mobile.*Safari/.test(ua) - } - })(), - - BrowserFeatures: { - XPath: !!document.evaluate, - SelectorsAPI: !!document.querySelector, - ElementExtensions: (function() { - var constructor = window.Element || window.HTMLElement; - return !!(constructor && constructor.prototype); - })(), - SpecificElementExtensions: (function() { - if (typeof window.HTMLDivElement !== 'undefined') - return true; - - var div = document.createElement('div'); - var form = document.createElement('form'); - var isSupported = false; - - if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) { - isSupported = true; - } - - div = form = null; - - return isSupported; - })() - }, - - ScriptFragment: ']*>([\\S\\s]*?)<\/script>', - JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, - - emptyFunction: function() { }, - K: function(x) { return x } -}; - -if (Prototype.Browser.MobileSafari) - Prototype.BrowserFeatures.SpecificElementExtensions = false; - - -var Abstract = { }; - - -var Try = { - these: function() { - var returnValue; - - for (var i = 0, length = arguments.length; i < length; i++) { - var lambda = arguments[i]; - try { - returnValue = lambda(); - break; - } catch (e) { } - } - - return returnValue; - } -}; - -/* Based on Alex Arnell's inheritance implementation. */ - -var Class = (function() { - function subclass() {}; - function create() { - var parent = null, properties = $A(arguments); - if (Object.isFunction(properties[0])) - parent = properties.shift(); - - function klass() { - this.initialize.apply(this, arguments); - } - - Object.extend(klass, Class.Methods); - klass.superclass = parent; - klass.subclasses = []; - - if (parent) { - subclass.prototype = parent.prototype; - klass.prototype = new subclass; - parent.subclasses.push(klass); - } - - for (var i = 0; i < properties.length; i++) - klass.addMethods(properties[i]); - - if (!klass.prototype.initialize) - klass.prototype.initialize = Prototype.emptyFunction; - - klass.prototype.constructor = klass; - return klass; - } - - function addMethods(source) { - var ancestor = this.superclass && this.superclass.prototype; - var properties = Object.keys(source); - - if (!Object.keys({ toString: true }).length) { - if (source.toString != Object.prototype.toString) - properties.push("toString"); - if (source.valueOf != Object.prototype.valueOf) - properties.push("valueOf"); - } - - for (var i = 0, length = properties.length; i < length; i++) { - var property = properties[i], value = source[property]; - if (ancestor && Object.isFunction(value) && - value.argumentNames().first() == "$super") { - var method = value; - value = (function(m) { - return function() { return ancestor[m].apply(this, arguments); }; - })(property).wrap(method); - - value.valueOf = method.valueOf.bind(method); - value.toString = method.toString.bind(method); - } - this.prototype[property] = value; - } - - return this; - } - - return { - create: create, - Methods: { - addMethods: addMethods - } - }; -})(); -(function() { - - var _toString = Object.prototype.toString; - - function extend(destination, source) { - for (var property in source) - destination[property] = source[property]; - return destination; - } - - function inspect(object) { - try { - if (isUndefined(object)) return 'undefined'; - if (object === null) return 'null'; - return object.inspect ? object.inspect() : String(object); - } catch (e) { - if (e instanceof RangeError) return '...'; - throw e; - } - } - - function toJSON(object) { - var type = typeof object; - switch (type) { - case 'undefined': - case 'function': - case 'unknown': return; - case 'boolean': return object.toString(); - } - - if (object === null) return 'null'; - if (object.toJSON) return object.toJSON(); - if (isElement(object)) return; - - var results = []; - for (var property in object) { - var value = toJSON(object[property]); - if (!isUndefined(value)) - results.push(property.toJSON() + ': ' + value); - } - - return '{' + results.join(', ') + '}'; - } - - function toQueryString(object) { - return $H(object).toQueryString(); - } - - function toHTML(object) { - return object && object.toHTML ? object.toHTML() : String.interpret(object); - } - - function keys(object) { - var results = []; - for (var property in object) - results.push(property); - return results; - } - - function values(object) { - var results = []; - for (var property in object) - results.push(object[property]); - return results; - } - - function clone(object) { - return extend({ }, object); - } - - function isElement(object) { - return !!(object && object.nodeType == 1); - } - - function isArray(object) { - return _toString.call(object) == "[object Array]"; - } - - - function isHash(object) { - return object instanceof Hash; - } - - function isFunction(object) { - return typeof object === "function"; - } - - function isString(object) { - return _toString.call(object) == "[object String]"; - } - - function isNumber(object) { - return _toString.call(object) == "[object Number]"; - } - - function isUndefined(object) { - return typeof object === "undefined"; - } - - extend(Object, { - extend: extend, - inspect: inspect, - toJSON: toJSON, - toQueryString: toQueryString, - toHTML: toHTML, - keys: keys, - values: values, - clone: clone, - isElement: isElement, - isArray: isArray, - isHash: isHash, - isFunction: isFunction, - isString: isString, - isNumber: isNumber, - isUndefined: isUndefined - }); -})(); -Object.extend(Function.prototype, (function() { - var slice = Array.prototype.slice; - - function update(array, args) { - var arrayLength = array.length, length = args.length; - while (length--) array[arrayLength + length] = args[length]; - return array; - } - - function merge(array, args) { - array = slice.call(array, 0); - return update(array, args); - } - - function argumentNames() { - var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1] - .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '') - .replace(/\s+/g, '').split(','); - return names.length == 1 && !names[0] ? [] : names; - } - - function bind(context) { - if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; - var __method = this, args = slice.call(arguments, 1); - return function() { - var a = merge(args, arguments); - return __method.apply(context, a); - } - } - - function bindAsEventListener(context) { - var __method = this, args = slice.call(arguments, 1); - return function(event) { - var a = update([event || window.event], args); - return __method.apply(context, a); - } - } - - function curry() { - if (!arguments.length) return this; - var __method = this, args = slice.call(arguments, 0); - return function() { - var a = merge(args, arguments); - return __method.apply(this, a); - } - } - - function delay(timeout) { - var __method = this, args = slice.call(arguments, 1); - timeout = timeout * 1000 - return window.setTimeout(function() { - return __method.apply(__method, args); - }, timeout); - } - - function defer() { - var args = update([0.01], arguments); - return this.delay.apply(this, args); - } - - function wrap(wrapper) { - var __method = this; - return function() { - var a = update([__method.bind(this)], arguments); - return wrapper.apply(this, a); - } - } - - function methodize() { - if (this._methodized) return this._methodized; - var __method = this; - return this._methodized = function() { - var a = update([this], arguments); - return __method.apply(null, a); - }; - } - - return { - argumentNames: argumentNames, - bind: bind, - bindAsEventListener: bindAsEventListener, - curry: curry, - delay: delay, - defer: defer, - wrap: wrap, - methodize: methodize - } -})()); - - -Date.prototype.toJSON = function() { - return '"' + this.getUTCFullYear() + '-' + - (this.getUTCMonth() + 1).toPaddedString(2) + '-' + - this.getUTCDate().toPaddedString(2) + 'T' + - this.getUTCHours().toPaddedString(2) + ':' + - this.getUTCMinutes().toPaddedString(2) + ':' + - this.getUTCSeconds().toPaddedString(2) + 'Z"'; -}; - - -RegExp.prototype.match = RegExp.prototype.test; - -RegExp.escape = function(str) { - return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); -}; -var PeriodicalExecuter = Class.create({ - initialize: function(callback, frequency) { - this.callback = callback; - this.frequency = frequency; - this.currentlyExecuting = false; - - this.registerCallback(); - }, - - registerCallback: function() { - this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); - }, - - execute: function() { - this.callback(this); - }, - - stop: function() { - if (!this.timer) return; - clearInterval(this.timer); - this.timer = null; - }, - - onTimerEvent: function() { - if (!this.currentlyExecuting) { - try { - this.currentlyExecuting = true; - this.execute(); - this.currentlyExecuting = false; - } catch(e) { - this.currentlyExecuting = false; - throw e; - } - } - } -}); -Object.extend(String, { - interpret: function(value) { - return value == null ? '' : String(value); - }, - specialChar: { - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '\\': '\\\\' - } -}); - -Object.extend(String.prototype, (function() { - - function prepareReplacement(replacement) { - if (Object.isFunction(replacement)) return replacement; - var template = new Template(replacement); - return function(match) { return template.evaluate(match) }; - } - - function gsub(pattern, replacement) { - var result = '', source = this, match; - replacement = prepareReplacement(replacement); - - if (Object.isString(pattern)) - pattern = RegExp.escape(pattern); - - if (!(pattern.length || pattern.source)) { - replacement = replacement(''); - return replacement + source.split('').join(replacement) + replacement; - } - - while (source.length > 0) { - if (match = source.match(pattern)) { - result += source.slice(0, match.index); - result += String.interpret(replacement(match)); - source = source.slice(match.index + match[0].length); - } else { - result += source, source = ''; - } - } - return result; - } - - function sub(pattern, replacement, count) { - replacement = prepareReplacement(replacement); - count = Object.isUndefined(count) ? 1 : count; - - return this.gsub(pattern, function(match) { - if (--count < 0) return match[0]; - return replacement(match); - }); - } - - function scan(pattern, iterator) { - this.gsub(pattern, iterator); - return String(this); - } - - function truncate(length, truncation) { - length = length || 30; - truncation = Object.isUndefined(truncation) ? '...' : truncation; - return this.length > length ? - this.slice(0, length - truncation.length) + truncation : String(this); - } - - function strip() { - return this.replace(/^\s+/, '').replace(/\s+$/, ''); - } - - function stripTags() { - return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, ''); - } - - function stripScripts() { - return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); - } - - function extractScripts() { - var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); - var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); - return (this.match(matchAll) || []).map(function(scriptTag) { - return (scriptTag.match(matchOne) || ['', ''])[1]; - }); - } - - function evalScripts() { - return this.extractScripts().map(function(script) { return eval(script) }); - } - - function escapeHTML() { - return this.replace(/&/g,'&').replace(//g,'>'); - } - - function unescapeHTML() { - return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&'); - } - - - function toQueryParams(separator) { - var match = this.strip().match(/([^?#]*)(#.*)?$/); - if (!match) return { }; - - return match[1].split(separator || '&').inject({ }, function(hash, pair) { - if ((pair = pair.split('='))[0]) { - var key = decodeURIComponent(pair.shift()); - var value = pair.length > 1 ? pair.join('=') : pair[0]; - if (value != undefined) value = decodeURIComponent(value); - - if (key in hash) { - if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; - hash[key].push(value); - } - else hash[key] = value; - } - return hash; - }); - } - - function toArray() { - return this.split(''); - } - - function succ() { - return this.slice(0, this.length - 1) + - String.fromCharCode(this.charCodeAt(this.length - 1) + 1); - } - - function times(count) { - return count < 1 ? '' : new Array(count + 1).join(this); - } - - function camelize() { - var parts = this.split('-'), len = parts.length; - if (len == 1) return parts[0]; - - var camelized = this.charAt(0) == '-' - ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) - : parts[0]; - - for (var i = 1; i < len; i++) - camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); - - return camelized; - } - - function capitalize() { - return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); - } - - function underscore() { - return this.replace(/::/g, '/') - .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') - .replace(/([a-z\d])([A-Z])/g, '$1_$2') - .replace(/-/g, '_') - .toLowerCase(); - } - - function dasherize() { - return this.replace(/_/g, '-'); - } - - function inspect(useDoubleQuotes) { - var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) { - if (character in String.specialChar) { - return String.specialChar[character]; - } - return '\\u00' + character.charCodeAt().toPaddedString(2, 16); - }); - if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; - return "'" + escapedString.replace(/'/g, '\\\'') + "'"; - } - - function toJSON() { - return this.inspect(true); - } - - function unfilterJSON(filter) { - return this.replace(filter || Prototype.JSONFilter, '$1'); - } - - function isJSON() { - var str = this; - if (str.blank()) return false; - str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); - return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); - } - - function evalJSON(sanitize) { - var json = this.unfilterJSON(); - try { - if (!sanitize || json.isJSON()) return eval('(' + json + ')'); - } catch (e) { } - throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); - } - - function include(pattern) { - return this.indexOf(pattern) > -1; - } - - function startsWith(pattern) { - return this.indexOf(pattern) === 0; - } - - function endsWith(pattern) { - var d = this.length - pattern.length; - return d >= 0 && this.lastIndexOf(pattern) === d; - } - - function empty() { - return this == ''; - } - - function blank() { - return /^\s*$/.test(this); - } - - function interpolate(object, pattern) { - return new Template(this, pattern).evaluate(object); - } - - return { - gsub: gsub, - sub: sub, - scan: scan, - truncate: truncate, - strip: String.prototype.trim ? String.prototype.trim : strip, - stripTags: stripTags, - stripScripts: stripScripts, - extractScripts: extractScripts, - evalScripts: evalScripts, - escapeHTML: escapeHTML, - unescapeHTML: unescapeHTML, - toQueryParams: toQueryParams, - parseQuery: toQueryParams, - toArray: toArray, - succ: succ, - times: times, - camelize: camelize, - capitalize: capitalize, - underscore: underscore, - dasherize: dasherize, - inspect: inspect, - toJSON: toJSON, - unfilterJSON: unfilterJSON, - isJSON: isJSON, - evalJSON: evalJSON, - include: include, - startsWith: startsWith, - endsWith: endsWith, - empty: empty, - blank: blank, - interpolate: interpolate - }; -})()); - -var Template = Class.create({ - initialize: function(template, pattern) { - this.template = template.toString(); - this.pattern = pattern || Template.Pattern; - }, - - evaluate: function(object) { - if (object && Object.isFunction(object.toTemplateReplacements)) - object = object.toTemplateReplacements(); - - return this.template.gsub(this.pattern, function(match) { - if (object == null) return (match[1] + ''); - - var before = match[1] || ''; - if (before == '\\') return match[2]; - - var ctx = object, expr = match[3]; - var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; - match = pattern.exec(expr); - if (match == null) return before; - - while (match != null) { - var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1]; - ctx = ctx[comp]; - if (null == ctx || '' == match[3]) break; - expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); - match = pattern.exec(expr); - } - - return before + String.interpret(ctx); - }); - } -}); -Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; - -var $break = { }; - -var Enumerable = (function() { - function each(iterator, context) { - var index = 0; - try { - this._each(function(value) { - iterator.call(context, value, index++); - }); - } catch (e) { - if (e != $break) throw e; - } - return this; - } - - function eachSlice(number, iterator, context) { - var index = -number, slices = [], array = this.toArray(); - if (number < 1) return array; - while ((index += number) < array.length) - slices.push(array.slice(index, index+number)); - return slices.collect(iterator, context); - } - - function all(iterator, context) { - iterator = iterator || Prototype.K; - var result = true; - this.each(function(value, index) { - result = result && !!iterator.call(context, value, index); - if (!result) throw $break; - }); - return result; - } - - function any(iterator, context) { - iterator = iterator || Prototype.K; - var result = false; - this.each(function(value, index) { - if (result = !!iterator.call(context, value, index)) - throw $break; - }); - return result; - } - - function collect(iterator, context) { - iterator = iterator || Prototype.K; - var results = []; - this.each(function(value, index) { - results.push(iterator.call(context, value, index)); - }); - return results; - } - - function detect(iterator, context) { - var result; - this.each(function(value, index) { - if (iterator.call(context, value, index)) { - result = value; - throw $break; - } - }); - return result; - } - - function findAll(iterator, context) { - var results = []; - this.each(function(value, index) { - if (iterator.call(context, value, index)) - results.push(value); - }); - return results; - } - - function grep(filter, iterator, context) { - iterator = iterator || Prototype.K; - var results = []; - - if (Object.isString(filter)) - filter = new RegExp(RegExp.escape(filter)); - - this.each(function(value, index) { - if (filter.match(value)) - results.push(iterator.call(context, value, index)); - }); - return results; - } - - function include(object) { - if (Object.isFunction(this.indexOf)) - if (this.indexOf(object) != -1) return true; - - var found = false; - this.each(function(value) { - if (value == object) { - found = true; - throw $break; - } - }); - return found; - } - - function inGroupsOf(number, fillWith) { - fillWith = Object.isUndefined(fillWith) ? null : fillWith; - return this.eachSlice(number, function(slice) { - while(slice.length < number) slice.push(fillWith); - return slice; - }); - } - - function inject(memo, iterator, context) { - this.each(function(value, index) { - memo = iterator.call(context, memo, value, index); - }); - return memo; - } - - function invoke(method) { - var args = $A(arguments).slice(1); - return this.map(function(value) { - return value[method].apply(value, args); - }); - } - - function max(iterator, context) { - iterator = iterator || Prototype.K; - var result; - this.each(function(value, index) { - value = iterator.call(context, value, index); - if (result == null || value >= result) - result = value; - }); - return result; - } - - function min(iterator, context) { - iterator = iterator || Prototype.K; - var result; - this.each(function(value, index) { - value = iterator.call(context, value, index); - if (result == null || value < result) - result = value; - }); - return result; - } - - function partition(iterator, context) { - iterator = iterator || Prototype.K; - var trues = [], falses = []; - this.each(function(value, index) { - (iterator.call(context, value, index) ? - trues : falses).push(value); - }); - return [trues, falses]; - } - - function pluck(property) { - var results = []; - this.each(function(value) { - results.push(value[property]); - }); - return results; - } - - function reject(iterator, context) { - var results = []; - this.each(function(value, index) { - if (!iterator.call(context, value, index)) - results.push(value); - }); - return results; - } - - function sortBy(iterator, context) { - return this.map(function(value, index) { - return { - value: value, - criteria: iterator.call(context, value, index) - }; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }).pluck('value'); - } - - function toArray() { - return this.map(); - } - - function zip() { - var iterator = Prototype.K, args = $A(arguments); - if (Object.isFunction(args.last())) - iterator = args.pop(); - - var collections = [this].concat(args).map($A); - return this.map(function(value, index) { - return iterator(collections.pluck(index)); - }); - } - - function size() { - return this.toArray().length; - } - - function inspect() { - return '#'; - } - - - - - - - - - - return { - each: each, - eachSlice: eachSlice, - all: all, - every: all, - any: any, - some: any, - collect: collect, - map: collect, - detect: detect, - findAll: findAll, - select: findAll, - filter: findAll, - grep: grep, - include: include, - member: include, - inGroupsOf: inGroupsOf, - inject: inject, - invoke: invoke, - max: max, - min: min, - partition: partition, - pluck: pluck, - reject: reject, - sortBy: sortBy, - toArray: toArray, - entries: toArray, - zip: zip, - size: size, - inspect: inspect, - find: detect - }; -})(); -function $A(iterable) { - if (!iterable) return []; - if ('toArray' in Object(iterable)) return iterable.toArray(); - var length = iterable.length || 0, results = new Array(length); - while (length--) results[length] = iterable[length]; - return results; -} - -function $w(string) { - if (!Object.isString(string)) return []; - string = string.strip(); - return string ? string.split(/\s+/) : []; -} - -Array.from = $A; - - -(function() { - var arrayProto = Array.prototype, - slice = arrayProto.slice, - _each = arrayProto.forEach; // use native browser JS 1.6 implementation if available - - function each(iterator) { - for (var i = 0, length = this.length; i < length; i++) - iterator(this[i]); - } - if (!_each) _each = each; - - function clear() { - this.length = 0; - return this; - } - - function first() { - return this[0]; - } - - function last() { - return this[this.length - 1]; - } - - function compact() { - return this.select(function(value) { - return value != null; - }); - } - - function flatten() { - return this.inject([], function(array, value) { - if (Object.isArray(value)) - return array.concat(value.flatten()); - array.push(value); - return array; - }); - } - - function without() { - var values = slice.call(arguments, 0); - return this.select(function(value) { - return !values.include(value); - }); - } - - function reverse(inline) { - return (inline !== false ? this : this.toArray())._reverse(); - } - - function uniq(sorted) { - return this.inject([], function(array, value, index) { - if (0 == index || (sorted ? array.last() != value : !array.include(value))) - array.push(value); - return array; - }); - } - - function intersect(array) { - return this.uniq().findAll(function(item) { - return array.detect(function(value) { return item === value }); - }); - } - - - function clone() { - return slice.call(this, 0); - } - - function size() { - return this.length; - } - - function inspect() { - return '[' + this.map(Object.inspect).join(', ') + ']'; - } - - function toJSON() { - var results = []; - this.each(function(object) { - var value = Object.toJSON(object); - if (!Object.isUndefined(value)) results.push(value); - }); - return '[' + results.join(', ') + ']'; - } - - function indexOf(item, i) { - i || (i = 0); - var length = this.length; - if (i < 0) i = length + i; - for (; i < length; i++) - if (this[i] === item) return i; - return -1; - } - - function lastIndexOf(item, i) { - i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; - var n = this.slice(0, i).reverse().indexOf(item); - return (n < 0) ? n : i - n - 1; - } - - function concat() { - var array = slice.call(this, 0), item; - for (var i = 0, length = arguments.length; i < length; i++) { - item = arguments[i]; - if (Object.isArray(item) && !('callee' in item)) { - for (var j = 0, arrayLength = item.length; j < arrayLength; j++) - array.push(item[j]); - } else { - array.push(item); - } - } - return array; - } - - Object.extend(arrayProto, Enumerable); - - if (!arrayProto._reverse) - arrayProto._reverse = arrayProto.reverse; - - Object.extend(arrayProto, { - _each: _each, - clear: clear, - first: first, - last: last, - compact: compact, - flatten: flatten, - without: without, - reverse: reverse, - uniq: uniq, - intersect: intersect, - clone: clone, - toArray: clone, - size: size, - inspect: inspect, - toJSON: toJSON - }); - - var CONCAT_ARGUMENTS_BUGGY = (function() { - return [].concat(arguments)[0][0] !== 1; - })(1,2) - - if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat; - - if (!arrayProto.indexOf) arrayProto.indexOf = indexOf; - if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf; -})(); -function $H(object) { - return new Hash(object); -}; - -var Hash = Class.create(Enumerable, (function() { - function initialize(object) { - this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); - } - - function _each(iterator) { - for (var key in this._object) { - var value = this._object[key], pair = [key, value]; - pair.key = key; - pair.value = value; - iterator(pair); - } - } - - function set(key, value) { - return this._object[key] = value; - } - - function get(key) { - if (this._object[key] !== Object.prototype[key]) - return this._object[key]; - } - - function unset(key) { - var value = this._object[key]; - delete this._object[key]; - return value; - } - - function toObject() { - return Object.clone(this._object); - } - - function keys() { - return this.pluck('key'); - } - - function values() { - return this.pluck('value'); - } - - function index(value) { - var match = this.detect(function(pair) { - return pair.value === value; - }); - return match && match.key; - } - - function merge(object) { - return this.clone().update(object); - } - - function update(object) { - return new Hash(object).inject(this, function(result, pair) { - result.set(pair.key, pair.value); - return result; - }); - } - - function toQueryPair(key, value) { - if (Object.isUndefined(value)) return key; - return key + '=' + encodeURIComponent(String.interpret(value)); - } - - function toQueryString() { - return this.inject([], function(results, pair) { - var key = encodeURIComponent(pair.key), values = pair.value; - - if (values && typeof values == 'object') { - if (Object.isArray(values)) - return results.concat(values.map(toQueryPair.curry(key))); - } else results.push(toQueryPair(key, values)); - return results; - }).join('&'); - } - - function inspect() { - return '#'; - } - - function toJSON() { - return Object.toJSON(this.toObject()); - } - - function clone() { - return new Hash(this); - } - - return { - initialize: initialize, - _each: _each, - set: set, - get: get, - unset: unset, - toObject: toObject, - toTemplateReplacements: toObject, - keys: keys, - values: values, - index: index, - merge: merge, - update: update, - toQueryString: toQueryString, - inspect: inspect, - toJSON: toJSON, - clone: clone - }; -})()); - -Hash.from = $H; -Object.extend(Number.prototype, (function() { - function toColorPart() { - return this.toPaddedString(2, 16); - } - - function succ() { - return this + 1; - } - - function times(iterator, context) { - $R(0, this, true).each(iterator, context); - return this; - } - - function toPaddedString(length, radix) { - var string = this.toString(radix || 10); - return '0'.times(length - string.length) + string; - } - - function toJSON() { - return isFinite(this) ? this.toString() : 'null'; - } - - function abs() { - return Math.abs(this); - } - - function round() { - return Math.round(this); - } - - function ceil() { - return Math.ceil(this); - } - - function floor() { - return Math.floor(this); - } - - return { - toColorPart: toColorPart, - succ: succ, - times: times, - toPaddedString: toPaddedString, - toJSON: toJSON, - abs: abs, - round: round, - ceil: ceil, - floor: floor - }; -})()); - -function $R(start, end, exclusive) { - return new ObjectRange(start, end, exclusive); -} - -var ObjectRange = Class.create(Enumerable, (function() { - function initialize(start, end, exclusive) { - this.start = start; - this.end = end; - this.exclusive = exclusive; - } - - function _each(iterator) { - var value = this.start; - while (this.include(value)) { - iterator(value); - value = value.succ(); - } - } - - function include(value) { - if (value < this.start) - return false; - if (this.exclusive) - return value < this.end; - return value <= this.end; - } - - return { - initialize: initialize, - _each: _each, - include: include - }; -})()); - - - -var Ajax = { - getTransport: function() { - return Try.these( - function() {return new XMLHttpRequest()}, - function() {return new ActiveXObject('Msxml2.XMLHTTP')}, - function() {return new ActiveXObject('Microsoft.XMLHTTP')} - ) || false; - }, - - activeRequestCount: 0 -}; - -Ajax.Responders = { - responders: [], - - _each: function(iterator) { - this.responders._each(iterator); - }, - - register: function(responder) { - if (!this.include(responder)) - this.responders.push(responder); - }, - - unregister: function(responder) { - this.responders = this.responders.without(responder); - }, - - dispatch: function(callback, request, transport, json) { - this.each(function(responder) { - if (Object.isFunction(responder[callback])) { - try { - responder[callback].apply(responder, [request, transport, json]); - } catch (e) { } - } - }); - } -}; - -Object.extend(Ajax.Responders, Enumerable); - -Ajax.Responders.register({ - onCreate: function() { Ajax.activeRequestCount++ }, - onComplete: function() { Ajax.activeRequestCount-- } -}); -Ajax.Base = Class.create({ - initialize: function(options) { - this.options = { - method: 'post', - asynchronous: true, - contentType: 'application/x-www-form-urlencoded', - encoding: 'UTF-8', - parameters: '', - evalJSON: true, - evalJS: true - }; - Object.extend(this.options, options || { }); - - this.options.method = this.options.method.toLowerCase(); - - if (Object.isString(this.options.parameters)) - this.options.parameters = this.options.parameters.toQueryParams(); - else if (Object.isHash(this.options.parameters)) - this.options.parameters = this.options.parameters.toObject(); - } -}); -Ajax.Request = Class.create(Ajax.Base, { - _complete: false, - - initialize: function($super, url, options) { - $super(options); - this.transport = Ajax.getTransport(); - this.request(url); - }, - - request: function(url) { - this.url = url; - this.method = this.options.method; - var params = Object.clone(this.options.parameters); - - if (!['get', 'post'].include(this.method)) { - params['_method'] = this.method; - this.method = 'post'; - } - - this.parameters = params; - - if (params = Object.toQueryString(params)) { - if (this.method == 'get') - this.url += (this.url.include('?') ? '&' : '?') + params; - else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) - params += '&_='; - } - - try { - var response = new Ajax.Response(this); - if (this.options.onCreate) this.options.onCreate(response); - Ajax.Responders.dispatch('onCreate', this, response); - - this.transport.open(this.method.toUpperCase(), this.url, - this.options.asynchronous); - - if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); - - this.transport.onreadystatechange = this.onStateChange.bind(this); - this.setRequestHeaders(); - - this.body = this.method == 'post' ? (this.options.postBody || params) : null; - this.transport.send(this.body); - - /* Force Firefox to handle ready state 4 for synchronous requests */ - if (!this.options.asynchronous && this.transport.overrideMimeType) - this.onStateChange(); - - } - catch (e) { - this.dispatchException(e); - } - }, - - onStateChange: function() { - var readyState = this.transport.readyState; - if (readyState > 1 && !((readyState == 4) && this._complete)) - this.respondToReadyState(this.transport.readyState); - }, - - setRequestHeaders: function() { - var headers = { - 'X-Requested-With': 'XMLHttpRequest', - 'X-Prototype-Version': Prototype.Version, - 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' - }; - - if (this.method == 'post') { - headers['Content-type'] = this.options.contentType + - (this.options.encoding ? '; charset=' + this.options.encoding : ''); - - /* Force "Connection: close" for older Mozilla browsers to work - * around a bug where XMLHttpRequest sends an incorrect - * Content-length header. See Mozilla Bugzilla #246651. - */ - if (this.transport.overrideMimeType && - (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) - headers['Connection'] = 'close'; - } - - if (typeof this.options.requestHeaders == 'object') { - var extras = this.options.requestHeaders; - - if (Object.isFunction(extras.push)) - for (var i = 0, length = extras.length; i < length; i += 2) - headers[extras[i]] = extras[i+1]; - else - $H(extras).each(function(pair) { headers[pair.key] = pair.value }); - } - - for (var name in headers) - this.transport.setRequestHeader(name, headers[name]); - }, - - success: function() { - var status = this.getStatus(); - return !status || (status >= 200 && status < 300); - }, - - getStatus: function() { - try { - return this.transport.status || 0; - } catch (e) { return 0 } - }, - - respondToReadyState: function(readyState) { - var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); - - if (state == 'Complete') { - try { - this._complete = true; - (this.options['on' + response.status] - || this.options['on' + (this.success() ? 'Success' : 'Failure')] - || Prototype.emptyFunction)(response, response.headerJSON); - } catch (e) { - this.dispatchException(e); - } - - var contentType = response.getHeader('Content-type'); - if (this.options.evalJS == 'force' - || (this.options.evalJS && this.isSameOrigin() && contentType - && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) - this.evalResponse(); - } - - try { - (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); - Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); - } catch (e) { - this.dispatchException(e); - } - - if (state == 'Complete') { - this.transport.onreadystatechange = Prototype.emptyFunction; - } - }, - - isSameOrigin: function() { - var m = this.url.match(/^\s*https?:\/\/[^\/]*/); - return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({ - protocol: location.protocol, - domain: document.domain, - port: location.port ? ':' + location.port : '' - })); - }, - - getHeader: function(name) { - try { - return this.transport.getResponseHeader(name) || null; - } catch (e) { return null; } - }, - - evalResponse: function() { - try { - return eval((this.transport.responseText || '').unfilterJSON()); - } catch (e) { - this.dispatchException(e); - } - }, - - dispatchException: function(exception) { - (this.options.onException || Prototype.emptyFunction)(this, exception); - Ajax.Responders.dispatch('onException', this, exception); - } -}); - -Ajax.Request.Events = - ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; - - - - - - - - -Ajax.Response = Class.create({ - initialize: function(request){ - this.request = request; - var transport = this.transport = request.transport, - readyState = this.readyState = transport.readyState; - - if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { - this.status = this.getStatus(); - this.statusText = this.getStatusText(); - this.responseText = String.interpret(transport.responseText); - this.headerJSON = this._getHeaderJSON(); - } - - if(readyState == 4) { - var xml = transport.responseXML; - this.responseXML = Object.isUndefined(xml) ? null : xml; - this.responseJSON = this._getResponseJSON(); - } - }, - - status: 0, - - statusText: '', - - getStatus: Ajax.Request.prototype.getStatus, - - getStatusText: function() { - try { - return this.transport.statusText || ''; - } catch (e) { return '' } - }, - - getHeader: Ajax.Request.prototype.getHeader, - - getAllHeaders: function() { - try { - return this.getAllResponseHeaders(); - } catch (e) { return null } - }, - - getResponseHeader: function(name) { - return this.transport.getResponseHeader(name); - }, - - getAllResponseHeaders: function() { - return this.transport.getAllResponseHeaders(); - }, - - _getHeaderJSON: function() { - var json = this.getHeader('X-JSON'); - if (!json) return null; - json = decodeURIComponent(escape(json)); - try { - return json.evalJSON(this.request.options.sanitizeJSON || - !this.request.isSameOrigin()); - } catch (e) { - this.request.dispatchException(e); - } - }, - - _getResponseJSON: function() { - var options = this.request.options; - if (!options.evalJSON || (options.evalJSON != 'force' && - !(this.getHeader('Content-type') || '').include('application/json')) || - this.responseText.blank()) - return null; - try { - return this.responseText.evalJSON(options.sanitizeJSON || - !this.request.isSameOrigin()); - } catch (e) { - this.request.dispatchException(e); - } - } -}); - -Ajax.Updater = Class.create(Ajax.Request, { - initialize: function($super, container, url, options) { - this.container = { - success: (container.success || container), - failure: (container.failure || (container.success ? null : container)) - }; - - options = Object.clone(options); - var onComplete = options.onComplete; - options.onComplete = (function(response, json) { - this.updateContent(response.responseText); - if (Object.isFunction(onComplete)) onComplete(response, json); - }).bind(this); - - $super(url, options); - }, - - updateContent: function(responseText) { - var receiver = this.container[this.success() ? 'success' : 'failure'], - options = this.options; - - if (!options.evalScripts) responseText = responseText.stripScripts(); - - if (receiver = $(receiver)) { - if (options.insertion) { - if (Object.isString(options.insertion)) { - var insertion = { }; insertion[options.insertion] = responseText; - receiver.insert(insertion); - } - else options.insertion(receiver, responseText); - } - else receiver.update(responseText); - } - } -}); - -Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { - initialize: function($super, container, url, options) { - $super(options); - this.onComplete = this.options.onComplete; - - this.frequency = (this.options.frequency || 2); - this.decay = (this.options.decay || 1); - - this.updater = { }; - this.container = container; - this.url = url; - - this.start(); - }, - - start: function() { - this.options.onComplete = this.updateComplete.bind(this); - this.onTimerEvent(); - }, - - stop: function() { - this.updater.options.onComplete = undefined; - clearTimeout(this.timer); - (this.onComplete || Prototype.emptyFunction).apply(this, arguments); - }, - - updateComplete: function(response) { - if (this.options.decay) { - this.decay = (response.responseText == this.lastText ? - this.decay * this.options.decay : 1); - - this.lastText = response.responseText; - } - this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); - }, - - onTimerEvent: function() { - this.updater = new Ajax.Updater(this.container, this.url, this.options); - } -}); - - - -function $(element) { - if (arguments.length > 1) { - for (var i = 0, elements = [], length = arguments.length; i < length; i++) - elements.push($(arguments[i])); - return elements; - } - if (Object.isString(element)) - element = document.getElementById(element); - return Element.extend(element); -} - -if (Prototype.BrowserFeatures.XPath) { - document._getElementsByXPath = function(expression, parentElement) { - var results = []; - var query = document.evaluate(expression, $(parentElement) || document, - null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - for (var i = 0, length = query.snapshotLength; i < length; i++) - results.push(Element.extend(query.snapshotItem(i))); - return results; - }; -} - -/*--------------------------------------------------------------------------*/ - -if (!window.Node) var Node = { }; - -if (!Node.ELEMENT_NODE) { - Object.extend(Node, { - ELEMENT_NODE: 1, - ATTRIBUTE_NODE: 2, - TEXT_NODE: 3, - CDATA_SECTION_NODE: 4, - ENTITY_REFERENCE_NODE: 5, - ENTITY_NODE: 6, - PROCESSING_INSTRUCTION_NODE: 7, - COMMENT_NODE: 8, - DOCUMENT_NODE: 9, - DOCUMENT_TYPE_NODE: 10, - DOCUMENT_FRAGMENT_NODE: 11, - NOTATION_NODE: 12 - }); -} - - -(function(global) { - - var SETATTRIBUTE_IGNORES_NAME = (function(){ - var elForm = document.createElement("form"); - var elInput = document.createElement("input"); - var root = document.documentElement; - elInput.setAttribute("name", "test"); - elForm.appendChild(elInput); - root.appendChild(elForm); - var isBuggy = elForm.elements - ? (typeof elForm.elements.test == "undefined") - : null; - root.removeChild(elForm); - elForm = elInput = null; - return isBuggy; - })(); - - var element = global.Element; - global.Element = function(tagName, attributes) { - attributes = attributes || { }; - tagName = tagName.toLowerCase(); - var cache = Element.cache; - if (SETATTRIBUTE_IGNORES_NAME && attributes.name) { - tagName = '<' + tagName + ' name="' + attributes.name + '">'; - delete attributes.name; - return Element.writeAttribute(document.createElement(tagName), attributes); - } - if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); - return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); - }; - Object.extend(global.Element, element || { }); - if (element) global.Element.prototype = element.prototype; -})(this); - -Element.cache = { }; -Element.idCounter = 1; - -Element.Methods = { - visible: function(element) { - return $(element).style.display != 'none'; - }, - - toggle: function(element) { - element = $(element); - Element[Element.visible(element) ? 'hide' : 'show'](element); - return element; - }, - - - hide: function(element) { - element = $(element); - element.style.display = 'none'; - return element; - }, - - show: function(element) { - element = $(element); - element.style.display = ''; - return element; - }, - - remove: function(element) { - element = $(element); - element.parentNode.removeChild(element); - return element; - }, - - update: (function(){ - - var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){ - var el = document.createElement("select"), - isBuggy = true; - el.innerHTML = ""; - if (el.options && el.options[0]) { - isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION"; - } - el = null; - return isBuggy; - })(); - - var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){ - try { - var el = document.createElement("table"); - if (el && el.tBodies) { - el.innerHTML = "test"; - var isBuggy = typeof el.tBodies[0] == "undefined"; - el = null; - return isBuggy; - } - } catch (e) { - return true; - } - })(); - - var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () { - var s = document.createElement("script"), - isBuggy = false; - try { - s.appendChild(document.createTextNode("")); - isBuggy = !s.firstChild || - s.firstChild && s.firstChild.nodeType !== 3; - } catch (e) { - isBuggy = true; - } - s = null; - return isBuggy; - })(); - - function update(element, content) { - element = $(element); - - if (content && content.toElement) - content = content.toElement(); - - if (Object.isElement(content)) - return element.update().insert(content); - - content = Object.toHTML(content); - - var tagName = element.tagName.toUpperCase(); - - if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) { - element.text = content; - return element; - } - - if (SELECT_ELEMENT_INNERHTML_BUGGY || TABLE_ELEMENT_INNERHTML_BUGGY) { - if (tagName in Element._insertionTranslations.tags) { - while (element.firstChild) { - element.removeChild(element.firstChild); - } - Element._getContentFromAnonymousElement(tagName, content.stripScripts()) - .each(function(node) { - element.appendChild(node) - }); - } - else { - element.innerHTML = content.stripScripts(); - } - } - else { - element.innerHTML = content.stripScripts(); - } - - content.evalScripts.bind(content).defer(); - return element; - } - - return update; - })(), - - replace: function(element, content) { - element = $(element); - if (content && content.toElement) content = content.toElement(); - else if (!Object.isElement(content)) { - content = Object.toHTML(content); - var range = element.ownerDocument.createRange(); - range.selectNode(element); - content.evalScripts.bind(content).defer(); - content = range.createContextualFragment(content.stripScripts()); - } - element.parentNode.replaceChild(content, element); - return element; - }, - - insert: function(element, insertions) { - element = $(element); - - if (Object.isString(insertions) || Object.isNumber(insertions) || - Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) - insertions = {bottom:insertions}; - - var content, insert, tagName, childNodes; - - for (var position in insertions) { - content = insertions[position]; - position = position.toLowerCase(); - insert = Element._insertionTranslations[position]; - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) { - insert(element, content); - continue; - } - - content = Object.toHTML(content); - - tagName = ((position == 'before' || position == 'after') - ? element.parentNode : element).tagName.toUpperCase(); - - childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); - - if (position == 'top' || position == 'after') childNodes.reverse(); - childNodes.each(insert.curry(element)); - - content.evalScripts.bind(content).defer(); - } - - return element; - }, - - wrap: function(element, wrapper, attributes) { - element = $(element); - if (Object.isElement(wrapper)) - $(wrapper).writeAttribute(attributes || { }); - else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); - else wrapper = new Element('div', wrapper); - if (element.parentNode) - element.parentNode.replaceChild(wrapper, element); - wrapper.appendChild(element); - return wrapper; - }, - - inspect: function(element) { - element = $(element); - var result = '<' + element.tagName.toLowerCase(); - $H({'id': 'id', 'className': 'class'}).each(function(pair) { - var property = pair.first(), attribute = pair.last(); - var value = (element[property] || '').toString(); - if (value) result += ' ' + attribute + '=' + value.inspect(true); - }); - return result + '>'; - }, - - recursivelyCollect: function(element, property) { - element = $(element); - var elements = []; - while (element = element[property]) - if (element.nodeType == 1) - elements.push(Element.extend(element)); - return elements; - }, - - ancestors: function(element) { - return Element.recursivelyCollect(element, 'parentNode'); - }, - - descendants: function(element) { - return Element.select(element, "*"); - }, - - firstDescendant: function(element) { - element = $(element).firstChild; - while (element && element.nodeType != 1) element = element.nextSibling; - return $(element); - }, - - immediateDescendants: function(element) { - if (!(element = $(element).firstChild)) return []; - while (element && element.nodeType != 1) element = element.nextSibling; - if (element) return [element].concat($(element).nextSiblings()); - return []; - }, - - previousSiblings: function(element) { - return Element.recursivelyCollect(element, 'previousSibling'); - }, - - nextSiblings: function(element) { - return Element.recursivelyCollect(element, 'nextSibling'); - }, - - siblings: function(element) { - element = $(element); - return Element.previousSiblings(element).reverse() - .concat(Element.nextSiblings(element)); - }, - - match: function(element, selector) { - if (Object.isString(selector)) - selector = new Selector(selector); - return selector.match($(element)); - }, - - up: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(element.parentNode); - var ancestors = Element.ancestors(element); - return Object.isNumber(expression) ? ancestors[expression] : - Selector.findElement(ancestors, expression, index); - }, - - down: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return Element.firstDescendant(element); - return Object.isNumber(expression) ? Element.descendants(element)[expression] : - Element.select(element, expression)[index || 0]; - }, - - previous: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element)); - var previousSiblings = Element.previousSiblings(element); - return Object.isNumber(expression) ? previousSiblings[expression] : - Selector.findElement(previousSiblings, expression, index); - }, - - next: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element)); - var nextSiblings = Element.nextSiblings(element); - return Object.isNumber(expression) ? nextSiblings[expression] : - Selector.findElement(nextSiblings, expression, index); - }, - - - select: function(element) { - var args = Array.prototype.slice.call(arguments, 1); - return Selector.findChildElements(element, args); - }, - - adjacent: function(element) { - var args = Array.prototype.slice.call(arguments, 1); - return Selector.findChildElements(element.parentNode, args).without(element); - }, - - identify: function(element) { - element = $(element); - var id = Element.readAttribute(element, 'id'); - if (id) return id; - do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id)); - Element.writeAttribute(element, 'id', id); - return id; - }, - - readAttribute: function(element, name) { - element = $(element); - if (Prototype.Browser.IE) { - var t = Element._attributeTranslations.read; - if (t.values[name]) return t.values[name](element, name); - if (t.names[name]) name = t.names[name]; - if (name.include(':')) { - return (!element.attributes || !element.attributes[name]) ? null : - element.attributes[name].value; - } - } - return element.getAttribute(name); - }, - - writeAttribute: function(element, name, value) { - element = $(element); - var attributes = { }, t = Element._attributeTranslations.write; - - if (typeof name == 'object') attributes = name; - else attributes[name] = Object.isUndefined(value) ? true : value; - - for (var attr in attributes) { - name = t.names[attr] || attr; - value = attributes[attr]; - if (t.values[attr]) name = t.values[attr](element, value); - if (value === false || value === null) - element.removeAttribute(name); - else if (value === true) - element.setAttribute(name, name); - else element.setAttribute(name, value); - } - return element; - }, - - getHeight: function(element) { - return Element.getDimensions(element).height; - }, - - getWidth: function(element) { - return Element.getDimensions(element).width; - }, - - classNames: function(element) { - return new Element.ClassNames(element); - }, - - hasClassName: function(element, className) { - if (!(element = $(element))) return; - var elementClassName = element.className; - return (elementClassName.length > 0 && (elementClassName == className || - new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); - }, - - addClassName: function(element, className) { - if (!(element = $(element))) return; - if (!Element.hasClassName(element, className)) - element.className += (element.className ? ' ' : '') + className; - return element; - }, - - removeClassName: function(element, className) { - if (!(element = $(element))) return; - element.className = element.className.replace( - new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); - return element; - }, - - toggleClassName: function(element, className) { - if (!(element = $(element))) return; - return Element[Element.hasClassName(element, className) ? - 'removeClassName' : 'addClassName'](element, className); - }, - - cleanWhitespace: function(element) { - element = $(element); - var node = element.firstChild; - while (node) { - var nextNode = node.nextSibling; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) - element.removeChild(node); - node = nextNode; - } - return element; - }, - - empty: function(element) { - return $(element).innerHTML.blank(); - }, - - descendantOf: function(element, ancestor) { - element = $(element), ancestor = $(ancestor); - - if (element.compareDocumentPosition) - return (element.compareDocumentPosition(ancestor) & 8) === 8; - - if (ancestor.contains) - return ancestor.contains(element) && ancestor !== element; - - while (element = element.parentNode) - if (element == ancestor) return true; - - return false; - }, - - scrollTo: function(element) { - element = $(element); - var pos = Element.cumulativeOffset(element); - window.scrollTo(pos[0], pos[1]); - return element; - }, - - getStyle: function(element, style) { - element = $(element); - style = style == 'float' ? 'cssFloat' : style.camelize(); - var value = element.style[style]; - if (!value || value == 'auto') { - var css = document.defaultView.getComputedStyle(element, null); - value = css ? css[style] : null; - } - if (style == 'opacity') return value ? parseFloat(value) : 1.0; - return value == 'auto' ? null : value; - }, - - getOpacity: function(element) { - return $(element).getStyle('opacity'); - }, - - setStyle: function(element, styles) { - element = $(element); - var elementStyle = element.style, match; - if (Object.isString(styles)) { - element.style.cssText += ';' + styles; - return styles.include('opacity') ? - element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; - } - for (var property in styles) - if (property == 'opacity') element.setOpacity(styles[property]); - else - elementStyle[(property == 'float' || property == 'cssFloat') ? - (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : - property] = styles[property]; - - return element; - }, - - setOpacity: function(element, value) { - element = $(element); - element.style.opacity = (value == 1 || value === '') ? '' : - (value < 0.00001) ? 0 : value; - return element; - }, - - getDimensions: function(element) { - element = $(element); - var display = Element.getStyle(element, 'display'); - if (display != 'none' && display != null) // Safari bug - return {width: element.offsetWidth, height: element.offsetHeight}; - - var els = element.style; - var originalVisibility = els.visibility; - var originalPosition = els.position; - var originalDisplay = els.display; - els.visibility = 'hidden'; - if (originalPosition != 'fixed') // Switching fixed to absolute causes issues in Safari - els.position = 'absolute'; - els.display = 'block'; - var originalWidth = element.clientWidth; - var originalHeight = element.clientHeight; - els.display = originalDisplay; - els.position = originalPosition; - els.visibility = originalVisibility; - return {width: originalWidth, height: originalHeight}; - }, - - makePositioned: function(element) { - element = $(element); - var pos = Element.getStyle(element, 'position'); - if (pos == 'static' || !pos) { - element._madePositioned = true; - element.style.position = 'relative'; - if (Prototype.Browser.Opera) { - element.style.top = 0; - element.style.left = 0; - } - } - return element; - }, - - undoPositioned: function(element) { - element = $(element); - if (element._madePositioned) { - element._madePositioned = undefined; - element.style.position = - element.style.top = - element.style.left = - element.style.bottom = - element.style.right = ''; - } - return element; - }, - - makeClipping: function(element) { - element = $(element); - if (element._overflow) return element; - element._overflow = Element.getStyle(element, 'overflow') || 'auto'; - if (element._overflow !== 'hidden') - element.style.overflow = 'hidden'; - return element; - }, - - undoClipping: function(element) { - element = $(element); - if (!element._overflow) return element; - element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; - element._overflow = null; - return element; - }, - - cumulativeOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - positionedOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - if (element) { - if (element.tagName.toUpperCase() == 'BODY') break; - var p = Element.getStyle(element, 'position'); - if (p !== 'static') break; - } - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - absolutize: function(element) { - element = $(element); - if (Element.getStyle(element, 'position') == 'absolute') return element; - - var offsets = Element.positionedOffset(element); - var top = offsets[1]; - var left = offsets[0]; - var width = element.clientWidth; - var height = element.clientHeight; - - element._originalLeft = left - parseFloat(element.style.left || 0); - element._originalTop = top - parseFloat(element.style.top || 0); - element._originalWidth = element.style.width; - element._originalHeight = element.style.height; - - element.style.position = 'absolute'; - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.width = width + 'px'; - element.style.height = height + 'px'; - return element; - }, - - relativize: function(element) { - element = $(element); - if (Element.getStyle(element, 'position') == 'relative') return element; - - element.style.position = 'relative'; - var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); - var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); - - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.height = element._originalHeight; - element.style.width = element._originalWidth; - return element; - }, - - cumulativeScrollOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.scrollTop || 0; - valueL += element.scrollLeft || 0; - element = element.parentNode; - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - getOffsetParent: function(element) { - if (element.offsetParent) return $(element.offsetParent); - if (element == document.body) return $(element); - - while ((element = element.parentNode) && element != document.body) - if (Element.getStyle(element, 'position') != 'static') - return $(element); - - return $(document.body); - }, - - viewportOffset: function(forElement) { - var valueT = 0, valueL = 0; - - var element = forElement; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - - if (element.offsetParent == document.body && - Element.getStyle(element, 'position') == 'absolute') break; - - } while (element = element.offsetParent); - - element = forElement; - do { - if (!Prototype.Browser.Opera || (element.tagName && (element.tagName.toUpperCase() == 'BODY'))) { - valueT -= element.scrollTop || 0; - valueL -= element.scrollLeft || 0; - } - } while (element = element.parentNode); - - return Element._returnOffset(valueL, valueT); - }, - - clonePosition: function(element, source) { - var options = Object.extend({ - setLeft: true, - setTop: true, - setWidth: true, - setHeight: true, - offsetTop: 0, - offsetLeft: 0 - }, arguments[2] || { }); - - source = $(source); - var p = Element.viewportOffset(source); - - element = $(element); - var delta = [0, 0]; - var parent = null; - if (Element.getStyle(element, 'position') == 'absolute') { - parent = Element.getOffsetParent(element); - delta = Element.viewportOffset(parent); - } - - if (parent == document.body) { - delta[0] -= document.body.offsetLeft; - delta[1] -= document.body.offsetTop; - } - - if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; - if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; - if (options.setWidth) element.style.width = source.offsetWidth + 'px'; - if (options.setHeight) element.style.height = source.offsetHeight + 'px'; - return element; - } -}; - -Object.extend(Element.Methods, { - getElementsBySelector: Element.Methods.select, - - childElements: Element.Methods.immediateDescendants -}); - -Element._attributeTranslations = { - write: { - names: { - className: 'class', - htmlFor: 'for' - }, - values: { } - } -}; - -if (Prototype.Browser.Opera) { - Element.Methods.getStyle = Element.Methods.getStyle.wrap( - function(proceed, element, style) { - switch (style) { - case 'left': case 'top': case 'right': case 'bottom': - if (proceed(element, 'position') === 'static') return null; - case 'height': case 'width': - if (!Element.visible(element)) return null; - - var dim = parseInt(proceed(element, style), 10); - - if (dim !== element['offset' + style.capitalize()]) - return dim + 'px'; - - var properties; - if (style === 'height') { - properties = ['border-top-width', 'padding-top', - 'padding-bottom', 'border-bottom-width']; - } - else { - properties = ['border-left-width', 'padding-left', - 'padding-right', 'border-right-width']; - } - return properties.inject(dim, function(memo, property) { - var val = proceed(element, property); - return val === null ? memo : memo - parseInt(val, 10); - }) + 'px'; - default: return proceed(element, style); - } - } - ); - - Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( - function(proceed, element, attribute) { - if (attribute === 'title') return element.title; - return proceed(element, attribute); - } - ); -} - -else if (Prototype.Browser.IE) { - Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap( - function(proceed, element) { - element = $(element); - try { element.offsetParent } - catch(e) { return $(document.body) } - var position = element.getStyle('position'); - if (position !== 'static') return proceed(element); - element.setStyle({ position: 'relative' }); - var value = proceed(element); - element.setStyle({ position: position }); - return value; - } - ); - - $w('positionedOffset viewportOffset').each(function(method) { - Element.Methods[method] = Element.Methods[method].wrap( - function(proceed, element) { - element = $(element); - try { element.offsetParent } - catch(e) { return Element._returnOffset(0,0) } - var position = element.getStyle('position'); - if (position !== 'static') return proceed(element); - var offsetParent = element.getOffsetParent(); - if (offsetParent && offsetParent.getStyle('position') === 'fixed') - offsetParent.setStyle({ zoom: 1 }); - element.setStyle({ position: 'relative' }); - var value = proceed(element); - element.setStyle({ position: position }); - return value; - } - ); - }); - - Element.Methods.cumulativeOffset = Element.Methods.cumulativeOffset.wrap( - function(proceed, element) { - try { element.offsetParent } - catch(e) { return Element._returnOffset(0,0) } - return proceed(element); - } - ); - - Element.Methods.getStyle = function(element, style) { - element = $(element); - style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); - var value = element.style[style]; - if (!value && element.currentStyle) value = element.currentStyle[style]; - - if (style == 'opacity') { - if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) - if (value[1]) return parseFloat(value[1]) / 100; - return 1.0; - } - - if (value == 'auto') { - if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) - return element['offset' + style.capitalize()] + 'px'; - return null; - } - return value; - }; - - Element.Methods.setOpacity = function(element, value) { - function stripAlpha(filter){ - return filter.replace(/alpha\([^\)]*\)/gi,''); - } - element = $(element); - var currentStyle = element.currentStyle; - if ((currentStyle && !currentStyle.hasLayout) || - (!currentStyle && element.style.zoom == 'normal')) - element.style.zoom = 1; - - var filter = element.getStyle('filter'), style = element.style; - if (value == 1 || value === '') { - (filter = stripAlpha(filter)) ? - style.filter = filter : style.removeAttribute('filter'); - return element; - } else if (value < 0.00001) value = 0; - style.filter = stripAlpha(filter) + - 'alpha(opacity=' + (value * 100) + ')'; - return element; - }; - - Element._attributeTranslations = (function(){ - - var classProp = 'className'; - var forProp = 'for'; - - var el = document.createElement('div'); - - el.setAttribute(classProp, 'x'); - - if (el.className !== 'x') { - el.setAttribute('class', 'x'); - if (el.className === 'x') { - classProp = 'class'; - } - } - el = null; - - el = document.createElement('label'); - el.setAttribute(forProp, 'x'); - if (el.htmlFor !== 'x') { - el.setAttribute('htmlFor', 'x'); - if (el.htmlFor === 'x') { - forProp = 'htmlFor'; - } - } - el = null; - - return { - read: { - names: { - 'class': classProp, - 'className': classProp, - 'for': forProp, - 'htmlFor': forProp - }, - values: { - _getAttr: function(element, attribute) { - return element.getAttribute(attribute); - }, - _getAttr2: function(element, attribute) { - return element.getAttribute(attribute, 2); - }, - _getAttrNode: function(element, attribute) { - var node = element.getAttributeNode(attribute); - return node ? node.value : ""; - }, - _getEv: (function(){ - - var el = document.createElement('div'); - el.onclick = Prototype.emptyFunction; - var value = el.getAttribute('onclick'); - var f; - - if (String(value).indexOf('{') > -1) { - f = function(element, attribute) { - attribute = element.getAttribute(attribute); - if (!attribute) return null; - attribute = attribute.toString(); - attribute = attribute.split('{')[1]; - attribute = attribute.split('}')[0]; - return attribute.strip(); - }; - } - else if (value === '') { - f = function(element, attribute) { - attribute = element.getAttribute(attribute); - if (!attribute) return null; - return attribute.strip(); - }; - } - el = null; - return f; - })(), - _flag: function(element, attribute) { - return $(element).hasAttribute(attribute) ? attribute : null; - }, - style: function(element) { - return element.style.cssText.toLowerCase(); - }, - title: function(element) { - return element.title; - } - } - } - } - })(); - - Element._attributeTranslations.write = { - names: Object.extend({ - cellpadding: 'cellPadding', - cellspacing: 'cellSpacing' - }, Element._attributeTranslations.read.names), - values: { - checked: function(element, value) { - element.checked = !!value; - }, - - style: function(element, value) { - element.style.cssText = value ? value : ''; - } - } - }; - - Element._attributeTranslations.has = {}; - - $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + - 'encType maxLength readOnly longDesc frameBorder').each(function(attr) { - Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; - Element._attributeTranslations.has[attr.toLowerCase()] = attr; - }); - - (function(v) { - Object.extend(v, { - href: v._getAttr2, - src: v._getAttr2, - type: v._getAttr, - action: v._getAttrNode, - disabled: v._flag, - checked: v._flag, - readonly: v._flag, - multiple: v._flag, - onload: v._getEv, - onunload: v._getEv, - onclick: v._getEv, - ondblclick: v._getEv, - onmousedown: v._getEv, - onmouseup: v._getEv, - onmouseover: v._getEv, - onmousemove: v._getEv, - onmouseout: v._getEv, - onfocus: v._getEv, - onblur: v._getEv, - onkeypress: v._getEv, - onkeydown: v._getEv, - onkeyup: v._getEv, - onsubmit: v._getEv, - onreset: v._getEv, - onselect: v._getEv, - onchange: v._getEv - }); - })(Element._attributeTranslations.read.values); - - if (Prototype.BrowserFeatures.ElementExtensions) { - (function() { - function _descendants(element) { - var nodes = element.getElementsByTagName('*'), results = []; - for (var i = 0, node; node = nodes[i]; i++) - if (node.tagName !== "!") // Filter out comment nodes. - results.push(node); - return results; - } - - Element.Methods.down = function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return element.firstDescendant(); - return Object.isNumber(expression) ? _descendants(element)[expression] : - Element.select(element, expression)[index || 0]; - } - })(); - } - -} - -else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { - Element.Methods.setOpacity = function(element, value) { - element = $(element); - element.style.opacity = (value == 1) ? 0.999999 : - (value === '') ? '' : (value < 0.00001) ? 0 : value; - return element; - }; -} - -else if (Prototype.Browser.WebKit) { - Element.Methods.setOpacity = function(element, value) { - element = $(element); - element.style.opacity = (value == 1 || value === '') ? '' : - (value < 0.00001) ? 0 : value; - - if (value == 1) - if(element.tagName.toUpperCase() == 'IMG' && element.width) { - element.width++; element.width--; - } else try { - var n = document.createTextNode(' '); - element.appendChild(n); - element.removeChild(n); - } catch (e) { } - - return element; - }; - - Element.Methods.cumulativeOffset = function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - if (element.offsetParent == document.body) - if (Element.getStyle(element, 'position') == 'absolute') break; - - element = element.offsetParent; - } while (element); - - return Element._returnOffset(valueL, valueT); - }; -} - -if ('outerHTML' in document.documentElement) { - Element.Methods.replace = function(element, content) { - element = $(element); - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) { - element.parentNode.replaceChild(content, element); - return element; - } - - content = Object.toHTML(content); - var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); - - if (Element._insertionTranslations.tags[tagName]) { - var nextSibling = element.next(); - var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); - parent.removeChild(element); - if (nextSibling) - fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); - else - fragments.each(function(node) { parent.appendChild(node) }); - } - else element.outerHTML = content.stripScripts(); - - content.evalScripts.bind(content).defer(); - return element; - }; -} - -Element._returnOffset = function(l, t) { - var result = [l, t]; - result.left = l; - result.top = t; - return result; -}; - -Element._getContentFromAnonymousElement = function(tagName, html) { - var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; - if (t) { - div.innerHTML = t[0] + html + t[1]; - t[2].times(function() { div = div.firstChild }); - } else div.innerHTML = html; - return $A(div.childNodes); -}; - -Element._insertionTranslations = { - before: function(element, node) { - element.parentNode.insertBefore(node, element); - }, - top: function(element, node) { - element.insertBefore(node, element.firstChild); - }, - bottom: function(element, node) { - element.appendChild(node); - }, - after: function(element, node) { - element.parentNode.insertBefore(node, element.nextSibling); - }, - tags: { - TABLE: ['', '
      ', 1], - TBODY: ['', '
      ', 2], - TR: ['', '
      ', 3], - TD: ['
      ', '
      ', 4], - SELECT: ['', 1] - } -}; - -(function() { - var tags = Element._insertionTranslations.tags; - Object.extend(tags, { - THEAD: tags.TBODY, - TFOOT: tags.TBODY, - TH: tags.TD - }); -})(); - -Element.Methods.Simulated = { - hasAttribute: function(element, attribute) { - attribute = Element._attributeTranslations.has[attribute] || attribute; - var node = $(element).getAttributeNode(attribute); - return !!(node && node.specified); - } -}; - -Element.Methods.ByTag = { }; - -Object.extend(Element, Element.Methods); - -(function(div) { - - if (!Prototype.BrowserFeatures.ElementExtensions && div['__proto__']) { - window.HTMLElement = { }; - window.HTMLElement.prototype = div['__proto__']; - Prototype.BrowserFeatures.ElementExtensions = true; - } - - div = null; - -})(document.createElement('div')) - -Element.extend = (function() { - - function checkDeficiency(tagName) { - if (typeof window.Element != 'undefined') { - var proto = window.Element.prototype; - if (proto) { - var id = '_' + (Math.random()+'').slice(2); - var el = document.createElement(tagName); - proto[id] = 'x'; - var isBuggy = (el[id] !== 'x'); - delete proto[id]; - el = null; - return isBuggy; - } - } - return false; - } - - function extendElementWith(element, methods) { - for (var property in methods) { - var value = methods[property]; - if (Object.isFunction(value) && !(property in element)) - element[property] = value.methodize(); - } - } - - var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkDeficiency('object'); - - if (Prototype.BrowserFeatures.SpecificElementExtensions) { - if (HTMLOBJECTELEMENT_PROTOTYPE_BUGGY) { - return function(element) { - if (element && typeof element._extendedByPrototype == 'undefined') { - var t = element.tagName; - if (t && (/^(?:object|applet|embed)$/i.test(t))) { - extendElementWith(element, Element.Methods); - extendElementWith(element, Element.Methods.Simulated); - extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]); - } - } - return element; - } - } - return Prototype.K; - } - - var Methods = { }, ByTag = Element.Methods.ByTag; - - var extend = Object.extend(function(element) { - if (!element || typeof element._extendedByPrototype != 'undefined' || - element.nodeType != 1 || element == window) return element; - - var methods = Object.clone(Methods), - tagName = element.tagName.toUpperCase(); - - if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); - - extendElementWith(element, methods); - - element._extendedByPrototype = Prototype.emptyFunction; - return element; - - }, { - refresh: function() { - if (!Prototype.BrowserFeatures.ElementExtensions) { - Object.extend(Methods, Element.Methods); - Object.extend(Methods, Element.Methods.Simulated); - } - } - }); - - extend.refresh(); - return extend; -})(); - -Element.hasAttribute = function(element, attribute) { - if (element.hasAttribute) return element.hasAttribute(attribute); - return Element.Methods.Simulated.hasAttribute(element, attribute); -}; - -Element.addMethods = function(methods) { - var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; - - if (!methods) { - Object.extend(Form, Form.Methods); - Object.extend(Form.Element, Form.Element.Methods); - Object.extend(Element.Methods.ByTag, { - "FORM": Object.clone(Form.Methods), - "INPUT": Object.clone(Form.Element.Methods), - "SELECT": Object.clone(Form.Element.Methods), - "TEXTAREA": Object.clone(Form.Element.Methods) - }); - } - - if (arguments.length == 2) { - var tagName = methods; - methods = arguments[1]; - } - - if (!tagName) Object.extend(Element.Methods, methods || { }); - else { - if (Object.isArray(tagName)) tagName.each(extend); - else extend(tagName); - } - - function extend(tagName) { - tagName = tagName.toUpperCase(); - if (!Element.Methods.ByTag[tagName]) - Element.Methods.ByTag[tagName] = { }; - Object.extend(Element.Methods.ByTag[tagName], methods); - } - - function copy(methods, destination, onlyIfAbsent) { - onlyIfAbsent = onlyIfAbsent || false; - for (var property in methods) { - var value = methods[property]; - if (!Object.isFunction(value)) continue; - if (!onlyIfAbsent || !(property in destination)) - destination[property] = value.methodize(); - } - } - - function findDOMClass(tagName) { - var klass; - var trans = { - "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", - "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", - "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", - "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", - "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": - "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": - "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": - "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": - "FrameSet", "IFRAME": "IFrame" - }; - if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; - if (window[klass]) return window[klass]; - klass = 'HTML' + tagName + 'Element'; - if (window[klass]) return window[klass]; - klass = 'HTML' + tagName.capitalize() + 'Element'; - if (window[klass]) return window[klass]; - - var element = document.createElement(tagName); - var proto = element['__proto__'] || element.constructor.prototype; - element = null; - return proto; - } - - var elementPrototype = window.HTMLElement ? HTMLElement.prototype : - Element.prototype; - - if (F.ElementExtensions) { - copy(Element.Methods, elementPrototype); - copy(Element.Methods.Simulated, elementPrototype, true); - } - - if (F.SpecificElementExtensions) { - for (var tag in Element.Methods.ByTag) { - var klass = findDOMClass(tag); - if (Object.isUndefined(klass)) continue; - copy(T[tag], klass.prototype); - } - } - - Object.extend(Element, Element.Methods); - delete Element.ByTag; - - if (Element.extend.refresh) Element.extend.refresh(); - Element.cache = { }; -}; - - -document.viewport = { - - getDimensions: function() { - return { width: this.getWidth(), height: this.getHeight() }; - }, - - getScrollOffsets: function() { - return Element._returnOffset( - window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, - window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); - } -}; - -(function(viewport) { - var B = Prototype.Browser, doc = document, element, property = {}; - - function getRootElement() { - if (B.WebKit && !doc.evaluate) - return document; - - if (B.Opera && window.parseFloat(window.opera.version()) < 9.5) - return document.body; - - return document.documentElement; - } - - function define(D) { - if (!element) element = getRootElement(); - - property[D] = 'client' + D; - - viewport['get' + D] = function() { return element[property[D]] }; - return viewport['get' + D](); - } - - viewport.getWidth = define.curry('Width'); - - viewport.getHeight = define.curry('Height'); -})(document.viewport); - - -Element.Storage = { - UID: 1 -}; - -Element.addMethods({ - getStorage: function(element) { - if (!(element = $(element))) return; - - var uid; - if (element === window) { - uid = 0; - } else { - if (typeof element._prototypeUID === "undefined") - element._prototypeUID = [Element.Storage.UID++]; - uid = element._prototypeUID[0]; - } - - if (!Element.Storage[uid]) - Element.Storage[uid] = $H(); - - return Element.Storage[uid]; - }, - - store: function(element, key, value) { - if (!(element = $(element))) return; - - if (arguments.length === 2) { - Element.getStorage(element).update(key); - } else { - Element.getStorage(element).set(key, value); - } - - return element; - }, - - retrieve: function(element, key, defaultValue) { - if (!(element = $(element))) return; - var hash = Element.getStorage(element), value = hash.get(key); - - if (Object.isUndefined(value)) { - hash.set(key, defaultValue); - value = defaultValue; - } - - return value; - }, - - clone: function(element, deep) { - if (!(element = $(element))) return; - var clone = element.cloneNode(deep); - clone._prototypeUID = void 0; - if (deep) { - var descendants = Element.select(clone, '*'), - i = descendants.length; - while (i--) { - descendants[i]._prototypeUID = void 0; - } - } - return Element.extend(clone); - } -}); -/* Portions of the Selector class are derived from Jack Slocum's DomQuery, - * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style - * license. Please see http://www.yui-ext.com/ for more information. */ - -var Selector = Class.create({ - initialize: function(expression) { - this.expression = expression.strip(); - - if (this.shouldUseSelectorsAPI()) { - this.mode = 'selectorsAPI'; - } else if (this.shouldUseXPath()) { - this.mode = 'xpath'; - this.compileXPathMatcher(); - } else { - this.mode = "normal"; - this.compileMatcher(); - } - - }, - - shouldUseXPath: (function() { - - var IS_DESCENDANT_SELECTOR_BUGGY = (function(){ - var isBuggy = false; - if (document.evaluate && window.XPathResult) { - var el = document.createElement('div'); - el.innerHTML = '
      '; - - var xpath = ".//*[local-name()='ul' or local-name()='UL']" + - "//*[local-name()='li' or local-name()='LI']"; - - var result = document.evaluate(xpath, el, null, - XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - - isBuggy = (result.snapshotLength !== 2); - el = null; - } - return isBuggy; - })(); - - return function() { - if (!Prototype.BrowserFeatures.XPath) return false; - - var e = this.expression; - - if (Prototype.Browser.WebKit && - (e.include("-of-type") || e.include(":empty"))) - return false; - - if ((/(\[[\w-]*?:|:checked)/).test(e)) - return false; - - if (IS_DESCENDANT_SELECTOR_BUGGY) return false; - - return true; - } - - })(), - - shouldUseSelectorsAPI: function() { - if (!Prototype.BrowserFeatures.SelectorsAPI) return false; - - if (Selector.CASE_INSENSITIVE_CLASS_NAMES) return false; - - if (!Selector._div) Selector._div = new Element('div'); - - try { - Selector._div.querySelector(this.expression); - } catch(e) { - return false; - } - - return true; - }, - - compileMatcher: function() { - var e = this.expression, ps = Selector.patterns, h = Selector.handlers, - c = Selector.criteria, le, p, m, len = ps.length, name; - - if (Selector._cache[e]) { - this.matcher = Selector._cache[e]; - return; - } - - this.matcher = ["this.matcher = function(root) {", - "var r = root, h = Selector.handlers, c = false, n;"]; - - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i = 0; i"; - } -}); - -if (Prototype.BrowserFeatures.SelectorsAPI && - document.compatMode === 'BackCompat') { - Selector.CASE_INSENSITIVE_CLASS_NAMES = (function(){ - var div = document.createElement('div'), - span = document.createElement('span'); - - div.id = "prototype_test_id"; - span.className = 'Test'; - div.appendChild(span); - var isIgnored = (div.querySelector('#prototype_test_id .test') !== null); - div = span = null; - return isIgnored; - })(); -} - -Object.extend(Selector, { - _cache: { }, - - xpath: { - descendant: "//*", - child: "/*", - adjacent: "/following-sibling::*[1]", - laterSibling: '/following-sibling::*', - tagName: function(m) { - if (m[1] == '*') return ''; - return "[local-name()='" + m[1].toLowerCase() + - "' or local-name()='" + m[1].toUpperCase() + "']"; - }, - className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", - id: "[@id='#{1}']", - attrPresence: function(m) { - m[1] = m[1].toLowerCase(); - return new Template("[@#{1}]").evaluate(m); - }, - attr: function(m) { - m[1] = m[1].toLowerCase(); - m[3] = m[5] || m[6]; - return new Template(Selector.xpath.operators[m[2]]).evaluate(m); - }, - pseudo: function(m) { - var h = Selector.xpath.pseudos[m[1]]; - if (!h) return ''; - if (Object.isFunction(h)) return h(m); - return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); - }, - operators: { - '=': "[@#{1}='#{3}']", - '!=': "[@#{1}!='#{3}']", - '^=': "[starts-with(@#{1}, '#{3}')]", - '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']", - '*=': "[contains(@#{1}, '#{3}')]", - '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", - '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" - }, - pseudos: { - 'first-child': '[not(preceding-sibling::*)]', - 'last-child': '[not(following-sibling::*)]', - 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', - 'empty': "[count(*) = 0 and (count(text()) = 0)]", - 'checked': "[@checked]", - 'disabled': "[(@disabled) and (@type!='hidden')]", - 'enabled': "[not(@disabled) and (@type!='hidden')]", - 'not': function(m) { - var e = m[6], p = Selector.patterns, - x = Selector.xpath, le, v, len = p.length, name; - - var exclusion = []; - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i = 0; i= 0)]"; - return new Template(predicate).evaluate({ - fragment: fragment, a: a, b: b }); - } - } - } - }, - - criteria: { - tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', - className: 'n = h.className(n, r, "#{1}", c); c = false;', - id: 'n = h.id(n, r, "#{1}", c); c = false;', - attrPresence: 'n = h.attrPresence(n, r, "#{1}", c); c = false;', - attr: function(m) { - m[3] = (m[5] || m[6]); - return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m); - }, - pseudo: function(m) { - if (m[6]) m[6] = m[6].replace(/"/g, '\\"'); - return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m); - }, - descendant: 'c = "descendant";', - child: 'c = "child";', - adjacent: 'c = "adjacent";', - laterSibling: 'c = "laterSibling";' - }, - - patterns: [ - { name: 'laterSibling', re: /^\s*~\s*/ }, - { name: 'child', re: /^\s*>\s*/ }, - { name: 'adjacent', re: /^\s*\+\s*/ }, - { name: 'descendant', re: /^\s/ }, - - { name: 'tagName', re: /^\s*(\*|[\w\-]+)(\b|$)?/ }, - { name: 'id', re: /^#([\w\-\*]+)(\b|$)/ }, - { name: 'className', re: /^\.([\w\-\*]+)(\b|$)/ }, - { name: 'pseudo', re: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/ }, - { name: 'attrPresence', re: /^\[((?:[\w-]+:)?[\w-]+)\]/ }, - { name: 'attr', re: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ } - ], - - assertions: { - tagName: function(element, matches) { - return matches[1].toUpperCase() == element.tagName.toUpperCase(); - }, - - className: function(element, matches) { - return Element.hasClassName(element, matches[1]); - }, - - id: function(element, matches) { - return element.id === matches[1]; - }, - - attrPresence: function(element, matches) { - return Element.hasAttribute(element, matches[1]); - }, - - attr: function(element, matches) { - var nodeValue = Element.readAttribute(element, matches[1]); - return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]); - } - }, - - handlers: { - concat: function(a, b) { - for (var i = 0, node; node = b[i]; i++) - a.push(node); - return a; - }, - - mark: function(nodes) { - var _true = Prototype.emptyFunction; - for (var i = 0, node; node = nodes[i]; i++) - node._countedByPrototype = _true; - return nodes; - }, - - unmark: (function(){ - - var PROPERTIES_ATTRIBUTES_MAP = (function(){ - var el = document.createElement('div'), - isBuggy = false, - propName = '_countedByPrototype', - value = 'x' - el[propName] = value; - isBuggy = (el.getAttribute(propName) === value); - el = null; - return isBuggy; - })(); - - return PROPERTIES_ATTRIBUTES_MAP ? - function(nodes) { - for (var i = 0, node; node = nodes[i]; i++) - node.removeAttribute('_countedByPrototype'); - return nodes; - } : - function(nodes) { - for (var i = 0, node; node = nodes[i]; i++) - node._countedByPrototype = void 0; - return nodes; - } - })(), - - index: function(parentNode, reverse, ofType) { - parentNode._countedByPrototype = Prototype.emptyFunction; - if (reverse) { - for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { - var node = nodes[i]; - if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; - } - } else { - for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) - if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; - } - }, - - unique: function(nodes) { - if (nodes.length == 0) return nodes; - var results = [], n; - for (var i = 0, l = nodes.length; i < l; i++) - if (typeof (n = nodes[i])._countedByPrototype == 'undefined') { - n._countedByPrototype = Prototype.emptyFunction; - results.push(Element.extend(n)); - } - return Selector.handlers.unmark(results); - }, - - descendant: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - h.concat(results, node.getElementsByTagName('*')); - return results; - }, - - child: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) { - for (var j = 0, child; child = node.childNodes[j]; j++) - if (child.nodeType == 1 && child.tagName != '!') results.push(child); - } - return results; - }, - - adjacent: function(nodes) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - var next = this.nextElementSibling(node); - if (next) results.push(next); - } - return results; - }, - - laterSibling: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - h.concat(results, Element.nextSiblings(node)); - return results; - }, - - nextElementSibling: function(node) { - while (node = node.nextSibling) - if (node.nodeType == 1) return node; - return null; - }, - - previousElementSibling: function(node) { - while (node = node.previousSibling) - if (node.nodeType == 1) return node; - return null; - }, - - tagName: function(nodes, root, tagName, combinator) { - var uTagName = tagName.toUpperCase(); - var results = [], h = Selector.handlers; - if (nodes) { - if (combinator) { - if (combinator == "descendant") { - for (var i = 0, node; node = nodes[i]; i++) - h.concat(results, node.getElementsByTagName(tagName)); - return results; - } else nodes = this[combinator](nodes); - if (tagName == "*") return nodes; - } - for (var i = 0, node; node = nodes[i]; i++) - if (node.tagName.toUpperCase() === uTagName) results.push(node); - return results; - } else return root.getElementsByTagName(tagName); - }, - - id: function(nodes, root, id, combinator) { - var targetNode = $(id), h = Selector.handlers; - - if (root == document) { - if (!targetNode) return []; - if (!nodes) return [targetNode]; - } else { - if (!root.sourceIndex || root.sourceIndex < 1) { - var nodes = root.getElementsByTagName('*'); - for (var j = 0, node; node = nodes[j]; j++) { - if (node.id === id) return [node]; - } - } - } - - if (nodes) { - if (combinator) { - if (combinator == 'child') { - for (var i = 0, node; node = nodes[i]; i++) - if (targetNode.parentNode == node) return [targetNode]; - } else if (combinator == 'descendant') { - for (var i = 0, node; node = nodes[i]; i++) - if (Element.descendantOf(targetNode, node)) return [targetNode]; - } else if (combinator == 'adjacent') { - for (var i = 0, node; node = nodes[i]; i++) - if (Selector.handlers.previousElementSibling(targetNode) == node) - return [targetNode]; - } else nodes = h[combinator](nodes); - } - for (var i = 0, node; node = nodes[i]; i++) - if (node == targetNode) return [targetNode]; - return []; - } - return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : []; - }, - - className: function(nodes, root, className, combinator) { - if (nodes && combinator) nodes = this[combinator](nodes); - return Selector.handlers.byClassName(nodes, root, className); - }, - - byClassName: function(nodes, root, className) { - if (!nodes) nodes = Selector.handlers.descendant([root]); - var needle = ' ' + className + ' '; - for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) { - nodeClassName = node.className; - if (nodeClassName.length == 0) continue; - if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle)) - results.push(node); - } - return results; - }, - - attrPresence: function(nodes, root, attr, combinator) { - if (!nodes) nodes = root.getElementsByTagName("*"); - if (nodes && combinator) nodes = this[combinator](nodes); - var results = []; - for (var i = 0, node; node = nodes[i]; i++) - if (Element.hasAttribute(node, attr)) results.push(node); - return results; - }, - - attr: function(nodes, root, attr, value, operator, combinator) { - if (!nodes) nodes = root.getElementsByTagName("*"); - if (nodes && combinator) nodes = this[combinator](nodes); - var handler = Selector.operators[operator], results = []; - for (var i = 0, node; node = nodes[i]; i++) { - var nodeValue = Element.readAttribute(node, attr); - if (nodeValue === null) continue; - if (handler(nodeValue, value)) results.push(node); - } - return results; - }, - - pseudo: function(nodes, name, value, root, combinator) { - if (nodes && combinator) nodes = this[combinator](nodes); - if (!nodes) nodes = root.getElementsByTagName("*"); - return Selector.pseudos[name](nodes, value, root); - } - }, - - pseudos: { - 'first-child': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - if (Selector.handlers.previousElementSibling(node)) continue; - results.push(node); - } - return results; - }, - 'last-child': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - if (Selector.handlers.nextElementSibling(node)) continue; - results.push(node); - } - return results; - }, - 'only-child': function(nodes, value, root) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) - results.push(node); - return results; - }, - 'nth-child': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root); - }, - 'nth-last-child': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, true); - }, - 'nth-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, false, true); - }, - 'nth-last-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, true, true); - }, - 'first-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, "1", root, false, true); - }, - 'last-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, "1", root, true, true); - }, - 'only-of-type': function(nodes, formula, root) { - var p = Selector.pseudos; - return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); - }, - - getIndices: function(a, b, total) { - if (a == 0) return b > 0 ? [b] : []; - return $R(1, total).inject([], function(memo, i) { - if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i); - return memo; - }); - }, - - nth: function(nodes, formula, root, reverse, ofType) { - if (nodes.length == 0) return []; - if (formula == 'even') formula = '2n+0'; - if (formula == 'odd') formula = '2n+1'; - var h = Selector.handlers, results = [], indexed = [], m; - h.mark(nodes); - for (var i = 0, node; node = nodes[i]; i++) { - if (!node.parentNode._countedByPrototype) { - h.index(node.parentNode, reverse, ofType); - indexed.push(node.parentNode); - } - } - if (formula.match(/^\d+$/)) { // just a number - formula = Number(formula); - for (var i = 0, node; node = nodes[i]; i++) - if (node.nodeIndex == formula) results.push(node); - } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b - if (m[1] == "-") m[1] = -1; - var a = m[1] ? Number(m[1]) : 1; - var b = m[2] ? Number(m[2]) : 0; - var indices = Selector.pseudos.getIndices(a, b, nodes.length); - for (var i = 0, node, l = indices.length; node = nodes[i]; i++) { - for (var j = 0; j < l; j++) - if (node.nodeIndex == indices[j]) results.push(node); - } - } - h.unmark(nodes); - h.unmark(indexed); - return results; - }, - - 'empty': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - if (node.tagName == '!' || node.firstChild) continue; - results.push(node); - } - return results; - }, - - 'not': function(nodes, selector, root) { - var h = Selector.handlers, selectorType, m; - var exclusions = new Selector(selector).findElements(root); - h.mark(exclusions); - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node._countedByPrototype) results.push(node); - h.unmark(exclusions); - return results; - }, - - 'enabled': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node.disabled && (!node.type || node.type !== 'hidden')) - results.push(node); - return results; - }, - - 'disabled': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (node.disabled) results.push(node); - return results; - }, - - 'checked': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (node.checked) results.push(node); - return results; - } - }, - - operators: { - '=': function(nv, v) { return nv == v; }, - '!=': function(nv, v) { return nv != v; }, - '^=': function(nv, v) { return nv == v || nv && nv.startsWith(v); }, - '$=': function(nv, v) { return nv == v || nv && nv.endsWith(v); }, - '*=': function(nv, v) { return nv == v || nv && nv.include(v); }, - '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, - '|=': function(nv, v) { return ('-' + (nv || "").toUpperCase() + - '-').include('-' + (v || "").toUpperCase() + '-'); } - }, - - split: function(expression) { - var expressions = []; - expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { - expressions.push(m[1].strip()); - }); - return expressions; - }, - - matchElements: function(elements, expression) { - var matches = $$(expression), h = Selector.handlers; - h.mark(matches); - for (var i = 0, results = [], element; element = elements[i]; i++) - if (element._countedByPrototype) results.push(element); - h.unmark(matches); - return results; - }, - - findElement: function(elements, expression, index) { - if (Object.isNumber(expression)) { - index = expression; expression = false; - } - return Selector.matchElements(elements, expression || '*')[index || 0]; - }, - - findChildElements: function(element, expressions) { - expressions = Selector.split(expressions.join(',')); - var results = [], h = Selector.handlers; - for (var i = 0, l = expressions.length, selector; i < l; i++) { - selector = new Selector(expressions[i].strip()); - h.concat(results, selector.findElements(element)); - } - return (l > 1) ? h.unique(results) : results; - } -}); - -if (Prototype.Browser.IE) { - Object.extend(Selector.handlers, { - concat: function(a, b) { - for (var i = 0, node; node = b[i]; i++) - if (node.tagName !== "!") a.push(node); - return a; - } - }); -} - -function $$() { - return Selector.findChildElements(document, $A(arguments)); -} - -var Form = { - reset: function(form) { - form = $(form); - form.reset(); - return form; - }, - - serializeElements: function(elements, options) { - if (typeof options != 'object') options = { hash: !!options }; - else if (Object.isUndefined(options.hash)) options.hash = true; - var key, value, submitted = false, submit = options.submit; - - var data = elements.inject({ }, function(result, element) { - if (!element.disabled && element.name) { - key = element.name; value = $(element).getValue(); - if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && - submit !== false && (!submit || key == submit) && (submitted = true)))) { - if (key in result) { - if (!Object.isArray(result[key])) result[key] = [result[key]]; - result[key].push(value); - } - else result[key] = value; - } - } - return result; - }); - - return options.hash ? data : Object.toQueryString(data); - } -}; - -Form.Methods = { - serialize: function(form, options) { - return Form.serializeElements(Form.getElements(form), options); - }, - - getElements: function(form) { - var elements = $(form).getElementsByTagName('*'), - element, - arr = [ ], - serializers = Form.Element.Serializers; - for (var i = 0; element = elements[i]; i++) { - arr.push(element); - } - return arr.inject([], function(elements, child) { - if (serializers[child.tagName.toLowerCase()]) - elements.push(Element.extend(child)); - return elements; - }) - }, - - getInputs: function(form, typeName, name) { - form = $(form); - var inputs = form.getElementsByTagName('input'); - - if (!typeName && !name) return $A(inputs).map(Element.extend); - - for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { - var input = inputs[i]; - if ((typeName && input.type != typeName) || (name && input.name != name)) - continue; - matchingInputs.push(Element.extend(input)); - } - - return matchingInputs; - }, - - disable: function(form) { - form = $(form); - Form.getElements(form).invoke('disable'); - return form; - }, - - enable: function(form) { - form = $(form); - Form.getElements(form).invoke('enable'); - return form; - }, - - findFirstElement: function(form) { - var elements = $(form).getElements().findAll(function(element) { - return 'hidden' != element.type && !element.disabled; - }); - var firstByIndex = elements.findAll(function(element) { - return element.hasAttribute('tabIndex') && element.tabIndex >= 0; - }).sortBy(function(element) { return element.tabIndex }).first(); - - return firstByIndex ? firstByIndex : elements.find(function(element) { - return /^(?:input|select|textarea)$/i.test(element.tagName); - }); - }, - - focusFirstElement: function(form) { - form = $(form); - form.findFirstElement().activate(); - return form; - }, - - request: function(form, options) { - form = $(form), options = Object.clone(options || { }); - - var params = options.parameters, action = form.readAttribute('action') || ''; - if (action.blank()) action = window.location.href; - options.parameters = form.serialize(true); - - if (params) { - if (Object.isString(params)) params = params.toQueryParams(); - Object.extend(options.parameters, params); - } - - if (form.hasAttribute('method') && !options.method) - options.method = form.method; - - return new Ajax.Request(action, options); - } -}; - -/*--------------------------------------------------------------------------*/ - - -Form.Element = { - focus: function(element) { - $(element).focus(); - return element; - }, - - select: function(element) { - $(element).select(); - return element; - } -}; - -Form.Element.Methods = { - - serialize: function(element) { - element = $(element); - if (!element.disabled && element.name) { - var value = element.getValue(); - if (value != undefined) { - var pair = { }; - pair[element.name] = value; - return Object.toQueryString(pair); - } - } - return ''; - }, - - getValue: function(element) { - element = $(element); - var method = element.tagName.toLowerCase(); - return Form.Element.Serializers[method](element); - }, - - setValue: function(element, value) { - element = $(element); - var method = element.tagName.toLowerCase(); - Form.Element.Serializers[method](element, value); - return element; - }, - - clear: function(element) { - $(element).value = ''; - return element; - }, - - present: function(element) { - return $(element).value != ''; - }, - - activate: function(element) { - element = $(element); - try { - element.focus(); - if (element.select && (element.tagName.toLowerCase() != 'input' || - !(/^(?:button|reset|submit)$/i.test(element.type)))) - element.select(); - } catch (e) { } - return element; - }, - - disable: function(element) { - element = $(element); - element.disabled = true; - return element; - }, - - enable: function(element) { - element = $(element); - element.disabled = false; - return element; - } -}; - -/*--------------------------------------------------------------------------*/ - -var Field = Form.Element; - -var $F = Form.Element.Methods.getValue; - -/*--------------------------------------------------------------------------*/ - -Form.Element.Serializers = { - input: function(element, value) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - return Form.Element.Serializers.inputSelector(element, value); - default: - return Form.Element.Serializers.textarea(element, value); - } - }, - - inputSelector: function(element, value) { - if (Object.isUndefined(value)) return element.checked ? element.value : null; - else element.checked = !!value; - }, - - textarea: function(element, value) { - if (Object.isUndefined(value)) return element.value; - else element.value = value; - }, - - select: function(element, value) { - if (Object.isUndefined(value)) - return this[element.type == 'select-one' ? - 'selectOne' : 'selectMany'](element); - else { - var opt, currentValue, single = !Object.isArray(value); - for (var i = 0, length = element.length; i < length; i++) { - opt = element.options[i]; - currentValue = this.optionValue(opt); - if (single) { - if (currentValue == value) { - opt.selected = true; - return; - } - } - else opt.selected = value.include(currentValue); - } - } - }, - - selectOne: function(element) { - var index = element.selectedIndex; - return index >= 0 ? this.optionValue(element.options[index]) : null; - }, - - selectMany: function(element) { - var values, length = element.length; - if (!length) return null; - - for (var i = 0, values = []; i < length; i++) { - var opt = element.options[i]; - if (opt.selected) values.push(this.optionValue(opt)); - } - return values; - }, - - optionValue: function(opt) { - return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; - } -}; - -/*--------------------------------------------------------------------------*/ - - -Abstract.TimedObserver = Class.create(PeriodicalExecuter, { - initialize: function($super, element, frequency, callback) { - $super(callback, frequency); - this.element = $(element); - this.lastValue = this.getValue(); - }, - - execute: function() { - var value = this.getValue(); - if (Object.isString(this.lastValue) && Object.isString(value) ? - this.lastValue != value : String(this.lastValue) != String(value)) { - this.callback(this.element, value); - this.lastValue = value; - } - } -}); - -Form.Element.Observer = Class.create(Abstract.TimedObserver, { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.Observer = Class.create(Abstract.TimedObserver, { - getValue: function() { - return Form.serialize(this.element); - } -}); - -/*--------------------------------------------------------------------------*/ - -Abstract.EventObserver = Class.create({ - initialize: function(element, callback) { - this.element = $(element); - this.callback = callback; - - this.lastValue = this.getValue(); - if (this.element.tagName.toLowerCase() == 'form') - this.registerFormCallbacks(); - else - this.registerCallback(this.element); - }, - - onElementEvent: function() { - var value = this.getValue(); - if (this.lastValue != value) { - this.callback(this.element, value); - this.lastValue = value; - } - }, - - registerFormCallbacks: function() { - Form.getElements(this.element).each(this.registerCallback, this); - }, - - registerCallback: function(element) { - if (element.type) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - Event.observe(element, 'click', this.onElementEvent.bind(this)); - break; - default: - Event.observe(element, 'change', this.onElementEvent.bind(this)); - break; - } - } - } -}); - -Form.Element.EventObserver = Class.create(Abstract.EventObserver, { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.EventObserver = Class.create(Abstract.EventObserver, { - getValue: function() { - return Form.serialize(this.element); - } -}); -(function() { - - var Event = { - KEY_BACKSPACE: 8, - KEY_TAB: 9, - KEY_RETURN: 13, - KEY_ESC: 27, - KEY_LEFT: 37, - KEY_UP: 38, - KEY_RIGHT: 39, - KEY_DOWN: 40, - KEY_DELETE: 46, - KEY_HOME: 36, - KEY_END: 35, - KEY_PAGEUP: 33, - KEY_PAGEDOWN: 34, - KEY_INSERT: 45, - - cache: {} - }; - - var docEl = document.documentElement; - var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl - && 'onmouseleave' in docEl; - - var _isButton; - if (Prototype.Browser.IE) { - var buttonMap = { 0: 1, 1: 4, 2: 2 }; - _isButton = function(event, code) { - return event.button === buttonMap[code]; - }; - } else if (Prototype.Browser.WebKit) { - _isButton = function(event, code) { - switch (code) { - case 0: return event.which == 1 && !event.metaKey; - case 1: return event.which == 1 && event.metaKey; - default: return false; - } - }; - } else { - _isButton = function(event, code) { - return event.which ? (event.which === code + 1) : (event.button === code); - }; - } - - function isLeftClick(event) { return _isButton(event, 0) } - - function isMiddleClick(event) { return _isButton(event, 1) } - - function isRightClick(event) { return _isButton(event, 2) } - - function element(event) { - event = Event.extend(event); - - var node = event.target, type = event.type, - currentTarget = event.currentTarget; - - if (currentTarget && currentTarget.tagName) { - if (type === 'load' || type === 'error' || - (type === 'click' && currentTarget.tagName.toLowerCase() === 'input' - && currentTarget.type === 'radio')) - node = currentTarget; - } - - if (node.nodeType == Node.TEXT_NODE) - node = node.parentNode; - - return Element.extend(node); - } - - function findElement(event, expression) { - var element = Event.element(event); - if (!expression) return element; - var elements = [element].concat(element.ancestors()); - return Selector.findElement(elements, expression, 0); - } - - function pointer(event) { - return { x: pointerX(event), y: pointerY(event) }; - } - - function pointerX(event) { - var docElement = document.documentElement, - body = document.body || { scrollLeft: 0 }; - - return event.pageX || (event.clientX + - (docElement.scrollLeft || body.scrollLeft) - - (docElement.clientLeft || 0)); - } - - function pointerY(event) { - var docElement = document.documentElement, - body = document.body || { scrollTop: 0 }; - - return event.pageY || (event.clientY + - (docElement.scrollTop || body.scrollTop) - - (docElement.clientTop || 0)); - } - - - function stop(event) { - Event.extend(event); - event.preventDefault(); - event.stopPropagation(); - - event.stopped = true; - } - - Event.Methods = { - isLeftClick: isLeftClick, - isMiddleClick: isMiddleClick, - isRightClick: isRightClick, - - element: element, - findElement: findElement, - - pointer: pointer, - pointerX: pointerX, - pointerY: pointerY, - - stop: stop - }; - - - var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { - m[name] = Event.Methods[name].methodize(); - return m; - }); - - if (Prototype.Browser.IE) { - function _relatedTarget(event) { - var element; - switch (event.type) { - case 'mouseover': element = event.fromElement; break; - case 'mouseout': element = event.toElement; break; - default: return null; - } - return Element.extend(element); - } - - Object.extend(methods, { - stopPropagation: function() { this.cancelBubble = true }, - preventDefault: function() { this.returnValue = false }, - inspect: function() { return '[object Event]' } - }); - - Event.extend = function(event, element) { - if (!event) return false; - if (event._extendedByPrototype) return event; - - event._extendedByPrototype = Prototype.emptyFunction; - var pointer = Event.pointer(event); - - Object.extend(event, { - target: event.srcElement || element, - relatedTarget: _relatedTarget(event), - pageX: pointer.x, - pageY: pointer.y - }); - - return Object.extend(event, methods); - }; - } else { - Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__; - Object.extend(Event.prototype, methods); - Event.extend = Prototype.K; - } - - function _createResponder(element, eventName, handler) { - var registry = Element.retrieve(element, 'prototype_event_registry'); - - if (Object.isUndefined(registry)) { - CACHE.push(element); - registry = Element.retrieve(element, 'prototype_event_registry', $H()); - } - - var respondersForEvent = registry.get(eventName); - if (Object.isUndefined(respondersForEvent)) { - respondersForEvent = []; - registry.set(eventName, respondersForEvent); - } - - if (respondersForEvent.pluck('handler').include(handler)) return false; - - var responder; - if (eventName.include(":")) { - responder = function(event) { - if (Object.isUndefined(event.eventName)) - return false; - - if (event.eventName !== eventName) - return false; - - Event.extend(event, element); - handler.call(element, event); - }; - } else { - if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED && - (eventName === "mouseenter" || eventName === "mouseleave")) { - if (eventName === "mouseenter" || eventName === "mouseleave") { - responder = function(event) { - Event.extend(event, element); - - var parent = event.relatedTarget; - while (parent && parent !== element) { - try { parent = parent.parentNode; } - catch(e) { parent = element; } - } - - if (parent === element) return; - - handler.call(element, event); - }; - } - } else { - responder = function(event) { - Event.extend(event, element); - handler.call(element, event); - }; - } - } - - responder.handler = handler; - respondersForEvent.push(responder); - return responder; - } - - function _destroyCache() { - for (var i = 0, length = CACHE.length; i < length; i++) { - Event.stopObserving(CACHE[i]); - CACHE[i] = null; - } - } - - var CACHE = []; - - if (Prototype.Browser.IE) - window.attachEvent('onunload', _destroyCache); - - if (Prototype.Browser.WebKit) - window.addEventListener('unload', Prototype.emptyFunction, false); - - - var _getDOMEventName = Prototype.K; - - if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) { - _getDOMEventName = function(eventName) { - var translations = { mouseenter: "mouseover", mouseleave: "mouseout" }; - return eventName in translations ? translations[eventName] : eventName; - }; - } - - function observe(element, eventName, handler) { - element = $(element); - - var responder = _createResponder(element, eventName, handler); - - if (!responder) return element; - - if (eventName.include(':')) { - if (element.addEventListener) - element.addEventListener("dataavailable", responder, false); - else { - element.attachEvent("ondataavailable", responder); - element.attachEvent("onfilterchange", responder); - } - } else { - var actualEventName = _getDOMEventName(eventName); - - if (element.addEventListener) - element.addEventListener(actualEventName, responder, false); - else - element.attachEvent("on" + actualEventName, responder); - } - - return element; - } - - function stopObserving(element, eventName, handler) { - element = $(element); - - var registry = Element.retrieve(element, 'prototype_event_registry'); - - if (Object.isUndefined(registry)) return element; - - if (eventName && !handler) { - var responders = registry.get(eventName); - - if (Object.isUndefined(responders)) return element; - - responders.each( function(r) { - Element.stopObserving(element, eventName, r.handler); - }); - return element; - } else if (!eventName) { - registry.each( function(pair) { - var eventName = pair.key, responders = pair.value; - - responders.each( function(r) { - Element.stopObserving(element, eventName, r.handler); - }); - }); - return element; - } - - var responders = registry.get(eventName); - - if (!responders) return; - - var responder = responders.find( function(r) { return r.handler === handler; }); - if (!responder) return element; - - var actualEventName = _getDOMEventName(eventName); - - if (eventName.include(':')) { - if (element.removeEventListener) - element.removeEventListener("dataavailable", responder, false); - else { - element.detachEvent("ondataavailable", responder); - element.detachEvent("onfilterchange", responder); - } - } else { - if (element.removeEventListener) - element.removeEventListener(actualEventName, responder, false); - else - element.detachEvent('on' + actualEventName, responder); - } - - registry.set(eventName, responders.without(responder)); - - return element; - } - - function fire(element, eventName, memo, bubble) { - element = $(element); - - if (Object.isUndefined(bubble)) - bubble = true; - - if (element == document && document.createEvent && !element.dispatchEvent) - element = document.documentElement; - - var event; - if (document.createEvent) { - event = document.createEvent('HTMLEvents'); - event.initEvent('dataavailable', true, true); - } else { - event = document.createEventObject(); - event.eventType = bubble ? 'ondataavailable' : 'onfilterchange'; - } - - event.eventName = eventName; - event.memo = memo || { }; - - if (document.createEvent) - element.dispatchEvent(event); - else - element.fireEvent(event.eventType, event); - - return Event.extend(event); - } - - - Object.extend(Event, Event.Methods); - - Object.extend(Event, { - fire: fire, - observe: observe, - stopObserving: stopObserving - }); - - Element.addMethods({ - fire: fire, - - observe: observe, - - stopObserving: stopObserving - }); - - Object.extend(document, { - fire: fire.methodize(), - - observe: observe.methodize(), - - stopObserving: stopObserving.methodize(), - - loaded: false - }); - - if (window.Event) Object.extend(window.Event, Event); - else window.Event = Event; -})(); - -(function() { - /* Support for the DOMContentLoaded event is based on work by Dan Webb, - Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */ - - var timer; - - function fireContentLoadedEvent() { - if (document.loaded) return; - if (timer) window.clearTimeout(timer); - document.loaded = true; - document.fire('dom:loaded'); - } - - function checkReadyState() { - if (document.readyState === 'complete') { - document.stopObserving('readystatechange', checkReadyState); - fireContentLoadedEvent(); - } - } - - function pollDoScroll() { - try { document.documentElement.doScroll('left'); } - catch(e) { - timer = pollDoScroll.defer(); - return; - } - fireContentLoadedEvent(); - } - - if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false); - } else { - document.observe('readystatechange', checkReadyState); - if (window == top) - timer = pollDoScroll.defer(); - } - - Event.observe(window, 'load', fireContentLoadedEvent); -})(); - -Element.addMethods(); - -/*------------------------------- DEPRECATED -------------------------------*/ - -Hash.toQueryString = Object.toQueryString; - -var Toggle = { display: Element.toggle }; - -Element.Methods.childOf = Element.Methods.descendantOf; - -var Insertion = { - Before: function(element, content) { - return Element.insert(element, {before:content}); - }, - - Top: function(element, content) { - return Element.insert(element, {top:content}); - }, - - Bottom: function(element, content) { - return Element.insert(element, {bottom:content}); - }, - - After: function(element, content) { - return Element.insert(element, {after:content}); - } -}; - -var $continue = new Error('"throw $continue" is deprecated, use "return" instead'); - -var Position = { - includeScrollOffsets: false, - - prepare: function() { - this.deltaX = window.pageXOffset - || document.documentElement.scrollLeft - || document.body.scrollLeft - || 0; - this.deltaY = window.pageYOffset - || document.documentElement.scrollTop - || document.body.scrollTop - || 0; - }, - - within: function(element, x, y) { - if (this.includeScrollOffsets) - return this.withinIncludingScrolloffsets(element, x, y); - this.xcomp = x; - this.ycomp = y; - this.offset = Element.cumulativeOffset(element); - - return (y >= this.offset[1] && - y < this.offset[1] + element.offsetHeight && - x >= this.offset[0] && - x < this.offset[0] + element.offsetWidth); - }, - - withinIncludingScrolloffsets: function(element, x, y) { - var offsetcache = Element.cumulativeScrollOffset(element); - - this.xcomp = x + offsetcache[0] - this.deltaX; - this.ycomp = y + offsetcache[1] - this.deltaY; - this.offset = Element.cumulativeOffset(element); - - return (this.ycomp >= this.offset[1] && - this.ycomp < this.offset[1] + element.offsetHeight && - this.xcomp >= this.offset[0] && - this.xcomp < this.offset[0] + element.offsetWidth); - }, - - overlap: function(mode, element) { - if (!mode) return 0; - if (mode == 'vertical') - return ((this.offset[1] + element.offsetHeight) - this.ycomp) / - element.offsetHeight; - if (mode == 'horizontal') - return ((this.offset[0] + element.offsetWidth) - this.xcomp) / - element.offsetWidth; - }, - - - cumulativeOffset: Element.Methods.cumulativeOffset, - - positionedOffset: Element.Methods.positionedOffset, - - absolutize: function(element) { - Position.prepare(); - return Element.absolutize(element); - }, - - relativize: function(element) { - Position.prepare(); - return Element.relativize(element); - }, - - realOffset: Element.Methods.cumulativeScrollOffset, - - offsetParent: Element.Methods.getOffsetParent, - - page: Element.Methods.viewportOffset, - - clone: function(source, target, options) { - options = options || { }; - return Element.clonePosition(target, source, options); - } -}; - -/*--------------------------------------------------------------------------*/ - -if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){ - function iter(name) { - return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]"; - } - - instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ? - function(element, className) { - className = className.toString().strip(); - var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className); - return cond ? document._getElementsByXPath('.//*' + cond, element) : []; - } : function(element, className) { - className = className.toString().strip(); - var elements = [], classNames = (/\s/.test(className) ? $w(className) : null); - if (!classNames && !className) return elements; - - var nodes = $(element).getElementsByTagName('*'); - className = ' ' + className + ' '; - - for (var i = 0, child, cn; child = nodes[i]; i++) { - if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) || - (classNames && classNames.all(function(name) { - return !name.toString().blank() && cn.include(' ' + name + ' '); - })))) - elements.push(Element.extend(child)); - } - return elements; - }; - - return function(className, parentElement) { - return $(parentElement || document.body).getElementsByClassName(className); - }; -}(Element.Methods); - -/*--------------------------------------------------------------------------*/ - -Element.ClassNames = Class.create(); -Element.ClassNames.prototype = { - initialize: function(element) { - this.element = $(element); - }, - - _each: function(iterator) { - this.element.className.split(/\s+/).select(function(name) { - return name.length > 0; - })._each(iterator); - }, - - set: function(className) { - this.element.className = className; - }, - - add: function(classNameToAdd) { - if (this.include(classNameToAdd)) return; - this.set($A(this).concat(classNameToAdd).join(' ')); - }, - - remove: function(classNameToRemove) { - if (!this.include(classNameToRemove)) return; - this.set($A(this).without(classNameToRemove).join(' ')); - }, - - toString: function() { - return $A(this).join(' '); - } -}; - -Object.extend(Element.ClassNames.prototype, Enumerable); - -/*--------------------------------------------------------------------------*/ diff --git a/sw/in_progress/pow/pow/WebContent/js/tabber.js b/sw/in_progress/pow/pow/WebContent/js/tabber.js deleted file mode 100644 index 9700c97a81..0000000000 --- a/sw/in_progress/pow/pow/WebContent/js/tabber.js +++ /dev/null @@ -1,536 +0,0 @@ -/*================================================== - $Id: tabber.js,v 1.9 2006/04/27 20:51:51 pat Exp $ - tabber.js by Patrick Fitzgerald pat@barelyfitz.com - - Documentation can be found at the following URL: - http://www.barelyfitz.com/projects/tabber/ - - License (http://www.opensource.org/licenses/mit-license.php) - - Copyright (c) 2006 Patrick Fitzgerald - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ==================================================*/ - -function tabberObj(argsObj) -{ - var arg; /* name of an argument to override */ - - /* Element for the main tabber div. If you supply this in argsObj, - then the init() method will be called. - */ - this.div = null; - - /* Class of the main tabber div */ - this.classMain = "tabber"; - - /* Rename classMain to classMainLive after tabifying - (so a different style can be applied) - */ - this.classMainLive = "tabberlive"; - - /* Class of each DIV that contains a tab */ - this.classTab = "tabbertab"; - - /* Class to indicate which tab should be active on startup */ - this.classTabDefault = "tabbertabdefault"; - - /* Class for the navigation UL */ - this.classNav = "tabbernav"; - - /* When a tab is to be hidden, instead of setting display='none', we - set the class of the div to classTabHide. In your screen - stylesheet you should set classTabHide to display:none. In your - print stylesheet you should set display:block to ensure that all - the information is printed. - */ - this.classTabHide = "tabbertabhide"; - - /* Class to set the navigation LI when the tab is active, so you can - use a different style on the active tab. - */ - this.classNavActive = "tabberactive"; - - /* Elements that might contain the title for the tab, only used if a - title is not specified in the TITLE attribute of DIV classTab. - */ - this.titleElements = ['h2','h3','h4','h5','h6']; - - /* Should we strip out the HTML from the innerHTML of the title elements? - This should usually be true. - */ - this.titleElementsStripHTML = true; - - /* If the user specified the tab names using a TITLE attribute on - the DIV, then the browser will display a tooltip whenever the - mouse is over the DIV. To prevent this tooltip, we can remove the - TITLE attribute after getting the tab name. - */ - this.removeTitle = true; - - /* If you want to add an id to each link set this to true */ - this.addLinkId = false; - - /* If addIds==true, then you can set a format for the ids. - will be replaced with the id of the main tabber div. - will be replaced with the tab number - (tab numbers starting at zero) - will be replaced with the tab number - (tab numbers starting at one) - will be replaced by the tab title - (with all non-alphanumeric characters removed) - */ - this.linkIdFormat = 'nav'; - - /* You can override the defaults listed above by passing in an object: - var mytab = new tabber({property:value,property:value}); - */ - for (arg in argsObj) { this[arg] = argsObj[arg]; } - - /* Create regular expressions for the class names; Note: if you - change the class names after a new object is created you must - also change these regular expressions. - */ - this.REclassMain = new RegExp('\\b' + this.classMain + '\\b', 'gi'); - this.REclassMainLive = new RegExp('\\b' + this.classMainLive + '\\b', 'gi'); - this.REclassTab = new RegExp('\\b' + this.classTab + '\\b', 'gi'); - this.REclassTabDefault = new RegExp('\\b' + this.classTabDefault + '\\b', 'gi'); - this.REclassTabHide = new RegExp('\\b' + this.classTabHide + '\\b', 'gi'); - - /* Array of objects holding info about each tab */ - this.tabs = new Array(); - - /* If the main tabber div was specified, call init() now */ - if (this.div) { - - this.init(this.div); - - /* We don't need the main div anymore, and to prevent a memory leak - in IE, we must remove the circular reference between the div - and the tabber object. */ - this.div = null; - } -} - - -/*-------------------------------------------------- - Methods for tabberObj - --------------------------------------------------*/ - - -tabberObj.prototype.init = function(e) -{ - /* Set up the tabber interface. - - e = element (the main containing div) - - Example: - init(document.getElementById('mytabberdiv')) - */ - - var - childNodes, /* child nodes of the tabber div */ - i, i2, /* loop indices */ - t, /* object to store info about a single tab */ - defaultTab=0, /* which tab to select by default */ - DOM_ul, /* tabbernav list */ - DOM_li, /* tabbernav list item */ - DOM_a, /* tabbernav link */ - aId, /* A unique id for DOM_a */ - headingElement; /* searching for text to use in the tab */ - - /* Verify that the browser supports DOM scripting */ - if (!document.getElementsByTagName) { return false; } - - /* If the main DIV has an ID then save it. */ - if (e.id) { - this.id = e.id; - } - - /* Clear the tabs array (but it should normally be empty) */ - this.tabs.length = 0; - - /* Loop through an array of all the child nodes within our tabber element. */ - childNodes = e.childNodes; - for(i=0; i < childNodes.length; i++) { - - /* Find the nodes where class="tabbertab" */ - if(childNodes[i].className && - childNodes[i].className.match(this.REclassTab)) { - - /* Create a new object to save info about this tab */ - t = new Object(); - - /* Save a pointer to the div for this tab */ - t.div = childNodes[i]; - - /* Add the new object to the array of tabs */ - this.tabs[this.tabs.length] = t; - - /* If the class name contains classTabDefault, - then select this tab by default. - */ - if (childNodes[i].className.match(this.REclassTabDefault)) { - defaultTab = this.tabs.length-1; - } - } - } - - /* Create a new UL list to hold the tab headings */ - DOM_ul = document.createElement("ul"); - DOM_ul.className = this.classNav; - - /* Loop through each tab we found */ - for (i=0; i < this.tabs.length; i++) { - - t = this.tabs[i]; - - /* Get the label to use for this tab: - From the title attribute on the DIV, - Or from one of the this.titleElements[] elements, - Or use an automatically generated number. - */ - t.headingText = t.div.title; - - /* Remove the title attribute to prevent a tooltip from appearing */ - if (this.removeTitle) { t.div.title = ''; } - - if (!t.headingText) { - - /* Title was not defined in the title of the DIV, - So try to get the title from an element within the DIV. - Go through the list of elements in this.titleElements - (typically heading elements ['h2','h3','h4']) - */ - for (i2=0; i2/gi," "); - t.headingText = t.headingText.replace(/<[^>]+>/g,""); - } - break; - } - } - } - - if (!t.headingText) { - /* Title was not found (or is blank) so automatically generate a - number for the tab. - */ - t.headingText = i + 1; - } - - /* Create a list element for the tab */ - DOM_li = document.createElement("li"); - - /* Save a reference to this list item so we can later change it to - the "active" class */ - t.li = DOM_li; - - /* Create a link to activate the tab */ - DOM_a = document.createElement("a"); - DOM_a.appendChild(document.createTextNode(t.headingText)); - DOM_a.href = "javascript:void(null);"; - DOM_a.title = t.headingText; - DOM_a.onclick = this.navClick; - - /* Add some properties to the link so we can identify which tab - was clicked. Later the navClick method will need this. - */ - DOM_a.tabber = this; - DOM_a.tabberIndex = i; - - /* Do we need to add an id to DOM_a? */ - if (this.addLinkId && this.linkIdFormat) { - - /* Determine the id name */ - aId = this.linkIdFormat; - aId = aId.replace(//gi, this.id); - aId = aId.replace(//gi, i); - aId = aId.replace(//gi, i+1); - aId = aId.replace(//gi, t.headingText.replace(/[^a-zA-Z0-9\-]/gi, '')); - - DOM_a.id = aId; - } - - /* Add the link to the list element */ - DOM_li.appendChild(DOM_a); - - /* Add the list element to the list */ - DOM_ul.appendChild(DOM_li); - } - - /* Add the UL list to the beginning of the tabber div */ - e.insertBefore(DOM_ul, e.firstChild); - - /* Make the tabber div "live" so different CSS can be applied */ - e.className = e.className.replace(this.REclassMain, this.classMainLive); - - /* Activate the default tab, and do not call the onclick handler */ - this.tabShow(defaultTab); - - /* If the user specified an onLoad function, call it now. */ - if (typeof this.onLoad == 'function') { - this.onLoad({tabber:this}); - } - - return this; -}; - - -tabberObj.prototype.navClick = function(event) -{ - /* This method should only be called by the onClick event of an - element, in which case we will determine which tab was clicked by - examining a property that we previously attached to the - element. - - Since this was triggered from an onClick event, the variable - "this" refers to the element that triggered the onClick - event (and not to the tabberObj). - - When tabberObj was initialized, we added some extra properties - to the element, for the purpose of retrieving them now. Get - the tabberObj object, plus the tab number that was clicked. - */ - - var - rVal, /* Return value from the user onclick function */ - a, /* element that triggered the onclick event */ - self, /* the tabber object */ - tabberIndex, /* index of the tab that triggered the event */ - onClickArgs; /* args to send the onclick function */ - - a = this; - if (!a.tabber) { return false; } - - self = a.tabber; - tabberIndex = a.tabberIndex; - - /* Remove focus from the link because it looks ugly. - I don't know if this is a good idea... - */ - a.blur(); - - /* If the user specified an onClick function, call it now. - If the function returns false then do not continue. - */ - if (typeof self.onClick == 'function') { - - onClickArgs = {'tabber':self, 'index':tabberIndex, 'event':event}; - - /* IE uses a different way to access the event object */ - if (!event) { onClickArgs.event = window.event; } - - rVal = self.onClick(onClickArgs); - if (rVal === false) { return false; } - } - - self.tabShow(tabberIndex); - - return false; -}; - - -tabberObj.prototype.tabHideAll = function() -{ - var i; /* counter */ - - /* Hide all tabs and make all navigation links inactive */ - for (i = 0; i < this.tabs.length; i++) { - this.tabHide(i); - } -}; - - -tabberObj.prototype.tabHide = function(tabberIndex) -{ - var div; - - if (!this.tabs[tabberIndex]) { return false; } - - /* Hide a single tab and make its navigation link inactive */ - div = this.tabs[tabberIndex].div; - - /* Hide the tab contents by adding classTabHide to the div */ - if (!div.className.match(this.REclassTabHide)) { - div.className += ' ' + this.classTabHide; - } - this.navClearActive(tabberIndex); - - return this; -}; - - -tabberObj.prototype.tabShow = function(tabberIndex) -{ - /* Show the tabberIndex tab and hide all the other tabs */ - - var div; - - if (!this.tabs[tabberIndex]) { return false; } - - /* Hide all the tabs first */ - this.tabHideAll(); - - /* Get the div that holds this tab */ - div = this.tabs[tabberIndex].div; - - /* Remove classTabHide from the div */ - div.className = div.className.replace(this.REclassTabHide, ''); - - /* Mark this tab navigation link as "active" */ - this.navSetActive(tabberIndex); - - /* If the user specified an onTabDisplay function, call it now. */ - if (typeof this.onTabDisplay == 'function') { - this.onTabDisplay({'tabber':this, 'index':tabberIndex}); - } - - return this; -}; - -tabberObj.prototype.navSetActive = function(tabberIndex) -{ - /* Note: this method does *not* enforce the rule - that only one nav item can be active at a time. - */ - - /* Set classNavActive for the navigation list item */ - this.tabs[tabberIndex].li.className = this.classNavActive; - - return this; -}; - - -tabberObj.prototype.navClearActive = function(tabberIndex) -{ - /* Note: this method does *not* enforce the rule - that one nav should always be active. - */ - - /* Remove classNavActive from the navigation list item */ - this.tabs[tabberIndex].li.className = ''; - - return this; -}; - - -/*==================================================*/ - - -function tabberAutomatic(tabberArgs) -{ - /* This function finds all DIV elements in the document where - class=tabber.classMain, then converts them to use the tabber - interface. - - tabberArgs = an object to send to "new tabber()" - */ - var - tempObj, /* Temporary tabber object */ - divs, /* Array of all divs on the page */ - i; /* Loop index */ - - if (!tabberArgs) { tabberArgs = {}; } - - /* Create a tabber object so we can get the value of classMain */ - tempObj = new tabberObj(tabberArgs); - - /* Find all DIV elements in the document that have class=tabber */ - - /* First get an array of all DIV elements and loop through them */ - divs = document.getElementsByTagName("div"); - for (i=0; i < divs.length; i++) { - - /* Is this DIV the correct class? */ - if (divs[i].className && - divs[i].className.match(tempObj.REclassMain)) { - - /* Now tabify the DIV */ - tabberArgs.div = divs[i]; - divs[i].tabber = new tabberObj(tabberArgs); - } - } - - return this; -} - - -/*==================================================*/ - - -function tabberAutomaticOnLoad(tabberArgs) -{ - /* This function adds tabberAutomatic to the window.onload event, - so it will run after the document has finished loading. - */ - var oldOnLoad; - - if (!tabberArgs) { tabberArgs = {}; } - - /* Taken from: http://simon.incutio.com/archive/2004/05/26/addLoadEvent */ - - oldOnLoad = window.onload; - if (typeof window.onload != 'function') { - window.onload = function() { - tabberAutomatic(tabberArgs); - - }; - } else { - window.onload = function() { - oldOnLoad(); - tabberAutomatic(tabberArgs); - - }; - } -} - - -/*==================================================*/ -function init_tabs(){ - if (typeof tabberOptions == 'undefined') { - tabberAutomatic({}); - } - else - {if (!tabberOptions['manualStartup']) { - tabberAutomatic(tabberOptions); - } - } -} - -function init_autotabber(){ -/* Run tabberAutomaticOnload() unless the "manualStartup" option was specified */ - - if (typeof tabberOptions == 'undefined') { - - tabberAutomaticOnLoad(); - - } else { - - if (!tabberOptions['manualStartup']) { - tabberAutomaticOnLoad(tabberOptions); - } - - } -} \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/lib/js-pushlet-client.js b/sw/in_progress/pow/pow/WebContent/lib/js-pushlet-client.js deleted file mode 100644 index 8a0739d9ca..0000000000 --- a/sw/in_progress/pow/pow/WebContent/lib/js-pushlet-client.js +++ /dev/null @@ -1,612 +0,0 @@ -/* - * Pushlet JS client library. - * NOTE: this should replace the js-pushlet-client.jsp file - * (since we can figure out pushletWebRoot from within JS) - * - * $Id: js-pushlet-client.js,v 1.2 2007/11/10 14:17:18 justb Exp $ - */ -var flag = false; -var pushletWebRoot = null; -var pushletURI; -var pushletNetURI; -var sessionId = null; -var controlQueue = new Queue(20); -var statusMsg = 'null'; -var statusChanged = false; -var statusChar = '|'; -var pushletNet; -var listenMode = null; -var listenSubject = null; - -// Initialize various URLs -_initURIs(); - -/************ Public application functions ******************/ - -// Embed pushlet frame in page -function p_embed(thePushletWebRoot) { - if (thePushletWebRoot) { - // Use this when webapp is not in same server e.g. with virtual hosts - pushletWebRoot = thePushletWebRoot; - _initURIs(); - } -//alert(pushletNetURI+""); - p_debug(flag, "p_embed", 'write ' + pushletLayer); - var pushletLayer = ''; - - self.document.write(pushletLayer); - _setStatus('initializing...'); - _showStatus(); - _waitForPushletFrame(); -} - -// Join the pushlet server -function p_join() { - // Ignore (for now) if already joined - if (sessionId != null) { - return; - } - - _setStatus('connecting...'); - p_debug(flag, "p_join", 'joining..'); - - - // Check if pushlet frame is loaded - if (pushletNet) { - // Pushlet iframe is ready for calls - pushletNet.setControlURI(pushletURI + '?p_event=join'); - } else { - - // Pushlet net iframe not loaded: continue waiting - setTimeout("p_join()", 100); - } -} - -// Create data event channel with the server -function p_listen(subject, mode) { - // Optional initial subject to subscribe to - if (subject) { - // Remember - listenSubject = subject; - } - - // Optional mode (stream, pull, poll) i.s.o. default - if (mode) { - // Remember - listenMode = mode; - } - - // Loop forever as long not joined - if (sessionId) { - // ok we have joined - - // Create event URI for listen - var uri = pushletURI + '?p_id=' + sessionId + '&p_event=listen'; - - // Optional subject to subscribe to - if (listenSubject) { - uri = uri + '&p_subject=' + listenSubject; - } - - // Optional mode (stream, pull, poll) i.s.o. default - if (listenMode) { - uri = uri + '&p_mode=' + listenMode; - } - - pushletNet.listen(uri); - return; - } - - // No join ack (sessionId) yet: wait until received - setTimeout("p_listen()", 100); - -} - -// Shorthand: Join the pushlet server and start listening immediately -function p_join_listen(subject, mode) { - p_join(); - p_listen(subject, mode); -} - -// Leave the pushlet server -function p_leave() { - // Ignore (for now) if already left - if (sessionId == null) { - return; - } - - var uri = pushletURI + '?p_event=leave'; - p_debug(flag, 'p_leave', 'leave uri=' + uri); - _sendControlURI(uri); -} - - -// Send heartbeat event; callback is onHeartbeatAck() -function p_heartbeat() { - var uri = pushletURI + '?p_event=hb'; - p_debug(flag, 'p_heartbeat'); - _sendControlURI(uri); -} - -// Publish to a subject -function p_publish(subject, nvPairs) { - if (!subject) { - return false; - } - - var uri = pushletURI + '?p_event=publish&p_subject=' + subject; - - var args = p_publish.arguments; - - // Put the arguments' name/value pairs in the URI - for (var i = 1; i < args.length; i++) { - uri = uri + '&' + args[i] + '=' + args[++i]; - } - - p_debug(false, 'p_publish', 'publish uri=' + uri); - _sendControlURI(uri); -} - -// Subscribe to a subject with optional label -function p_subscribe(subject, label) { - var uri = pushletURI + '?p_event=subscribe&p_subject=' + subject; - if (label) { - uri = uri + '&p_label=' + label; - } - - p_debug(flag, 'p_subscribe', 'subscribe uri=' + uri); - _sendControlURI(uri); -} - - // Unsubscribe from a subject -function p_unsubscribe(subscriptionId) { - var uri = pushletURI + '?p_event=unsubscribe'; - - if (subscriptionId) { - uri = uri + '&p_sid=' + subscriptionId; - } - - p_debug(flag, 'p_unsubscribe', 'unsubscribe uri=' + uri); - _sendControlURI(uri); -} - - -// Get webroot for this webapp -function p_getWebRoot() { - return pushletWebRoot; -} - -// Get pushlet session id -function p_getSessionId() { - return sessionId; -} - -// Show debug window -function p_setDebug(aFlag) { - flag = aFlag; - p_setNetDebug(aFlag); -} - -// Show network debug window -function p_setNetDebug(aFlag) { - pushletNet.p_setDebug(aFlag); -} - -/************ Private functions ******************/ - -/** CALLBACKS FROM pushletFrame ***/ - -// Generic callback from server; this function is called from within the -// Pushlet subscriber frame (see frames below). -function _push(args) { - // Create a PushletEvent object from the arguments passed in - // push.arguments is event data coming from the Server - var event = new PushletEvent(args); - - p_debug(flag, '_push() from server: ', event.toString()); - - // Do action based on event type - var eventType = event.getEvent(); - - if (eventType == 'data') { - _setStatus('data'); - _doCallback(event, window.onData); - } else if (eventType == 'join-ack') { - sessionId = event.get('p_id'); - _setStatus('connected'); - _doCallback(event, window.onJoinAck); - } else if (eventType == 'listen-ack') { - _setStatus('listening'); - _doCallback(event, window.onListenAck); - - // Send empty heartbeat event. This - // silences many busy browser windows. - // At least in Moz and IE. - p_heartbeat(); - } else if (eventType == 'hb') { - _setStatus('heartbeat'); - _doCallback(event, window.onHeartbeat); - } else if (eventType == 'hb-ack') { - _doCallback(event, window.onHeartbeatAck); - } else if (eventType == 'leave-ack') { - sessionId = null; - _setStatus('disconnected'); - _doCallback(event, window.onLeaveAck); - } else if (eventType == 'refresh-ack') { - _doCallback(event, window.onRefreshAck); - } else if (eventType == 'subscribe-ack') { - _setStatus('subscribed to ' + event.get('p_subject')); - _doCallback(event, window.onSubscribeAck); - } else if (eventType == 'unsubscribe-ack') { - _setStatus('unsubscribed'); - _doCallback(event, window.onUnsubscribeAck); - } else if (eventType == 'abort') { - _setStatus('abort'); - _doCallback(event, window.onAbort); - } else if (eventType.match(/nack$/)) { - _setStatus('error response: ' + event.get('p_reason')); - _doCallback(event, window.onNack); - } -} - -function getWebRoot() { - /** Return directory of this relative to document URL. */ - if (pushletWebRoot != null) { - return pushletWebRoot; - } - //derive the baseDir value by looking for the script tag that loaded this file - var head = document.getElementsByTagName('head')[0]; - var nodes = head.childNodes; - for (var i = 0; i < nodes.length; ++i) { - var src = nodes.item(i).src; - if (src) { - var index = src.indexOf("lib/js-pushlet-client.js"); - if (index >= 0) { - pushletWebRoot = src.substring(0, index); - break; - } - } - } - return pushletWebRoot; -} - -function _initURIs() { - pushletURI = getWebRoot() + 'pushlet.srv'; - pushletNetURI = getWebRoot() + 'lib/js-pushlet-net.html'; - //alert(pushletURI); -// alert(pushletNetURI); -} - -function _showStatus() { - // To show progress - if (statusChanged == true) { - if (statusChar == '|') statusChar = '/'; - else if (statusChar == '/') statusChar = '--'; - else if (statusChar == '--') statusChar = '\\'; - else statusChar = '|'; - statusChanged = false; - } - - window.defaultStatus = statusMsg; - window.status = statusMsg + ' ' + statusChar; - timeout = window.setTimeout('_showStatus()', 400); -} - -function _setStatus(status) { - statusMsg = "pushlet - " + status; - statusChanged = true; -} - -function _onUnload() { - p_debug(true, "pushlet-lib", "_onUnload() called"); -} - -function _onBeforeUnload() { - p_debug(true, "pushlet-lib", "_onBeforeUnload() called"); -} - -function _onStop() { - p_debug(true, "pushlet-lib", "_onStop() called"); -} - -function _doCallback(event, cbFunction) { - // Do specific callback function if provided by client - if (cbFunction) { - // Do specific callback like onData(), onJoinAck() etc. - cbFunction(event); - } else if (window.onEvent) { - // general callback onEvent() provided to catch all events - onEvent(event); - } -} - -/** CALLS TO pushletFrame ***/ - - -function _sendControlURI(uri) { - if (controlQueue.isFull()) { - // TODO divert to errpage - alert('serious problem: control queue is full'); - // no sense going on - return; - } - - if (sessionId == null) { - controlQueue.enqueue(uri); - _processControlQueue(); - return; - } - - // All clear to send immediately ? - if (controlQueue.isEmpty()) { - if (pushletNet.isControlReady()) { - // Ok send direct - uri = uri + '&p_id=' + sessionId; - pushletNet.setControlURI(uri); - } else { - controlQueue.enqueue(uri); - } - } else { - // Queue not empty - controlQueue.enqueue(uri); - } - - if (!controlQueue.isEmpty()) { - _processControlQueue(); - } -} - -function _processControlQueue() { - if (controlQueue.isEmpty()) { - // all done - return; - } - - if (sessionId != null) { - // Dequeue next control URI if pushletFrame ready - if (pushletNet.isControlReady()) { - var uri = controlQueue.dequeue() + '&p_id=' + sessionId; - pushletNet.setControlURI(uri); - } - } - - // Loop forever as long queue is not empty - if (!controlQueue.isEmpty()) { - setTimeout("_processControlQueue()", 50); - } -} - - -function _waitForPushletFrame() { - // Loop forever as long net uri not ready - if (self.pushletFrame && self.pushletFrame.isLoaded && self.pushletFrame.isLoaded()) { - _setStatus('loaded pushlet frame...'); - - pushletNet = self.pushletFrame; - return; - } - - _setStatus('pushlet frame not ready'); - setTimeout("_waitForPushletFrame()", 20); -} - -/************** Util classes *******************************/ - -/** NV pair object */ -function NameValuePair(name, value) { - this.name = name; - this.value = value; -} - -/** Simple Map object to store array of name/value pairs */ -function Map() { - // Data members - this.index = 0; - this.map = new Array(); - - // Function members - this.get = MapGet; - this.put = MapPut; - this.toString = MapToString; - this.toTable = MapToTable; -} - -/** get() */ -function MapGet(name) { - for (var i = 0; i < this.index; i++) { - if (this.map[i].name == name) { - return this.map[i].value; - } - } - return ''; -} - -/** put() */ -function MapPut(name, value) { - this.map[this.index++] = new NameValuePair(name, value); -} - -/** To HTML string */ -function MapToString() { - var res = ''; - - for (var i = 0; i < this.index; i++) { - res = res + this.map[i].name + '=' + this.map[i].value + '\n'; - } - return res; -} - -/** To HTML table */ -function MapToTable() { - var res = ''; - var styleDiv = '
      ' - - for (var i = 0; i < this.index; i++) { - res = res + '
      '; - } - res += '
      ' + styleDiv + this.map[i].name + '' + styleDiv + this.map[i].value + '
      ' - return res; -} - -/** Simple FIFO Queue class */ -function Queue(aCapacity) { - // Data members - this.capacity = aCapacity; - this.size = 0; - this.arr = new Array(); - this.front = 0; - this.rear = 0; - - // Function members - this.dequeue = QueueDequeue; - this.enqueue = QueueEnqueue; - this.next = QueueNext; - this.isFull = QueueIsFull; - this.isEmpty = QueueIsEmpty; -} - -/** enqueue() */ -function QueueEnqueue(item) { - if (this.isFull()) { - alert('queue full !!'); - return; - } - - this.arr[this.rear] = item; - this.rear = this.next(this.rear); - this.size++; -} - -/** dequeue() */ -function QueueDequeue(name) { - if (this.isEmpty()) { - alert('queue empty !!'); - return; - } - var temp = this.arr[this.front]; - this.arr[this.front] = null; - this.front = this.next(this.front); - this.size--; - return temp; -} - -/** Circular counter. */ -function QueueNext(index) { - return (index + 1 < this.capacity ? index + 1 : 0); -} - -function QueueIsFull() { - return this.size == this.capacity; -} - -function QueueIsEmpty() { - return this.size == 0; -} - -/* Class to represent nl.justobjects.pushlet.Event in JavaScript. - Arguments are an array where args[i] is name and args[i+1] is value -*/ -function PushletEvent(args) { - // Member variable setup; the Map stores the N/V pairs - this.map = new Map(); - - // Member function setup - this.getSubject = PushletEventGetSubject - this.getEvent = PushletEventGetEvent - this.put = PushletEventPut - this.get = PushletEventGet - this.toString = PushletEventToString - this.toTable = PushletEventToTable - - // Put the arguments' name/value pairs in the Map - for (var i = 0; i < args.length; i++) { - this.put(args[i], args[++i]); - } -} - -// Get the subject attribute -function PushletEventGetSubject() { - return this.map.get('p_subject') -} - -// Get the subject attribute -function PushletEventGetEvent() { - return this.map.get('p_event') -} - -// Get event attribute -function PushletEventGet(name) { - return this.map.get(name) -} - -// Put event attribute -function PushletEventPut(name, value) { - return this.map.put(name, value) -} - -function PushletEventToString() { - return this.map.toString(); -} - -// Convert content to HTML TABLE -function PushletEventToTable() { - return this.map.toTable(); -} - -/*************** Debug utility *******************************/ -var timestamp = 0 -var debugWindow = null -var messages = new Array() -var messagesIndex = 0 - -/** Send debug messages to a (D)HTML window. */ -function p_debug(flag, label, value) { - - // Only print if the flag is set - if (!flag) { - return; - } - - var funcName = "none"; - - // Fetch JS function name if any - if (p_debug.caller) { - funcName = p_debug.caller.toString() - funcName = funcName.substring(9, funcName.indexOf(")") + 1) - } - - // Create message - var msg = "-" + funcName + ": " + label + "=" + value - - // Add optional timestamp - var now = new Date() - var elapsed = now - timestamp - if (elapsed < 10000) { - msg += " (" + elapsed + " msec)" - } - - timestamp = now - - // Show. - - if ((debugWindow == null) || debugWindow.closed) { - debugWindow = window.open("", "p_debugWin", "toolbar=no,scrollbars=yes,resizable=yes,width=600,height=400"); - } - - // Add message to current list - messages[messagesIndex++] = msg - - // Write doc header - debugWindow.document.writeln('Pushlet Debug Window'); - - // Write the messages - for (var i = 0; i < messagesIndex; i++) { - debugWindow.document.writeln('
      ' + i + ': ' + messages[i] + '
      '); - } - - // Write doc footer and close - debugWindow.document.writeln(''); - debugWindow.document.close(); - debugWindow.focus(); - -} diff --git a/sw/in_progress/pow/pow/WebContent/lib/js-pushlet-net.html b/sw/in_progress/pow/pow/WebContent/lib/js-pushlet-net.html deleted file mode 100644 index fceafc90b2..0000000000 --- a/sw/in_progress/pow/pow/WebContent/lib/js-pushlet-net.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - Pushlet Networking Component - - - - - - - - - - - - - - - diff --git a/sw/in_progress/pow/pow/WebContent/logOut.jsp b/sw/in_progress/pow/pow/WebContent/logOut.jsp deleted file mode 100644 index 49ec9f46f0..0000000000 --- a/sw/in_progress/pow/pow/WebContent/logOut.jsp +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - Log Out - - - - - - - - - - <%-- desabonnement du pushlet--%> -
      -Bye bye <% out.println(session.getAttribute("login")); %> !
      -Thank you for using Paparazzi On the Web !
      - -<% -session.removeAttribute("login"); -session.removeAttribute("rights"); -session.invalidate(); -%> - -

      -Click here to go to the Paparazzi project homepage.
      -Click here to return to the Paparazzi On the Web homepage. -

      -
      - - \ No newline at end of file diff --git a/sw/in_progress/pow/pow/WebContent/test.html b/sw/in_progress/pow/pow/WebContent/test.html deleted file mode 100644 index 048391b403..0000000000 --- a/sw/in_progress/pow/pow/WebContent/test.html +++ /dev/null @@ -1,92 +0,0 @@ - - - -Test Dom - - - - - - - - -

      Coucou

      - - - -
      - -
      - -
      -
      -
      - - - \ No newline at end of file diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/Version.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/Version.java deleted file mode 100644 index a2563f7192..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/Version.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet; - -/** - * Version info class. - * - *

      Purpose

      - * Extract version info from jar manifest file. - * - * @author Just van den Broecke - * @version $Id: Version.java,v 1.4 2006/05/06 00:10:11 justb Exp $ - */ - -public class Version { - /** Version info extracted from the .jar manifest file (see build.xml and build.properties). */ - public static final String SOFTWARE_VERSION = Version.class.getPackage().getSpecificationVersion(); - public static final String BUILD_DATE = Version.class.getPackage().getImplementationVersion(); -} - -/* - * $Log: Version.java,v $ - * Revision 1.4 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.3 2004/02/08 16:07:55 justb - * *** empty log message *** - * - * Revision 1.2 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.1 2003/08/11 21:29:48 justb - * first checkin - * - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/client/PushletClient.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/client/PushletClient.java deleted file mode 100644 index e1c77ebcfa..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/client/PushletClient.java +++ /dev/null @@ -1,699 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.client; - -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.EventParser; -import nl.justobjects.pushlet.core.Protocol; -import nl.justobjects.pushlet.util.PushletException; - -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.OutputStream; -import java.net.*; -import java.util.Map; - -/** - * Client API for Java HTTP client applets or apps. - *

      - * Use this class within Java client applications or applets. - * Implement a PushletClientListener to receive callbacks for - * data-related Event objects pushed by the server. - *

      - * This class may also be used as a base class and be extended - * for custom clients, hence the presence of many proteced methods. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: PushletClient.java,v 1.19 2009/06/04 12:46:35 justb Exp $ - * @see PushletClientListener - * @see nl.justobjects.pushlet.test.PushletApplet - * @see nl.justobjects.pushlet.test.PushletPingApplication - */ -public class PushletClient implements Protocol { - /** - * Pushlet URL. - */ - private String pushletURL; - - /** - * Debug flag for verbose output. - */ - private boolean debug; - - /** - * Id gotten on join ack - */ - private String id; - - /** - * Internal listener for data events pushed by server. - */ - protected DataEventListener dataEventListener; - - /** - * Constructor with full pushlet URL. - */ - public PushletClient(String aPushletURL) { - pushletURL = aPushletURL; - } - - /** - * Constructor with host and port using default URI. - */ - public PushletClient(String aHost, int aPort) { - this("http://" + aHost + ":" + aPort + DEFAULT_SERVLET_URI); - } - - /** - * Set proxy options and optional proxy authentication. - *

      - * Contributed by Dele Olajide - * See http://groups.yahoo.com/group/pushlet/message/634 - *

      - * Usage: - * PushletClient pushletClient = new PushletClient("http:://www.domain.com/pushlet"); - * pushletClient.setProxyOptions("proxy.bla.com", "8080", ....); - *

      - * use pushletClient further as normal - */ - public void setProxyOptions(String aProxyHost, - String aProxyPort, String theNonProxyHosts, - String aUserName, String aPassword, String anNTLMDomain) { - - // Enable proxying - System.setProperty("http.proxySet", "true"); - System.setProperty("http.proxyHost", aProxyHost); - System.setProperty("http.proxyPort", aProxyPort); - - // Set optional non-proxy hosts - if (theNonProxyHosts != null) { - System.setProperty("http.nonProxyHosts", theNonProxyHosts); - } - - // If user name specified configure proxy authentication - if (aUserName != null) { - System.setProperty("http.proxyUser", aUserName); - System.setProperty("http.proxyPassword", aPassword); - - // See inner class below - Authenticator.setDefault(new HTTPAuthenticateProxy(aUserName, aPassword)); - - // Optional NT domain - if (anNTLMDomain != null) { - System.setProperty("http.auth.ntlm.domain", anNTLMDomain); - } - } - } - - /** - * Join server, starts session. - */ - public void join() throws PushletException { - Event event = new Event(E_JOIN); - event.setField(P_FORMAT, FORMAT_XML); - Event response = doControl(event); - throwOnNack(response); - - // Join Ack received - id = response.getField(P_ID); - } - - /** - * Leave server, stops session. - */ - public void leave() throws PushletException { - stopListen(); - throwOnInvalidSession(); - Event event = new Event(E_LEAVE); - event.setField(P_ID, id); - Event response = doControl(event); - - throwOnNack(response); - id = null; - } - - /** - * Open data channel. - */ - public void listen(PushletClientListener aListener) throws PushletException { - listen(aListener, MODE_STREAM); - } - - /** - * Open data channel in stream or push mode. - */ - public void listen(PushletClientListener aListener, String aMode) throws PushletException { - listen(aListener, aMode, null); - } - - /** - * Open data channel in stream or push mode with a subject. - */ - public void listen(PushletClientListener aListener, String aMode, String aSubject) throws PushletException { - throwOnInvalidSession(); - stopListen(); - - String listenURL = pushletURL - + "?" + P_EVENT + "=" + E_LISTEN - + "&" + P_ID + "=" + id - + "&" + P_MODE + "=" + aMode; - if (aSubject != null) { - listenURL = listenURL + "&" + P_SUBJECT + "=" + aSubject; - } - - // Start listener thread (sync call). - startDataEventListener(aListener, listenURL); - } - - /** - * Immediate listener: joins/subscribes and listens in one action. - */ - public void joinListen(PushletClientListener aListener, String aMode, String aSubject) throws PushletException { - stopListen(); - - String listenURL = pushletURL - + "?" + P_EVENT + "=" + E_JOIN_LISTEN - + "&" + P_FORMAT + "=" + FORMAT_XML - + "&" + P_MODE + "=" + aMode - + "&" + P_SUBJECT + "=" + aSubject; - - // Start listener thread (sync call). - startDataEventListener(aListener, listenURL); - } - - /** - * Publish an event through server. - */ - public void publish(String aSubject, Map theAttributes) throws PushletException { - throwOnInvalidSession(); - Event event = new Event(E_PUBLISH, theAttributes); - event.setField(P_SUBJECT, aSubject); - event.setField(P_ID, id); - Event response = doControl(event); - throwOnNack(response); - } - - /** - * Subscribes, returning subscription id. - */ - public String subscribe(String aSubject, String aLabel) throws PushletException { - throwOnInvalidSession(); - Event event = new Event(E_SUBSCRIBE); - event.setField(P_ID, id); - event.setField(P_SUBJECT, aSubject); - - // Optional label, is returned in data events - if (aLabel != null) { - event.setField(P_SUBSCRIPTION_LABEL, aLabel); - } - - // Send request - Event response = doControl(event); - throwOnNack(response); - - return response.getField(P_SUBSCRIPTION_ID); - } - - /** - * Subscribes, returning subscription id. - */ - public String subscribe(String aSubject) throws PushletException { - return subscribe(aSubject, null); - } - - /** - * Unsubscribes with subscription id. - */ - public void unsubscribe(String aSubscriptionId) throws PushletException { - throwOnInvalidSession(); - Event event = new Event(E_UNSUBSCRIBE); - event.setField(P_ID, id); - - // Optional subscription id - if (aSubscriptionId != null) { - event.setField(P_SUBSCRIPTION_ID, aSubscriptionId); - } - - Event response = doControl(event); - throwOnNack(response); - } - - /** - * Unsubscribes from all subjects. - */ - public void unsubscribe() throws PushletException { - unsubscribe(null); - } - - /** - * Stop the listener. - */ - public void stopListen() throws PushletException { - if (dataEventListener != null) { - unsubscribe(); - dataEventListener.stop(); - dataEventListener = null; - } - } - - public void setDebug(boolean b) { - debug = b; - } - - /** - * Starts default DataEventListener and waits for its thread to start. - */ - protected void startDataEventListener(PushletClientListener aListener, String aListenURL) { - // Suggestion by Jeff Nowakowski 29.oct.2006 - dataEventListener = new DataEventListener(aListener, aListenURL); - - synchronized (dataEventListener) { - dataEventListener.start(); - try { - // Wait for data event listener (thread) to start - dataEventListener.wait(); - } catch (InterruptedException e) { - } - } - } - - protected void throwOnNack(Event anEvent) throws PushletException { - if (anEvent.getEventType().equals(E_NACK)) { - throw new PushletException("Negative response: reason=" + anEvent.getField(P_REASON)); - } - } - - protected void throwOnInvalidSession() throws PushletException { - if (id == null) { - throw new PushletException("Invalid pushlet session"); - } - } - - protected Reader openURL(String aURL) throws PushletException { - // Open URL connection with server - try { - p("Connecting to " + aURL); - URL url = new URL(aURL); - URLConnection urlConnection = url.openConnection(); - - // Disable any kind of caching. - urlConnection.setUseCaches(false); - urlConnection.setDefaultUseCaches(false); - - // TODO: later version may use POST - // Enable HTTP POST - // urlConnection.setDoOutput(true); - - // Do the POST with Event in XML in body - // OutputStream os = urlConnection.getOutputStream(); - // os.write(anEvent.toXML().getBytes()); - // os.flush(); - // os.close(); - - // Get the stream from the server. - // reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); - // Note: somehow the client does not work with some JVMs when using - // BufferedInputStream... So do unbuffered input. - // p("Opening urlConnection inputstream"); - return new InputStreamReader(urlConnection.getInputStream()); - - } catch (Throwable t) { - warn("openURL() could not open " + aURL, t); - throw new PushletException(" could not open " + aURL, t); - } - } - - - /** - * Send control events to server and return response. - */ - protected Event doControl(Event aControlEvent) throws PushletException { - String controlURL = pushletURL + "?" + aControlEvent.toQueryString(); - - p("doControl to " + controlURL); - - // Open URL connection with server - Reader reader = openURL(controlURL); - - // Get Pushlet event from stream - Event event = null; - try { - p("Getting event..."); - // Get next event from server - event = EventParser.parse(reader); - p("Event received " + event); - return event; - } catch (Throwable t) { - // Stop and report error. - warn("doControl() exception", t); - throw new PushletException(" error parsing response from" + controlURL, t); - } - } - - /** - * Util: print. - */ - protected void p(String s) { - if (debug) { - System.out.println("[PushletClient] " + s); - } - } - - /** - * Util: warn. - */ - protected void warn(String s) { - warn(s, null); - } - - /** - * Util: warn with exception. - */ - protected void warn(String s, Throwable t) { - System.err.println("[PushletClient] - WARN - " + s + " ex=" + t); - - if (t != null) { - t.printStackTrace(); - } - } - - /** - * Internal (default) listener for the Pushlet data channel. - */ - protected class DataEventListener implements Runnable { - /** - * Client's listener that gets called back on events. - */ - private PushletClientListener listener; - - /** - * Receiver receiveThread. - */ - private Thread receiveThread = null; - private Reader reader; - private String refreshURL; - private String listenURL; - - public DataEventListener(PushletClientListener aListener, String aListenURL) { - listener = aListener; - listenURL = aListenURL; - } - - public void start() { - // All ok: start a receiver receiveThread - receiveThread = new Thread(this); - receiveThread.start(); - - } - - /** - * Stop listening; may restart later with start(). - */ - public void stop() { - p("In stop()"); - bailout(); - } - - /** - * Receive event objects from server and callback listener. - */ - public void run() { - p("Start run()"); - try { - while (receiveThread != null && receiveThread.isAlive()) { - // Connect to server - reader = openURL(listenURL); - - synchronized (this) { - // Inform the calling thread we're ready to receive events. - // Suggestion by Jeff Nowakowski 29.oct.2006 - this.notify(); - } - - // Get events while we're alive. - while (receiveThread != null && receiveThread.isAlive()) { - Event event = null; - try { - // p("Getting event..."); - // Get next event from server - event = EventParser.parse(reader); - p("Event received " + event); - } catch (Throwable t) { - - // Stop and report error. - // warn("Stop run() on exception", t); - if (listener != null) { - listener.onError("exception during receive: " + t); - } - - break; - } - - // Handle event by calling listener - if (event != null && listener != null) { - // p("received: " + event.toXML()); - String eventType = event.getEventType(); - if (eventType.equals(E_HEARTBEAT)) { - listener.onHeartbeat(event); - } else if (eventType.equals(E_DATA)) { - listener.onData(event); - } else if (eventType.equals(E_JOIN_LISTEN_ACK)) { - id = event.getField(P_ID); - } else if (eventType.equals(E_LISTEN_ACK)) { - p("Listen ack ok"); - } else if (eventType.equals(E_REFRESH_ACK)) { - // ignore - } else if (eventType.equals(E_ABORT)) { - listener.onAbort(event); - listener = null; - break; - } else if (eventType.equals(E_REFRESH)) { - refresh(event); - } else { - handleUnknownEventType(eventType, event, listener); - } - } - } - } - } catch (Throwable t) { - warn("Exception in run() ", t); - // bailout(); - } - } - - protected void disconnect() { - p("start disconnect()"); - if (reader != null) { - try { - // this blocks, find another way - // reader.close(); - p("Closed reader ok"); - } catch (Exception ignore) { - } finally { - reader = null; - } - } - p("end disconnect()"); - } - - /** - * Stop receiver receiveThread. - */ - public void stopThread() { - p("In stopThread()"); - - // Keep a reference such that we can kill it from here. - Thread targetThread = receiveThread; - - receiveThread = null; - - // This should stop the main loop for this receiveThread. - // Killing a receiveThread on a blcing read is tricky. - // See also http://gee.cs.oswego.edu/dl/cpj/cancel.html - if ((targetThread != null) && targetThread.isAlive()) { - - targetThread.interrupt(); - - try { - - // Wait for it to die - targetThread.join(500); - } catch (InterruptedException ignore) { - } - - // If current receiveThread refuses to die, - // take more rigorous methods. - if (targetThread.isAlive()) { - - // Not preferred but may be needed - // to stop during a blocking read. - targetThread.stop(); - - // Wait for it to die - try { - targetThread.join(500); - } catch (Throwable ignore) { - } - } - - p("Stopped receiveThread alive=" + targetThread.isAlive()); - - } - } - - /** - * Stop listening on stream from server. - */ - public void bailout() { - p("In bailout()"); - stopThread(); - disconnect(); - } - - /** - * Handle refresh, by pausing. - */ - protected void refresh(Event aRefreshEvent) throws PushletException { - try { - // Wait for specified time. - Thread.sleep(Long.parseLong(aRefreshEvent.getField(P_WAIT))); - } catch (Throwable t) { - warn("abort while refresing"); - refreshURL = null; - return; - } - - // If stopped during sleep, don't proceed - if (receiveThread == null) { - return; - } - - // Create url to refresh - refreshURL = pushletURL - + "?" + P_ID + "=" + id - + "&" + P_EVENT + "=" + E_REFRESH - ; - - if (reader != null) { - try { - reader.close(); - - } catch (IOException ignore) { - - } - reader = null; - } - - reader = openURL(refreshURL); - } - - /** - * Handle unknown Event (default behaviour). - */ - protected void handleUnknownEventType(String eventType, Event event, PushletClientListener listener) { - warn("unsupported event type received: " + eventType); - } - } - - /** - * Authenticator - */ - private static class HTTPAuthenticateProxy extends Authenticator { - - /** - * Contributed by Dele Olajide - * See http://groups.yahoo.com/group/pushlet/message/634 - */ - - private String thePassword = ""; - private String theUser = ""; - - public HTTPAuthenticateProxy(String username, String password) { - - thePassword = password; - theUser = username; - } - - protected PasswordAuthentication getPasswordAuthentication() { - // System.out.println("[HttpAuthenticateProxy] Username = " + theUser); - // System.out.println("[HttpAuthenticateProxy] Password = " + thePassword); - - return new PasswordAuthentication(theUser, thePassword.toCharArray()); - } - - } - -} - -/* - * $Log: PushletClient.java,v $ - * Revision 1.19 2009/06/04 12:46:35 justb - * PushletClient: add more hooks for extension (feat ID: 2799694 Craig M) - * - * Revision 1.18 2007/11/10 13:52:47 justb - * make startDataEventListener method protected to allow overriding - * - * Revision 1.17 2006/10/29 16:47:57 justb - * included patch from Jeff Nowakowski: wait until listener thread runs - * - * Revision 1.16 2005/05/06 20:08:20 justb - * client enhancements - * - * Revision 1.15 2005/03/27 17:42:27 justb - * enhancements - * - * Revision 1.14 2005/03/25 23:54:04 justb - * *** empty log message *** - * - * Revision 1.13 2005/02/28 16:59:40 justb - * fixes for leave and disconnect - * - * Revision 1.12 2005/02/28 15:57:54 justb - * added SimpleListener example - * - * Revision 1.11 2005/02/21 12:31:44 justb - * added proxy contribution from Dele Olajide - * - * Revision 1.10 2005/02/20 13:05:32 justb - * removed the Postlet (integrated in Pushlet protocol) - * - * Revision 1.9 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.8 2005/02/18 09:54:12 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.7 2005/02/15 15:46:30 justb - * client API improves - * - * Revision 1.6 2005/02/15 13:28:56 justb - * first quick rewrite adapt for v2 protocol - * - * Revision 1.5 2004/10/25 21:23:44 justb - * *** empty log message *** - * - * Revision 1.4 2004/10/24 13:52:51 justb - * small fixes in client lib - * - * Revision 1.3 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.2 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.1 2004/03/10 20:14:17 justb - * renamed all *JavaPushletClient* to *PushletClient* - * - * Revision 1.10 2004/03/10 15:45:55 justb - * many cosmetic changes - * - * Revision 1.9 2003/08/17 20:30:20 justb - * cosmetic changes - * - * Revision 1.8 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * - */ \ No newline at end of file diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/client/PushletClient.java.patch b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/client/PushletClient.java.patch deleted file mode 100644 index 63d660354d..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/client/PushletClient.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- PushletClient.java 6 May 2005 20:08:20 -0000 1.16 -+++ PushletClient.java 28 Oct 2006 23:19:12 -0000 -@@ -142,7 +142,13 @@ - } - - dataEventListener = new DataEventListener(aListener, listenURL); -- dataEventListener.start(); -+ synchronized (dataEventListener) { -+ dataEventListener.start(); -+ try { -+ dataEventListener.wait(); -+ } catch (InterruptedException e) { -+ } -+ } - } - - /** Immediate listener. */ -@@ -354,6 +360,11 @@ - // Connect to server - reader = openURL(listenURL); - -+ synchronized (this) { -+ // Inform the calling thread we're ready to receive events. -+ this.notify(); -+ } -+ - // Get events while we're alive. - while (receiveThread != null && receiveThread.isAlive()) { - Event event = null; diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/client/PushletClientListener.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/client/PushletClientListener.java deleted file mode 100644 index 864e2ef7dd..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/client/PushletClientListener.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.client; - -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.Protocol; - -/** - * Interface for listener of the PushletClient object. - * - * @version $Id: PushletClientListener.java,v 1.5 2005/02/21 11:50:37 justb Exp $ - * @author Just van den Broecke - Just Objects © - **/ -public interface PushletClientListener extends Protocol { - /** Abort event from server. */ - public void onAbort(Event theEvent); - - /** Data event from server. */ - public void onData(Event theEvent); - - /** Heartbeat event from server. */ - public void onHeartbeat(Event theEvent); - - /** Error occurred. */ - public void onError(String message); -} - -/* -* $Log: PushletClientListener.java,v $ -* Revision 1.5 2005/02/21 11:50:37 justb -* ohase1 of refactoring Subscriber into Session/Controller/Subscriber -* -* Revision 1.4 2005/02/15 15:46:31 justb -* client API improves -* -* Revision 1.3 2004/10/24 12:58:18 justb -* revised client and test classes for new protocol -* -* Revision 1.2 2004/09/03 22:35:37 justb -* Almost complete rewrite, just checking in now -* -* Revision 1.1 2004/03/10 20:14:17 justb -* renamed all *JavaPushletClient* to *PushletClient* -* -* Revision 1.3 2003/08/15 08:37:40 justb -* fix/add Copyright+LGPL file headers and footers -* -* -*/ \ No newline at end of file diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/BrowserAdapter.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/BrowserAdapter.java deleted file mode 100644 index d523882f49..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/BrowserAdapter.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Iterator; - -/** - * Generic implementation of ClientAdapter for browser clients. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: BrowserAdapter.java,v 1.6 2007/11/09 13:15:35 justb Exp $ - */ -public class BrowserAdapter implements ClientAdapter, Protocol { - - public static final String START_DOCUMENT = - "" - + "" - + "\n"; - public static final String END_DOCUMENT = ""; - - private PrintWriter servletOut; - private HttpServletResponse servletRsp; - private int bytesSent; - - /** - * Constructor. - */ - public BrowserAdapter(HttpServletResponse aServletResponse) { - servletRsp = aServletResponse; - } - - /** - * Generic init. - */ - public void start() throws IOException { - // Keep servlet request/response objects until page ends in stop() - // Content type as HTML - servletRsp.setStatus(HttpServletResponse.SC_OK); - servletRsp.setContentType("text/html;charset=UTF-8"); - - // http://www.junlu.com/msg/45902.html - // Log.debug("bufsize=" + aRsp.getBufferSize()); - servletOut = servletRsp.getWriter(); - send(START_DOCUMENT); - } - - /** - * Push Event to client. - */ - public void push(Event anEvent) throws IOException { - Log.debug("BCA event=" + anEvent.toXML()); - - // Check if we should refresh - if (anEvent.getEventType().equals(Protocol.E_REFRESH)) { - // Append refresh and tail of HTML document - // Construct the JS callback line to be sent as last line of doc. - // This will refresh the request using the unique id to determine - // the subscriber instance on the server. The client will wait for - // a number of milliseconds. - long refreshWaitMillis = Long.parseLong(anEvent.getField(P_WAIT)); - - // Create servlet request for requesting next events (refresh) - String url = anEvent.getField(P_URL); - String jsRefreshTrigger = "\n"; - - - send(jsRefreshTrigger + END_DOCUMENT); - } else { - send(event2JavaScript(anEvent)); - } - } - - /** - * End HTML page in client browser. - */ - public void stop() { - // To be garbage collected if adapter remains active - servletOut = null; - } - - /** - * Send any string to browser. - */ - protected void send(String s) throws IOException { - // Send string to browser. - // Log.debug("Adapter: sending: " + s); - if (servletOut == null) { - throw new IOException("Client adapter was stopped"); - } - - servletOut.print(s); - - servletOut.flush(); - - // Note: this doesn't seem to have effect - // in Tomcat 4/5 if the client already disconnected. - servletRsp.flushBuffer(); - - bytesSent += s.length(); - Log.debug("bytesSent= " + bytesSent); - // Log.debug("BCA sent event: " + s); - } - - /** - * Converts the Java Event to a JavaScript function call in browser page. - */ - protected String event2JavaScript(Event event) throws IOException { - - // Convert the event to a comma-separated string. - String jsArgs = ""; - for (Iterator iter = event.getFieldNames(); iter.hasNext();) { - String name = (String) iter.next(); - String value = event.getField(name); - String nextArgument = (jsArgs.equals("") ? "" : ",") + "'" + name + "'" + ", \"" + value + "\""; - jsArgs += nextArgument; - } - - // Construct and return the function call */ - return ""; - } - -} - -/* - * $Log: BrowserAdapter.java,v $ - * Revision 1.6 2007/11/09 13:15:35 justb - * add charset=UTF-8 in returned HTTP content types - * - * Revision 1.5 2006/05/15 11:52:53 justb - * updates mainly for AJAX client - * - * Revision 1.4 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.3 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.2 2005/02/21 11:50:44 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.1 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.12 2005/02/15 13:30:23 justb - * changes for Tomcat buffering (now working in tc4 and 5.0) - * - * Revision 1.11 2005/01/24 22:45:58 justb - * getting safari to work - * - * Revision 1.10 2005/01/18 16:46:27 justb - * buffer size setting ignored by tomcat workings - * - * Revision 1.9 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.8 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.7 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.6 2004/08/15 16:00:15 justb - * enhancements to pull mode - * - * Revision 1.5 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.4 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.3 2003/08/12 09:57:05 justb - * replaced all print statements to Log.*() calls - * - * Revision 1.2 2003/05/18 16:15:07 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:30 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:02 justb - * first import into SF - * - * Revision 1.5 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.4 2000/12/27 22:39:35 just - * no message - * - * Revision 1.3 2000/10/30 14:15:47 just - * no message - * - * - */ - diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/ClientAdapter.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/ClientAdapter.java deleted file mode 100644 index 4b187325ef..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/ClientAdapter.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import java.io.IOException; - -/** - * Adapter interface for encapsulation of specific HTTP clients. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: ClientAdapter.java,v 1.8 2007/11/23 14:33:07 justb Exp $ - */ -public interface ClientAdapter { - - /** - * Start event push. - */ - public void start() throws IOException; - - /** - * Push single Event to client. - */ - public void push(Event anEvent) throws IOException; - - /** - * Stop event push. - */ - public void stop() throws IOException; -} - -/* - * $Log: ClientAdapter.java,v $ - * Revision 1.8 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.7 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.6 2005/02/21 11:50:45 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.5 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.4 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.3 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:30 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ - diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Command.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Command.java deleted file mode 100644 index dbba4fae76..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Command.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Servlets; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * Wraps pushlet request/response data. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Command.java,v 1.4 2007/11/23 14:33:07 justb Exp $ - */ -public class Command implements Protocol { - - /** - * Pushlet request event. - */ - public final Event reqEvent; - - /** - * Pushlet response event. - */ - private Event rspEvent; - - /** - * HTTP Servlet GET/POST request. - */ - public final HttpServletRequest httpReq; - - /** - * HTTP Servlet GET/POST response. - */ - public final HttpServletResponse httpRsp; - - /** - * Pushlet session. - */ - public final Session session; - - /** - * Per-response client adapter. - */ - private ClientAdapter clientAdapter; - - /** - * Constructor. - */ - private Command(Session aSession, Event aRequestEvent, HttpServletRequest aHTTPReq, HttpServletResponse aHTTPRsp) { - session = aSession; - reqEvent = aRequestEvent; - httpReq = aHTTPReq; - httpRsp = aHTTPRsp; - } - - /** - * Create new Command object. - */ - public static Command create(Session aSession, Event aReqEvent, HttpServletRequest aHTTPReq, HttpServletResponse aHTTPRsp) { - return new Command(aSession, aReqEvent, aHTTPReq, aHTTPRsp); - } - - /** - * Set pushlet response event. - */ - public void setResponseEvent(Event aResponseEvent) { - rspEvent = aResponseEvent; - } - - /** - * Get pushlet response event. - */ - public Event getResponseEvent() { - return rspEvent; - } - - /** - * Get client adapter for request. - */ - public ClientAdapter getClientAdapter() throws PushletException { - if (clientAdapter == null) { - // Create and initialize client-specific adapter. - clientAdapter = createClientAdapter(); - } - return clientAdapter; - } - - /** - * Create client notifier based on "format" parameter passed in request. - */ - protected ClientAdapter createClientAdapter() throws PushletException { - - // Assumed to be set by parent. - String outputFormat = session.getFormat(); - - // Determine client adapter to create. - if (outputFormat.equals(FORMAT_JAVASCRIPT)) { - // Client expects to receive Events as JavaScript dispatch calls.. - return new BrowserAdapter(httpRsp); - } else if (outputFormat.equals(FORMAT_SERIALIZED_JAVA_OBJECT)) { - // Client expects to receive Events as Serialized Java Objects. - return new SerializedAdapter(httpRsp); - } else if (outputFormat.equals(FORMAT_XML)) { - // Client expects to receive Events as stream of XML docs. - return new XMLAdapter(httpRsp); - } else if (outputFormat.equals(FORMAT_XML_STRICT)) { - // Client expects to receive Events embedded in single XML doc. - return new XMLAdapter(httpRsp, true); - } else { - throw new PushletException("Null or invalid output format: " + outputFormat); - } - } - - /** - * Sends HTTP response headers. - */ - protected void sendResponseHeaders() { - // Just to try to prevent caching in any form. - Servlets.setNoCacheHeaders(httpRsp); - - // Close connection for Java enabled browsers - if (session.getUserAgent().indexOf("java") > 0) { - // The connection should be closed after this request - // NB: this allows sending a "long response". Some clients - // in particular java.net.URL in VMs > 1.1 that use HTTP/1.1 - // will block if - // - the content length is not sent - // - if Connection: close HTTP header is not sent. - // - // Since we don't know the content length we will assume - // the underlying servlet engine will use chunked encoding. - httpRsp.setHeader("Connection", "close"); - } - } - - -} - -/* - * $Log: Command.java,v $ - * Revision 1.4 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.3 2005/05/06 19:44:00 justb - * added xml-strict format - * - * Revision 1.2 2005/02/28 17:25:15 justb - * commented - * - * Revision 1.1 2005/02/28 12:45:59 justb - * introduced Command class - * - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Config.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Config.java deleted file mode 100644 index c598e033d7..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Config.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Sys; - -import java.io.File; -import java.util.Properties; - -/** - * Loads and maintains overall configuration. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Config.java,v 1.5 2007/11/23 21:10:17 justb Exp $ - */ -public class Config implements ConfigDefs { - private static final String PROPERTIES_FILE = "pushlet.properties"; - private static Properties properties; - - /** - * Factory method: create object from property denoting class name. - * - * @param aClassNameProp property name e.g. "session.class" - * @return an instance of class denoted by property - * @throws PushletException when class cannot be instantiated - */ - public static Object createObject(String aClassNameProp, String aDefault) throws PushletException { - Class clazz = getClass(aClassNameProp, aDefault); - try { - return clazz.newInstance(); - } catch (Throwable t) { - // Usually a misconfiguration - throw new PushletException("Cannot instantiate class for " + aClassNameProp + "=" + clazz, t); - } - } - - /** - * Factory method: create object from property denoting class name. - * - * @param aClassNameProp property name e.g. "session.class" - * @return a Class object denoted by property - * @throws PushletException when class cannot be instantiated - */ - public static Class getClass(String aClassNameProp, String aDefault) throws PushletException { - // Singleton + factory pattern: create object instance - // from configured class name - String clazz = (aDefault == null ? getProperty(aClassNameProp) : getProperty(aClassNameProp, aDefault)); - - try { - return Class.forName(clazz); - } catch (ClassNotFoundException t) { - // Usually a misconfiguration - throw new PushletException("Cannot find class for " + aClassNameProp + "=" + clazz, t); - } - } - - /** - * Initialize event sources from properties file. - */ - public static void load(String aDirPath) { - // Load Event sources using properties file. - try { - // Try loading through classpath first (e.g. in WEB-INF/classes or from .jar) - Log.info("Config: loading " + PROPERTIES_FILE + " from classpath"); - properties = Sys.loadPropertiesResource(PROPERTIES_FILE); - } catch (Throwable t) { - // Try from provided dir (e.g. WEB_INF/pushlet.properties) - String filePath = aDirPath + File.separator + PROPERTIES_FILE; - Log.info("Config: cannot load " + PROPERTIES_FILE + " from classpath, will try from " + filePath); - - try { - properties = Sys.loadPropertiesFile(filePath); - } catch (Throwable t2) { - Log.fatal("Config: cannot load properties file from " + filePath, t); - - // Give up - return; - } - } - - Log.info("Config: loaded values=" + properties); - } - - public static String getProperty(String aName, String aDefault) { - return properties.getProperty(aName, aDefault); - } - - public static String getProperty(String aName) { - String value = properties.getProperty(aName); - if (value == null) { - throw new IllegalArgumentException("Unknown property: " + aName); - } - return value; - } - - public static boolean getBoolProperty(String aName) { - String value = getProperty(aName); - try { - return value.equals("true"); - } catch (Throwable t) { - throw new IllegalArgumentException("Illegal property value: " + aName + " val=" + value); - } - } - - public static int getIntProperty(String aName) { - String value = getProperty(aName); - try { - return Integer.parseInt(value); - } catch (Throwable t) { - throw new IllegalArgumentException("Illegal property value: " + aName + " val=" + value); - } - } - - public static long getLongProperty(String aName) { - String value = getProperty(aName); - try { - return Long.parseLong(value); - } catch (Throwable t) { - throw new IllegalArgumentException("Illegal property value: " + aName + " val=" + value); - } - } - - public static boolean hasProperty(String aName) { - return properties.containsKey(aName); - } - - -} - -/* - * $Log: Config.java,v $ - * Revision 1.5 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.4 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.3 2007/11/10 13:44:02 justb - * pushlet.properties and sources.properties can now also be put under WEB-INF - * - * Revision 1.2 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.1 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/ConfigDefs.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/ConfigDefs.java deleted file mode 100644 index df00d41beb..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/ConfigDefs.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - - -/** - * Definition of config property strings. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: ConfigDefs.java,v 1.9 2007/12/07 12:57:40 justb Exp $ - */ -public interface ConfigDefs { - /** - * Class factory definitions, used to insert your custom classes. - */ - public static final String CONTROLLER_CLASS = "controller.class"; - public static final String DISPATCHER_CLASS = "dispatcher.class"; - public static final String LOGGER_CLASS = "logger.class"; - public static final String SESSION_MANAGER_CLASS = "sessionmanager.class"; - public static final String SESSION_CLASS = "session.class"; - public static final String SUBSCRIBER_CLASS = "subscriber.class"; - public static final String SUBSCRIPTION_CLASS = "subscription.class"; - - /** - * Session management. - */ - public static final String SESSION_ID_SIZE = "session.id.size"; - public static final String SESSION_ID_GENERATION = "session.id.generation"; - public static final String SESSION_ID_GENERATION_UUID = "uuid"; - public static final String SESSION_ID_GENERATION_RANDOMSTRING = "randomstring"; - public static final String SESSION_TIMEOUT_MINS = "session.timeout.mins"; - - public static final String SOURCES_ACTIVATE = "sources.activate"; - - /** - * Logging - */ - public static final String LOG_LEVEL = "log.level"; - public static final int LOG_LEVEL_FATAL = 1; - public static final int LOG_LEVEL_ERROR = 2; - public static final int LOG_LEVEL_WARN = 3; - public static final int LOG_LEVEL_INFO = 4; - public static final int LOG_LEVEL_DEBUG = 5; - public static final int LOG_LEVEL_TRACE = 6; - - /** - * Queues - */ - public static final String QUEUE_SIZE = "queue.size"; - public static final String QUEUE_READ_TIMEOUT_MILLIS = "queue.read.timeout.millis"; - public static final String QUEUE_WRITE_TIMEOUT_MILLIS = "queue.write.timeout.millis"; - - /** - * Listening modes. - */ - public static final String LISTEN_FORCE_PULL_ALL = "listen.force.pull.all"; - public static final String LISTEN_FORCE_PULL_AGENTS = "listen.force.pull.agents"; - - - public static final String PULL_REFRESH_TIMEOUT_MILLIS = "pull.refresh.timeout.millis"; - public static final String PULL_REFRESH_WAIT_MIN_MILLIS = "pull.refresh.wait.min.millis"; - public static final String PULL_REFRESH_WAIT_MAX_MILLIS = "pull.refresh.wait.max.millis"; - - - public static final String POLL_REFRESH_TIMEOUT_MILLIS = "poll.refresh.timeout.millis"; - public static final String POLL_REFRESH_WAIT_MIN_MILLIS = "poll.refresh.wait.min.millis"; - public static final String POLL_REFRESH_WAIT_MAX_MILLIS = "poll.refresh.wait.max.millis"; - -} - -/* - * $Log: ConfigDefs.java,v $ - * Revision 1.9 2007/12/07 12:57:40 justb - * added log4j and make it the default logging method - * - * Revision 1.8 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.7 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.6 2007/11/10 14:48:35 justb - * make session key generation configurable (can use uuid) - * - * Revision 1.5 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.4 2005/02/21 16:59:00 justb - * SessionManager and session lease introduced - * - * Revision 1.3 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.2 2005/02/21 11:16:44 justb - * add log level config prop - * - * Revision 1.1 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - * - * - */ - diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Controller.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Controller.java deleted file mode 100644 index ca90b1539e..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Controller.java +++ /dev/null @@ -1,502 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.PushletException; - -import java.io.IOException; - -/** - * Handles servlet requests from client. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Controller.java,v 1.9 2007/11/23 14:33:07 justb Exp $ - */ -public class Controller implements Protocol, ConfigDefs { - - private Session session; - - /** - * Protected constructor as we create through factory method. - */ - protected Controller() { - } - - /** - * Create instance through factory method. - * - * @param aSession the parent Session - * @return a Controller object (or derived) - * @throws PushletException exception, usually misconfiguration - */ - public static Controller create(Session aSession) throws PushletException { - Controller controller; - try { - controller = (Controller) Config.getClass(CONTROLLER_CLASS, "nl.justobjects.pushlet.core.Controller").newInstance(); - } catch (Throwable t) { - throw new PushletException("Cannot instantiate Controller from config", t); - } - controller.session = aSession; - return controller; - } - - /** - * Handle command. - */ - public void doCommand(Command aCommand) { - try { - // Update lease time to live - session.kick(); - - // Set remote IP address of client - session.setAddress(aCommand.httpReq.getRemoteAddr()); - - debug("doCommand() event=" + aCommand.reqEvent); - - // Get event type - String eventType = aCommand.reqEvent.getEventType(); - - // Determine action based on event type - if (eventType.equals(Protocol.E_REFRESH)) { - // Pull/poll mode clients that refresh - doRefresh(aCommand); - } else if (eventType.equals(Protocol.E_SUBSCRIBE)) { - // Subscribe - doSubscribe(aCommand); - } else if (eventType.equals(Protocol.E_UNSUBSCRIBE)) { - // Unsubscribe - doUnsubscribe(aCommand); - } else if (eventType.equals(Protocol.E_JOIN)) { - // Join - doJoin(aCommand); - } else if (eventType.equals(Protocol.E_JOIN_LISTEN)) { - // Join and listen (for simple and e.g. REST apps) - doJoinListen(aCommand); - } else if (eventType.equals(Protocol.E_LEAVE)) { - // Leave - doLeave(aCommand); - } else if (eventType.equals(Protocol.E_HEARTBEAT)) { - // Heartbeat mainly to do away with browser "busy" cursor - doHeartbeat(aCommand); - } else if (eventType.equals(Protocol.E_PUBLISH)) { - // Publish event - doPublish(aCommand); - } else if (eventType.equals(Protocol.E_LISTEN)) { - // Listen to pushed events - doListen(aCommand); - } - - // Handle response back to client - if (eventType.endsWith(Protocol.E_LISTEN) || - eventType.equals(Protocol.E_REFRESH)) { - // Data channel events - // Loops until refresh or connection closed - getSubscriber().fetchEvents(aCommand); - - } else { - // Send response for control commands - sendControlResponse(aCommand); - } - - } catch (Throwable t) { - warn("Exception in doCommand(): " + t); - t.printStackTrace(); - } - } - - public String toString() { - return session.toString(); - } - - /** - * Handle heartbeat event. - */ - protected void doHeartbeat(Command aCommand) { - - // Set heartbeat acknowledgement to client - aCommand.setResponseEvent(new Event(E_HEARTBEAT_ACK)); - } - - /** - * Handle Join request. - */ - protected void doJoin(Command aCommand) throws PushletException { - - Event responseEvent = null; - - try { - - session.start(); - - // Determine format for encoding Events to client. - // Default assume a userAgent window on the other end. - String format = aCommand.reqEvent.getField(P_FORMAT, FORMAT_JAVASCRIPT); - - session.setFormat(format); - responseEvent = new Event(E_JOIN_ACK); - - // Set unique subscriber id and encoding format - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_FORMAT, format); - info("joined"); - } catch (Throwable t) { - session.stop(); - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doJoin() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - - } - - /** - * Handle JoinListen request. - */ - protected void doJoinListen(Command aCommand) throws PushletException { - - // Basically bundles a join and a listen - // This request is handly for simple apps that - // need to do a single request to get events immediately - // For example in RESTful apps. - - // First do regular join - doJoin(aCommand); - if (!aCommand.getResponseEvent().getEventType().equals(E_NACK)) { - // If successful do the listen - doListen(aCommand); - if (!aCommand.getResponseEvent().getEventType().equals(E_NACK)) { - // If still ok do the listen ack - aCommand.getResponseEvent().setField(P_EVENT, E_JOIN_LISTEN_ACK); - } - } - } - - /** - * Handle Leave request. - */ - protected void doLeave(Command aCommand) throws IOException { - - Event responseEvent = null; - - try { - // Also removes all subscriptions - session.stop(); - - // Prepare acknowledgement - responseEvent = new Event(E_LEAVE_ACK); - - // Set unique subscriber id - responseEvent.setField(P_ID, session.getId()); - info("left"); - } catch (Throwable t) { - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doLeave() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - - } - - /** - * Handle Listen request. - */ - protected void doListen(Command aCommand) throws PushletException { - - - String mode = MODE_STREAM; - // Should we always force "pull" mode ? - if (Config.getBoolProperty(LISTEN_FORCE_PULL_ALL)) { - mode = MODE_PULL; - } else { - // Determine optimal mode determined by parameter and/or user agent - // Mode param determines how events are transfered to the client - - // In "stream" mode, a stream of events is sent, i.e. the document - // is neverending. In "pull" or "poll" mode a complete document is returned - // ending with a request to refresh. - mode = aCommand.reqEvent.getField(P_MODE, MODE_STREAM); - - String userAgent = aCommand.httpReq.getHeader("User-Agent"); - if (userAgent != null) { - userAgent = userAgent.toLowerCase(); - for (int i = 0; i < session.FORCED_PULL_AGENTS.length; i++) { - if ((userAgent.indexOf(session.FORCED_PULL_AGENTS[i]) != -1)) { - info("Forcing pull mode for agent=" + userAgent); - mode = MODE_PULL; - break; - } - } - } else { - userAgent = "unknown"; - } - } - - getSubscriber().setMode(mode); - - // Prepare acknowledgement - Event listenAckEvent = new Event(E_LISTEN_ACK); - - // Add subscription(s) if subject(s) specified - String subject = aCommand.reqEvent.getField(P_SUBJECT); - if (subject != null) { - // Optional label for subscription - String label = aCommand.reqEvent.getField(Protocol.P_SUBSCRIPTION_LABEL); - - // Add a subscription - Subscription subscription = getSubscriber().addSubscription(subject, label); - - // Add subscription id and optional label to listen-ack event - listenAckEvent.setField(P_SUBSCRIPTION_ID, subscription.getId()); - if (label != null) { - listenAckEvent.setField(P_SUBSCRIPTION_LABEL, label); - } - } - - // Set unique subscriber id, push mode and encoding format - listenAckEvent.setField(P_ID, session.getId()); - listenAckEvent.setField(P_MODE, mode); - listenAckEvent.setField(P_FORMAT, session.getFormat()); - - // Activate the subscriber - getSubscriber().start(); - - // Enqueue listen ack event on data channel - aCommand.setResponseEvent(listenAckEvent); - - info("Listening mode=" + mode + " userAgent=" + session.getUserAgent()); - - } - - /** - * Handle Publish request. - */ - protected void doPublish(Command aCommand) { - Event responseEvent = null; - - try { - String subject = aCommand.reqEvent.getField(Protocol.P_SUBJECT); - if (subject == null) { - // Return error response - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "no subject provided"); - } else { - aCommand.reqEvent.setField(P_FROM, session.getId()); - aCommand.reqEvent.setField(P_EVENT, E_DATA); - - // Event may be targeted to specific user (p_to field) - String to = aCommand.reqEvent.getField(P_TO); - if (to != null) { - Dispatcher.getInstance().unicast(aCommand.reqEvent, to); - } else { - // No to: multicast - debug("doPublish() event=" + aCommand.reqEvent); - Dispatcher.getInstance().multicast(aCommand.reqEvent); - } - - // Acknowledge - responseEvent = new Event(E_PUBLISH_ACK); - } - - } catch (Throwable t) { - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doPublish() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - } - - /** - * Handle refresh event. - */ - protected void doRefresh(Command aCommand) { - // Set ack - aCommand.setResponseEvent(new Event(E_REFRESH_ACK)); - } - - /** - * Handle Subscribe request. - */ - protected void doSubscribe(Command aCommand) throws IOException { - - Event responseEvent = null; - try { - String subject = aCommand.reqEvent.getField(Protocol.P_SUBJECT); - Subscription subscription = null; - if (subject == null) { - // Return error response - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "no subject provided"); - } else { - - String label = aCommand.reqEvent.getField(Protocol.P_SUBSCRIPTION_LABEL); - subscription = getSubscriber().addSubscription(subject, label); - - // Acknowledge - responseEvent = new Event(E_SUBSCRIBE_ACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_SUBJECT, subject); - responseEvent.setField(P_SUBSCRIPTION_ID, subscription.getId()); - if (label != null) { - responseEvent.setField(P_SUBSCRIPTION_LABEL, label); - } - info("subscribed to " + subject + " sid=" + subscription.getId()); - } - - } catch (Throwable t) { - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doSubscribe() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - } - - /** - * Handle Unsubscribe request. - */ - protected void doUnsubscribe(Command aCommand) throws IOException { - - - Event responseEvent = null; - try { - String subscriptionId = aCommand.reqEvent.getField(Protocol.P_SUBSCRIPTION_ID); - if (subscriptionId == null) { - // Unsuscbribe all - getSubscriber().removeSubscriptions(); - responseEvent = new Event(E_UNSUBSCRIBE_ACK); - responseEvent.setField(P_ID, session.getId()); - info("unsubscribed all"); - } else { - // Subscription id provided: remove Subscription - Subscription subscription = getSubscriber().removeSubscription(subscriptionId); - if (subscription == null) { - // Unknown subscription id: return error response - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "no subscription for sid=" + subscriptionId); - warn("unsubscribe: no subscription for sid=" + subscriptionId); - } else { - // OK return ack - responseEvent = new Event(E_UNSUBSCRIBE_ACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_SUBSCRIPTION_ID, subscription.getId()); - responseEvent.setField(P_SUBJECT, subscription.getSubject()); - if (subscription.getLabel() != null) { - responseEvent.setField(P_SUBSCRIPTION_LABEL, subscription.getLabel()); - } - info("unsubscribed sid= " + subscriptionId); - } - } - } catch (Throwable t) { - responseEvent = new Event(E_NACK); - responseEvent.setField(P_ID, session.getId()); - responseEvent.setField(P_REASON, "unexpected error: " + t); - warn("doUnsubscribe() error: " + t); - t.printStackTrace(); - } finally { - // Always set response event in command - aCommand.setResponseEvent(responseEvent); - } - } - - public Subscriber getSubscriber() { - return session.getSubscriber(); - } - - /** - * Send response on the control channel. - */ - protected void sendControlResponse(Command aCommand) { - try { - - // Try to prevent caching in any form. - aCommand.sendResponseHeaders(); - - // Let clientAdapter determine how to send event - aCommand.getClientAdapter().start(); - - // Push to client through client adapter - aCommand.getClientAdapter().push(aCommand.getResponseEvent()); - - // One shot response - aCommand.getClientAdapter().stop(); - } catch (Throwable t) { - session.stop(); - } - } - - - /** - * Info. - */ - protected void info(String s) { - session.info("[Controller] " + s); - } - - /** - * Exceptional print util. - */ - protected void warn(String s) { - session.warn("[Controller] " + s); - } - - /** - * Exceptional print util. - */ - protected void debug(String s) { - session.debug("[Controller] " + s); - } - - -} - -/* - * $Log: Controller.java,v $ - * Revision 1.9 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.8 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * Revision 1.7 2005/02/28 13:05:59 justb - * introduced join-listen protocol service - * - * Revision 1.6 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.5 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.4 2005/02/25 15:13:00 justb - * session id generation more robust - * - * Revision 1.3 2005/02/21 16:59:06 justb - * SessionManager and session lease introduced - * - * Revision 1.2 2005/02/21 12:32:28 justb - * fixed publish event in Controller - * - * Revision 1.1 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Dispatcher.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Dispatcher.java deleted file mode 100644 index 83b402f693..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Dispatcher.java +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.PushletException; - -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; - -/** - * Routes Events to Subscribers. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Dispatcher.java,v 1.9 2007/12/04 13:55:53 justb Exp $ - */ -public class Dispatcher implements Protocol, ConfigDefs { - /** - * Singleton pattern: single instance. - */ - private static Dispatcher instance; - protected SessionManagerVisitor sessionManagerVisitor; - - static { - try { - instance = (Dispatcher) Config.getClass(DISPATCHER_CLASS, "nl.justobjects.pushlet.core.Dispatcher").newInstance(); - Log.info("Dispatcher created className=" + instance.getClass()); - } catch (Throwable t) { - Log.fatal("Cannot instantiate Dispatcher from config", t); - } - } - - /** - * Singleton pattern with factory method: protected constructor. - */ - protected Dispatcher() { - - } - - /** - * Singleton pattern: get single instance. - */ - public static Dispatcher getInstance() { - return instance; - } - - /** - * Send event to all subscribers. - */ - public synchronized void broadcast(Event anEvent) { - try { - // Let the SessionManager loop through Sessions, calling - // our Visitor Method for each Session. This is done to guard - // synchronization with SessionManager and to optimize by - // not getting an array of all sessions. - Object[] args = new Object[2]; - args[1] = anEvent; - Method method = sessionManagerVisitor.getMethod("visitBroadcast"); - SessionManager.getInstance().apply(sessionManagerVisitor, method, args); - } catch (Throwable t) { - Log.error("Error calling SessionManager.apply: ", t); - } - } - - /** - * Send event to subscribers matching Event subject. - */ - public synchronized void multicast(Event anEvent) { - try { - // Let the SessionManager loop through Sessions, calling - // our Visitor Method for each Session. This is done to guard - // synchronization with SessionManager and to optimize by - // not getting an array of all sessions. - Method method = sessionManagerVisitor.getMethod("visitMulticast"); - Object[] args = new Object[2]; - args[1] = anEvent; - SessionManager.getInstance().apply(sessionManagerVisitor, method, args); - } catch (Throwable t) { - Log.error("Error calling SessionManager.apply: ", t); - } - } - - - /** - * Send event to specific subscriber. - */ - public synchronized void unicast(Event event, String aSessionId) { - // Get subscriber to send event to - Session session = SessionManager.getInstance().getSession(aSessionId); - if (session == null) { - Log.warn("unicast: session with id=" + aSessionId + " does not exist"); - return; - } - - // Send Event to subscriber. - session.getSubscriber().onEvent((Event) event.clone()); - } - - /** - * Start Dispatcher. - */ - public void start() throws PushletException { - Log.info("Dispatcher started"); - - // Create callback for SessionManager visits. - sessionManagerVisitor = new SessionManagerVisitor(); - } - - /** - * Stop Dispatcher. - */ - public void stop() { - // Send abort control event to all subscribers. - Log.info("Dispatcher stopped: broadcast abort to all subscribers"); - broadcast(new Event(E_ABORT)); - } - - /** - * Supplies Visitor methods for callbacks from SessionManager. - */ - private class SessionManagerVisitor { - private final Map visitorMethods = new HashMap(2); - - SessionManagerVisitor() throws PushletException { - - try { - // Setup Visitor Methods for callback from SessionManager - // This is a slight opitmization over creating Method objects - // on each invokation. - Class[] argsClasses = {Session.class, Event.class}; - visitorMethods.put("visitMulticast", this.getClass().getMethod("visitMulticast", argsClasses)); - visitorMethods.put("visitBroadcast", this.getClass().getMethod("visitBroadcast", argsClasses)); - } catch (NoSuchMethodException e) { - throw new PushletException("Failed to setup SessionManagerVisitor", e); - } - } - - /** - * Return Visitor Method by name. - */ - public Method getMethod(String aName) { - return (Method) visitorMethods.get(aName); - - } - - /** - * Visitor method called by SessionManager. - */ - public void visitBroadcast(Session aSession, Event event) { - aSession.getSubscriber().onEvent((Event) event.clone()); - } - - /** - * Visitor method called by SessionManager. - */ - public void visitMulticast(Session aSession, Event event) { - Subscriber subscriber = aSession.getSubscriber(); - Event clonedEvent; - Subscription subscription; - - // Send only if the subscriber's criteria - // match the event. - if ((subscription = subscriber.match(event)) != null) { - // Personalize event - clonedEvent = (Event) event.clone(); - - // Set subscription id and optional label - clonedEvent.setField(P_SUBSCRIPTION_ID, subscription.getId()); - if (subscription.getLabel() != null) { - event.setField(P_SUBSCRIPTION_LABEL, subscription.getLabel()); - } - - subscriber.onEvent(clonedEvent); - } - } - } -} - -/* - * $Log: Dispatcher.java,v $ - * Revision 1.9 2007/12/04 13:55:53 justb - * reimplement SessionManager concurrency (prev version was not thread-safe!) - * - * Revision 1.8 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.7 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.6 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.5 2005/02/21 16:59:06 justb - * SessionManager and session lease introduced - * - * Revision 1.4 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.3 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - * Revision 1.2 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.1 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.14 2005/02/16 14:39:34 justb - * fixed leave handling and added "poll" mode - * - * Revision 1.13 2004/10/24 20:50:35 justb - * refine subscription with label and sending sid and label on events - * - * Revision 1.12 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.11 2004/09/26 21:39:43 justb - * allow multiple subscriptions and out-of-band requests - * - * Revision 1.10 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.9 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.8 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.7 2004/08/12 13:18:54 justb - * cosmetic changes - * - * Revision 1.6 2004/03/10 15:45:55 justb - * many cosmetic changes - * - * Revision 1.5 2004/03/10 13:59:28 justb - * rewrite using Collection classes and finer synchronization - * - * Revision 1.4 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.3 2003/08/12 08:54:40 justb - * added getSubscriberCount() and use Log - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:18 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:04 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Event.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Event.java deleted file mode 100644 index b74d3c9bab..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Event.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Sys; - -import java.io.Serializable; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -/** - * Represents the event data. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Event.java,v 1.13 2007/11/23 14:33:07 justb Exp $ - */ -public class Event implements Protocol, Serializable { - - protected Map attributes = new HashMap(3); - - public Event(String anEventType) { - this(anEventType, null); - } - - public Event(String anEventType, Map theAttributes) { - - if (theAttributes != null) { - setAttrs(theAttributes); - } - - // Set required field event type - setField(P_EVENT, anEventType); - - // Set time in seconds since 1970 - setField(P_TIME, System.currentTimeMillis() / 1000); - } - - public Event(Map theAttributes) { - if (!theAttributes.containsKey(P_EVENT)) { - throw new IllegalArgumentException(P_EVENT + " not found in attributes"); - } - setAttrs(theAttributes); - } - - public static Event createDataEvent(String aSubject) { - return createDataEvent(aSubject, null); - } - - public static Event createDataEvent(String aSubject, Map theAttributes) { - Event dataEvent = new Event(E_DATA, theAttributes); - dataEvent.setField(P_SUBJECT, aSubject); - return dataEvent; - } - - public String getEventType() { - return getField(P_EVENT); - } - - public String getSubject() { - return getField(P_SUBJECT); - } - - public void setField(String name, String value) { - attributes.put(name, value); - } - - public void setField(String name, int value) { - attributes.put(name, value + ""); - } - - public void setField(String name, long value) { - attributes.put(name, value + ""); - } - - public String getField(String name) { - return (String) attributes.get(name); - } - - /** - * Return field; if null return default. - */ - public String getField(String name, String aDefault) { - String result = getField(name); - return result == null ? aDefault : result; - } - - public Iterator getFieldNames() { - return attributes.keySet().iterator(); - } - - public String toString() { - return attributes.toString(); - } - - /** - * Convert to HTTP query string. - */ - public String toQueryString() { - String queryString = ""; - String amp = ""; - for (Iterator iter = getFieldNames(); iter.hasNext();) { - String nextAttrName = (String) iter.next(); - String nextAttrValue = getField(nextAttrName); - queryString = queryString + amp + nextAttrName + "=" + nextAttrValue; - // After first add "&". - amp = "&"; - } - - return queryString; - } - - public String toXML(boolean strict) { - String xmlString = " -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import java.io.*; -import java.util.HashMap; - -/** - * Parses XML into Event objects. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: EventParser.java,v 1.3 2007/11/23 14:33:07 justb Exp $ - */ -public class EventParser { - - - private EventParser() { - } - - /** - * Parse Event from a File. - */ - public static Event parse(File aFile) throws IOException { - BufferedReader br = new BufferedReader(new FileReader(aFile)); - return parse(br); - } - - /** - * Parse Event from input Reader. - */ - public static Event parse(Reader aReader) throws IOException { - StringBuffer preparsedString = new StringBuffer(24); - - // First find the opening tag ('<') - char nextChar; - while ((nextChar = (char) aReader.read()) != '<') ; - - // Append '<' - preparsedString.append(nextChar); - - // Then find end-tag ('>'), appending all chars to preparsed string. - do { - nextChar = (char) aReader.read(); - preparsedString.append(nextChar); - } while (nextChar != '>'); - - return parse(preparsedString.toString()); - } - - /** - * Parse Event from a String. - */ - public static Event parse(String aString) throws IOException { - aString = aString.trim(); - - if (!aString.startsWith("<") || !aString.endsWith("/>")) { - throw new IOException("No start or end tag found while parsing event [" + aString + "]"); - } - - // Create the attributes object. - HashMap properties = new HashMap(3); - - // Remove the start and end (< ... />) from the string - aString = aString.substring(1, aString.length() - 2).trim(); - - int index = 0; - - // Parse the tag - while (!Character.isWhitespace(aString.charAt(index)) - && (index < aString.length())) { - index++; - } - - // We don't use the tag: remove from string - aString = aString.substring(index).trim(); - index = 0; - - String attrName; - String attrValue; - - while (index < aString.length()) { - - // Parse attribute name - while ((aString.charAt(index) != '=') - && (index < aString.length())) { - index++; - } - - // Create attr name string - attrName = aString.substring(0, index).trim(); - - // remove the attributeName and the '=' from the string - aString = aString.substring(index + 1).trim(); - index = 1; // read past the first wrapping "\"" - - // Parse attribute value - while ((aString.charAt(index) != '\"') - && (index < aString.length())) { - - // bypass the special characters '\' and '"' inside the - // attributevalue itself which are deliniated with a preceding - // '\' - if (aString.charAt(index) == '\\') { - aString = aString.substring(0, index) - + aString.substring(index + 1); // remove the '\' - } - - index++; - } - - // create the attribute value; exclude the wrapping quote-characters - attrValue = aString.substring(1, index); - - // Set the attribute N/V - properties.put(attrName, attrValue); - - aString = aString.substring(index + 1).trim(); - index = 0; - } - - return new Event(properties); - } - - /** - * Test method: use files to test. - */ - public static void main(String[] args) { - try { - Event event = parse(new File(args[0])); - System.out.println("OK parsed Event file " + args[0]); - System.out.println(event.toXML()); - - event = parse(event.toXML()); - System.out.println("OK parsed Event string"); - System.out.println(event.toXML()); - } catch (Throwable t) { - System.out.println("Error parsing event file: " + args[0]); - t.printStackTrace(); - } - } -} - -/* - * $Log: EventParser.java,v $ - * Revision 1.3 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.2 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.1 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.3 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.2 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.1 2003/05/18 16:12:27 justb - * adding support for XML encoded Events - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/EventPullSource.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/EventPullSource.java deleted file mode 100644 index 0f183dba1b..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/EventPullSource.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; - -/** - * Abstract Event source from which Events are pulled. - * - * @version $Id: EventPullSource.java,v 1.15 2007/11/23 14:33:07 justb Exp $ - * @author Just van den Broecke - Just Objects © - **/ - -/** - * ABC for specifc EventPullSources. - */ -abstract public class EventPullSource implements EventSource, Runnable { - private volatile boolean alive = false; - private volatile boolean active = false; - private static int threadNum = 0; - private Thread thread; - - public EventPullSource() { - } - - abstract protected long getSleepTime(); - - abstract protected Event pullEvent(); - - public void start() { - thread = new Thread(this, "EventPullSource-" + (++threadNum)); - thread.setDaemon(true); - thread.start(); - } - - public boolean isAlive() { - return alive; - } - - /** - * Stop the event generator thread. - */ - public void stop() { - alive = false; - - if (thread != null) { - thread.interrupt(); - thread = null; - } - - } - - /** - * Activate the event generator thread. - */ - synchronized public void activate() { - if (active) { - return; - } - active = true; - if (!alive) { - start(); - return; - } - Log.debug(getClass().getName() + ": notifying..."); - notifyAll(); - } - - /** - * Deactivate the event generator thread. - */ - public void passivate() { - if (!active) { - return; - } - active = false; - } - - /** - * Main loop: sleep, generate event and publish. - */ - public void run() { - Log.debug(getClass().getName() + ": starting..."); - alive = true; - while (alive) { - try { - - Thread.sleep(getSleepTime()); - - // Stopped during sleep: end loop. - if (!alive) { - break; - } - - // If passivated wait until we get - // get notify()-ied. If there are no subscribers - // it wasts CPU to remain producing events... - synchronized (this) { - while (!active) { - Log.debug(getClass().getName() + ": waiting..."); - wait(); - } - } - - } catch (InterruptedException e) { - break; - } - - try { - // Derived class should produce an event. - Event event = pullEvent(); - - // Let the publisher push it to subscribers. - Dispatcher.getInstance().multicast(event); - } catch (Throwable t) { - Log.warn("EventPullSource exception while multicasting ", t); - t.printStackTrace(); - } - } - Log.debug(getClass().getName() + ": stopped"); - } -} - -/* - * $Log: EventPullSource.java,v $ - * Revision 1.15 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.14 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.13 2005/02/21 16:59:08 justb - * SessionManager and session lease introduced - * - * Revision 1.12 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.11 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.10 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.9 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.8 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.7 2004/08/15 16:00:15 justb - * enhancements to pull mode - * - * Revision 1.6 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.5 2004/03/10 14:01:55 justb - * formatting and *Subscriber refactoring - * - * Revision 1.4 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.3 2003/08/12 09:57:05 justb - * replaced all print statements to Log.*() calls - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/EventQueue.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/EventQueue.java deleted file mode 100644 index 18fd52318d..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/EventQueue.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -/** - * FIFO queue with guarded suspension. - * Purpose
      - *

      - * Implementation
      - * FIFO queue class implemented with circular array. The enQueue() and - * deQueue() methods use guarded suspension according to a readers/writers - * pattern, implemented with java.lang.Object.wait()/notify(). - *

      - * Examples
      - *

      - *
      - * - * @author Just van den Broecke - Just Objects © - * @version $Id: EventQueue.java,v 1.3 2007/11/23 14:33:07 justb Exp $ - */ -public class EventQueue { - /** - * Defines maximum queue size - */ - private int capacity = 8; - private Event[] queue = null; - private int front, rear; - - /** - * Construct queue with default (8) capacity. - */ - public EventQueue() { - this(8); - } - - /** - * Construct queue with specified capacity. - */ - public EventQueue(int capacity) { - this.capacity = capacity; - queue = new Event[capacity]; - front = rear = 0; - } - - /** - * Put item in queue; waits() indefinitely if queue is full. - */ - public synchronized boolean enQueue(Event item) throws InterruptedException { - return enQueue(item, -1); - } - - /** - * Put item in queue; if full wait maxtime. - */ - public synchronized boolean enQueue(Event item, long maxWaitTime) throws InterruptedException { - - // Wait (optional maxtime) as long as the queue is full - while (isFull()) { - if (maxWaitTime > 0) { - // Wait at most maximum time - wait(maxWaitTime); - - // Timed out or woken; if still full we - // had bad luck and return failure. - if (isFull()) { - return false; - } - } else { - wait(); - } - } - - // Put item in queue - queue[rear] = item; - rear = next(rear); - - // Wake up waiters; NOTE: first waiter will eat item - notifyAll(); - return true; - } - - /** - * Get head; if empty wait until something in queue. - */ - public synchronized Event deQueue() throws InterruptedException { - return deQueue(-1); - } - - /** - * Get head; if empty wait for specified time at max. - */ - public synchronized Event deQueue(long maxWaitTime) throws InterruptedException { - while (isEmpty()) { - if (maxWaitTime >= 0) { - wait(maxWaitTime); - - // Timed out or woken; if still empty we - // had bad luck and return failure. - if (isEmpty()) { - return null; - } - } else { - // Wait indefinitely for something in queue. - wait(); - } - } - - // Dequeue item - Event result = fetchNext(); - - // Notify possible wait()-ing enQueue()-ers - notifyAll(); - - // Return dequeued item - return result; - } - - /** - * Get all queued Events. - */ - public synchronized Event[] deQueueAll(long maxWaitTime) throws InterruptedException { - while (isEmpty()) { - if (maxWaitTime >= 0) { - wait(maxWaitTime); - - // Timed out or woken; if still empty we - // had bad luck and return failure. - if (isEmpty()) { - return null; - } - } else { - // Wait indefinitely for something in queue. - wait(); - } - } - - // Dequeue all items item - Event[] events = new Event[getSize()]; - for (int i = 0; i < events.length; i++) { - events[i] = fetchNext(); - } - - // Notify possible wait()-ing enQueue()-ers - notifyAll(); - - // Return dequeued item - return events; - } - - public synchronized int getSize() { - return (rear >= front) ? (rear - front) : (capacity - front + rear); - } - - /** - * Is the queue empty ? - */ - public synchronized boolean isEmpty() { - return front == rear; - } - - /** - * Is the queue full ? - */ - public synchronized boolean isFull() { - return (next(rear) == front); - } - - /** - * Circular counter. - */ - private int next(int index) { - return (index + 1 < capacity ? index + 1 : 0); - } - - /** - * Circular counter. - */ - private Event fetchNext() { - Event temp = queue[front]; - queue[front] = null; - front = next(front); - return temp; - } - - public static void p(String s) { - System.out.println(s); - } - - public static void main(String[] args) { - EventQueue q = new EventQueue(8); - Event event = new Event("t"); - try { - q.enQueue(event); - p("(1) size = " + q.getSize()); - q.enQueue(event); - p("(2) size = " + q.getSize()); - q.deQueue(); - p("(1) size = " + q.getSize()); - q.deQueue(); - p("(0) size = " + q.getSize()); - - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - p("(3) size = " + q.getSize()); - q.deQueue(); - p("(2) size = " + q.getSize()); - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - p("(5) size = " + q.getSize()); - q.enQueue(event); - q.enQueue(event); - p("(7) size = " + q.getSize()); - q.deQueue(); - q.deQueue(); - q.deQueue(); - p("(4) size = " + q.getSize()); - q.deQueue(); - q.deQueue(); - q.deQueue(); - ; - q.deQueue(); - p("(0) size = " + q.getSize()); - - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - q.enQueue(event); - p("(5) size = " + q.getSize()); - - q.deQueue(); - q.deQueue(); - q.deQueue(); - ; - q.deQueue(); - p("(1) size = " + q.getSize()); - } catch (InterruptedException ie) { - } - } -} - -/* -* $Log: EventQueue.java,v $ -* Revision 1.3 2007/11/23 14:33:07 justb -* core classes now configurable through factory -* -* Revision 1.2 2005/02/21 11:50:46 justb -* ohase1 of refactoring Subscriber into Session/Controller/Subscriber -* -* Revision 1.1 2005/02/18 10:07:23 justb -* many renamings of classes (make names compact) -* -* Revision 1.6 2005/02/16 12:16:16 justb -* added support for "poll" mode -* -* Revision 1.5 2005/01/13 14:47:15 justb -* control evt: send response on same (control) connection -* -* Revision 1.4 2004/09/03 22:35:37 justb -* Almost complete rewrite, just checking in now -* -* Revision 1.3 2003/08/15 08:37:40 justb -* fix/add Copyright+LGPL file headers and footers -* -* -*/ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/EventSource.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/EventSource.java deleted file mode 100644 index 0975bde10e..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/EventSource.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import javax.servlet.ServletContext; - -/** - * Abstract Event source from which Events are pulled. - * - * @version $Id: EventSource.java,v 1.7 2007/11/23 14:33:07 justb Exp $ - * @author Just van den Broecke - Just Objects © - **/ - -/** - * Interface for specifc Event(Pull/Push)Sources. - */ -public interface EventSource { - /** - * Activate the event source. - */ - public void activate(); - - /** - * Deactivate the event source. - */ - public void passivate(); - - /** - * Halt the event source. - */ - public void stop(); - - /** - * @author thomas genin - * gives access to the servlet context of pushlet to the source class - */ - public void setServletContext(ServletContext srvCtxt); - -} - -/* - * $Log: EventSource.java,v $ - * Revision 1.7 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.6 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.5 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.4 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.3 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ - diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/EventSourceManager.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/EventSourceManager.java deleted file mode 100644 index 119c95fb58..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/EventSourceManager.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.Sys; - -import java.util.Enumeration; -import java.util.Properties; -import java.util.Vector; -import java.io.File; - -import javax.servlet.ServletContext; - -/** - * Maintains lifecycle of event sources. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: EventSourceManager.java,v 1.14 2007/11/10 13:44:02 justb Exp $ - */ -public class EventSourceManager { - private static Vector eventSources = new Vector(0); - private static final String PROPERTIES_FILE = "sources.properties"; - - /** - * Initialize event sources from properties file. - */ - public static void start(String aDirPath,ServletContext srvCtxt) { - // Load Event sources using properties file. - Log.info("EventSourceManager: start"); - - Properties properties = null; - - try { - properties = Sys.loadPropertiesResource(PROPERTIES_FILE); - } catch (Throwable t) { - // Try from provided dir (e.g. WEB_INF/pushlet.properties) - String filePath = aDirPath + File.separator + PROPERTIES_FILE; - Log.info("EventSourceManager: cannot load " + PROPERTIES_FILE + " from classpath, will try from " + filePath); - - try { - properties = Sys.loadPropertiesFile(filePath); - } catch (Throwable t2) { - Log.fatal("EventSourceManager: cannot load properties file from " + filePath, t); - - // Give up - Log.warn("EventSourceManager: not starting local event sources (maybe that is what you want)"); - return; - } - } - - // Create event source collection - eventSources = new Vector(properties.size()); - - // Add the configured sources - for (Enumeration e = properties.keys(); e.hasMoreElements();) { - String nextKey = (String) e.nextElement(); - String nextClass = properties.getProperty(nextKey); - EventSource nextEventSource = null; - try { - nextEventSource = (EventSource) Class.forName(nextClass).newInstance(); - //rajout thomas genin - nextEventSource.setServletContext(srvCtxt); - ////////////////////// - Log.info("created EventSource: key=" + nextKey + " class=" + nextClass); - eventSources.addElement(nextEventSource); - - } catch (Exception ex) { - Log.warn("Cannot create EventSource: class=" + nextClass, ex); - } - } - - activate(); - } - - /** - * Activate all event sources. - */ - public static void activate() { - Log.info("Activating " + eventSources.size() + " EventSources"); - for (int i = 0; i < eventSources.size(); i++) { - ((EventSource) eventSources.elementAt(i)).activate(); - } - Log.info("EventSources activated"); - } - - /** - * Deactivate all event sources. - */ - public static void passivate() { - Log.info("Passivating " + eventSources.size() + " EventSources"); - for (int i = 0; i < eventSources.size(); i++) { - ((EventSource) eventSources.elementAt(i)).passivate(); - } - Log.info("EventSources passivated"); - } - - /** - * Halt event sources. - */ - public static void stop() { - Log.info("Stopping " + eventSources.size() + " EventSources..."); - for (int i = 0; i < eventSources.size(); i++) { - ((EventSource) eventSources.elementAt(i)).stop(); - } - Log.info("EventSources stopped"); - } - -} - -/* - * $Log: EventSourceManager.java,v $ - * Revision 1.14 2007/11/10 13:44:02 justb - * pushlet.properties and sources.properties can now also be put under WEB-INF - * - * Revision 1.13 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.12 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - * Revision 1.11 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.10 2005/02/15 13:29:49 justb - * use Sys.loadPropertiesResource() - * - * Revision 1.9 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.8 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.7 2004/08/15 16:00:15 justb - * enhancements to pull mode - * - * Revision 1.6 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.5 2004/08/12 13:18:54 justb - * cosmetic changes - * - * Revision 1.4 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.3 2003/08/12 09:41:35 justb - * replace static initalizer with explicit init() - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:17 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.5 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.4 2000/10/30 14:15:47 just - * no message - * - * Revision 1.3 2000/08/31 08:26:54 just - * Changed classloader that loads eventsources.properties to use EventSourceManager's classloader - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Protocol.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Protocol.java deleted file mode 100644 index 79c265f62f..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Protocol.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) 2004 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - - -/** - * Constants for Pushlet protocols. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Protocol.java,v 1.15 2007/11/23 14:33:07 justb Exp $ - */ -public interface Protocol { - /** - * Default URI . - */ - public static final String DEFAULT_SERVLET_URI = "/pushlet/pushlet.srv"; - - // - // Common protocol header/parameter names - // - - /** - * Event type (join, leave, data, subscribe etc) . - */ - public static final String P_EVENT = "p_event"; - - /** - * Time in seconds since 1970 - */ - public static final String P_TIME = "p_time"; - - /** - * Event sequence number, numbers per-client. - */ - public static final String P_SEQ = "p_seq"; - - /** - * Subject (topic) of data event. - */ - public static final String P_SUBJECT = "p_subject"; - - /** - * Originator of Event. - */ - public static final String P_FROM = "p_from"; - - /** - * Addressee of Event, subject or client p_id. - */ - public static final String P_TO = "p_to"; - - /** - * Identifier for client instance within server. - */ - public static final String P_ID = "p_id"; - - /** - * Subscription id, identifies single subscription. - */ - public static final String P_SUBSCRIPTION_ID = "p_sid"; - - /** - * Format to receive events - */ - public static final String P_FORMAT = "p_format"; - - /** - * Protocol mode. - */ - public static final String P_MODE = "p_mode"; - - /** - * Reason for errors. - */ - public static final String P_REASON = "p_reason"; - - /** - * URL attribute. - */ - public static final String P_URL = "p_url"; - - /** - * Wait attribute. - */ - public static final String P_WAIT = "p_wait"; - - /** - * Subscription label, may be used to return user-specific - * token with a data event, e.g. the name of a function for a callback. - */ - public static final String P_SUBSCRIPTION_LABEL = "p_label"; - - // - // Event values with direction for P_EVENT (C=client, S=server) - // - - /** - * C-->S Request to join server. - */ - public static final String E_JOIN = "join"; - - /** - * S-->C Acknowledgement of join. - */ - public static final String E_JOIN_ACK = "join-ack"; - - /** - * C-->S Request to join server. - */ - public static final String E_JOIN_LISTEN = "join-listen"; - - /** - * S-->C Acknowledgement of join. - */ - public static final String E_JOIN_LISTEN_ACK = "join-listen-ack"; - - /** - * C-->S Client starts listening. - */ - public static final String E_LISTEN = "listen"; - - /** - * S-->C Ack of listen. - */ - public static final String E_LISTEN_ACK = "listen-ack"; - - /** - * C-->S Client leaves server. - */ - public static final String E_LEAVE = "leave"; - - /** - * S-->C Ack of leave. - */ - public static final String E_LEAVE_ACK = "leave-ack"; - - /** - * C-->S Publish to subject. - */ - public static final String E_PUBLISH = "publish"; - - /** - * S-->C Publish to subject acknowledge. - */ - public static final String E_PUBLISH_ACK = "publish-ack"; - - /** - * C-->S Subscribe to subject request. - */ - public static final String E_SUBSCRIBE = "subscribe"; - - /** - * S-->C Subscribe to subject acknowledge. - */ - public static final String E_SUBSCRIBE_ACK = "subscribe-ack"; - - /** - * C-->S Unsubscribe from subject request. - */ - public static final String E_UNSUBSCRIBE = "unsubscribe"; - - /** - * S--C Unsubscribe from subject acknowledge. - */ - public static final String E_UNSUBSCRIBE_ACK = "unsubscribe-ack"; - - /** - * S-->C Client error response, transitional error. - */ - public static final String E_NACK = "nack"; - - /** - * S-->C Client should abort, permanent error. - */ - public static final String E_ABORT = "abort"; - - /** - * S-->C Data. - */ - public static final String E_DATA = "data"; - - /** - * S-->C or C-->S Heartbeat. - */ - public static final String E_HEARTBEAT = "hb"; - - /** - * S-->C S-->C or C-->S Heartbeat confirmed. - */ - public static final String E_HEARTBEAT_ACK = "hb-ack"; - - /** - * S-->C or C-->S client refresh of data channel. - */ - public static final String E_REFRESH = "refresh"; - - /** - * S-->C client should refresh data channel. - */ - public static final String E_REFRESH_ACK = "refresh-ack"; - - // - // Values for P_FORMAT parameter - // - - /** - * JavaScript callback. - */ - public static String FORMAT_JAVASCRIPT = "js"; - - /** - * Java serialized object. - */ - public static String FORMAT_SERIALIZED_JAVA_OBJECT = "ser"; - - /** - * Stream of XML documents. - */ - public static String FORMAT_XML = "xml"; - - /** - * Single XML document containing zero or more events. - */ - public static String FORMAT_XML_STRICT = "xml-strict"; - - // - // Values for P_MODE parameter - // - public static final String MODE_STREAM = "stream"; - public static final String MODE_PULL = "pull"; - public static final String MODE_POLL = "poll"; - - // - // Values for special/reserved subjects - // TODO: use these to publish events when clients do these actions - // TODO: Dispatcher may intercept these subjects to send cached events - // - public static final String SUBJECT_META = "/meta"; - public static final String SUBJECT_META_SUBS = SUBJECT_META + "/subs"; - public static final String SUBJECT_META_JOINS = SUBJECT_META + "/joins"; - - -} - -/* - * $Log: Protocol.java,v $ - * Revision 1.15 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.14 2006/10/19 12:33:40 justb - * add atomic join-listen support (one request) - * - * Revision 1.13 2005/05/06 19:44:00 justb - * added xml-strict format - * - * Revision 1.12 2005/02/28 13:05:59 justb - * introduced join-listen protocol service - * - * Revision 1.11 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.10 2005/02/16 12:16:17 justb - * added support for "poll" mode - * - * Revision 1.9 2005/01/24 22:46:02 justb - * getting safari to work - * - * Revision 1.8 2005/01/24 13:42:00 justb - * new protocol changes (p_listen) - * - * Revision 1.7 2005/01/18 16:47:10 justb - * protocol changes for v2 and publishing from pushlet client - * - * Revision 1.6 2005/01/13 14:47:15 justb - * control evt: send response on same (control) connection - * - * Revision 1.5 2004/10/24 13:52:52 justb - * small fixes in client lib - * - * Revision 1.4 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.3 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.2 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.1 2004/09/03 21:02:20 justb - * make more formalized protocol - * - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/SerializedAdapter.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/SerializedAdapter.java deleted file mode 100644 index 501a6ba3ce..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/SerializedAdapter.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.ObjectOutputStream; - -/** - * Implementation of ClientAdapter that sends Events as serialized objects. - *

      - * NOTE: You are discouraged to use this adapter, since it is Java-only - * and may have JVM-specific problems. Far better choice is to use XML - * and the XMLAdapter. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: SerializedAdapter.java,v 1.4 2007/11/23 14:33:07 justb Exp $ - */ -class SerializedAdapter implements ClientAdapter { - private ObjectOutputStream out = null; - public static final String CONTENT_TYPE = "application/x-java-serialized-object"; - private HttpServletResponse servletRsp; - - /** - * Initialize. - */ - public SerializedAdapter(HttpServletResponse aServletResponse) { - servletRsp = aServletResponse; - } - - public void start() throws IOException { - - servletRsp.setContentType(CONTENT_TYPE); - - // Use a serialized object output stream - out = new ObjectOutputStream(servletRsp.getOutputStream()); - - // Don't need this further - servletRsp = null; - } - - /** - * Push Event to client. - */ - public void push(Event anEvent) throws IOException { - out.writeObject(anEvent); - - out.flush(); - } - - - public void stop() throws IOException { - } -} - -/* - * $Log: SerializedAdapter.java,v $ - * Revision 1.4 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.3 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.2 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.1 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.4 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.3 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:13:48 justb - * fixed blocking for java.net.URL with HTTP/1.1 (JVMs > 1.1) - * - * Revision 1.1.1.1 2002/09/24 21:02:31 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:18 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:03 justb - * first import into SF - * - * Revision 1.5 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.4 2000/12/27 22:39:35 just - * no message - * - * Revision 1.3 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Session.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Session.java deleted file mode 100644 index 8adf9ba6f4..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Session.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.PushletException; - -/** - * Represents client pushlet session state. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Session.java,v 1.8 2007/11/23 14:33:07 justb Exp $ - */ -public class Session implements Protocol, ConfigDefs { - private Controller controller; - private Subscriber subscriber; - - private String userAgent; - private long LEASE_TIME_MILLIS = Config.getLongProperty(SESSION_TIMEOUT_MINS) * 60 * 1000; - private volatile long timeToLive = LEASE_TIME_MILLIS; - - public static String[] FORCED_PULL_AGENTS = Config.getProperty(LISTEN_FORCE_PULL_AGENTS).split(","); - - private String address = "unknown"; - private String format = FORMAT_XML; - - private String id; - - /** - * Protected constructor as we create through factory method. - */ - protected Session() { - } - - /** - * Create instance through factory method. - * - * @param anId a session id - * @return a Session object (or derived) - * @throws PushletException exception, usually misconfiguration - */ - public static Session create(String anId) throws PushletException { - Session session; - try { - session = (Session) Config.getClass(SESSION_CLASS, "nl.justobjects.pushlet.core.Session").newInstance(); - } catch (Throwable t) { - throw new PushletException("Cannot instantiate Session from config", t); - } - - // Init session - session.id = anId; - session.controller = Controller.create(session); - session.subscriber = Subscriber.create(session); - return session; - } - - /** - * Return (remote) Subscriber client's IP address. - */ - public String getAddress() { - return address; - } - - /** - * Return command controller. - */ - public Controller getController() { - return controller; - } - - /** - * Return Event format to send to client. - */ - public String getFormat() { - return format; - } - - /** - * Return (remote) Subscriber client's unique id. - */ - public String getId() { - return id; - } - - /** - * Return subscriber. - */ - public Subscriber getSubscriber() { - return subscriber; - } - - /** - * Return remote HTTP User-Agent. - */ - public String getUserAgent() { - return userAgent; - } - - /** - * Set address. - */ - protected void setAddress(String anAddress) { - address = anAddress; - } - - /** - * Set event format to encode. - */ - protected void setFormat(String aFormat) { - format = aFormat; - } - - /** - * Set client HTTP UserAgent. - */ - public void setUserAgent(String aUserAgent) { - userAgent = aUserAgent; - } - - /** - * Decrease time to live. - */ - public void age(long aDeltaMillis) { - timeToLive -= aDeltaMillis; - } - - /** - * Has session timed out? - */ - public boolean isExpired() { - return timeToLive <= 0; - } - - /** - * Keep alive by resetting TTL. - */ - public void kick() { - timeToLive = LEASE_TIME_MILLIS; - } - - public void start() { - SessionManager.getInstance().addSession(this); - } - - public void stop() { - subscriber.stop(); - SessionManager.getInstance().removeSession(this); - } - - /** - * Info. - */ - public void info(String s) { - Log.info("S-" + this + ": " + s); - } - - /** - * Exceptional print util. - */ - public void warn(String s) { - Log.warn("S-" + this + ": " + s); - } - - /** - * Exceptional print util. - */ - public void debug(String s) { - Log.debug("S-" + this + ": " + s); - } - - public String toString() { - return getAddress() + "[" + getId() + "]"; - } -} - -/* - * $Log: Session.java,v $ - * Revision 1.8 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.7 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * Revision 1.6 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.5 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.4 2005/02/25 15:13:01 justb - * session id generation more robust - * - * Revision 1.3 2005/02/21 16:59:08 justb - * SessionManager and session lease introduced - * - * Revision 1.2 2005/02/21 12:32:28 justb - * fixed publish event in Controller - * - * Revision 1.1 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/SessionManager.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/SessionManager.java deleted file mode 100644 index 7d3441dc7b..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/SessionManager.java +++ /dev/null @@ -1,386 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Rand; -import nl.justobjects.pushlet.util.Sys; - -import java.rmi.server.UID; -import java.util.*; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; - -/** - * Manages lifecycle of Sessions. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: SessionManager.java,v 1.12 2007/12/04 13:55:53 justb Exp $ - */ -public class SessionManager implements ConfigDefs { - - /** - * Singleton pattern: single instance. - */ - private static SessionManager instance; - - static { - // Singleton + factory pattern: create single instance - // from configured class name - try { - instance = (SessionManager) Config.getClass(SESSION_MANAGER_CLASS, "nl.justobjects.pushlet.core.SessionManager").newInstance(); - Log.info("SessionManager created className=" + instance.getClass()); - } catch (Throwable t) { - Log.fatal("Cannot instantiate SessionManager from config", t); - } - } - - /** - * Timer to schedule session leasing TimerTasks. - */ - private Timer timer; - private final long TIMER_INTERVAL_MILLIS = 60000; - - /** - * Map of active sessions, keyed by their id, all access is through mutex. - */ - private Map sessions = new HashMap(13); - - /** - * Cache of Sessions for iteration and to allow concurrent modification. - */ - private Session[] sessionCache = new Session[0]; - - /** - * State of SessionCache, becomes true whenever sessionCache out of sync with sessions Map. - */ - private boolean sessionCacheDirty = false; - - /** - * Lock for any operation on Sessions (Session Map and/or -cache). - */ - private final Object mutex = new Object(); - - /** - * Singleton pattern: protected constructor needed for derived classes. - */ - protected SessionManager() { - } - - /** - * Visitor pattern implementation for Session iteration. - *

      - * This method can be used to iterate over all Sessions in a threadsafe way. - * See Dispatcher.multicast and broadcast methods for examples. - * - * @param visitor the object that should implement method parm - * @param method the method to be called from visitor - * @param args arguments to be passed in visit method, args[0] will always be Session object - */ - public void apply(Object visitor, Method method, Object[] args) { - - synchronized (mutex) { - - // Refresh Session cache if required - // We use a cache for two reasons: - // 1. to prevent concurrent modification from within visitor method - // 2. some optimization (vs setting up Iterator for each apply() - if (sessionCacheDirty) { - // Clear out existing cache - for (int i = 0; i < sessionCache.length; i++) { - sessionCache[i] = null; - } - - // Refill cache and update state - sessionCache = (Session[]) sessions.values().toArray(sessionCache); - sessionCacheDirty = false; - } - - // Valid session cache: loop and call supplied Visitor method - Session nextSession; - for (int i = 0; i < sessionCache.length; i++) { - nextSession = sessionCache[i]; - - // Session cache may not be entirely filled - if (nextSession == null) { - break; - } - - try { - // First argument is always a Session object - args[0] = nextSession; - - // Use Java reflection to call the method passed by the Visitor - method.invoke(visitor, args); - } catch (IllegalAccessException e) { - Log.warn("apply: illegal method access: ", e); - } catch (InvocationTargetException e) { - Log.warn("apply: method invoke: ", e); - } - } - } - } - - /** - * Create new Session (but add later). - */ - public Session createSession(Event anEvent) throws PushletException { - // Trivial - return Session.create(createSessionId()); - } - - - /** - * Singleton pattern: get single instance. - */ - public static SessionManager getInstance() { - return instance; - } - - /** - * Get Session by session id. - */ - public Session getSession(String anId) { - synchronized (mutex) { - return (Session) sessions.get(anId); - } - } - - /** - * Get copy of listening Sessions. - */ - public Session[] getSessions() { - synchronized (mutex) { - return (Session[]) sessions.values().toArray(new Session[0]); - } - } - - /** - * Get number of listening Sessions. - */ - public int getSessionCount() { - synchronized (mutex) { - return sessions.size(); - } - } - - /** - * Get status info. - */ - public String getStatus() { - Session[] sessions = getSessions(); - StringBuffer statusBuffer = new StringBuffer(); - statusBuffer.append("SessionMgr: " + sessions.length + " sessions \\n"); - for (int i = 0; i < sessions.length; i++) { - statusBuffer.append(sessions[i] + "\\n"); - } - return statusBuffer.toString(); - } - - /** - * Is Session present?. - */ - public boolean hasSession(String anId) { - synchronized (mutex) { - return sessions.containsKey(anId); - } - } - - /** - * Add session. - */ - public void addSession(Session session) { - synchronized (mutex) { - sessions.put(session.getId(), session); - sessionCacheDirty = true; - } - // log(session.getId() + " at " + session.getAddress() + " adding "); - info(session.getId() + " at " + session.getAddress() + " added "); - } - - /** - * Register session for removal. - */ - public Session removeSession(Session aSession) { - synchronized (mutex) { - Session session = (Session) sessions.remove(aSession.getId()); - if (session != null) { - info(session.getId() + " at " + session.getAddress() + " removed "); - } - sessionCacheDirty = true; - return session; - } - } - - - /** - * Starts us. - */ - public void start() throws PushletException { - if (timer != null) { - stop(); - } - timer = new Timer(false); - timer.schedule(new AgingTimerTask(), TIMER_INTERVAL_MILLIS, TIMER_INTERVAL_MILLIS); - info("started; interval=" + TIMER_INTERVAL_MILLIS + "ms"); - } - - /** - * Stopis us. - */ - public void stop() { - if (timer != null) { - timer.cancel(); - timer = null; - } - synchronized (mutex) { - sessions.clear(); - } - info("stopped"); - } - - /** - * Create unique Session id. - */ - protected String createSessionId() { - // Use UUID if specified in config (thanks Uli Romahn) - if (Config.hasProperty(SESSION_ID_GENERATION) && Config.getProperty(SESSION_ID_GENERATION).equals(SESSION_ID_GENERATION_UUID)) { - // We want to be Java 1.4 compatible so use UID class (1.5+ we may use java.util.UUID). - return new UID().toString(); - } - - // Other cases use random name - - // Create a unique session id - // In 99.9999 % of the cases this should be generated at once - // We need the mutext to prevent the chance of creating - // same-valued ids (thanks Uli Romahn) - synchronized (mutex) { - String id; - while (true) { - id = Rand.randomName(Config.getIntProperty(SESSION_ID_SIZE)); - if (!hasSession(id)) { - // Created unique session id - break; - } - } - return id; - } - } - - /** - * Util: stdout printing. - */ - protected void info(String s) { - Log.info("SessionManager: " + new Date() + " " + s); - } - - /** - * Util: stdout printing. - */ - protected void warn(String s) { - Log.warn("SessionManager: " + s); - } - - /** - * Util: stdout printing. - */ - protected void debug(String s) { - Log.debug("SessionManager: " + s); - } - - /** - * Manages Session timeouts. - */ - private class AgingTimerTask extends TimerTask { - private long lastRun = Sys.now(); - private long delta; - private Method visitMethod; - - public AgingTimerTask() throws PushletException { - try { - // Setup Visitor Methods for callback from SessionManager - Class[] argsClasses = {Session.class}; - visitMethod = this.getClass().getMethod("visit", argsClasses); - } catch (NoSuchMethodException e) { - throw new PushletException("Failed to setup AgingTimerTask", e); - } - } - - /** - * Clock tick callback from Timer. - */ - public void run() { - long now = Sys.now(); - delta = now - lastRun; - lastRun = now; - debug("AgingTimerTask: tick"); - - // Use Visitor pattern to loop through Session objects (see visit() below) - getInstance().apply(this, visitMethod, new Object[1]); - } - - /** - * Callback from SessionManager during apply() - */ - public void visit(Session aSession) { - try { - // Age the lease - aSession.age(delta); - debug("AgingTimerTask: visit: " + aSession); - - // Stop session if lease expired - if (aSession.isExpired()) { - info("AgingTimerTask: Session expired: " + aSession); - aSession.stop(); - } - } catch (Throwable t) { - warn("AgingTimerTask: Error in timer task : " + t); - } - } - } -} - -/* - * $Log: SessionManager.java,v $ - * Revision 1.12 2007/12/04 13:55:53 justb - * reimplement SessionManager concurrency (prev version was not thread-safe!) - * - * Revision 1.11 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.10 2007/11/10 14:47:45 justb - * make session key generation configurable (can use uuid) - * - * Revision 1.9 2007/11/10 14:17:18 justb - * minor cosmetic changes just commit now - * - * Revision 1.8 2007/07/02 08:12:16 justb - * redo to original version of session cache (with break, but nullify array first) - * - * Revision 1.7 2007/07/02 07:33:02 justb - * small fix in sessionmgr for holes in sessioncache array (continue i.s.o. break) - * - * Revision 1.6 2006/11/18 12:13:47 justb - * made SessionManager constructor protected to allow constructing derived classes - * - * Revision 1.5 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * Revision 1.4 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.3 2005/02/28 09:14:55 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.2 2005/02/25 15:13:01 justb - * session id generation more robust - * - * Revision 1.1 2005/02/21 16:59:09 justb - * SessionManager and session lease introduced - * - - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Subscriber.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Subscriber.java deleted file mode 100644 index dca30b6bfd..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Subscriber.java +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.util.Rand; -import nl.justobjects.pushlet.util.Sys; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.net.URLEncoder; - -/** - * Handles data channel between dispatcher and client. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Subscriber.java,v 1.26 2007/11/23 14:33:07 justb Exp $ - */ -public class Subscriber implements Protocol, ConfigDefs { - private Session session; - - /** - * Blocking queue. - */ - private EventQueue eventQueue = new EventQueue(Config.getIntProperty(QUEUE_SIZE)); - - /** - * URL to be used in refresh requests in pull/poll modes. - */ - private long queueReadTimeoutMillis = Config.getLongProperty(QUEUE_READ_TIMEOUT_MILLIS); - private long queueWriteTimeoutMillis = Config.getLongProperty(QUEUE_WRITE_TIMEOUT_MILLIS); - private long refreshTimeoutMillis = Config.getLongProperty(PULL_REFRESH_TIMEOUT_MILLIS); - volatile long lastAlive = Sys.now(); - - /** - * Map of active subscriptions, keyed by their subscription id. - */ - private Map subscriptions = Collections.synchronizedMap(new HashMap(3)); - - /** - * Are we able to accept/send events ?. - */ - private volatile boolean active; - - /** - * Transfer mode (stream, pull, poll). - */ - private String mode; - - - /** - * Protected constructor as we create through factory method. - */ - protected Subscriber() { - } - - /** - * Create instance through factory method. - * - * @param aSession the parent Session - * @return a Subscriber object (or derived) - * @throws PushletException exception, usually misconfiguration - */ - public static Subscriber create(Session aSession) throws PushletException { - Subscriber subscriber; - try { - subscriber = (Subscriber) Config.getClass(SUBSCRIBER_CLASS, "nl.justobjects.pushlet.core.Subscriber").newInstance(); - } catch (Throwable t) { - throw new PushletException("Cannot instantiate Subscriber from config", t); - } - - subscriber.session = aSession; - return subscriber; - } - - public void start() { - active = true; - } - - public void stop() { - removeSubscriptions(); - active = false; - } - - public void bailout() { - session.stop(); - } - - /** - * Are we still active to handle events. - */ - public boolean isActive() { - return active; - } - - /** - * Return client session. - */ - public Session getSession() { - return session; - } - - /** - * Get (session) id. - */ - public String getId() { - return session.getId(); - } - - /** - * Return subscriptions. - */ - public Subscription[] getSubscriptions() { - // todo: Optimize - return (Subscription[]) subscriptions.values().toArray(new Subscription[0]); - } - - /** - * Add a subscription. - */ - public Subscription addSubscription(String aSubject, String aLabel) throws PushletException { - Subscription subscription = Subscription.create(aSubject, aLabel); - subscriptions.put(subscription.getId(), subscription); - info("Subscription added subject=" + aSubject + " sid=" + subscription.getId() + " label=" + aLabel); - return subscription; - } - - /** - * Remove a subscription. - */ - public Subscription removeSubscription(String aSubscriptionId) { - Subscription subscription = (Subscription) subscriptions.remove(aSubscriptionId); - if (subscription == null) { - warn("No subscription found sid=" + aSubscriptionId); - return null; - } - info("Subscription removed subject=" + subscription.getSubject() + " sid=" + subscription.getId() + " label=" + subscription.getLabel()); - return subscription; - } - - /** - * Remove all subscriptions. - */ - public void removeSubscriptions() { - subscriptions.clear(); - } - - public String getMode() { - return mode; - } - - public void setMode(String aMode) { - mode = aMode; - } - - public long getRefreshTimeMillis() { - String minWaitProperty = PULL_REFRESH_WAIT_MIN_MILLIS; - String maxWaitProperty = PULL_REFRESH_WAIT_MAX_MILLIS; - if (mode.equals((MODE_POLL))) { - minWaitProperty = POLL_REFRESH_WAIT_MIN_MILLIS; - maxWaitProperty = POLL_REFRESH_WAIT_MAX_MILLIS; - - } - return Rand.randomLong(Config.getLongProperty(minWaitProperty), - Config.getLongProperty(maxWaitProperty)); - } - - /** - * Get events from queue and push to client. - */ - public void fetchEvents(Command aCommand) throws PushletException { - - String refreshURL = aCommand.httpReq.getRequestURI() + "?" + P_ID + "=" + session.getId() + "&" + P_EVENT + "=" + E_REFRESH; - - // This is the only thing required to support "poll" mode - if (mode.equals(MODE_POLL)) { - queueReadTimeoutMillis = 0; - refreshTimeoutMillis = Config.getLongProperty(POLL_REFRESH_TIMEOUT_MILLIS); - } - - // Required for fast bailout (tomcat) - aCommand.httpRsp.setBufferSize(128); - - // Try to prevent caching in any form. - aCommand.sendResponseHeaders(); - - // Let clientAdapter determine how to send event - ClientAdapter clientAdapter = aCommand.getClientAdapter(); - Event responseEvent = aCommand.getResponseEvent(); - try { - clientAdapter.start(); - - // Send first event (usually hb-ack or listen-ack) - clientAdapter.push(responseEvent); - - // In pull/poll mode and when response is listen-ack or join-listen-ack, - // return and force refresh immediately - // such that the client recieves response immediately over this channel. - // This is usually when loading the browser app for the first time - if ((mode.equals(MODE_POLL) || mode.equals(MODE_PULL)) - && responseEvent.getEventType().endsWith(Protocol.E_LISTEN_ACK)) { - sendRefresh(clientAdapter, refreshURL); - - // We should come back later with refresh event... - return; - } - } catch (Throwable t) { - bailout(); - return; - } - - - Event[] events = null; - - // Main loop: as long as connected, get events and push to client - long eventSeqNr = 1; - while (isActive()) { - // Indicate we are still alive - lastAlive = Sys.now(); - - // Update session time to live - session.kick(); - - // Get next events; blocks until timeout or entire contents - // of event queue is returned. Note that "poll" mode - // will return immediately when queue is empty. - try { - // Put heartbeat in queue when starting to listen in stream mode - // This speeds up the return of *_LISTEN_ACK - if (mode.equals(MODE_STREAM) && eventSeqNr == 1) { - eventQueue.enQueue(new Event(E_HEARTBEAT)); - } - - events = eventQueue.deQueueAll(queueReadTimeoutMillis); - } catch (InterruptedException ie) { - warn("interrupted"); - bailout(); - } - - // Send heartbeat when no events received - if (events == null) { - events = new Event[1]; - events[0] = new Event(E_HEARTBEAT); - } - - // ASSERT: one or more events available - - // Send events to client using adapter - // debug("received event count=" + events.length); - for (int i = 0; i < events.length; i++) { - // Check for abort event - if (events[i].getEventType().equals(E_ABORT)) { - warn("Aborting Subscriber"); - bailout(); - } - - // Push next Event to client - try { - // Set sequence number - events[i].setField(P_SEQ, eventSeqNr++); - - // Push to client through client adapter - clientAdapter.push(events[i]); - } catch (Throwable t) { - bailout(); - return; - } - } - - // Force client refresh request in pull or poll modes - if (mode.equals(MODE_PULL) || mode.equals(MODE_POLL)) { - sendRefresh(clientAdapter, refreshURL); - - // Always leave loop in pull/poll mode - break; - } - } - } - - /** - * Determine if we should receive event. - */ - public Subscription match(Event event) { - Subscription[] subscriptions = getSubscriptions(); - for (int i = 0; i < subscriptions.length; i++) { - if (subscriptions[i].match(event)) { - return subscriptions[i]; - } - } - return null; - } - - /** - * Event from Dispatcher: enqueue it. - */ - public void onEvent(Event theEvent) { - if (!isActive()) { - return; - } - - // p("send: queue event: "+theEvent.getSubject()); - - // Check if we had any active continuation for at - // least 'timeOut' millisecs. If the client has left this - // instance there would be no way of knowing otherwise. - long now = Sys.now(); - if (now - lastAlive > refreshTimeoutMillis) { - warn("not alive for at least: " + refreshTimeoutMillis + "ms, leaving..."); - bailout(); - return; - } - - // Put event in queue; leave if queue full - try { - if (!eventQueue.enQueue(theEvent, queueWriteTimeoutMillis)) { - warn("queue full, bailing out..."); - bailout(); - } - - // ASSERTION : Event in queue. - // see fetchEvents() where Events are dequeued and pushed to the client. - } catch (InterruptedException ie) { - bailout(); - } - - } - - /** - * Send refresh command to pull/poll clients. - */ - protected void sendRefresh(ClientAdapter aClientAdapter, String aRefreshURL) { - Event refreshEvent = new Event(E_REFRESH); - - // Set wait time and url for refresh - refreshEvent.setField(P_WAIT, "" + getRefreshTimeMillis()); - refreshEvent.setField(P_URL, aRefreshURL); - - try { - // Push to client through client adapter - aClientAdapter.push(refreshEvent); - - // Stop this round until refresh event - aClientAdapter.stop(); - } catch (Throwable t) { - // Leave on any exception - bailout(); - } - } - - /** - * Info. - */ - protected void info(String s) { - session.info("[Subscriber] " + s); - } - - /** - * Exceptional print util. - */ - protected void warn(String s) { - session.warn("[Subscriber] " + s); - } - - /** - * Exceptional print util. - */ - protected void debug(String s) { - session.debug("[Subscriber] " + s); - } - - - public String toString() { - return session.toString(); - } -} - -/* - * $Log: Subscriber.java,v $ - * Revision 1.26 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.25 2007/11/10 15:53:15 justb - * put heartbeat in queue when start fetching events in stream-mode - * - * Revision 1.24 2006/10/19 12:33:40 justb - * add atomic join-listen support (one request) - * - * Revision 1.22 2006/05/06 00:06:28 justb - * first rough version AJAX client - * - * Revision 1.21 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.20 2005/02/21 16:59:09 justb - * SessionManager and session lease introduced - * - * Revision 1.19 2005/02/21 12:32:28 justb - * fixed publish event in Controller - * - * Revision 1.18 2005/02/21 11:50:46 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.17 2005/02/20 13:05:32 justb - * removed the Postlet (integrated in Pushlet protocol) - * - * Revision 1.16 2005/02/18 12:36:47 justb - * changes for renaming and configurability - * - * Revision 1.15 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.14 2005/02/18 09:54:15 justb - * refactor: rename Publisher Dispatcher and single Subscriber class - * - * Revision 1.13 2005/02/16 14:39:34 justb - * fixed leave handling and added "poll" mode - * - * Revision 1.12 2005/01/24 13:42:00 justb - * new protocol changes (p_listen) - * - * Revision 1.11 2005/01/13 14:47:15 justb - * control evt: send response on same (control) connection - * - * Revision 1.10 2004/10/24 20:50:35 justb - * refine subscription with label and sending sid and label on events - * - * Revision 1.9 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.8 2004/09/26 21:39:43 justb - * allow multiple subscriptions and out-of-band requests - * - * Revision 1.7 2004/09/20 22:01:38 justb - * more changes for new protocol - * - * Revision 1.6 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.5 2004/08/13 23:36:05 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.4 2004/03/10 14:01:55 justb - * formatting and *Subscriber refactoring - * - * Revision 1.3 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:32 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:18 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:04 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Subscription.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Subscription.java deleted file mode 100644 index c6f88bd597..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/Subscription.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Rand; -import nl.justobjects.pushlet.util.PushletException; - - -/** - * Represents single subject subscription - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Subscription.java,v 1.5 2007/11/23 14:33:07 justb Exp $ - */ -public class Subscription implements ConfigDefs { - public static final int ID_SIZE = 5; - public static final String SUBJECT_SEPARATOR = ","; - private String id = Rand.randomName(ID_SIZE); - private String subject; - private String[] subjects; - - /** - * Optional label, a user supplied token. - */ - private String label; - - - /** - * Protected constructor as we create through factory method. - */ - protected Subscription() { - } - - /** - * Create instance through factory method. - * - * @param aSubject the subject (topic). - * @return a Subscription object (or derived) - * @throws nl.justobjects.pushlet.util.PushletException - * exception, usually misconfiguration - */ - public static Subscription create(String aSubject) throws PushletException { - return create(aSubject, null); - } - - /** - * Create instance through factory method. - * - * @param aSubject the subject (topic). - * @param aLabel the subject label (optional). - * @return a Subscription object (or derived) - * @throws nl.justobjects.pushlet.util.PushletException - * exception, usually misconfiguration - */ - public static Subscription create(String aSubject, String aLabel) throws PushletException { - if (aSubject == null || aSubject.length() == 0) { - throw new IllegalArgumentException("Null or emtpy subject"); - } - - Subscription subscription; - try { - subscription = (Subscription) Config.getClass(SUBSCRIPTION_CLASS, "nl.justobjects.pushlet.core.Subscription").newInstance(); - } catch (Throwable t) { - throw new PushletException("Cannot instantiate Subscriber from config", t); - } - - // Init - subscription.subject = aSubject; - - // We may subscribe to multiple subjects by separating - // them with SUBJECT_SEPARATOR, e.g. "/stocks/aex,/system/memory,.."). - subscription.subjects = aSubject.split(SUBJECT_SEPARATOR); - - subscription.label = aLabel; - return subscription; - } - - - public String getId() { - return id; - } - - public String getLabel() { - return label; - } - - public String getSubject() { - return subject; - } - - /** - * Determine if Event matches subscription. - */ - public boolean match(Event event) { - String eventSubject = event.getSubject(); - - // Silly case but check anyway - if (eventSubject == null || eventSubject.length() == 0) { - return false; - } - - // Test if one of the subjects matches - for (int i = 0; i < subjects.length; i++) { - if (eventSubject.startsWith(subjects[i])) { - return true; - } - } - - // No match - return false; - } -} - -/* - * $Log: Subscription.java,v $ - * Revision 1.5 2007/11/23 14:33:07 justb - * core classes now configurable through factory - * - * Revision 1.4 2006/05/06 00:10:11 justb - * various chgs but not too serious... - * - * Revision 1.3 2005/02/16 15:23:10 justb - * multiple subject (, separated) support - * - * Revision 1.2 2005/01/18 16:47:10 justb - * protocol changes for v2 and publishing from pushlet client - * - * Revision 1.1 2004/09/26 21:39:43 justb - * allow multiple subscriptions and out-of-band requests - * - * - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/XMLAdapter.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/XMLAdapter.java deleted file mode 100644 index 70a9c3c47d..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/core/XMLAdapter.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.core; - -import nl.justobjects.pushlet.util.Log; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * ClientAdapter that sends Events as XML. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: XMLAdapter.java,v 1.7 2007/11/09 13:15:35 justb Exp $ - */ -class XMLAdapter implements ClientAdapter { - /** - * Header for strict XML - */ - // public static final String XML_HEAD = "\n"; - private String contentType = "text/plain;charset=UTF-8"; - private ServletOutputStream out = null; - private HttpServletResponse servletRsp; - private boolean strictXML; - - /** - * Initialize. - */ - public XMLAdapter(HttpServletResponse aServletResponse) { - this(aServletResponse, false); - } - - /** - * Initialize. - */ - public XMLAdapter(HttpServletResponse aServletResponse, boolean useStrictXML) { - servletRsp = aServletResponse; - - // Strict XML implies returning a complete XML document - strictXML = useStrictXML; - if (strictXML) { - contentType = "text/xml;charset=UTF-8"; - } - } - - public void start() throws IOException { - - // If content type is plain text - // then this is not a complete XML document, but rather - // a stream of XML documents where each document is - // an Event. In strict XML mode a complete document is returned. - servletRsp.setContentType(contentType); - - out = servletRsp.getOutputStream(); - - // Don't need this further - servletRsp = null; - - // Start XML document if strict XML mode - if (strictXML) { - out.print(""); - } - } - - /** - * Force client to refresh the request. - */ - public void push(Event anEvent) throws IOException { - debug("event=" + anEvent); - - // Send the event as XML to the client and flush. - out.print(anEvent.toXML(strictXML)); - out.flush(); - } - - /** - * No action. - */ - public void stop() throws IOException { - // Close XML document if strict XML mode - if (strictXML) { - out.print(""); - out.flush(); - } - } - - private void debug(String s) { - Log.debug("[XMLAdapter]" + s); - } -} - -/* - * $Log: XMLAdapter.java,v $ - * Revision 1.7 2007/11/09 13:15:35 justb - * add charset=UTF-8 in returned HTTP content types - * - * Revision 1.6 2006/05/15 11:52:53 justb - * updates mainly for AJAX client - * - * Revision 1.5 2006/05/06 00:06:28 justb - * first rough version AJAX client - * - * Revision 1.4 2005/05/06 19:44:00 justb - * added xml-strict format - * - * Revision 1.3 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.2 2005/02/21 11:50:47 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.1 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.7 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.6 2004/03/10 14:01:55 justb - * formatting and *Subscriber refactoring - * - * Revision 1.5 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.4 2003/08/13 14:00:00 justb - * some testing for applets; no real change - * - * Revision 1.3 2003/08/12 09:57:06 justb - * replaced all print statements to Log.*() calls - * - * Revision 1.2 2003/05/19 21:56:29 justb - * various fixes for applet clients - * - * Revision 1.1 2003/05/18 16:12:28 justb - * adding support for XML encoded Events - */ diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/servlet/Pushlet.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/servlet/Pushlet.java deleted file mode 100644 index 33bbde24c0..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/servlet/Pushlet.java +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.servlet; - -import nl.justobjects.pushlet.core.*; -import nl.justobjects.pushlet.util.Log; -import nl.justobjects.pushlet.util.Servlets; -import nl.justobjects.pushlet.util.PushletException; -import nl.justobjects.pushlet.Version; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.Enumeration; - -/** - * Servlet runs a Subscriber per request. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Pushlet.java,v 1.23 2007/12/04 13:55:53 justb Exp $ - */ -public class Pushlet extends HttpServlet implements Protocol { - - public void init() throws ServletException { - try { - // Load configuration (from classpath or WEB-INF root path) - String webInfPath = getServletContext().getRealPath("/") + "/WEB-INF"; - Config.load(webInfPath); - - Log.init(); - - // Start - Log.info("init() Pushlet Webapp - version=" + Version.SOFTWARE_VERSION + " built=" + Version.BUILD_DATE); - - // Start session manager - SessionManager.getInstance().start(); - - // Start event Dispatcher - Dispatcher.getInstance().start(); - - - if (Config.getBoolProperty(Config.SOURCES_ACTIVATE)) { - EventSourceManager.start(webInfPath,getServletContext());// changed by thomas genin - } else { - Log.info("Not starting local event sources"); - } - } catch (Throwable t) { - throw new ServletException("Failed to initialize Pushlet framework " + t, t); - } - } - - public void destroy() { - Log.info("destroy(): Exit Pushlet webapp"); - - if (Config.getBoolProperty(Config.SOURCES_ACTIVATE)) { - // Stop local event sources - EventSourceManager.stop(); - } else { - Log.info("No local event sources to stop"); - } - - // Should abort all subscribers - Dispatcher.getInstance().stop(); - - // Should stop all sessions - SessionManager.getInstance().stop(); - } - - /** - * Servlet GET request: handles event requests. - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - Event event = null; - - try { - // Event parm identifies event type from the client - String eventType = Servlets.getParameter(request, P_EVENT); - - // Always must have an event type - if (eventType == null) { - Log.warn("Pushlet.doGet(): bad request, no event specified"); - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "No eventType specified"); - return; - } - - // Create Event and set attributes from parameters - event = new Event(eventType); - for (Enumeration e = request.getParameterNames(); e.hasMoreElements();) { - String nextAttribute = (String) e.nextElement(); - event.setField(nextAttribute, request.getParameter(nextAttribute)); - } - - - } catch (Throwable t) { - // Error creating event - Log.warn("Pushlet: Error creating event in doGet(): ", t); - response.setStatus(HttpServletResponse.SC_BAD_REQUEST); - return; - } - - // Handle parsed request - doRequest(event, request, response); - - } - - /** - * Servlet POST request: extracts event data from body. - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - Event event = null; - try { - // Create Event by parsing XML from input stream. - event = EventParser.parse(new InputStreamReader(request.getInputStream())); - - // Always must have an event type - if (event.getEventType() == null) { - Log.warn("Pushlet.doPost(): bad request, no event specified"); - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "No eventType specified"); - return; - } - - - } catch (Throwable t) { - // Error creating event - Log.warn("Pushlet: Error creating event in doPost(): ", t); - response.setStatus(HttpServletResponse.SC_BAD_REQUEST); - return; - } - - // Handle parsed request - doRequest(event, request, response); - - } - - /** - * Generic request handler (GET+POST). - */ - protected void doRequest(Event anEvent, HttpServletRequest request, HttpServletResponse response) { - // Must have valid event type. - String eventType = anEvent.getEventType(); - try { - - // Get Session: either by creating (on Join eventType) - // or by id (any other eventType, since client is supposed to have joined). - Session session = null; - if (eventType.startsWith(Protocol.E_JOIN)) { - // Join request: create new subscriber - session = SessionManager.getInstance().createSession(anEvent); - - String userAgent = request.getHeader("User-Agent"); - if (userAgent != null) { - userAgent = userAgent.toLowerCase(); - } else { - userAgent = "unknown"; - } - session.setUserAgent(userAgent); - - } else { - // Must be a request for existing Session - - // Get id - String id = anEvent.getField(P_ID); - - // We must have an id value - if (id == null) { - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "No id specified"); - Log.warn("Pushlet: bad request, no id specified event=" + eventType); - return; - } - - // We have an id: get the session object - session = SessionManager.getInstance().getSession(id); - - // Check for invalid id - if (session == null) { - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid or expired id: " + id); - Log.warn("Pushlet: bad request, no session found id=" + id + " event=" + eventType); - return; - } - } - - // ASSERTION: we have a valid Session - - // Let Controller handle request further - // including exceptions - Command command = Command.create(session, anEvent, request, response); - session.getController().doCommand(command); - } catch (Throwable t) { - // Hmm we should never ever get here - Log.warn("Pushlet: Exception in doRequest() event=" + eventType, t); - t.printStackTrace(); - response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); - } - - } -} - -/* - * $Log: Pushlet.java,v $ - * Revision 1.23 2007/12/04 13:55:53 justb - * reimplement SessionManager concurrency (prev version was not thread-safe!) - * - * Revision 1.22 2007/11/24 10:29:36 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.21 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.20 2007/11/10 13:44:02 justb - * pushlet.properties and sources.properties can now also be put under WEB-INF - * - * Revision 1.19 2006/05/15 11:52:53 justb - * updates mainly for AJAX client - * - * Revision 1.18 2005/02/28 15:58:05 justb - * added SimpleListener example - * - * Revision 1.17 2005/02/28 13:06:01 justb - * introduced join-listen protocol service - * - * Revision 1.16 2005/02/28 12:45:59 justb - * introduced Command class - * - * Revision 1.15 2005/02/28 09:14:56 justb - * sessmgr/dispatcher factory/singleton support - * - * Revision 1.14 2005/02/25 15:13:04 justb - * session id generation more robust - * - * Revision 1.13 2005/02/21 17:19:21 justb - * move init()/destroy() to Pushlet servlet - * - * Revision 1.12 2005/02/21 16:59:17 justb - * SessionManager and session lease introduced - * - * Revision 1.11 2005/02/21 11:50:47 justb - * ohase1 of refactoring Subscriber into Session/Controller/Subscriber - * - * Revision 1.10 2005/02/20 13:05:32 justb - * removed the Postlet (integrated in Pushlet protocol) - * - * Revision 1.9 2005/02/18 10:07:23 justb - * many renamings of classes (make names compact) - * - * Revision 1.8 2005/01/13 14:47:15 justb - * control evt: send response on same (control) connection - * - * Revision 1.7 2004/10/24 12:58:18 justb - * revised client and test classes for new protocol - * - * Revision 1.6 2004/09/26 21:39:44 justb - * allow multiple subscriptions and out-of-band requests - * - * Revision 1.5 2004/09/20 22:01:40 justb - * more changes for new protocol - * - * Revision 1.4 2004/09/03 22:35:37 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.3 2004/08/13 23:36:06 justb - * rewrite of Pullet into Pushlet "pull" mode - * - * Revision 1.2 2003/08/15 08:37:40 justb - * fix/add Copyright+LGPL file headers and footers - * - * Revision 1.1 2003/08/13 13:26:57 justb - * moved all servlets to servlet package - * - * Revision 1.2 2003/05/18 16:15:08 justb - * support for XML encoded Events - * - * Revision 1.1.1.1 2002/09/24 21:02:32 justb - * import to sourceforge - * - * Revision 1.1.1.1 2002/09/20 22:48:18 justb - * import to SF - * - * Revision 1.1.1.1 2002/09/20 14:19:04 justb - * first import into SF - * - * Revision 1.3 2002/04/15 20:42:41 just - * reformatting and renaming GuardedQueue to EventQueue - * - * Revision 1.2 2000/08/21 20:48:29 just - * added CVS log and id tags plus copyrights - * - * - */ - diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/DefaultLogger.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/DefaultLogger.java deleted file mode 100644 index bc0648c9a1..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/DefaultLogger.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -/** - * Default logger. - *

      - * Logs to stdout. Override this class by setting "logger.class" in pushlet.properties to your own logger - * to integrate your own logging library. - * - * @author Just van den Broecke - * @version $Id: DefaultLogger.java,v 1.2 2007/12/07 12:57:40 justb Exp $ - */ -public class DefaultLogger implements PushletLogger { - - - /** - * Level intialized with default. - */ - private int level = LOG_LEVEL_INFO; - - public DefaultLogger() { - } - - public void init() { - - } - - /** - * Log message for trace level. - * - * @param aMessage the message to be logged - */ - public void trace(String aMessage) { - if (level < LOG_LEVEL_TRACE) { - return; - } - print("TRACE", aMessage); - } - - /** - * Log message for debug level. - * - * @param aMessage the message to be logged - */ - public void debug(String aMessage) { - if (level < LOG_LEVEL_DEBUG) { - return; - } - print("DEBUG", aMessage); - } - - /** - * Log message for info level. - * - * @param aMessage the message to be logged - */ - public void info(String aMessage) { - if (level < LOG_LEVEL_INFO) { - return; - } - print("INFO", aMessage); - } - - /** - * Log message for warning level. - * - * @param aMessage the message to be logged - */ - public void warn(String aMessage) { - if (level < LOG_LEVEL_WARN) { - return; - } - print("WARN", aMessage); - } - - /** - * Log message for warning level with exception. - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void warn(String aMessage, Throwable aThrowable) { - warn(aMessage + " exception=" + aThrowable); - } - - /** - * Log message for error level. - * - * @param aMessage the message to be logged - */ - public void error(String aMessage) { - if (level < LOG_LEVEL_ERROR) { - return; - } - print("FATAL", aMessage); - } - - /** - * Log message (error level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void error(String aMessage, Throwable aThrowable) { - error(aMessage + " exception=" + aThrowable); - } - - /** - * Log message for fatal level. - * - * @param aMessage the message to be logged - */ - public void fatal(String aMessage) { - if (level < LOG_LEVEL_FATAL) { - return; - } - print("FATAL", aMessage); - } - - /** - * Log message (fatal level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void fatal(String aMessage, Throwable aThrowable) { - fatal(aMessage + " exception=" + aThrowable); - } - - /** - * Set log level - * - * @param aLevel the message to be logged - */ - public void setLevel(int aLevel) { - level = aLevel; - } - - /** - * Print message. - * - * @param aTag the log type - * @param aMessage the message to be logged - */ - private void print(String aTag, String aMessage) { - // SImple std out e.g. to catalina.out in Tomcat - System.out.println("Pushlet[" + aTag + "] " + aMessage); - } - -} - -/* -* $Log: DefaultLogger.java,v $ -* Revision 1.2 2007/12/07 12:57:40 justb -* added log4j and make it the default logging method -* -* Revision 1.1 2007/11/23 21:10:17 justb -* add hooks for custom logging (you can override DefaultLogger in pushlet.properties) -* -* -* -*/ \ No newline at end of file diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Log.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Log.java deleted file mode 100644 index ee6bd254d4..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Log.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -import nl.justobjects.pushlet.core.Config; -import nl.justobjects.pushlet.core.ConfigDefs; - -/** - * Logging wrapper. - *

      - * Provides a hook to direct logging to your own logging library. Override the DefaultLogger class by setting - * "logger.class" in pushlet.properties to your own logger - * to integrate your own logging library. - * - * @author Just van den Broecke - * @version $Id: Log.java,v 1.5 2007/12/07 12:57:40 justb Exp $ - */ -public class Log implements ConfigDefs { - /** - * Init with default to have at least some logging. - */ - private static PushletLogger logger = new DefaultLogger(); - - /** - * General purpose initialization. - */ - static public void init() { - try { - logger = (PushletLogger) Config.getClass(LOGGER_CLASS, "nl.justobjects.pushlet.util.DefaultLogger").newInstance(); - } catch (Throwable t) { - // Hmmm cannot log this since we don't have a log... - System.out.println("Cannot instantiate Logger from config ex=" + t); - return; - } - - logger.init(); - - // Set log level - logger.setLevel(Config.getIntProperty(Config.LOG_LEVEL)); - - logger.info("Logging intialized logger class=" + logger.getClass()); - } - - /** - * Log message for trace level. - * - * @param aMessage the message to be logged - */ - static public void trace(String aMessage) { - logger.debug(aMessage); - } - - /** - * Log message for debug level. - * - * @param aMessage the message to be logged - */ - static public void debug(String aMessage) { - logger.debug(aMessage); - } - - /** - * Log message for info level. - * - * @param aMessage the message to be logged - */ - static public void info(String aMessage) { - logger.info(aMessage); - } - - /** - * Log message for warning level. - * - * @param aMessage the message to be logged - */ - static public void warn(String aMessage) { - logger.warn(aMessage); - } - - /** - * Log message for warning level with exception. - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - static public void warn(String aMessage, Throwable aThrowable) { - logger.warn(aMessage, aThrowable); - } - - /** - * Log message for error level. - * - * @param aMessage the message to be logged - */ - static public void error(String aMessage) { - logger.error(aMessage); - } - - /** - * Log message (error level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - static public void error(String aMessage, Throwable aThrowable) { - logger.error(aMessage, aThrowable); - } - - /** - * Log message for fatal level. - * - * @param aMessage the message to be logged - */ - static public void fatal(String aMessage) { - logger.fatal(aMessage); - } - - /** - * Log message (fatal level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - static public void fatal(String aMessage, Throwable aThrowable) { - logger.fatal(aMessage, aThrowable); - } - - /** - * Set log level - * - * @param aLevel the message to be logged - */ - static public void setLevel(int aLevel) { - logger.setLevel(aLevel); - } -} - -/* -* $Log: Log.java,v $ -* Revision 1.5 2007/12/07 12:57:40 justb -* added log4j and make it the default logging method -* -* Revision 1.4 2007/11/23 21:29:43 justb -* add hooks for custom logging (you can override DefaultLogger in pushlet.properties) -* -* Revision 1.3 2007/11/23 21:10:17 justb -* add hooks for custom logging (you can override DefaultLogger in pushlet.properties) -* -* Revision 1.2 2005/02/21 11:15:59 justb -* support log levels -* -* Revision 1.1 2005/02/18 10:07:23 justb -* many renamings of classes (make names compact) -* -* Revision 1.7 2004/09/03 22:35:37 justb -* Almost complete rewrite, just checking in now -* -* Revision 1.6 2004/08/12 13:16:08 justb -* make debug flag false -* -* Revision 1.5 2004/03/10 14:01:55 justb -* formatting and *Subscriber refactoring -* -* Revision 1.4 2003/08/15 09:54:46 justb -* fix javadoc warnings -* -* Revision 1.3 2003/08/15 08:37:40 justb -* fix/add Copyright+LGPL file headers and footers -* -* Revision 1.2 2003/08/12 09:42:47 justb -* enhancements -* -* Revision 1.1 2003/08/12 08:46:00 justb -* cvs comment tags added -* -* -*/ \ No newline at end of file diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Log4jLogger.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Log4jLogger.java deleted file mode 100644 index ca96762621..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Log4jLogger.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -import org.apache.log4j.Level; -import org.apache.log4j.LogManager; -import org.apache.log4j.Logger; - -/** - * Logger to use Log4j for logging. - *

      - * Logs using Log4j. - * This class will require a log4j library in the classpath of the Pushlet. - * - * @author Uli Romahn - * @version $Id: Log4jLogger.java,v 1.1 2007/12/07 12:57:40 justb Exp $ - */ -public class Log4jLogger implements PushletLogger { - - /** - * Level intialized with default. - */ - private Logger logger = LogManager.getLogger("pushlet"); - - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#init() - */ - public void init() { - setLevel(LOG_LEVEL_INFO); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#debug(java.lang.String) - */ - public void debug(String aMessage) { - if (!logger.isDebugEnabled()) { - return; - } - logger.debug(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#error(java.lang.String) - */ - public void error(String aMessage) { - logger.error(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#error(java.lang.String, java.lang.Throwable) - */ - public void error(String aMessage, Throwable aThrowable) { - logger.error(aMessage, aThrowable); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#fatal(java.lang.String) - */ - public void fatal(String aMessage) { - logger.fatal(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#fatal(java.lang.String, java.lang.Throwable) - */ - public void fatal(String aMessage, Throwable aThrowable) { - logger.fatal(aMessage, aThrowable); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#info(java.lang.String) - */ - public void info(String aMessage) { - if (!logger.isInfoEnabled()) { - return; - } - logger.info(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#trace(java.lang.String) - */ - public void trace(String aMessage) { - logger.trace(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#warn(java.lang.String) - */ - public void warn(String aMessage) { - logger.warn(aMessage); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#warn(java.lang.String, java.lang.Throwable) - */ - public void warn(String aMessage, Throwable aThrowable) { - logger.warn(aMessage, aThrowable); - } - - /* (non-Javadoc) - * @see nl.justobjects.pushlet.util.PushletLogger#setLevel(int) - */ - public void setLevel(int aLevel) { - if (aLevel < LOG_LEVEL_FATAL) { - logger.setLevel(Level.OFF); - } else { - switch (aLevel) { - case LOG_LEVEL_FATAL: - logger.setLevel(Level.FATAL); - break; - case LOG_LEVEL_ERROR: - logger.setLevel(Level.ERROR); - break; - case LOG_LEVEL_WARN: - logger.setLevel(Level.WARN); - break; - case LOG_LEVEL_INFO: - logger.setLevel(Level.INFO); - break; - case LOG_LEVEL_DEBUG: - logger.setLevel(Level.DEBUG); - break; - case LOG_LEVEL_TRACE: - logger.setLevel(Level.TRACE); - break; - default: - logger.setLevel(Level.INFO); - } - } - } -} diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/PushletException.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/PushletException.java deleted file mode 100644 index 09ecd3176c..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/PushletException.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -/** - * Generic exception wrapper. - * - * @author Just van den Broecke - * @version $Id: PushletException.java,v 1.1 2005/02/15 15:14:34 justb Exp $ - */ -public class PushletException extends Exception { - - private PushletException() { - } - - public PushletException(String aMessage, Throwable t) { - super(aMessage + "\n embedded exception=" + t.toString()); - } - - public PushletException(String aMessage) { - super(aMessage); - } - - public PushletException(Throwable t) { - this("PushletException: ", t); - } - - public String toString() { - return "PushletException: " + getMessage(); - } -} - -/* - * $Log: PushletException.java,v $ - * Revision 1.1 2005/02/15 15:14:34 justb - * *** empty log message *** - * - - * - */ \ No newline at end of file diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/PushletLogger.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/PushletLogger.java deleted file mode 100644 index e70bc68703..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/PushletLogger.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -import nl.justobjects.pushlet.core.ConfigDefs; - -/** - * Logger interface to allow different logging providers. - *

      - * - * @author Ulrich Romahn - * @version $Id: PushletLogger.java,v 1.1 2007/12/07 12:57:40 justb Exp $ - */ -public interface PushletLogger extends ConfigDefs { - - /** - * Method allowing to initialize our logger - */ - public void init(); - - /** - * Log message for trace level. - * - * @param aMessage the message to be logged - */ - public void trace(String aMessage); - - /** - * Log message for debug level. - * - * @param aMessage the message to be logged - */ - public void debug(String aMessage); - - /** - * Log message for info level. - * - * @param aMessage the message to be logged - */ - public void info(String aMessage); - - /** - * Log message for warning level. - * - * @param aMessage the message to be logged - */ - public void warn(String aMessage); - - /** - * Log message for warning level with exception. - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void warn(String aMessage, Throwable aThrowable); - - /** - * Log message for error level. - * - * @param aMessage the message to be logged - */ - public void error(String aMessage); - - /** - * Log message (error level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void error(String aMessage, Throwable aThrowable); - - /** - * Log message for fatal level. - * - * @param aMessage the message to be logged - */ - public void fatal(String aMessage); - - /** - * Log message (fatal level with exception). - * - * @param aMessage the message to be logged - * @param aThrowable the exception - */ - public void fatal(String aMessage, Throwable aThrowable); - - /** - * Set log level - * - * @param aLevel a valid Level from ConfigDefs - */ - public void setLevel(int aLevel); -} diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Rand.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Rand.java deleted file mode 100644 index 041970941f..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Rand.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. -package nl.justobjects.pushlet.util; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.PrintWriter; -import java.util.Random; - -/** - * Randomizing routines. - * - * @author Just van den Broecke - * @version $Id: Rand.java,v 1.4 2007/12/07 12:57:40 justb Exp $ - */ -public class Rand { - private static char CHARS[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'v', 'w', 'y', 'z'}; - private static char NON_VOWELS[] = {'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'z'}; - private static char VOWELS[] = {'a', 'e', 'i', 'o', 'u', 'y'}; - private static Random random = new Random(); - - public static char randomChar() { - return CHARS[randomInt(0, CHARS.length - 1)]; - } - - public static char randomVowel() { - return VOWELS[randomInt(0, VOWELS.length - 1)]; - } - - public static char randomNonVowel() { - return NON_VOWELS[randomInt(0, NON_VOWELS.length - 1)]; - } - - public static File randomTempDir() throws Exception { - File file = new File(System.getProperty("java.io.tmpdir") + File.separator + "oasetest" + File.separator + randomString(12)); - file.mkdirs(); - file.deleteOnExit(); - return file; - } - - public static File randomTempFile() throws Exception { - File file = new File(System.getProperty("java.io.tmpdir") + File.separator + "oase-" + randomString(6)); - file.createNewFile(); - file.deleteOnExit(); - return file; - } - - public static File randomBinaryFile(int aSize) throws Exception { - File file = randomTempFile(); - FileOutputStream fos = new FileOutputStream(file); - fos.write(randomBytes(aSize)); - fos.close(); - return file; - } - - public static File randomTextFile(int aSize) throws Exception { - File file = randomTempFile(); - PrintWriter pw = new PrintWriter(new FileOutputStream(file)); - pw.write(randomString(aSize)); - pw.close(); - return file; - } - - public static byte[] randomBytes(int aSize) { - return randomBlob(aSize); - } - - public static byte[] randomBlob(int aSize) { - byte[] retval = new byte[aSize]; - for (int i = 0; i < retval.length; i++) { - retval[i] = randomByte(); - } - return retval; - } - - public static byte randomByte() { - return (byte) random.nextInt(); - } - - public static double randomDouble() { - return random.nextLong(); - } - - - public static int randomInt() { - return random.nextInt(); - } - - public static int randomInt(int min, int max) { - return (int) ((Math.random() * (double) (max + 1 - min)) + min); - } - - public static long randomLong() { - return random.nextLong(); - } - - public static long randomLong(long min, long max) { - return (long) ((Math.random() * (double) (max + 1L - min)) + min); - } - - public static String randomName(int aLength) { - StringBuffer sb = new StringBuffer(aLength); - for (int i = 0; i < aLength; i++) { - sb.append(i % 2 == 0 ? randomNonVowel() : randomVowel()); - } - return sb.toString(); - } - - public static void randomSleep(long min, long max) { - try { - Thread.sleep(randomLong(min, max)); - } catch (InterruptedException ie) { - - } - } - - public static String randomString(int aLength) { - StringBuffer sb = new StringBuffer(aLength); - for (int i = 0; i < aLength; i++) { - sb.append(randomChar()); - } - return sb.toString(); - } - - public static String randomString() { - return "" + randomLong(); - } - - -} - -/* - * $Log: Rand.java,v $ - * Revision 1.4 2007/12/07 12:57:40 justb - * added log4j and make it the default logging method - * - * Revision 1.3 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.2 2004/09/03 22:35:38 justb - * Almost complete rewrite, just checking in now - * - * Revision 1.1 2004/03/10 12:21:27 justb - * *** empty log message *** - * - * - */ \ No newline at end of file diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Servlets.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Servlets.java deleted file mode 100644 index 3b0f20c89f..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Servlets.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - - -/** - * Servlet utilities. - * - * @author Just van den Broecke - Just Objects © - * @version $Id: Servlets.java,v 1.2 2007/11/23 21:10:17 justb Exp $ - */ -public class Servlets { - - /** - * Get parameter; if not set or empty return null. - */ - public static String getParameter(HttpServletRequest aRequest, String aName) { - return getParameter(aRequest, aName, null); - } - - /** - * Get parameter; if not set or empty return specified default value. - */ - public static String getParameter(HttpServletRequest aRequest, String aName, String aDefault) { - String value = aRequest.getParameter(aName); - if (value == null || value.length() == 0) { - value = aDefault; - } - return value; - } - - /** - * Set HTTP headers to prevent caching. - */ - public static void setNoCacheHeaders(HttpServletResponse aResponse) { - // Set to expire far in the past. - aResponse.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT"); - - // Set standard HTTP/1.1 no-cache headers. - aResponse.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); - - // Set IE extended HTTP/1.1 no-cache headers (use addHeader). - aResponse.addHeader("Cache-Control", "post-check=0, pre-check=0"); - - // Set standard HTTP/1.0 no-cache header. - aResponse.setHeader("Pragma", "no-cache"); - - } - -} - -/* - * $Log: Servlets.java,v $ - * Revision 1.2 2007/11/23 21:10:17 justb - * add hooks for custom logging (you can override DefaultLogger in pushlet.properties) - * - * Revision 1.1 2004/09/20 22:01:40 justb - * more changes for new protocol - * - * - */ - - diff --git a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Sys.java b/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Sys.java deleted file mode 100644 index 2b72ab55e1..0000000000 --- a/sw/in_progress/pow/pow/src/nl/justobjects/pushlet/util/Sys.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2000 Just Objects B.V. -// Distributable under LGPL license. See terms of license at gnu.org. - -package nl.justobjects.pushlet.util; - - -import java.io.FileInputStream; -import java.io.IOException; -import java.text.CharacterIterator; -import java.text.StringCharacterIterator; -import java.util.Properties; - -/** - * Utilities that interact with the underlying OS/JVM. - * - * @author Just van den Broecke - * @version $Id: Sys.java,v 1.4 2007/11/10 14:17:18 justb Exp $ - */ -public class Sys { - - /** - * Replace characters having special meaning inside HTML tags - * with their escaped equivalents, using character entities such as '&'. - *

      - *

      The escaped characters are : - *

        - *
      • < - *
      • > - *
      • " - *
      • ' - *
      • \ - *
      • & - *
      - *

      - *

      This method ensures that arbitrary text appearing inside a tag does not "confuse" - * the tag. For example, HREF='Blah.do?Page=1&Sort=ASC' - * does not comply with strict HTML because of the ampersand, and should be changed to - * HREF='Blah.do?Page=1&Sort=ASC'. This is commonly seen in building - * query strings. (In JSTL, the c:url tag performs this task automatically.) - */ - static public String forHTMLTag(String aTagFragment) { - final StringBuffer result = new StringBuffer(); - - final StringCharacterIterator iterator = new StringCharacterIterator(aTagFragment); - char character = iterator.current(); - while (character != CharacterIterator.DONE) { - if (character == '<') { - result.append("<"); - } else if (character == '>') { - result.append(">"); - } else if (character == '\"') { - result.append("""); - } else if (character == '\'') { - result.append("'"); - } else if (character == '\\') { - result.append("\"); - } else if (character == '&') { - result.append("&"); - } else { - //the char is not a special one - //add it to the result as is - result.append(character); - } - character = iterator.next(); - } - return result.toString(); - } - - /** - * Load properties file from classpath. - */ - static public Properties loadPropertiesResource(String aResourcePath) throws IOException { - try { - // Use the class loader that loaded our class. - // This is required where for reasons like security - // multiple class loaders exist, e.g. BEA WebLogic. - // Thanks to Lutz Lennemann 29-aug-2000. - ClassLoader classLoader = Sys.class.getClassLoader(); - - Properties properties = new Properties(); - - // Try loading it. - properties.load(classLoader.getResourceAsStream(aResourcePath)); - return properties; - } catch (Throwable t) { - throw new IOException("failed loading Properties resource from " + aResourcePath); - } - } - - /** - * Load properties file from file path. - */ - static public Properties loadPropertiesFile(String aFilePath) throws IOException { - try { - - Properties properties = new Properties(); - - // Try loading it. - properties.load(new FileInputStream(aFilePath)); - return properties; - } catch (Throwable t) { - throw new IOException("failed loading Properties file from " + aFilePath); - } - } - - /** - * Shorthand for current time. - */ - static public long now() { - return System.currentTimeMillis(); - } - -} diff --git a/sw/in_progress/pow/pow/src/pow/AES.java b/sw/in_progress/pow/pow/src/pow/AES.java deleted file mode 100644 index c54f5f5de4..0000000000 --- a/sw/in_progress/pow/pow/src/pow/AES.java +++ /dev/null @@ -1,192 +0,0 @@ -package pow; - -import java.security.*; -import java.security.spec.InvalidKeySpecException; -import java.security.spec.InvalidParameterSpecException; -//import java.security.spec.KeySpec; - -import javax.crypto.*; -import javax.crypto.spec.*; - -//import org.apache.commons.codec.binary.Hex; - -import java.io.*; - -/** -* implements AES encryption and decryption algorithms -* @see http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html -*/ - -public class AES { - - private byte[] key; - private SecretKeySpec skeySpec; - private Cipher cipher_encrypt; - private Cipher cipher_decrypt; - // - /** - * construct a cipher with a generated 128 bits key - * @throws InvalidParameterSpecException - * @throws InvalidAlgorithmParameterException - * @throws NoSuchAlgorithmException - * @throws NoSuchPaddingException - */ - public AES() throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidParameterSpecException, InvalidAlgorithmParameterException { - // Get the KeyGenerator - KeyGenerator kgen = KeyGenerator.getInstance("AES"); - kgen.init(128); // 192 and 256 bits may not be available - // Generate the secret key specs. - SecretKey skey = kgen.generateKey(); - key = skey.getEncoded(); - skeySpec = new SecretKeySpec(key, "AES"); - cipher_encrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher_encrypt.init(Cipher.ENCRYPT_MODE, skeySpec); - byte[] iv = cipher_encrypt.getParameters().getParameterSpec(IvParameterSpec.class).getIV(); - cipher_decrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher_decrypt.init(Cipher.DECRYPT_MODE, skeySpec,new IvParameterSpec(iv)); - } - /** - * construct a cipher from an user specified key - * @param password - * @throws NoSuchAlgorithmException - * @throws NoSuchPaddingException - * @throws InvalidKeyException - * @throws InvalidParameterSpecException - * @throws InvalidAlgorithmParameterException - * @throws InvalidKeySpecException - */ - public AES(String password) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidParameterSpecException, InvalidAlgorithmParameterException, InvalidKeySpecException { - // autre facon de generer la cle -/* SecureRandom random = new SecureRandom(); - byte salt[] = new byte[8]; - random.nextBytes(salt); - - SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); - KeySpec spec = new PBEKeySpec(password.toCharArray(), salt, 1024, 256); - SecretKey tmp = factory.generateSecret(spec); - SecretKey secret = new SecretKeySpec(tmp.getEncoded(), "AES"); -*/ - // Get the KeyGenerator - KeyGenerator kgen = KeyGenerator.getInstance("AES"); - kgen.init(128); // 192 and 256 bits may not be available - // Generate the secret key specs. - SecretKey skey = kgen.generateKey(); - key = skey.getEncoded(); - skeySpec = new SecretKeySpec(key, "AES"); - cipher_encrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher_encrypt.init(Cipher.ENCRYPT_MODE, skeySpec); - byte[] iv = cipher_encrypt.getParameters().getParameterSpec(IvParameterSpec.class).getIV(); - cipher_decrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher_decrypt.init(Cipher.DECRYPT_MODE, skeySpec,new IvParameterSpec(iv)); - } - /** - * construct a cipher from a key and a parameter array - * usefull to create a remote decryption cypher - * @param key - * @param iv parameter of the cipher - * @throws InvalidKeyException - * @throws InvalidAlgorithmParameterException - * @throws NoSuchAlgorithmException - * @throws NoSuchPaddingException - */ - public AES(byte[] key,byte[] iv) throws InvalidKeyException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchPaddingException{ - skeySpec = new SecretKeySpec(key, "AES"); - key = skeySpec.getEncoded(); - cipher_encrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher_encrypt.init(Cipher.ENCRYPT_MODE, skeySpec,new IvParameterSpec(iv)); - cipher_decrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher_decrypt.init(Cipher.DECRYPT_MODE, skeySpec, new IvParameterSpec(iv)); - } - /** - * get the init parameter of the cipher object - */ - public byte[] getParamsEncrypt() throws InvalidParameterSpecException{ - AlgorithmParameters params = cipher_encrypt.getParameters(); - byte[] iv = params.getParameterSpec(IvParameterSpec.class).getIV(); - return iv; - } - /** - * get thecipher key - * @return - */ - public byte[] getKey(){return key;} - -/** - * encrypt a byte array with AES algorithm - * @see org.apache.commons.codec.binary.Hex to convert byte Array into hexString - * @param msg - * @return - * @throws IOException - * @throws BadPaddingException - * @throws IllegalBlockSizeException - */ - public byte[] encrypt(byte[] msg) throws IOException, IllegalBlockSizeException, BadPaddingException{ - ByteArrayInputStream in= new ByteArrayInputStream(msg); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - crypt(in, out, cipher_encrypt); - return out.toByteArray(); - } - /** - * decrypt a byte array with AES algorithm - * @see org.apache.commons.codec.binary.Hex to convert byte Array into hexString - * @param msg - * @return - * @throws IOException - * @throws BadPaddingException - * @throws IllegalBlockSizeException - */ - public byte[] decrypt(byte[] msg) throws IOException, IllegalBlockSizeException, BadPaddingException{ - ByteArrayInputStream in= new ByteArrayInputStream(msg); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - crypt(in, out, cipher_decrypt); - return out.toByteArray(); - } - /** - * Crypts or decrypts the specified input stream to the specified output - * stream with a given cipher. The crypting or decrypting operation is - * determined by the cipher's state. - * @param cipher The cipher used to crypt the specified input stream to the specified output - * stream. - * @param in the input srteal stream to be encypted or decrypted. - * @param out the output stream to be encypted or decrypted. - * @throws java.io.IOException if an I/O error occurs during crypting the input stream to the output stream. - * @throws BadPaddingException - * @throws IllegalBlockSizeException - */ - private void crypt(InputStream in, OutputStream out, Cipher cipher) - throws IOException, IllegalBlockSizeException, BadPaddingException - { - int blockSize = cipher.getBlockSize(); - int outputSize = cipher.getOutputSize(blockSize); - byte[] inBytes = new byte[blockSize]; - byte[] outBytes = new byte[outputSize]; - - int inLength = 0; - boolean done = false; - while(!done) - { - inLength = in.read(inBytes); - if(inLength == blockSize) - { - try - { - int outLength = cipher.update(inBytes, 0, blockSize, outBytes); - out.write(outBytes, 0, outLength); - } - catch(ShortBufferException e) - { - e.printStackTrace(); - } - } - else - done = true; - } - - if(inLength > 0) - outBytes = cipher.doFinal(inBytes, 0, inLength); - else - outBytes = cipher.doFinal(); - out.write(outBytes); - - } -} diff --git a/sw/in_progress/pow/pow/src/pow/AcStatus.java b/sw/in_progress/pow/pow/src/pow/AcStatus.java deleted file mode 100644 index 0f387a1011..0000000000 --- a/sw/in_progress/pow/pow/src/pow/AcStatus.java +++ /dev/null @@ -1,17 +0,0 @@ -package pow; -/** - * implements the life cycle of a drone when it is detected on the ivy bus - * @author genin - * - */ -public enum AcStatus { - UNKNOWN, - ASKING_IVY_CONF, - IVY_CONF_RECEIVED, - ASKING_WEB_ID, - WEB_ID_RECEIVED, - UPLOADING_CONF, - CONF_OK, - ALIVE, - CONF_NOTOK -} diff --git a/sw/in_progress/pow/pow/src/pow/AlreadyRegisteredUserException.java b/sw/in_progress/pow/pow/src/pow/AlreadyRegisteredUserException.java deleted file mode 100644 index 6da62c1551..0000000000 --- a/sw/in_progress/pow/pow/src/pow/AlreadyRegisteredUserException.java +++ /dev/null @@ -1,20 +0,0 @@ -package pow; -/** - * exception to inform that a user cannot be created in the users' file - * because it exists yet - * @author genin - * - */ -public class AlreadyRegisteredUserException extends Exception { - - private User usr; - - public AlreadyRegisteredUserException (User u){ - usr = u; - } - - public String toString() { - return "AlreadyRegisteredUserException : login " + usr.getLogin() + " is already used" ; - } - -} diff --git a/sw/in_progress/pow/pow/src/pow/BusIvy_.java b/sw/in_progress/pow/pow/src/pow/BusIvy_.java deleted file mode 100644 index 9d32edf17f..0000000000 --- a/sw/in_progress/pow/pow/src/pow/BusIvy_.java +++ /dev/null @@ -1,61 +0,0 @@ -package pow; -import java.io.*; -import java.net.*; -import java.util.*; -import java.util.Calendar; -/** - * - * inner representation of an ivy bus - * store the drones' information about the drones which belong to this ivy bus - * store the IP adresse of the machine where the ivy bus is working - */ -public class BusIvy_ -{ - private Calendar oCalendar; - private long oTime; - private InetAddress busAddress; - private ArrayList DronesId = new ArrayList(); - - public void setAddress(InetAddress myInetAddress) - { - busAddress = myInetAddress; - } - public void updateTime() - { - oCalendar=Calendar.getInstance(); - oTime = oCalendar.getTimeInMillis(); - } - public void addDrones(int newDroneId) - { - DronesId.add(newDroneId); - } - public ArrayList getDrones() - { - return DronesId; - } - public void displayDrones() - { - System.out.println("Bus Ivy : "); - System.out.println(busAddress); - System.out.println("Drones : "); - for(Integer myDrone : DronesId) - { - System.out.println(DronesId); - } - } - public InetAddress getAddress() - { - return busAddress; - } - public boolean isOwnBy(int myDroneId) - { - return DronesId.contains(myDroneId); - } - public boolean isAlive() - { - Calendar iCalendar = Calendar.getInstance(); - long iTime = iCalendar.getTimeInMillis(); - - return ((iTime - oTime)<10000); // 10 secondes - } -} \ No newline at end of file diff --git a/sw/in_progress/pow/pow/src/pow/Conf.java b/sw/in_progress/pow/pow/src/pow/Conf.java deleted file mode 100644 index 4724511868..0000000000 --- a/sw/in_progress/pow/pow/src/pow/Conf.java +++ /dev/null @@ -1,231 +0,0 @@ -package pow; -import java.io.*; -/** - * - * store usefull datas about the server configuration - * reading a specific file on the tomcat server - */ -public class Conf { - - - private String mailAdmin; - private String adminLogin; - /** - * The port in which the module listen. - */ - private int port; - /** - * The dimension of the datagrams received. - */ - private int taille; - /** - * The passWord of the database - */ - private String passWord; - /** - * The userName of the dataBase - */ - private String userName; - /** - * The Name of the dataBase - */ - private String dataBaseName; - /** - * The timeout of the connection - */ - private int timeout; - /** - * The repertory of configuration files - */ - private String flightPlanRep; - /** - * The port in which msg from web are sended to ivy - */ - private int portWebToIvy ; - - public Conf() - { - File oFile = null; - FileReader oFileReader = null; - BufferedReader oBufferedReader = null; - String fileName = "pow.conf"; - - String line; - - try - { - - oFile = new File("./conf/" + fileName); - //oFile = new File("./" + fileName); - oFileReader = new FileReader(oFile); - oBufferedReader = new BufferedReader(oFileReader); - - while((line = oBufferedReader.readLine())!=null) - { - if( (!(line.startsWith("#")))&&(line.length()!= 0) ) - { - if(line.startsWith(""))); - } - if(line.startsWith(""))); - } - if(line.startsWith("")); - } - if(line.startsWith("")); - } - if(line.startsWith("")); - } - if(line.startsWith(""))); - } - if(line.startsWith("")); - } - if(line.startsWith("")); - } - if(line.startsWith("")); - } - if(line.startsWith(""))); - } - } - } - } - catch(IOException ex) - { - System.out.println("No conf file detected"); - ex.printStackTrace(); - } - - } - - public Conf(String default_folder,String conf_filename) - { - File oFile = null; - FileReader oFileReader = null; - BufferedReader oBufferedReader = null; - String fileName = conf_filename; - - String line; - - try - { - - oFile = new File(default_folder+"/conf/" + fileName); - //oFile = new File("./" + fileName); - oFileReader = new FileReader(oFile); - oBufferedReader = new BufferedReader(oFileReader); - - while((line = oBufferedReader.readLine())!=null) - { - if( (!(line.startsWith("#")))&&(line.length()!= 0) ) - { - if(line.startsWith(""))); - } - if(line.startsWith(""))); - } - if(line.startsWith("")); - } - if(line.startsWith("")); - } - if(line.startsWith("")); - } - if(line.startsWith(""))); - } - if(line.startsWith("")); - } - if(line.startsWith("")); - } - if(line.startsWith("")); - } - if(line.startsWith(""))); - } - } - } - } - catch(IOException ex) - { - System.out.println("No conf file detected"); - ex.printStackTrace(); - } - } - - public int port() - { - return port; - } - - public int portWebToIvy() - { - return portWebToIvy; - } - public int taille() - { - return taille; - } - public String passWord() - { - return passWord; - } - public String userName() - { - return userName; - } - public String dataBaseName() - { - return dataBaseName; - } - public int timeout() - { - return timeout; - } - public String flightPlanRep() - { - return flightPlanRep; - } - - public String mailAdmin() - { - return mailAdmin; - } - - public String adminLogin(){ - return adminLogin; - } -} \ No newline at end of file diff --git a/sw/in_progress/pow/pow/src/pow/ConfJSP.java b/sw/in_progress/pow/pow/src/pow/ConfJSP.java deleted file mode 100644 index 275d803d6d..0000000000 --- a/sw/in_progress/pow/pow/src/pow/ConfJSP.java +++ /dev/null @@ -1,24 +0,0 @@ -package pow; -/* -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -*/ -/** - * interface which gives access to useful information to a Java Server Page - */ -public class ConfJSP { - - static Conf powConf = new Conf(); - - public static String getAdminLogin() //throws Exception - { - return powConf.adminLogin(); - } - - public static String getAdminMail() //throws Exception - { - return powConf.mailAdmin(); - } - -} diff --git a/sw/in_progress/pow/pow/src/pow/Greeting.java b/sw/in_progress/pow/pow/src/pow/Greeting.java deleted file mode 100644 index c1a9497469..0000000000 --- a/sw/in_progress/pow/pow/src/pow/Greeting.java +++ /dev/null @@ -1,147 +0,0 @@ -package pow; - -import java.io.File; -import java.io.PrintWriter; -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.*; -import java.net.*; -import java.util.Iterator; - -/** - * Servlet implementation class Greeting - * Handles the connection request from a new web client - * check the login's information and rights - */ -public class Greeting extends HttpServlet { - private static final long serialVersionUID = 1L; - private String default_folder="blabla"; - - public void init(ServletConfig config) throws ServletException { - super.init(config); // necessaire sinon getServletContext renvoie null dans doPost - default_folder = config.getServletContext().getRealPath(""); - // creation repertoire conf - /* - String filepath = default_folder + "/conf"; - File repository = new File(filepath); - deleteDirectory(repository); - repository = new File(filepath); - if ((!repository.exists()) && (!repository.isDirectory())) { - repository.mkdir(); // exists isDirectory() - } - */ - // creation d'un fichier d'user par defaut si n'existe pas - File def_user_file = new File(default_folder + "/conf/"+"userTable.tbl"); - if (!def_user_file.exists()){ - User usr0 = new User("admin","pwdadmin",Rights.ADMIN); - User usr1 = new User("toto","pwdtoto",Rights.ADMIN); - User usr2 = new User("tata","pwdtata",Rights.USER); - User usr3 = new User("titi","pwdtiti",Rights.USER); - usr2.addDrone("MJ5"); - usr3.addDrone("TJ1"); - usr3.addDrone("MJ5"); - UserTab logTab = new UserTab(); - try{ - logTab.insert(usr0); - logTab.insert(usr1); - logTab.insert(usr2); - logTab.insert(usr3); - } - catch(AlreadyRegisteredUserException e) {} - logTab.serialize(default_folder + "/conf/"+"userTable.tbl"); - } - } - - public Greeting(){ - super(); - - } - - /** - * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) - */ - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } - - /** - * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) - */ - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - // va chercherla session correspondant à la requete et la crée sinon (param true) - HttpSession session = request.getSession(true); - //Cookie c = new Cookie("nom","valeur"); - //response.addCookie(MonCookie); - String login = request.getParameter("login"); - String password; - response.setContentType("text/html;charset=UTF-8"); - PrintWriter out = response.getWriter(); - if (login ==null) - { - login = "VISITOR"; - password=null; - session.setAttribute("login",login); - session.setAttribute("rights","visitor"); - // ok on lance l'interface - out.println(""); - } - else { - // on verifie la validite du mot de passe - login = request.getParameter("login").toString(); - password = request.getParameter("password").toString(); - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl"); - if (logTab.checkUser(login, password)){ - - Rights r = logTab.seek(login).getRights(); - session.setAttribute("login",login); - if (r==Rights.ADMIN){ - session.setAttribute("rights","admin"); - } - else if (r==Rights.USER) { - session.setAttribute("rights","user"); - Iterator itr = logTab.getItrUsr(login); - String dronenameallowedtobectl=""; - if (itr!=null){ - while(itr.hasNext()){ - dronenameallowedtobectl+=itr.next()+";"; - // transmettre la liste des avions a la page web - } - } - session.setAttribute("dronectl",dronenameallowedtobectl); - } - else { - session.setAttribute("rights","visitor");// inutile normalement - } - // ok on lance l'interface - out.println(""); - } - else { - // on renvoie une page d'erreur de login - out.println(""); - } - - } - out.close(); - } - - - static private boolean deleteDirectory(File path) { - boolean resultat = true; - - if( path.exists() ) { - File[] files = path.listFiles(); - for(int i=0; i[:port] [passphrase]"); - return; - } - - File file = new File("jssecacerts"); - if (file.isFile() == false) { - char SEP = File.separatorChar; - File dir = new File(System.getProperty("java.home") + SEP - + "lib" + SEP + "security"); - file = new File(dir, "jssecacerts"); - if (file.isFile() == false) { - file = new File(dir, "cacerts"); - } - } - System.out.println("Loading KeyStore " + file + "..."); - InputStream in = new FileInputStream(file); - KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); - ks.load(in, passphrase); - in.close(); - - SSLContext context = SSLContext.getInstance("TLS"); - TrustManagerFactory tmf = - TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - tmf.init(ks); - X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0]; - SavingTrustManager tm = new SavingTrustManager(defaultTrustManager); - context.init(null, new TrustManager[] {tm}, null); - SSLSocketFactory factory = context.getSocketFactory(); - - System.out.println("Opening connection to " + host + ":" + port + "..."); - SSLSocket socket = (SSLSocket)factory.createSocket(host, port); - socket.setSoTimeout(10000); - try { - System.out.println("Starting SSL handshake..."); - socket.startHandshake(); - socket.close(); - System.out.println(); - System.out.println("No errors, certificate is already trusted"); - } catch (SSLException e) { - System.out.println(); - e.printStackTrace(System.out); - } - - X509Certificate[] chain = tm.chain; - if (chain == null) { - System.out.println("Could not obtain server certificate chain"); - return; - } - - BufferedReader reader = - new BufferedReader(new InputStreamReader(System.in)); - - System.out.println(); - System.out.println("Server sent " + chain.length + " certificate(s):"); - System.out.println(); - MessageDigest sha1 = MessageDigest.getInstance("SHA1"); - MessageDigest md5 = MessageDigest.getInstance("MD5"); - for (int i = 0; i < chain.length; i++) { - X509Certificate cert = chain[i]; - System.out.println - (" " + (i + 1) + " Subject " + cert.getSubjectDN()); - System.out.println(" Issuer " + cert.getIssuerDN()); - sha1.update(cert.getEncoded()); - System.out.println(" sha1 " + toHexString(sha1.digest())); - md5.update(cert.getEncoded()); - System.out.println(" md5 " + toHexString(md5.digest())); - System.out.println(); - } - - System.out.println("Enter certificate to add to trusted keystore or 'q' to quit: [1]"); - String line = reader.readLine().trim(); - int k; - try { - k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1; - } catch (NumberFormatException e) { - System.out.println("KeyStore not changed"); - return; - } - - X509Certificate cert = chain[k]; - String alias = host + "-" + (k + 1); - ks.setCertificateEntry(alias, cert); - - OutputStream out = new FileOutputStream("jssecacerts"); - ks.store(out, passphrase); - out.close(); - - System.out.println(); - System.out.println(cert); - System.out.println(); - System.out.println - ("Added certificate to keystore 'jssecacerts' using alias '" - + alias + "'"); - } - - private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray(); - - private static String toHexString(byte[] bytes) { - StringBuilder sb = new StringBuilder(bytes.length * 3); - for (int b : bytes) { - b &= 0xff; - sb.append(HEXDIGITS[b >> 4]); - sb.append(HEXDIGITS[b & 15]); - sb.append(' '); - } - return sb.toString(); - } - - private static class SavingTrustManager implements X509TrustManager { - - private final X509TrustManager tm; - private X509Certificate[] chain; - - SavingTrustManager(X509TrustManager tm) { - this.tm = tm; - } - - public X509Certificate[] getAcceptedIssuers() { - throw new UnsupportedOperationException(); - } - - public void checkClientTrusted(X509Certificate[] chain, String authType) - throws CertificateException { - throw new UnsupportedOperationException(); - } - - public void checkServerTrusted(X509Certificate[] chain, String authType) - throws CertificateException { - this.chain = chain; - tm.checkServerTrusted(chain, authType); - } - } - -} diff --git a/sw/in_progress/pow/pow/src/pow/Ivy2TomcatHttpServer.java b/sw/in_progress/pow/pow/src/pow/Ivy2TomcatHttpServer.java deleted file mode 100644 index 6a25ccad52..0000000000 --- a/sw/in_progress/pow/pow/src/pow/Ivy2TomcatHttpServer.java +++ /dev/null @@ -1,291 +0,0 @@ -package pow; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.PrintWriter; -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.codec.binary.Hex; -import org.apache.commons.fileupload.*; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -//import org.apache.commons.fileupload.util.Streams; -import org.apache.commons.fileupload.disk.DiskFileItemFactory; - -import java.util.HashMap; -import java.util.List; -import java.util.Iterator; -import java.io.File; -import java.net.InetAddress; -/** - * Handles the connection request from a new ivy bus - * provide a unique id for the ivy bus - * provide a unique id for each new drone on a ivy bus - * handles the uploading of the configuration files for each new drone on a ivy bus - */ -public class Ivy2TomcatHttpServer extends HttpServlet { - private static final long serialVersionUID = 1L; - private static int webIdCount = 1; - private static int droneIdCount = 1; - private String default_folder="blabla"; - private HashMap tableIvySession ;// correspondance webid,session ivy - /** - * - */ - public Ivy2TomcatHttpServer() { - super(); - - } - - public void init(ServletConfig config) throws ServletException { - // - // faire le menage du repertoire upload - //config.getServletContext().getRealPath(""); - //String default_folder=getServletContext().getRealPath("/"); // repertoire de l'appli - default_folder = config.getServletContext().getRealPath(""); - //System.out.println("default appli folder : "+ default_folder); - - String filepath = default_folder + "/upload"; - File repository = new File(filepath); - deleteDirectory(repository); - repository = new File(filepath); - if ((!repository.exists()) && (!repository.isDirectory())) { - repository.mkdir(); // exists isDirectory() - } - tableIvySession = new HashMap(); - // mise a disposition des sessions pour les autres servlet - config.getServletContext().setAttribute("ivySessionTable", tableIvySession); - // creation d'un fichier d'user pour Ivy par defaut si n'existe pas - File def_user_file = new File(default_folder + "/conf/"+"userIvyTable.tbl"); - if (!def_user_file.exists()){ - User usr0 = new User("admin_ivy","pwdadmin_ivy",Rights.IVY); - UserTab logTab = new UserTab(); - try{ - logTab.insert(usr0); - } - catch(AlreadyRegisteredUserException e) {} - logTab.serialize(default_folder + "/conf/"+"userIvyTable.tbl"); - } - } - - static private boolean deleteDirectory(File path) { - boolean resultat = true; - - if( path.exists() ) { - File[] files = path.listFiles(); - for(int i=0; i"); - out.println("1"); - out.println(""+newWebId+""); - out.println(""+aesKey+""); - out.println(""+aesIv+""); - out.println(""); - InetAddress remoteClient = InetAddress.getByName(request.getRemoteAddr()); - SessionIvy session = new SessionIvy(login,newWebId,cipher_aes,remoteClient); - tableIvySession.put(remoteClient,session); - out.close(); - System.out.println("**************************************"); - System.out.println("Web Id sended = " + newWebId); - System.out.println("remote client = " + request.getRemoteAddr() + " host=" + request.getRemoteHost() + " port=" + request.getRemotePort()); - System.out.println("key sended = " + aesKey ); - System.out.println("iv parameter = " + aesIv ); - System.out.println("**************************************"); - } - catch (Exception ex){ - PrintWriter out = response.getWriter(); - out.println(""); - out.println("2"); - out.println(""); - out.close(); - System.out.println("AES encryption not supported by server!!!\n"); - ex.printStackTrace(); - } - } - else { - PrintWriter out = response.getWriter(); - out.println(""); - out.println("0"); - out.println(""); - out.close(); - System.out.println("Not authorized access attempt from an ivy client!!!"); - } - } - else if (order.equals("reconnect")) - { - - } - else if (order.equals("requestNewDroneWebId")) - {// client has a webId (not in multipart post) yet and wants to do somtheing else than uploading - System.out.println("Drone Web Id for new drone requested !!!"); - String ivyId = request.getParameter("ivyWebId"); - //String ivyDroneId = request.getParameter("ivyDroneId"); - System.out.println("ivyId " + ivyId + " request new Drone Web Id for unknown ivy drone ");// + ivyDroneId); - int webidsession = Integer.parseInt(ivyId); - //int droneivyid = Integer.parseInt(ivyDroneId); - int newdroneWebId = droneIdCount;droneIdCount++; - PrintWriter out = response.getWriter(); - out.println(""); - out.close(); - System.out.println("new drone Web Id sended (dronewebid = "+newdroneWebId+") !!!"); - } - } - else // client has a webId ( in multipart post) yet and wants to upload conf files - { - System.out.println("uploading file requested..."); - String res = uploadFile(request); - PrintWriter out = response.getWriter(); - out.println(""); - out.println(res); - out.println(""); - out.close(); - }// end if check IvyId - - } - - /* for parameter - see http://stackoverflow.com/questions/992019/java-256bit-aes-encryption - - */ - - - - - /* - * handles the upload of a file from a ivy bus to the server via http - */ - private String uploadFile(HttpServletRequest request){ - boolean isMultipart = ServletFileUpload.isMultipartContent(request); - String resu = "-1"; - List items=null; - String webid="zzz"; - String droneid = "yyy"; - String filepath=""; - // String default_folder=getServletContext().getRealPath("/"); - - System.out.println("!!!def upload rep !!! " + default_folder); - File uploadedFile; - if (isMultipart) - { - // System.out.println("is multipart ...."); - // Create a factory for disk-based file items - FileItemFactory factory = new DiskFileItemFactory(); - // Set factory constraints - // factory.setSizeThreshold(yourMaxMemorySize); - // factory.setRepository(yourTempDirectory); - // Create a new file upload handler - ServletFileUpload upload = new ServletFileUpload(factory); - // Set overall request size constraint - // upload.setSizeMax(yourMaxRequestSize); - // Parse the request - try { - items = upload.parseRequest(request); - // Process the uploaded items - // on cherche le web id - // System.out.println("on cherche le web id ...."); - boolean doIt1 = true;boolean doIt2 = true; - Iterator iter = items.iterator(); - while ((doIt1||doIt2) && iter.hasNext()) { - FileItem item = (FileItem) iter.next(); - if (item.isFormField()) { - String fieldName = item.getFieldName(); - if (fieldName.equals("ivyWebId")){ - doIt1 = false ; - webid = item.getString(); - } - else if (fieldName.equals("droneWebId")){ - doIt2 = false; - droneid = item.getString(); - } - } - } - filepath = default_folder +"/upload/"+droneid; - File repository = new File(filepath); - if ((!repository.exists()) && (!repository.isDirectory())) { - boolean res=repository.mkdir(); // exists isDirectory() - System.out.println("repertoire "+filepath+" cree ? " + res); - } - if (!webid.equals("zzz")){ - // on cherche les fichiers - iter = items.iterator(); - while (iter.hasNext()) { - FileItem item = (FileItem) iter.next(); - if (!item.isFormField()) { // on verifie la nature de l'item - String fileName = item.getName(); - //String contentType = item.getContentType(); - //boolean isInMemory = item.isInMemory(); - //long sizeInBytes = item.getSize(); - uploadedFile = new File(filepath+"/"+fileName); - try { - item.write(uploadedFile); - resu = "1"; - System.out.println("file: "+fileName+" for web drone "+droneid+" was uploaded successfully"); - } catch (Exception e) { - resu = "0"; - System.out.println("unable to write file on server : "+droneid+"/"+fileName); - e.printStackTrace(); - } - } //end if - } // end while - } - } catch (FileUploadException e) { - System.out.println("unable to parse client request "); - e.printStackTrace(); - } - } // end if multipart - return resu; - } -} diff --git a/sw/in_progress/pow/pow/src/pow/Ivy2UdpReading.java b/sw/in_progress/pow/pow/src/pow/Ivy2UdpReading.java deleted file mode 100644 index 136728150f..0000000000 --- a/sw/in_progress/pow/pow/src/pow/Ivy2UdpReading.java +++ /dev/null @@ -1,1071 +0,0 @@ -package pow; - -import java.io.*; -import java.net.*; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -//import java.util.Vector; - -import fr.dgac.ivy.*; -import java.lang.*; - - -import org.apache.commons.codec.binary.Hex; -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpException; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.UsernamePasswordCredentials; -import org.apache.commons.httpclient.auth.AuthScope; -import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.commons.httpclient.methods.PostMethod; -import org.apache.commons.httpclient.methods.multipart.FilePart; -import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity; -import org.apache.commons.httpclient.methods.multipart.Part; -import org.apache.commons.httpclient.methods.multipart.StringPart; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.httpclient.params.HttpMethodParams; -import org.apache.commons.httpclient.protocol.Protocol; -import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; -import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler; - -import java.io.StringReader; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; - -/** - * This aims to send Udp datagram containing information on the active drones - * to the web serveur - * @author jabln, thomas genin - * @version 2.0 - */ -class Ivy2UdpReading implements Runnable{ - private boolean stopThread; - private InetAddress serveur; - private String login; - private String password; - final static int portUdpSend = 8535; - final static int portUdpReceive = 8536; - private Ivy bus,tempsbus; - final static int taille = 1024; - static int maxAircrafts = 1000; // TODO a changer !!! mettre une map ou qqch - static int datagramLength = 17; // modif , on a rajoute la couleur a la fin - private String datagramMatrix[][] = new String[maxAircrafts][datagramLength];// TODO a changer !!! mettre une map ou qqch - private int aircraftNumber = 0; - private Boolean aircraftAlive[] = new Boolean[maxAircrafts];// TODO a changer !!! mettre une map ou qqch - private int count[] = new int[maxAircrafts];// TODO a changer !!! mettre une map ou qqch - private int countSettings[]=new int[maxAircrafts];// TODO a changer !!! mettre une map ou qqch - private HashMap> settingsToBeChanged = new HashMap>(); - private int webId=-999; - private byte[] aesKey ; - private AES aesCipher; - private String url; - private acNetIdStorage acNetIds; - private ConcurrentHashMap dronesStatus; - /* *********************** */ - private static long time2resetWptFilter = 20*60*1000; // on nettoie les filtres tous les 20min !!!!! - private MsgFilter waypointMsgFilter; - private long chrono_start; - private long elapsed_time; - private long chrono_start2; - private long timeToSendValues=60*1000; // on envoie les values d'un drone toutes les 60 secondes - private HashMap lastvaluesMap; - /* ************************ */ - private long num_msg; - private SimpleDateFormat dateformat; - /* ************************* */ - /** - * create an object which listens on the local ivy bus and send messages to the server - */ - public Ivy2UdpReading(String hostname,String login, String password) - { - num_msg = 0; - dateformat = new SimpleDateFormat("d:M:y:HH:mm:ss"); - stopThread = false; - try{ - this.login = login; - this.password = password; - serveur = InetAddress.getByName(hostname); - // ********************************************* // - this.url = "http://"+hostname+":8080/TestServletPow/Ivy2TomcatHttpServer.srv"; - // ********************************************* // - dronesStatus = new ConcurrentHashMap(); - lastvaluesMap = new HashMap(); - // ********************************************* // - waypointMsgFilter = new MsgFilter(); - chrono_start = System.currentTimeMillis(); - chrono_start2 = System.currentTimeMillis(); - // ********************************************* // - bus = new Ivy("Ivy2Udp", "Ivy2Udp Ready", null); - } catch (Exception ie) { - System.out.println("Error : cannot connect to server"); - } - } - /** - * create an object which listens on the local ivy bus and send messages to the server - * @param urlObj describes information about the server - * @param login - * @param password - */ - public Ivy2UdpReading(PowUrl urlObj,String login, String password) - { - stopThread = false; - try{ - this.login = login; - this.password = password; - serveur = InetAddress.getByName(urlObj.getServerName()); - // ********************************************* // - this.url = urlObj.getWebUrl(); - // ********************************************* // - dronesStatus = new ConcurrentHashMap(); - lastvaluesMap = new HashMap(); - // ********************************************* // - waypointMsgFilter = new MsgFilter(); - chrono_start = System.currentTimeMillis(); - chrono_start2 = System.currentTimeMillis(); - // ********************************************* // - bus = new Ivy("Ivy2Udp", "Ivy2Udp Ready", null); - } catch (Exception ie) { - System.out.println("Error : cannot connect to server"); - } - } - /* ******************************** */ - /* *********** structure de correspondance entre webid et ivyid pour chaque drone ************ */ - /** - * initiate the object which allow to store information about drones - */ - public void setStorage(){ - acNetIds = new acNetIdStorage(webId,bus,url,maxAircrafts,dronesStatus); - } - /** - * - * @return the structure which allow to store information about drones - */ - public acNetIdStorage getStorage(){ - return acNetIds ; - } - /** - * - * @return the unique id of this ivy bus for the server - */ - public int getIvyWebId(){ - return webId; - } - /** - * methode qui interroge le serveur web tomcat pour lui demander un identifiant unique - * methode get - * @SEE http://hc.apache.org/httpclient-3.x/tutorial.html - * @SEE blogs.sun.com/gc/entry/unable_to_find_valid_certification - * @SEE http://blogs.sun.com/andreas/entry/no_more_unable_to_find - */ - public void getWebId() throws IvyConnectionExeption - { - int res = -1; - int statusCode=-1; - // http config - // SSLUtilities.trustAllHostnames(); - // SSLUtilities.trustAllHttpsCertificates() ; - HttpClient client = new HttpClient(); - client.getParams().setParameter("http.useragent", "Ivy request"); - //si https ... - // inutile mais bon pour 1 connection ... - Protocol stricthttps = new Protocol("https", (ProtocolSocketFactory)new StrictSSLProtocolSocketFactory(true), 443); - client.getHostConfiguration().setHost("localhost", 443, stricthttps); - - /* - Protocol easyhttps = new Protocol("https", new EasySSLProtocolSocketFactory(), 443); - Protocol.registerProtocol("https", easyhttps); - client.getHostConfiguration().setHost("localhost", 443, easyhttps); - */ - - PostMethod method = new PostMethod(url); - method.addParameter("order", "requestWebId"); - method.addParameter("login", login); - method.addParameter("pwd", password); - try { - System.out.println("### envoie de la requete requestWebId###"); - statusCode = client.executeMethod(method); - if (statusCode != HttpStatus.SC_OK) { - System.err.println("Method failed: " + method.getStatusLine()); - throw new IvyConnectionExeption("Erreur de retour de la requete de connection"); - } - else - { - // Read the response body. - try { - String responseBody = method.getResponseBodyAsString();//getResponseBody();//); - // Deal with the response - try { - // parse response in XML tree - // @SEE http://java.developpez.com/faq/xml/?page=dom - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document document = parser.parse(new InputSource(new StringReader(responseBody))); - // get login acknowledgment - Element ack_node = (Element)document.getElementsByTagName("ConnectionAck").item(0); - int ack = Integer.parseInt(ack_node.getTextContent()); - if (ack==1){ - // get webid node - Element webid_node = (Element)document.getElementsByTagName("webid").item(0); - webId = Integer.parseInt(webid_node.getTextContent()); - if (webId==-999) {throw new IvyConnectionExeption("unable to have correct webId");} - // get key node - Element aeskey_node= (Element)document.getElementsByTagName("aeskey").item(0); - String str_hex_aeskey = aeskey_node.getTextContent(); - // get match key node - Element aesiv_node= (Element)document.getElementsByTagName("aesiv").item(0); - String str_hex_aesIvParameter = aesiv_node.getTextContent(); - // - aesKey = Hex.decodeHex(str_hex_aeskey.toCharArray()); - byte[] iv = Hex.decodeHex(str_hex_aesIvParameter.toCharArray()); - aesCipher = new AES(aesKey,iv); - // - System.out.println("##########################"); - System.out.println("### connection ok+\t###"); - System.out.println("### web id = "+ webId +"\t###"); - System.out.println("### aes key = "+ str_hex_aeskey +"\t###"); - System.out.println("##########################"); - } - else if (ack==2){ - throw new IvyConnectionExeption("login ok, but aes encryption not supported by server"); - } - else - { - throw new IvyConnectionExeption("login process failed, you're not allowed to access the server"); - } - } - catch(Exception e) { - e.printStackTrace(); - throw new IvyConnectionExeption("unable to read the server response"); - } - } - catch (IOException e) { - System.err.println("IOException : echec execution requete post : request webId"); - e.printStackTrace(); - throw new IvyConnectionExeption("No response from the server"); - } - } - } catch (HttpException e) { - e.printStackTrace(); - throw new IvyConnectionExeption("HttpException : echec execution requete post : request webId"); - } catch (IOException e) { - e.printStackTrace(); - throw new IvyConnectionExeption("IOException : echec execution requete post : request webId"); - } finally { - method.releaseConnection(); // Release the connection. - - } - } - - /** - * This method binds the object to some messages - * of the bus Ivy. Each information that is needed by the web server is put in an - * array. This array is sent to server. - */ - - public void bindMsg2Ivy() throws IvyException { - for (int i = 0; i < countSettings.length; i++) { - countSettings[i] = 0; - } - - for (int i = 0; i < count.length; i++) { - count[i] = 0; - } - for (int i = 0; i < datagramMatrix.length; i++) { - for (int j = 0; j < datagramMatrix[i].length - 1; j++) { - datagramMatrix[i][j] = new String(" "); - } - } - for (int i = 0; i < aircraftAlive.length; i++) { - aircraftAlive[i] = true; - } - // bus = new Ivy("Ivy2Udp", "Ivy2Udp Ready", null); - - bus.bindMsg("ground FLIGHT_PARAM ([^ ]*) [^ ]* [^ ]* [^ ]* ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) .*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - - try { - //int acId = acId(args[0]); - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - //AcStatus droneState = dronesStatus.get(args[0]); - aircraftIdSeeker a ; - //System.out.println("status drones "+args[0] + ": " + droneState); - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][3] = args[1]; - datagramMatrix[acIndex][4] = args[2]; - datagramMatrix[acIndex][5] = args[3]; - datagramMatrix[acIndex][6] = args[4]; - datagramMatrix[acIndex][7] = args[5]; - datagramMatrix[acIndex][8] = args[6]; - datagramMatrix[acIndex][9] = args[7]; - send(acIndex); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process FLIGHT_PARAM information"); - } - - } - }); - - bus.bindMsg("ground ENGINE_STATUS ([^ ]*) [^ ]* [^ ]* [^ ]* [^ ]* ([^ ]*).*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - - try { - - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][10] = args[1]; - send(acIndex); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process ENGINE_STATUS information"); - } - - } - }); - - bus.bindMsg("ground ENGINE_STATUS ([^ ]*) ([^ ]*) .*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - - try { - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][12] = args[1]; - send(acIndex); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process AP_STATUS information"); - } - - } - }); - - - bus.bindMsg("ground AP_STATUS ([^ ]*) [^ ]* [^ ]* [^ ]* [^ ]* ([^ ]*) .*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - - try { - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][11] = args[1]; - send(acIndex); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process AP_STATUS information"); - } - - } - }); - - bus.bindMsg("ground NAV_STATUS ([^ ]*) ([^ ]*).*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - - try { - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][13] = args[1]; - // - String j2b[] = new String[1]; - j2b[0] = args[1]; - String s = new String("NAV_STATUS"); - //send(acIndex); - send(acIndex,s,j2b); - // - //send(acIndex); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process NAV_STATUS information"); - } - - } - }); - bus.bindMsg("ground DL_VALUES ([^ ]*) ([^ ]*)", new IvyMessageListener(){ - public void receive(IvyClient client, String[] args){ - try{ - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - String[] settingSplited = args[1].split(","); - String settingId = new String (""); - settingId = settingId + countSettings[acIndex]; - datagramMatrix[acIndex][14] = settingId; - datagramMatrix[acIndex][15] = settingSplited[countSettings[acIndex]]; - send(acIndex); - countSettings[acIndex] = (countSettings[acIndex] + 1) % settingSplited.length; - // gestion de l'A/R de DL_SETTING - // on attend que la valeur du setting soit effectivement change pour envoyer l'A/R - if (settingsToBeChanged.containsKey(acIndex)){ - HashMap h = settingsToBeChanged.get(acIndex); - Set k = h.keySet(); - Iterator itr = k.iterator(); - - while(itr.hasNext()){ - int current_settingid = itr.next(); - float value = h.get(current_settingid); - //System.out.println(""+current_settingid+" "+ value +"=?" +settingSplited[current_settingid]); - if(value==Float.parseFloat(settingSplited[current_settingid])){ - h.remove(current_settingid); - String chgSet[] = new String[2]; - chgSet[0] = ""+current_settingid; - chgSet[1] = ""+value; - String s = new String("DL_SETTING_ACK"); - send(acIndex,s,chgSet); - System.out.print("%"); - } - } - } - // gestion de l'envoie de l'ensemble des valeurs de - // setting pour un drone , on envoie la trame par periode timeToSendValues - Long lasttime = lastvaluesMap.get(acIndex); - long nowtime = System.currentTimeMillis(); - boolean firsttime = false; - if (lasttime==null){ - lasttime = nowtime; - lastvaluesMap.put(acIndex,nowtime); - firsttime = true ; - } - - if (firsttime||((nowtime-lasttime)>timeToSendValues)){ - // on envoie la value - String csv[] = new String[1]; - csv[0] = args[1]; - String s = new String("SETTINGS_VALUES"); - send(acIndex,s,csv); - System.out.print("+"); - lastvaluesMap.put(acIndex,nowtime); - } - - - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch(Exception ie) { - System.out.println("Can't process DL_VALUES information"); - System.out.println("acid= "+args[0]); - System.out.println("csv= "+args[1]); - System.out.println("********************\n"+ie.toString()+"\n********************"); - } - } - }); - // on surveille les messages WAYPOINT_MOVED pour traquer l'A/R d'un ordre venant d'un client web - // qui consisterait a deplacer un waypoint - bus.bindMsg("ground WAYPOINT_MOVED ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*)",new IvyMessageListener(){ - public void receive(IvyClient client, String[] args){ - try { - //int i = acId(args[0]); - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - int i = a.getAcId(); - String mvWp[] = new String[4]; - for (int j = 0;j<4;j++){ - mvWp[j] = args[j+1]; - } - String s = new String("WAYPOINT_MOVED"); - send(i,s,mvWp); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - catch (Exception ie){ - System.out.println("Can't process MOVE_WAYPOINT information"); - } - } - }); - // on traque ce message pour assurer l'A/R d'un ordre venant d'un client web qui viserait - // a modifier un parametre d'un drone - bus.bindMsg("DL_SETTING ([^ ]*) ([^ ]*) ([^ ]*)", new IvyMessageListener(){ - - public void receive(IvyClient client, String[] args){ - try{ - //int i = acId(args[0]); - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - int indexAircraft = a.getAcId(); - int indexSetting = Integer.parseInt(args[1]); - float valueSetting = Float.parseFloat(args[2]); - // memorisation qu'une requete DL_SETTING a ete faire - // voir traitement dans ground DL_VALUES - if (!settingsToBeChanged.containsKey(indexAircraft)){ - settingsToBeChanged.put(indexAircraft, new HashMap()); - } - settingsToBeChanged.get(indexAircraft).put(indexSetting, valueSetting); - System.out.print("$"); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - catch (Exception ie){ - System.out.println("Can't process DL_SETTING information"); - } - } - }); - - bus.bindMsg("ground TELEMETRY_STATUS ([^ ]*) ([^ ]*)", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - - try { - //int i = acId(args[0]); - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - int i = a.getAcId(); - if (i != -1) { - float f = Float.parseFloat(args[1]); - if (aircraftAlive[i] && f > 30) { - aircraftAlive[i] = false; - String s = new String("Plane_Die"); - send(i, s); - } else { - if (!aircraftAlive[i] && f < 30) { - aircraftAlive[i] = true; - String s = new String("Plane_Resurect"); - send(i, s); - } - } - } - } - } catch (Exception ie) { - - System.out.println("Can't process TELEMETRY_STATUS information"); - } - - } - }); - - bus.start(null); - } - - /* - * add usefull info to msg for storage in database - */ - private String add_info_msg(String msg){ - String monHeure = this.dateformat.format(new Date()); - String res = ""+this.webId+" " + this.num_msg + " " + monHeure +" " + msg; - this.num_msg++; - return res; - } - - /** - * This method send to the web server the datagram containing the informations - * about the aircraft - * @param acId Line of the matrix containing the informations about the plane - * @throws java.lang.Exception - */ - public void send(int acId){// throws Exception { - String s = ""; - if (count[acId] == 5) { - // try { - if (aircraftAlive[acId]) { - byte buffer[];// = new byte[taille]; - s = ""; - for (int i = 1; i < 7; i++) { - s = s + datagramMatrix[acId][i] + " "; - } - for(int i = 7; i< 10;i++){ - //StringBuffer str = new StringBuffer(4); - StringBuffer str = new StringBuffer(datagramMatrix[acId][i]); - str.setLength(5); - s = s + str + " "; - } - for(int i = 10; itaille){System.out.println("Alerte taille trame udp:"+buffer.length+" !!!!");} - DatagramPacket dataUdp = new DatagramPacket(buffer, buffer.length, serveur, portUdpSend); - try{ - DatagramSocket socketUdp = new DatagramSocket(); - try{ - socketUdp.send(dataUdp); - System.out.print("#"); - count[acId] = 0; - } - catch(IOException ex){System.out.print("datagram creation error : msg not sended");} - } - catch (SocketException ex){System.out.print("socket error : msg not sended");} - - } - catch( IOException ex){System.out.print("cipher error : cannot encrypt msg : msg not sended to server");ex.printStackTrace();} - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - } - //} - //catch (IOException ioex){ System.out.println("socket send exception, Can't send message " + s);} - //catch (Exception ie) { - // System.out.println("Can't send message on the web"); - //} - } else { - count[acId]++; - } - } - - - /** - * This method send to the web server a specific order with parameters - * @param acId : Line of the matrix containing the informations about the plane - * @param s : order - * @param as : parameters - */ - - public void send(int acId, String s, String[] as){ - String order = s; - s = s + " " + datagramMatrix[acId][1]+ " "; - for (int i =0; i< as.length;i++){ - s = s + as[i] + " "; - } - byte buffer[];//= new byte[taille]; - //System.out.println(s); - // gestion de l'ecoute ou non des msg waypoint_moved et des autres msg speciaux - - boolean isnew = true; - // on filtre certains messages - if (order.equals("WAYPOINT_MOVED") - ||order.equals("NAV_STATUS")) - { - //System.out.println("elapsed time : "+elapsed_time); - elapsed_time = System.currentTimeMillis() - chrono_start; - if (elapsed_time>time2resetWptFilter) - { - waypointMsgFilter.resetfilter(); - chrono_start = System.currentTimeMillis(); - } - isnew = waypointMsgFilter.isNew(s); - } - if(isnew){ - System.out.print("!"); - s = this.add_info_msg(s); - buffer = s.getBytes(); - try{ - buffer = this.aesCipher.encrypt(buffer); - if (buffer.length>taille){System.out.println("Alerte taille trame udp:"+buffer.length+" !!!!");} - DatagramPacket dataUdp = new DatagramPacket(buffer, buffer.length, serveur, portUdpSend); - try{ - DatagramSocket socketUdp = new DatagramSocket(); - try{ - socketUdp.send(dataUdp); - } - catch(IOException ex){System.out.print("datagram creation error : msg not sended");} - } - catch (SocketException ex){System.out.print("socket error : msg not sended");} - - } - catch (IOException ex){System.out.print("cipher error : cannot encrypt msg : msg not sended to server");ex.printStackTrace();} - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - } - } - - - - /** - * This method send a particular message about an aircraft - * @param acId line of the matrix containing the informations about the plane - * @param s message that is to be sent to send - */ - public void send(int acId, String s) { - s = s + " " + datagramMatrix[acId][1]; - byte buffer[] ;//= new byte[taille]; - s = this.add_info_msg(s); - buffer = s.getBytes(); - System.out.println(s); - try{ - buffer = this.aesCipher.encrypt(buffer); - if (buffer.length>taille){System.out.println("Alerte taille trame udp:"+buffer.length+" !!!!");} - DatagramPacket dataUdp = new DatagramPacket(buffer, buffer.length, serveur, portUdpSend); - try{ - DatagramSocket socketUdp = new DatagramSocket(); - try{ - socketUdp.send(dataUdp); - } - catch(IOException ex){System.out.print("datagram creation error : msg not sended");} - } - catch (SocketException ex){System.out.print("socket error : msg not sended");} - - } - catch (IOException ex){System.out.print("cannot encrypt msg : msg not sended to server");ex.printStackTrace();} - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - } - - /** - * listen the udp socket to get orders from web clients and send them to ivy - */ - public void run() { - byte[] complete_data ; - int true_length_of_msg ; - int i; - byte[] data_with_no_padding; - - - // getWebId(); - // login procedure - setStorage(); - try{ - bindMsg2Ivy(); - // on lance le reading - try - { - System.out.println("on lance udp writing "); - int portUdpReceive = 8536 ; - DatagramSocket socket = new DatagramSocket(portUdpReceive); - while (true) { - byte buffer[] = new byte[taille]; - DatagramPacket data = new DatagramPacket(buffer, buffer.length); - try{ - socket.receive(data); - System.out.print("data received from server web : "); - String[] messageed; - try{ - complete_data = data.getData(); - true_length_of_msg = data.getLength(); - data_with_no_padding = new byte[true_length_of_msg]; - for(i=0;i< true_length_of_msg;i++){ - data_with_no_padding[i]=complete_data[i]; - } - byte[] decrypted_data = aesCipher.decrypt(data_with_no_padding); - //String s = new String(data.getData());System.out.println(s); - String s = new String(decrypted_data);System.out.println(s); - messageed = s.split(" "); - try{ - // creer un objet d'envoie qui connait la correspondance ivyid et webid pour chaque drone - new Ivy2UdpWriting(messageed, getStorage()); - } - catch(IvyException e1){ System.out.println("erreur sending msg to ivy : " + s);} - } - catch(IOException ex){System.out.print("cipher error : cannot decrypt msg : msg not sended to ivy");ex.printStackTrace();} - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(buffer)))); - System.out.print("cannot encrypt msg : msg not sended to server"); - } - } - catch(IOException e){ System.out.println("erreur socket when receive message");} - } - } - catch(SocketException e){ System.out.println("erreur creation de socket server-->ivy ");} - } - catch (IvyException e){ - System.out.println("unable to bind to ivy...connection failed"); - e.printStackTrace(); - System.exit(0); - } - - } - - - /* - * - */ - public static void main(String argv[]) throws IvyException { - // serveur = InetAddress.getByName(argv[0]); - if (argv.length<1){ - System.out.println("failure :1 params required : [server name or url]"); - } - else { - byte[] complete_data ; - int true_length_of_msg ; - int i; - byte[] data_with_no_padding={'z'}; - try { - // seek user login info - String hostname = argv[0]; - PowUrl connectInfo = new PowUrl("http","blanc",8080,"TestServletPow","Ivy2TomcatHttpServer.srv"); - System.out.println("connecting to : "+ connectInfo.getWebUrl()); - - String login="admin_ivy"; - String password = "pwdadmin_ivy"; - Ivy2UdpReading link = new Ivy2UdpReading(connectInfo,login, password); - link.getWebId(); // login procedure - // - link.setStorage(); - - link.bindMsg2Ivy(); - // on lance le reading - try - { - System.out.println("on lance udp writing "); - int portUdpReceive = 8536 ; - DatagramSocket socket = new DatagramSocket(portUdpReceive); - while (true) { - byte buffer[] = new byte[taille]; - DatagramPacket data = new DatagramPacket(buffer, buffer.length); - try{ - socket.receive(data); - System.out.print("data received from server web : "); - String[] messageed; - try{ - complete_data = data.getData(); - true_length_of_msg = data.getLength(); - data_with_no_padding = new byte[true_length_of_msg]; - for(i=0;i< true_length_of_msg;i++){ - data_with_no_padding[i]=complete_data[i]; - } - byte[] decrypted_data = link.aesCipher.decrypt(data_with_no_padding); - //String s = new String(data.getData());System.out.println(s); - String s = new String(decrypted_data);System.out.println(s); - messageed = s.split(" "); - try{ - // creer un objet d'envoie qui connait la correspondance ivyid et webid pour chaque drone - new Ivy2UdpWriting(messageed, link.getStorage()); - } - catch(IvyException e1){ System.out.println("erreur sending msg to ivy : " + s);} - } - catch(IOException ex){System.out.print("cipher error : cannot decrypt msg : msg not sended to ivy");ex.printStackTrace();} - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(data_with_no_padding)))); - System.out.print("cannot decrypt msg : msg not sended to server"); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(data_with_no_padding)))); - System.out.print("cannot decrypt msg : msg not sended to server"); - } - } - catch(IOException e){ System.out.println("erreur socket when receive message");} - } - } - catch(SocketException e){ System.out.println("erreur creation de socket server-->ivy ");} - // - } catch (IvyConnectionExeption e) { - System.out.println(e.toString()); - e.printStackTrace(); - System.exit(0); } - } - } - /* - * Inner class which manage to find the index of a plane according to its ivyid - * if the drone is unknown , an identifiant is requested to the server and its conf files are uploaded - */ - class aircraftIdSeeker { - private String droneId; - private int res; - - public aircraftIdSeeker(String s){ - - droneId = s; - res = -1; - } - - public int getAcId() {return res;} - - public void seek(){ - AcStatus droneState = dronesStatus.get(droneId); - int i = 0; - if (droneState==AcStatus.ALIVE){ - while (i < maxAircrafts && !droneId.equals(datagramMatrix[i][0])) { - i++; - } - if (i < aircraftNumber) { - res = (i); - } - else { - // gtrosse erreur - System.out.println("ERROR , ALIVE BUT NOT IN MATRIX !!!"); - } - } - else if (droneState==AcStatus.UNKNOWN) - { - acNetIds.seekAcNetId(droneId); - } - else if (droneState==AcStatus.CONF_OK) { - acNetId ac = acNetIds.getAcNetId(droneId); - datagramMatrix[aircraftNumber][0] = ac.getIdOnIvy(); // id on IvyBus - datagramMatrix[aircraftNumber][1] = ac.getIdOnWeb(); // id on Web Client - datagramMatrix[aircraftNumber][2] = ac.getName(); // name - datagramMatrix[aircraftNumber][16] = ac.getColor(); - dronesStatus.replace(droneId,AcStatus.ALIVE); - // - if (datagramMatrix[aircraftNumber][0].equals(" ")) { - res= (-1); - } else { - aircraftNumber++; - String newPlane = new String("New_Plane"); - String name[] = new String[1]; - name[0] = ac.getName(); - send(aircraftNumber - 1, newPlane,name); - //int acWebId = Integer.parseInt(ac.getIdOnWeb()); - //send(acWebId, newPlane); - res= (aircraftNumber - 1); - } - } - else { - // do thing - } - } - } //fin class acId - -} // fin class ivy2udpreading - - - - - - - diff --git a/sw/in_progress/pow/pow/src/pow/Ivy2UdpReading2.java b/sw/in_progress/pow/pow/src/pow/Ivy2UdpReading2.java deleted file mode 100644 index 4944ee6c23..0000000000 --- a/sw/in_progress/pow/pow/src/pow/Ivy2UdpReading2.java +++ /dev/null @@ -1,915 +0,0 @@ -package pow; - -import java.io.*; -import java.net.*; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -//import java.util.Vector; - -import fr.dgac.ivy.*; -import java.lang.*; - - -import org.apache.commons.codec.binary.Hex; -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpException; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.UsernamePasswordCredentials; -import org.apache.commons.httpclient.auth.AuthScope; -import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.commons.httpclient.methods.PostMethod; -import org.apache.commons.httpclient.methods.multipart.FilePart; -import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity; -import org.apache.commons.httpclient.methods.multipart.Part; -import org.apache.commons.httpclient.methods.multipart.StringPart; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.httpclient.params.HttpMethodParams; -import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler; - -import java.util.concurrent.Semaphore; - -import java.io.StringReader; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; - -/** - * This aims to send Udp datagram containing information on the active drones - * to the web serveur - * @author jabln, thomas genin - * @version 2.0 - */ -class Ivy2UdpReading2 { - - static InetAddress serveur; - final static int portUdpSend = 8535; - final static int portUdpReceive = 8536; - private Ivy bus,tempsbus; - final static int taille = 1024; - static int maxAircrafts = 1000; // TODO a changer !!! mettre une map ou qqch - static int datagramLength = 17; // modif , on a rajoute la couleur a la fin - private String datagramMatrix[][] = new String[maxAircrafts][datagramLength];// TODO a changer !!! mettre une map ou qqch - private int aircraftNumber = 0; - private Boolean aircraftAlive[] = new Boolean[maxAircrafts];// TODO a changer !!! mettre une map ou qqch - private int count[] = new int[maxAircrafts];// TODO a changer !!! mettre une map ou qqch - private int countSettings[]=new int[maxAircrafts];// TODO a changer !!! mettre une map ou qqch - private HashMap> settingsToBeChanged = new HashMap>(); - private int webId=-999; - private byte[] aesKey ; - private AES aesCipher; - private String url; - private acNetIdStorage acNetIds; - private ConcurrentHashMap dronesStatus; - /* *********************** */ - private static long time2resetWptFilter = 20*60*1000; // on nettoie les filtres tous les 20min !!!!! - private MsgFilter waypointMsgFilter; - private long chrono_start; - private long elapsed_time; - private long chrono_start2; - private long timeToSendValues=60*1000; // on envoie les values d'un drone toutes les 60 secondes - private HashMap lastvaluesMap; - - /* *********** structure de correspondance entre webid et ivyid pour chaque drone ************ */ - public void setStorage(){ - acNetIds = new acNetIdStorage(webId,bus,url,maxAircrafts,dronesStatus); - } - - public acNetIdStorage getStorage(){ - return acNetIds ; - } - /* ************************* */ - public Ivy2UdpReading2(String hostname) - { - try{ - serveur = InetAddress.getByName(hostname); - // ********************************************* // - url = "http://"+hostname+":8080/TestServletPow/Ivy2TomcatHttpServer.srv"; - // ********************************************* // - dronesStatus = new ConcurrentHashMap(); - lastvaluesMap = new HashMap(); - // ********************************************* // - waypointMsgFilter = new MsgFilter(); - chrono_start = System.currentTimeMillis(); - chrono_start2 = System.currentTimeMillis(); - // ********************************************* // - bus = new Ivy("Ivy2Udp", "Ivy2Udp Ready", null); - } catch (Exception ie) { - System.out.println("Error : cannot connect to server"); - } - } - - public int getIvyWebId(){ - return webId; - } - /** - * methode qui interroge le serveur web tomcat pour lui demander un identifiant unique - * methode get - * @SEE http://hc.apache.org/httpclient-3.x/tutorial.html - */ - public void getWebId(String login , String pwd) throws IvyConnectionExeption - { - int statusCode=-1; - HttpClient client = new HttpClient(); - client.getParams().setParameter("http.useragent", "Ivy request"); - PostMethod method = new PostMethod(url); - /* - NameValuePair[] data = { - new NameValuePair("requestWebId", "xxx"), - new NameValuePair("password", "bloggs") - }; - method.setRequestBody(data); - */ - - // static InetAddress InetAddress.getByAddress(byte[] addr) ; - - method.addParameter("order", "requestWebId"); - method.addParameter("login", login); - method.addParameter("pwd", pwd); - try { - System.out.println("### envoie de la requete requestWebId###"); - statusCode = client.executeMethod(method); - if (statusCode != HttpStatus.SC_OK) { - System.err.println("Method failed: " + method.getStatusLine()); - //System.exit(0);// on clot l'appli - throw new IvyConnectionExeption("Erreur de retour de la requete de connection"); - } - else - { - // Read the response body. - try { - String responseBody = method.getResponseBodyAsString();//getResponseBody();//); - // Deal with the response - try { - // parse response in XML tree - // @SEE http://java.developpez.com/faq/xml/?page=dom - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document document = parser.parse(new InputSource(new StringReader(responseBody))); - // get login acknowledgment - Element ack_node = (Element)document.getElementsByTagName("ConnectionAck").item(0); - int ack = Integer.parseInt(ack_node.getTextContent()); - if (ack==1){ - // get webid node - Element webid_node = (Element)document.getElementsByTagName("webid").item(0); - webId = Integer.parseInt(webid_node.getTextContent()); - if (webId==-999) {throw new IvyConnectionExeption("unable to have correct webId");} - // get key node - Element aeskey_node= (Element)document.getElementsByTagName("aeskey").item(0); - String str_hex_aeskey = aeskey_node.getTextContent(); - // get match key node - Element aesiv_node= (Element)document.getElementsByTagName("aesiv").item(0); - String str_hex_aesIvParameter = aesiv_node.getTextContent(); - // - aesKey = Hex.decodeHex(str_hex_aeskey.toCharArray()); - byte[] iv = Hex.decodeHex(str_hex_aesIvParameter.toCharArray()); - aesCipher = new AES(aesKey,iv); - // - System.out.println("##########################"); - System.out.println("### connection ok+\t###"); - System.out.println("### web id = "+ webId +"\t###"); - System.out.println("### aes key = "+ str_hex_aeskey +"\t###"); - System.out.println("##########################"); - - } - else if (ack==2){ - throw new IvyConnectionExeption("login ok, but aes encryption not supported by server"); - } - else - { - throw new IvyConnectionExeption("login process failed, you're not allowed to access the server"); - } - - } - catch(Exception e) { - e.printStackTrace(); - throw new IvyConnectionExeption("unable to read the server response"); - } - } - catch (IOException e) { - System.err.println("IOException : echec execution requete post : request webId"); - e.printStackTrace(); - throw new IvyConnectionExeption("No response from the server"); - } - } - } catch (HttpException e) { - e.printStackTrace(); - throw new IvyConnectionExeption("HttpException : echec execution requete post : request webId"); - } catch (IOException e) { - e.printStackTrace(); - throw new IvyConnectionExeption("IOException : echec execution requete post : request webId"); - } finally { - method.releaseConnection(); // Release the connection. - - } - - /* HttpClient client = new HttpClient(); - //client.getState().setCredentials( - // new AuthScope("ivybus", 443, "realm"), - // new UsernamePasswordCredentials("username", "password") - // ); - GetMethod method = new GetMethod(url); - // method.setDoAuthentication( true ); - // Provide custom retry handler is necessary - method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, - new DefaultHttpMethodRetryHandler(3, false)); - */ - } - - - - - - - /** - * This method binds the object to some messages - * of the bus Ivy. Each information that is needed by the web server is put in an - * array. This array is sent to server. - */ - - public void bindMsg2Ivy() throws IvyException { - for (int i = 0; i < countSettings.length; i++) { - countSettings[i] = 0; - } - - for (int i = 0; i < count.length; i++) { - count[i] = 0; - } - for (int i = 0; i < datagramMatrix.length; i++) { - for (int j = 0; j < datagramMatrix[i].length - 1; j++) { - datagramMatrix[i][j] = new String(" "); - } - } - for (int i = 0; i < aircraftAlive.length; i++) { - aircraftAlive[i] = true; - } - // bus = new Ivy("Ivy2Udp", "Ivy2Udp Ready", null); - - bus.bindMsg("ground FLIGHT_PARAM ([^ ]*) [^ ]* [^ ]* [^ ]* ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) .*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - - try { - //int acId = acId(args[0]); - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - //AcStatus droneState = dronesStatus.get(args[0]); - aircraftIdSeeker a ; - //System.out.println("status drones "+args[0] + ": " + droneState); - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][3] = args[1]; - datagramMatrix[acIndex][4] = args[2]; - datagramMatrix[acIndex][5] = args[3]; - datagramMatrix[acIndex][6] = args[4]; - datagramMatrix[acIndex][7] = args[5]; - datagramMatrix[acIndex][8] = args[6]; - datagramMatrix[acIndex][9] = args[7]; - send(acIndex); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process FLIGHT_PARAM information"); - } - - } - }); - - bus.bindMsg("ground ENGINE_STATUS ([^ ]*) [^ ]* [^ ]* [^ ]* [^ ]* ([^ ]*).*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - - try { - - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][10] = args[1]; - send(acIndex); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process ENGINE_STATUS information"); - } - - } - }); - - bus.bindMsg("ground ENGINE_STATUS ([^ ]*) ([^ ]*) .*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - - try { - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][12] = args[1]; - send(acIndex); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process AP_STATUS information"); - } - - } - }); - - - bus.bindMsg("ground AP_STATUS ([^ ]*) [^ ]* [^ ]* [^ ]* [^ ]* ([^ ]*) .*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - - try { - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][11] = args[1]; - send(acIndex); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process AP_STATUS information"); - } - - } - }); - - bus.bindMsg("ground NAV_STATUS ([^ ]*) ([^ ]*).*", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - - try { - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - datagramMatrix[acIndex][13] = args[1]; - // - String j2b[] = new String[1]; - j2b[0] = args[1]; - String s = new String("NAV_STATUS"); - //send(acIndex); - send(acIndex,s,j2b); - // - //send(acIndex); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch (Exception ie) { - System.out.println("Can't process NAV_STATUS information"); - } - - } - }); - - - bus.bindMsg("ground DL_VALUES ([^ ]*) ([^ ]*)", new IvyMessageListener(){ - - public void receive(IvyClient client, String[] args){ - try{ - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE){ - a = new aircraftIdSeeker(args[0]); - a.seek(); - int acIndex = a.getAcId(); - if (acIndex != -1) { - String[] settingSplited = args[1].split(","); - String settingId = new String (""); - settingId = settingId + countSettings[acIndex]; - datagramMatrix[acIndex][14] = settingId; - datagramMatrix[acIndex][15] = settingSplited[countSettings[acIndex]]; - send(acIndex); - countSettings[acIndex] = (countSettings[acIndex] + 1) % settingSplited.length; - // gestion de l'A/R de DL_SETTING - // on attend que la valeur du setting soit effectivement change pour envoyer l'A/R - if (settingsToBeChanged.containsKey(acIndex)){ - HashMap h = settingsToBeChanged.get(acIndex); - Set k = h.keySet(); - Iterator itr = k.iterator(); - - while(itr.hasNext()){ - int current_settingid = itr.next(); - float value = h.get(current_settingid); - //System.out.println(""+current_settingid+" "+ value +"=?" +settingSplited[current_settingid]); - if(value==Float.parseFloat(settingSplited[current_settingid])){ - h.remove(current_settingid); - String chgSet[] = new String[2]; - chgSet[0] = ""+current_settingid; - chgSet[1] = ""+value; - String s = new String("DL_SETTING_ACK"); - send(acIndex,s,chgSet); - System.out.print("%"); - } - } - } - // gestion de l'envoie de l'ensemble des valeurs de - // setting pour un drone , on envoie la trame par periode timeToSendValues - Long lasttime = lastvaluesMap.get(acIndex); - long nowtime = System.currentTimeMillis(); - boolean firsttime = false; - if (lasttime==null){ - lasttime = nowtime; - lastvaluesMap.put(acIndex,nowtime); - firsttime = true ; - } - - if (firsttime||((nowtime-lasttime)>timeToSendValues)){ - // on envoie la value - String csv[] = new String[1]; - csv[0] = args[1]; - String s = new String("SETTINGS_VALUES"); - send(acIndex,s,csv); - System.out.print("+"); - lastvaluesMap.put(acIndex,nowtime); - } - - - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - } catch(Exception ie) { - System.out.println("Can't process DL_VALUES information"); - System.out.println("acid= "+args[0]); - System.out.println("csv= "+args[1]); - System.out.println("********************\n"+ie.toString()+"\n********************"); - } - } - - - - }); - - - - // bus.bindMsg("MOVE_WAYPOINT ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*)",new IvyMessageListener(){ - - // on surveille les messages WAYPOINT_MOVED pour traquer l'A/R d'un ordre venant d'un client web - // qui consisterait a deplacer un waypoint - bus.bindMsg("ground WAYPOINT_MOVED ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*)",new IvyMessageListener(){ - public void receive(IvyClient client, String[] args){ - try { - //int i = acId(args[0]); - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - int i = a.getAcId(); - String mvWp[] = new String[4]; - for (int j = 0;j<4;j++){ - mvWp[j] = args[j+1]; - } - String s = new String("WAYPOINT_MOVED"); - send(i,s,mvWp); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - catch (Exception ie){ - System.out.println("Can't process MOVE_WAYPOINT information"); - } - } - }); - // on traque ce message pour assurer l'A/R d'un ordre venant d'un client web qui viserait - // a modifier un parametre d'un drone - bus.bindMsg("DL_SETTING ([^ ]*) ([^ ]*) ([^ ]*)", new IvyMessageListener(){ - - public void receive(IvyClient client, String[] args){ - try{ - //int i = acId(args[0]); - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - int indexAircraft = a.getAcId(); - int indexSetting = Integer.parseInt(args[1]); - float valueSetting = Float.parseFloat(args[2]); - // memorisation qu'une requete DL_SETTING a ete faire - // voir traitement dans ground DL_VALUES - if (!settingsToBeChanged.containsKey(indexAircraft)){ - settingsToBeChanged.put(indexAircraft, new HashMap()); - } - settingsToBeChanged.get(indexAircraft).put(indexSetting, valueSetting); - System.out.print("$"); - } - else // autres etats UNKNOWN,ASKING_IVY_CONF,ASKING_WEB_ID, - { - //do nothing // skip message - } - } - catch (Exception ie){ - System.out.println("Can't process DL_SETTING information"); - } - } - }); - - bus.bindMsg("ground TELEMETRY_STATUS ([^ ]*) ([^ ]*)", new IvyMessageListener() { - - public void receive(IvyClient client, String[] args) { - - try { - //int i = acId(args[0]); - AcStatus droneState=dronesStatus.putIfAbsent(args[0],AcStatus.UNKNOWN); - aircraftIdSeeker a ; - if ((droneState==AcStatus.UNKNOWN)||(droneState==AcStatus.CONF_OK)) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - } - else if (droneState==AcStatus.ALIVE) - { - a = new aircraftIdSeeker(args[0]); - a.seek(); - int i = a.getAcId(); - if (i != -1) { - float f = Float.parseFloat(args[1]); - if (aircraftAlive[i] && f > 30) { - aircraftAlive[i] = false; - String s = new String("Plane_Die"); - send(i, s); - } else { - if (!aircraftAlive[i] && f < 30) { - aircraftAlive[i] = true; - String s = new String("Plane_Resurect"); - send(i, s); - } - } - } - } - } catch (Exception ie) { - - System.out.println("Can't process TELEMETRY_STATUS information"); - } - - } - }); - - bus.start(null); - } - - /** - * This method send to the web server the datagram containing the informations - * about the aircraft - * @param acId Line of the matrix containing the informations about the plane - * @throws java.lang.Exception - */ - public void send(int acId){// throws Exception { - String s = ""; - if (count[acId] == 5) { - // try { - if (aircraftAlive[acId]) { - byte buffer[];// = new byte[taille]; - s = ""; - for (int i = 1; i < 7; i++) { - s = s + datagramMatrix[acId][i] + " "; - } - for(int i = 7; i< 10;i++){ - //StringBuffer str = new StringBuffer(4); - StringBuffer str = new StringBuffer(datagramMatrix[acId][i]); - str.setLength(5); - s = s + str + " "; - } - for(int i = 10; itaille){System.out.println("Alerte taille trame udp:"+buffer.length+" !!!!");} - DatagramPacket dataUdp = new DatagramPacket(buffer, buffer.length, serveur, portUdpSend); - try{ - DatagramSocket socketUdp = new DatagramSocket(); - try{ - socketUdp.send(dataUdp); - System.out.print("#"); - count[acId] = 0; - } - catch(IOException ex){System.out.print("datagram creation error : msg not sended");} - } - catch (SocketException ex){System.out.print("socket error : msg not sended");} - - } - catch( IOException ex){System.out.print("cipher error : cannot encrypt msg : msg not sended to server");ex.printStackTrace();} - } - //} - //catch (IOException ioex){ System.out.println("socket send exception, Can't send message " + s);} - //catch (Exception ie) { - // System.out.println("Can't send message on the web"); - //} - } else { - count[acId]++; - } - } - - - /** - * This method send to the web server a specific order with parameters - * @param acId : Line of the matrix containing the informations about the plane - * @param s : order - * @param as : parameters - */ - - public void send(int acId, String s, String[] as){ - String order = s; - s = s + " " + datagramMatrix[acId][1]+ " "; - for (int i =0; i< as.length;i++){ - s = s + as[i] + " "; - } - byte buffer[];//= new byte[taille]; - //System.out.println(s); - // gestion de l'ecoute ou non des msg waypoint_moved et des autres msg speciaux - - boolean isnew = true; - // on filtre certains messages - if (order.equals("WAYPOINT_MOVED") - ||order.equals("NAV_STATUS")) - { - //System.out.println("elapsed time : "+elapsed_time); - elapsed_time = System.currentTimeMillis() - chrono_start; - if (elapsed_time>time2resetWptFilter) - { - waypointMsgFilter.resetfilter(); - chrono_start = System.currentTimeMillis(); - } - isnew = waypointMsgFilter.isNew(s); - } - if(isnew){ - System.out.print("!"); - buffer = s.getBytes(); - try{ - buffer = this.aesCipher.encrypt(buffer); - if (buffer.length>taille){System.out.println("Alerte taille trame udp:"+buffer.length+" !!!!");} - DatagramPacket dataUdp = new DatagramPacket(buffer, buffer.length, serveur, portUdpSend); - try{ - DatagramSocket socketUdp = new DatagramSocket(); - try{ - socketUdp.send(dataUdp); - } - catch(IOException ex){System.out.print("datagram creation error : msg not sended");} - } - catch (SocketException ex){System.out.print("socket error : msg not sended");} - - } - catch (IOException ex){System.out.print("cipher error : cannot encrypt msg : msg not sended to server");ex.printStackTrace();} - } - } - - - - /** - * This method send a particular message about an aircraft - * @param acId line of the matrix containing the informations about the plane - * @param s message that is to be sent to send - */ - public void send(int acId, String s) { - s = s + " " + datagramMatrix[acId][1]; - byte buffer[] ;//= new byte[taille]; - buffer = s.getBytes(); - System.out.println(s); - try{ - buffer = this.aesCipher.encrypt(buffer); - if (buffer.length>taille){System.out.println("Alerte taille trame udp:"+buffer.length+" !!!!");} - DatagramPacket dataUdp = new DatagramPacket(buffer, buffer.length, serveur, portUdpSend); - try{ - DatagramSocket socketUdp = new DatagramSocket(); - try{ - socketUdp.send(dataUdp); - } - catch(IOException ex){System.out.print("datagram creation error : msg not sended");} - } - catch (SocketException ex){System.out.print("socket error : msg not sended");} - - } - catch (IOException ex){System.out.print("cannot encrypt msg : msg not sended to server");ex.printStackTrace();} - } - - /* - * - */ - public static void main(String argv[]) throws IvyException { - // serveur = InetAddress.getByName(argv[0]); - if (argv.length<1){ - System.out.println("failure :1 params required : [server name or url]"); - } - else { - byte[] complete_data ; - int true_length_of_msg ; - int i; - byte[] data_with_no_padding; - String hostname = argv[0]; - Ivy2UdpReading2 link = new Ivy2UdpReading2(hostname ); - try { - // seek user login info - String login="admin_ivy"; - String password = "pwdadmin_ivy"; - link.getWebId(login, password); // login procedure - // - link.setStorage(); - link.bindMsg2Ivy(); - // on lance le reading - try - { - System.out.println("on lance udp writing "); - int portUdpReceive = 8536 ; - DatagramSocket socket = new DatagramSocket(portUdpReceive); - while (true) { - byte buffer[] = new byte[taille]; - DatagramPacket data = new DatagramPacket(buffer, buffer.length); - try{ - socket.receive(data); - System.out.print("data received from server web : "); - String[] messageed; - try{ - complete_data = data.getData(); - true_length_of_msg = data.getLength(); - data_with_no_padding = new byte[true_length_of_msg]; - for(i=0;i< true_length_of_msg;i++){ - data_with_no_padding[i]=complete_data[i]; - } - byte[] decrypted_data = link.aesCipher.decrypt(data_with_no_padding); - //String s = new String(data.getData());System.out.println(s); - String s = new String(decrypted_data);System.out.println(s); - messageed = s.split(" "); - try{ - // creer un objet d'envoie qui connait la correspondance ivyid et webid pour chaque drone - new Ivy2UdpWriting(messageed, link.getStorage()); - } - catch(IvyException e1){ System.out.println("erreur sending msg to ivy : " + s);} - } - catch(IOException ex){System.out.print("cipher error : cannot decrypt msg : msg not sended to ivy");ex.printStackTrace();} - } - catch(IOException e){ System.out.println("erreur socket when receive message");} - } - } - catch(SocketException e){ System.out.println("erreur creation de socket server-->ivy ");} - // - } catch (IvyConnectionExeption e) { - System.out.println(e.toString()); - e.printStackTrace(); - System.exit(0); } - } - } - /* - * Inner class which manage to find the index of a plane according to its ivyid - * if the drone is unknown , an identifiant is requested to the server and its conf files are uploaded - */ - class aircraftIdSeeker { - private String droneId; - private int res; - - public aircraftIdSeeker(String s){ - - droneId = s; - res = -1; - } - - public int getAcId() {return res;} - - public void seek(){ - AcStatus droneState = dronesStatus.get(droneId); - int i = 0; - if (droneState==AcStatus.ALIVE){ - while (i < maxAircrafts && !droneId.equals(datagramMatrix[i][0])) { - i++; - } - if (i < aircraftNumber) { - res = (i); - } - else { - // gtrosse erreur - System.out.println("ERROR , ALIVE BUT NOT IN MATRIX !!!"); - } - } - else if (droneState==AcStatus.UNKNOWN) - { - acNetIds.seekAcNetId(droneId); - } - else if (droneState==AcStatus.CONF_OK) { - acNetId ac = acNetIds.getAcNetId(droneId); - datagramMatrix[aircraftNumber][0] = ac.getIdOnIvy(); // id on IvyBus - datagramMatrix[aircraftNumber][1] = ac.getIdOnWeb(); // id on Web Client - datagramMatrix[aircraftNumber][2] = ac.getName(); // name - datagramMatrix[aircraftNumber][16] = ac.getColor(); - dronesStatus.replace(droneId,AcStatus.ALIVE); - // - if (datagramMatrix[aircraftNumber][0].equals(" ")) { - res= (-1); - } else { - aircraftNumber++; - String newPlane = new String("New_Plane"); - String name[] = new String[1]; - name[0] = ac.getName(); - send(aircraftNumber - 1, newPlane,name); - //int acWebId = Integer.parseInt(ac.getIdOnWeb()); - //send(acWebId, newPlane); - res= (aircraftNumber - 1); - } - } - else { - // do thing - } - } - } //fin class acId -} // fin class ivy2udpreading - - - - - - - diff --git a/sw/in_progress/pow/pow/src/pow/Ivy2UdpWriting.java b/sw/in_progress/pow/pow/src/pow/Ivy2UdpWriting.java deleted file mode 100644 index 9eff025809..0000000000 --- a/sw/in_progress/pow/pow/src/pow/Ivy2UdpWriting.java +++ /dev/null @@ -1,65 +0,0 @@ -package pow; - -import java.io.*; -import java.net.*; -import fr.dgac.ivy.*; - -/** - * This class aims to give order to the drones according to the datagrams it - * receive from the web - * @author jabln - */ -class Ivy2UdpWriting implements IvyMessageListener { - - //static InetAddress serveur; - // final static int port = 8535; - //final static int taille = 1024; - private Ivy bus; - private acNetIdStorage netIdStorage; - private String[] message; //Array which contains the informations are to be sent on the bus - private String IvyAcId; //Identity of the aircraft on the bus Ivy - - /** - * This constructor of the class binds to the bus Ivy and implements the - * method receive to send on the bus the informations given in parametres - * in an array of string - * @param message Informations that is to be sent on the bus Ivy - * @param storage the object which to do the link between webid and ivyid for each drone - * @throws java.lang.Exception - */ - Ivy2UdpWriting(String[] message, acNetIdStorage storage) throws IvyException { - this.message = message; - netIdStorage = storage; - int acwebid = Integer.parseInt(message[1]); - this.IvyAcId = netIdStorage.getAcIvyId(acwebid); - if ( this.IvyAcId != null) { - bus = new Ivy("Web Writing", "Web Writing ready", null); - bus.start(null); - bus.bindMsg("FLIGHT_PARA.*", this); - } - else - { - System.out.println("enable to make the link between webid on ivyidy"); - } - } - - /** - * This method implements the method receive of the bus Ivy class. It sends - * the informations on the bus and stop the bind - * @param client - * @param args - */ - public void receive(IvyClient client, String args[]) { - try { - String s = "WEB_MSG "; - s = s + message[0] + " " + IvyAcId + " "; - for (int i = 2; i < message.length; i++) { - s = s + message[i] + " "; - } - bus.sendMsg(s); - bus.stop(); - } catch (IvyException ie) { - System.out.println("can't send my message on the bus"); - } - } -} diff --git a/sw/in_progress/pow/pow/src/pow/IvyConnectionExeption.java b/sw/in_progress/pow/pow/src/pow/IvyConnectionExeption.java deleted file mode 100644 index 8fc3c3c7de..0000000000 --- a/sw/in_progress/pow/pow/src/pow/IvyConnectionExeption.java +++ /dev/null @@ -1,18 +0,0 @@ -package pow; - -public class IvyConnectionExeption extends Exception { - - /** - * - */ - private static final long serialVersionUID = 1805159521752564076L; - private String reason; - - public IvyConnectionExeption(String res){ - super(); - reason = res; - } - public String toString() { - return "IvyConnectionExeption : "+reason; - } -} diff --git a/sw/in_progress/pow/pow/src/pow/IvyIHM.java b/sw/in_progress/pow/pow/src/pow/IvyIHM.java deleted file mode 100644 index 9d3a61b1fb..0000000000 --- a/sw/in_progress/pow/pow/src/pow/IvyIHM.java +++ /dev/null @@ -1,299 +0,0 @@ -package pow; - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; - -public class IvyIHM { - private JFrame glob_fenetre; - private JLabel login_lbl; - private JTextField login_txtfield; - private JLabel pwd_lbl; - private JPasswordField pwd_txtfield; - private JLabel url_lbl; - private JTextField url_txtfield; - - private Container contenuMore; - private boolean moreIsVisible ; - private JLabel protocol_lbl; - private JComboBox protocol_field; - private JLabel port_lbl; - private JComboBox port_field; - private JLabel site_lbl; - private JTextField site_txtfield; - private JLabel servlet_lbl; - private JTextField servlet_txtfield; - private String[] protocolsStrings = { "http", "https" }; - private String[] portsStrings = { "none", "80","8080","443" }; - private JButton log_btn; - private JButton quit_btn; - private JButton more_btn; - private boolean logged ; - private static int taille_text = 20; - public IvyIHM(){ - logged = false; - glob_fenetre = new JFrame("Connection to POW Server"); - glob_fenetre.setLocation(100,200); - - Container contenuTextField ; - //ensemble des textfiled - JPanel listTextField= new JPanel(); - listTextField.setLayout(new BoxLayout(listTextField, BoxLayout.PAGE_AXIS)); - contenuTextField = new JPanel(new FlowLayout()); - login_lbl = new JLabel("login"); - login_txtfield= new JTextField("",taille_text); - contenuTextField.add(login_lbl); - contenuTextField.add(login_txtfield); - listTextField.add(contenuTextField); - // - contenuTextField = new JPanel(new FlowLayout()); - pwd_lbl = new JLabel("password"); - pwd_txtfield= new JPasswordField(taille_text); - contenuTextField.add(pwd_lbl); - contenuTextField.add(pwd_txtfield); - listTextField.add(contenuTextField); - // - contenuTextField = new JPanel(new FlowLayout()); - url_lbl = new JLabel("hostname"); - url_txtfield= new JTextField("",taille_text); - contenuTextField.add(url_lbl); - contenuTextField.add(url_txtfield); - listTextField.add(contenuTextField); - // - listTextField.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); - // les deux boutons - - log_btn = new JButton("Log !"); - quit_btn = new JButton("Quit !");; - Container contenuButton = new JPanel(new FlowLayout()); - contenuButton.add(quit_btn); - contenuButton.add(log_btn); - - log_btn.addActionListener(new LogAction()); - quit_btn.addActionListener(new QuitAction()); - // - glob_fenetre.setLayout(new BorderLayout()); - Container contenu = glob_fenetre.getContentPane(); - contenu.add(listTextField,BorderLayout.CENTER); - contenu.add(contenuButton,BorderLayout.SOUTH); - glob_fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - glob_fenetre.pack(); - glob_fenetre.setVisible(true); - } - - public IvyIHM(boolean t){ - logged = false; - glob_fenetre = new JFrame("Connection to POW Server"); - glob_fenetre.setLocation(100,200); - - Container contenuTextField ; - //ensemble des textfiled - JPanel listTextField= new JPanel(); - listTextField.setLayout(new BoxLayout(listTextField, BoxLayout.PAGE_AXIS)); - contenuTextField = new JPanel(new FlowLayout()); - login_lbl = new JLabel("login"); - login_txtfield= new JTextField("admin_ivy",taille_text); - contenuTextField.add(login_lbl); - contenuTextField.add(login_txtfield); - listTextField.add(contenuTextField); - // - contenuTextField = new JPanel(new FlowLayout()); - pwd_lbl = new JLabel("password"); - pwd_txtfield= new JPasswordField("pwdadmin_ivy",taille_text); - contenuTextField.add(pwd_lbl); - contenuTextField.add(pwd_txtfield); - listTextField.add(contenuTextField); - // - contenuTextField = new JPanel(new FlowLayout()); - url_lbl = new JLabel("hostname"); - url_txtfield= new JTextField("blanc",taille_text); - contenuTextField.add(url_lbl); - contenuTextField.add(url_txtfield); - listTextField.add(contenuTextField); - // - listTextField.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); - // les trois boutons - more_btn = new JButton("More..."); - log_btn = new JButton("Log !"); - quit_btn = new JButton("Quit !");; - Container contenuButton = new JPanel(new FlowLayout()); - contenuButton.add(quit_btn); - contenuButton.add(log_btn); - contenuButton.add(more_btn); - more_btn.addActionListener(new MoreAction(glob_fenetre)); - log_btn.addActionListener(new LogAction()); - quit_btn.addActionListener(new QuitAction()); - //le panneau more.... - contenuMore = new JPanel(); - contenuMore.setLayout(new BoxLayout(contenuMore, BoxLayout.PAGE_AXIS)); - - Container contenuMoreMore = new JPanel(new FlowLayout()); - - protocol_field = new JComboBox(protocolsStrings); - protocol_lbl = new JLabel("protocol"); - contenuMoreMore.add(protocol_lbl); - contenuMoreMore.add(protocol_field); - //contenuMore.add(contenuMoreMore); - - //contenuMoreMore = new JPanel(new FlowLayout()); - port_lbl = new JLabel("port"); - port_field = new JComboBox(portsStrings);; - contenuMoreMore.add(port_lbl); - contenuMoreMore.add(port_field); - contenuMore.add(contenuMoreMore); - - contenuMoreMore = new JPanel(new FlowLayout()); - site_lbl= new JLabel("site name"); - site_txtfield= new JTextField("TestServletPow",taille_text); - contenuMoreMore.add(site_lbl); - contenuMoreMore.add(site_txtfield); - contenuMore.add(contenuMoreMore); - - contenuMoreMore = new JPanel(new FlowLayout()); - servlet_lbl= new JLabel("servlet name"); - servlet_txtfield= new JTextField("Ivy2TomcatHttpServer.srv",taille_text); - contenuMoreMore.add(servlet_lbl); - contenuMoreMore.add(servlet_txtfield); - contenuMore.add(contenuMoreMore); - moreIsVisible = false; - contenuMore.setVisible(moreIsVisible); - // - glob_fenetre.setLayout(new BorderLayout()); - Container contenu = glob_fenetre.getContentPane(); - contenu.add(listTextField,BorderLayout.NORTH); - contenu.add(contenuMore,BorderLayout.CENTER); - contenu.add(contenuButton,BorderLayout.SOUTH); - glob_fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - glob_fenetre.pack(); - glob_fenetre.setVisible(true); - } - - public static void main(String[] args) - { - SwingUtilities.invokeLater(new Runnable() { - public void run() { - new IvyIHM(true); - } - }); - } - - class QuitAction implements ActionListener { - public void actionPerformed(ActionEvent e){ - Runnable code = new Runnable() { - public void run() { - - System.exit(0); - - } - }; - if (SwingUtilities.isEventDispatchThread()) { - code.run(); - } else { - SwingUtilities.invokeLater(code); - } - - } - } - - - class LogAction implements ActionListener { - public void actionPerformed(ActionEvent e){ - if(!logged){ - Runnable code = new Runnable() { - public void run() { - Ivy2UdpReading module; - String login = login_txtfield.getText(); - String host = url_txtfield.getText(); - char[] pwd_array = pwd_txtfield.getPassword(); - String pwd = new String(pwd_array); - if (moreIsVisible){ - String siteName = site_txtfield.getText(); - String servletName = servlet_txtfield.getText(); - String strports ; - strports = portsStrings[port_field.getSelectedIndex()]; - int port=-1; - if (!strports.equals("none")){ - port = Integer.parseInt(strports); - } - String strProto = protocolsStrings[ protocol_field.getSelectedIndex()]; - System.out.println("port : "+port+"\tproto :"+ strProto); - PowUrl info = new PowUrl(strProto,host,port,siteName,servletName); - JOptionPane.showMessageDialog(glob_fenetre, - "you will be connected to "+ info.getWebUrl(), - "logging info", - JOptionPane.INFORMATION_MESSAGE); - module = new Ivy2UdpReading(info,login,pwd); - } - else{ - module = new Ivy2UdpReading(host,login,pwd); - } - - try { - module.getWebId(); - new Thread(module).start(); - } catch (IvyConnectionExeption e) { - // echec du log - //custom title, error icon - System.out.println("erreur de connection : "+e.toString()); - JOptionPane.showMessageDialog(glob_fenetre, - "Your password or your login are not correct, retry please...\n"+ - "Be sure a valid SSL certificat exist in your $JAVA_HOME/jre/lib/security folder,\n"+ - "otherwise use InstallCert [hostname] java programm", - "logging error", - JOptionPane.ERROR_MESSAGE); - - - } - - - // clearing - for(int i = 0; i< pwd_array.length;i++){ - pwd_array[i]='0'; - } - } - }; - if (SwingUtilities.isEventDispatchThread()) { - code.run(); - } else { - SwingUtilities.invokeLater(code); - } - } - else{ - JOptionPane.showMessageDialog(glob_fenetre, - "you are already logged and send information to server", - "Info",JOptionPane.WARNING_MESSAGE); - } - } - - } - - - class MoreAction implements ActionListener { - JFrame globalFrame; - - MoreAction(JFrame g){ - globalFrame = g; - } - public void actionPerformed(ActionEvent e){ - Runnable code = new Runnable() { - public void run() { - if(moreIsVisible){ - contenuMore.setVisible(false);moreIsVisible=false;more_btn.setText("More...");} - else { - contenuMore.setVisible(true);moreIsVisible=true;more_btn.setText("Less..."); - } - globalFrame.pack(); - - } - }; - if (SwingUtilities.isEventDispatchThread()) { - code.run(); - } else { - SwingUtilities.invokeLater(code); - } - - } - } - -} - diff --git a/sw/in_progress/pow/pow/src/pow/IvyMsg.java b/sw/in_progress/pow/pow/src/pow/IvyMsg.java deleted file mode 100644 index c10e823fc4..0000000000 --- a/sw/in_progress/pow/pow/src/pow/IvyMsg.java +++ /dev/null @@ -1,39 +0,0 @@ -package pow; - - -public class IvyMsg { - - private int webId; - private long num_msg; - private String timeMsg;//"d:M:y:HH:mm:ss" add 2000 to d - private String ivyMsg; - private dbOrder order; - - public IvyMsg(int wId,long num,String date,String msg,dbOrder order){ - webId = wId; - num_msg = num; - timeMsg = date; - ivyMsg = msg; - this.order = order; - } - - public IvyMsg(int wId,long num,String date,String msg){ - webId = wId; - num_msg = num; - timeMsg = date; - ivyMsg = msg; - this.order = null; - } - - public int getWebId(){return webId;} - public long getNumMsg() {return num_msg;} - public String getTimeMsg() {return timeMsg;} - public String getIvyMsg() {return ivyMsg;} - public dbOrder getOrder() {return order;} - public void setOrder(dbOrder o ) { order=o;} - - public String getSQLQUERY(){ - return ""; - } - -} diff --git a/sw/in_progress/pow/pow/src/pow/Md5.java b/sw/in_progress/pow/pow/src/pow/Md5.java deleted file mode 100644 index b5619f4c1e..0000000000 --- a/sw/in_progress/pow/pow/src/pow/Md5.java +++ /dev/null @@ -1,83 +0,0 @@ -package pow; -import java.io.UnsupportedEncodingException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -/** - * tool class to implemente MD5 encoding - * ( found on the web ) - * - */ -public class Md5 -{ - public static String encode(String password) - { - byte[] uniqueKey = password.getBytes(); - byte[] hash = null; - - try - { - hash = MessageDigest.getInstance("MD5").digest(uniqueKey); - } - catch (NoSuchAlgorithmException e) - { - throw new Error("No MD5 support in this VM."); - } - - StringBuilder hashString = new StringBuilder(); - for (int i = 0; i < hash.length; i++) - { - String hex = Integer.toHexString(hash[i]); - if (hex.length() == 1) - { - hashString.append('0'); - hashString.append(hex.charAt(hex.length() - 1)); - } - else - hashString.append(hex.substring(hex.length() - 2)); - } - return hashString.toString(); - } -/* - public static String hash(String plaintext) { - MessageDigest md = null; - - try { - md = MessageDigest.getInstance("SHA-1"); // SHA-1 generator instance - } catch(NoSuchAlgorithmException e) { - return ""; - } - - try { - //8859_1 ou UTF-8 - md.update(plaintext.getBytes("UTF-8")); // Message summary generation - } catch(UnsupportedEncodingException e) { - return ""; - } - - byte raw[] = md.digest(); // Message summary reception - - try{ - String hash = new String(org.apache.commons.codec.binary.Base64.encodeBase64(raw),"UTF-8"); - //String hash = new String(raw); - return hash; - } - catch (UnsupportedEncodingException use){ - return ""; - } - } - - */ - public static void main(String[] args) - { - if (args.length != 1) - { - System.out.println("Usage: java Md5 "); - return; - } - - String toEncode = args[0]; - - System.out.println("Original string ... " + toEncode); - System.out.println("String MD5 ........ " + encode(toEncode)); - } -} \ No newline at end of file diff --git a/sw/in_progress/pow/pow/src/pow/MsgFilter.java b/sw/in_progress/pow/pow/src/pow/MsgFilter.java deleted file mode 100644 index 55109da2a4..0000000000 --- a/sw/in_progress/pow/pow/src/pow/MsgFilter.java +++ /dev/null @@ -1,33 +0,0 @@ -package pow; -import java.util.HashSet; - -/** - * classe permettant de filtrer les messages waypoints inutile - * @author genin - * - */ -public class MsgFilter { - - - private HashSet msgset; - - public MsgFilter(){ - msgset = new HashSet(); - } - /** - * informe si le message est deja contenu dans le filtre - * et l'ajoute le cas echeant - * @param msg - * @return - */ - public boolean isNew(String msg){ - boolean res = msgset.add(msg); - return res; - } - /** - * vide le filtre - */ - public void resetfilter(){ - msgset.clear(); - } -} diff --git a/sw/in_progress/pow/pow/src/pow/PowUrl.java b/sw/in_progress/pow/pow/src/pow/PowUrl.java deleted file mode 100644 index 4044ecafd9..0000000000 --- a/sw/in_progress/pow/pow/src/pow/PowUrl.java +++ /dev/null @@ -1,24 +0,0 @@ -package pow; - -public class PowUrl { - private String protocole="http"; - private int port =-1; - private String serverName; - private String webAppName; - private String servletLoginName; - - public PowUrl(String protocol,String server,int port,String webapp,String servletName){ - if (protocol.equals("https")) this.protocole="https"; - this.port = port; - this.serverName =server; - this.webAppName = webapp; - this.servletLoginName = servletName; - } - - public String getServerName() {return serverName;} - public String getWebUrl() { - if (port==-1) return ""+protocole+"://"+serverName+"/"+webAppName+"/"+servletLoginName; - else - return ""+protocole+"://"+serverName+":"+port+"/"+webAppName+"/"+servletLoginName; - } -} diff --git a/sw/in_progress/pow/pow/src/pow/Rights.java b/sw/in_progress/pow/pow/src/pow/Rights.java deleted file mode 100644 index 1e418b45ab..0000000000 --- a/sw/in_progress/pow/pow/src/pow/Rights.java +++ /dev/null @@ -1,12 +0,0 @@ -package pow; -/** - * describe the different rights a web user can have - * @author genin - * - */ -public enum Rights { - VISITOR, // can only see the drones - ADMIN, // can pilot all the drones and manage user's account and create others administrators - USER, - IVY // specify an ivy user which send data to the server via UDP -} diff --git a/sw/in_progress/pow/pow/src/pow/SGBDfeeder.java b/sw/in_progress/pow/pow/src/pow/SGBDfeeder.java deleted file mode 100644 index 8701c0d600..0000000000 --- a/sw/in_progress/pow/pow/src/pow/SGBDfeeder.java +++ /dev/null @@ -1,81 +0,0 @@ -package pow; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Queue; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.LinkedBlockingQueue; - -//CREATE TABLE connexion(id INTEGER NOT NULL AUTO_INCREMENT,webId INTEGER,login VARCHAR(50),start DATE NOT NULL,end DATE DEFAULT NULL,PRIMARY KEY(id)); - - -public class SGBDfeeder implements Runnable { - - private String dbName; - private String dbLogin; - private String dbPwd; - private Queue fifo; - - public SGBDfeeder(String dbname,String dbuser,String dbpwd){ - fifo = new ConcurrentLinkedQueue(); - //fifo = new LinkedBlockingQueue(); - dbName=dbname; - dbLogin=dbuser; - dbPwd=dbpwd; - } - - public Queue getQueueFIFO(){ - return fifo; - } - - - public void run() { - Connection connection = null; - Statement stmt = null; - ResultSet rs = null; - - String url = "jdbc:mysql://localhost/"+dbName; - //String login = "root"; - //String password = "pwdroot"; - // connect to SGBD - try { - //Connection to the Data Base - Class.forName("com.mysql.jdbc.Driver").newInstance(); - connection = DriverManager.getConnection(url,dbLogin,dbPwd); - // receiving msg - while(true){ - // get msg - - // store it in db - try{ - //connection = DriverManager.getConnection(url,login,password); - stmt = connection.createStatement(); - int res = stmt.executeUpdate("CREATE DATABASE pow_sql"); - res = stmt.executeUpdate("CREATE TABLE connexion (" + - "web_id INTEGER," + - "login VARCHAR(50), " + - "start DATE NOT NULL, " + - "end DATE DEFAULT NULL)"); - } catch (SQLException ex) { - System.out.println("SQLException: " + ex.getMessage()); - System.out.println("SQLState: " + ex.getSQLState()); - System.out.println("VendorError: " + ex.getErrorCode()); - } - } - } - catch (SQLException ex) {System.out.println("unable to connect to db");} - catch (ClassNotFoundException ex) {} - catch (IllegalAccessException ex){} - catch ( InstantiationException ex){} - finally - { - if(connection!=null){try{connection.close();}catch(Exception e){e.printStackTrace();}} - //etc. - } - } - - -} diff --git a/sw/in_progress/pow/pow/src/pow/SSLUtilities.java b/sw/in_progress/pow/pow/src/pow/SSLUtilities.java deleted file mode 100644 index 2d661f232b..0000000000 --- a/sw/in_progress/pow/pow/src/pow/SSLUtilities.java +++ /dev/null @@ -1,322 +0,0 @@ -package pow; - -import java.security.GeneralSecurityException; -import java.security.SecureRandom; -import java.security.cert.X509Certificate; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; - -/** - * This class provide various static methods that relax X509 certificate and - * hostname verification while using the SSL over the HTTP protocol. - * call: - * SSLUtilities.trustAllHostnames() to turn off the default hostname verification on HTTPS connection; - * SSLUtilities.trustAllHttpsCertificates() to turn off the default certificate validation on HTTPS connection. - * - * @see http://en.wikibooks.org/wiki/WebObjects/Web_Services/How_to_Trust_Any_SSL_Certificate - * @author Francis Labrie - */ -public final class SSLUtilities { - - /** - * Hostname verifier for the Sun's deprecated API. - * - * @deprecated see {@link #_hostnameVerifier}. - */ - private static com.sun.net.ssl.HostnameVerifier __hostnameVerifier; - /** - * Thrust managers for the Sun's deprecated API. - * - * @deprecated see {@link #_trustManagers}. - */ - private static com.sun.net.ssl.TrustManager[] __trustManagers; - /** - * Hostname verifier. - */ - private static HostnameVerifier _hostnameVerifier; - /** - * Thrust managers. - */ - private static TrustManager[] _trustManagers; - - - /** - * Set the default Hostname Verifier to an instance of a fake class that - * trust all hostnames. This method uses the old deprecated API from the - * com.sun.ssl package. - * - * @deprecated see {@link #_trustAllHostnames()}. - */ - private static void __trustAllHostnames() { - // Create a trust manager that does not validate certificate chains - if(__hostnameVerifier == null) { - __hostnameVerifier = new _FakeHostnameVerifier(); - } // if - // Install the all-trusting host name verifier - com.sun.net.ssl.HttpsURLConnection. - setDefaultHostnameVerifier(__hostnameVerifier); - } // __trustAllHttpsCertificates - - /** - * Set the default X509 Trust Manager to an instance of a fake class that - * trust all certificates, even the self-signed ones. This method uses the - * old deprecated API from the com.sun.ssl package. - * - * @deprecated see {@link #_trustAllHttpsCertificates()}. - */ - private static void __trustAllHttpsCertificates() { - com.sun.net.ssl.SSLContext context; - - // Create a trust manager that does not validate certificate chains - if(__trustManagers == null) { - __trustManagers = new com.sun.net.ssl.TrustManager[] - {new _FakeX509TrustManager()}; - } // if - // Install the all-trusting trust manager - try { - context = com.sun.net.ssl.SSLContext.getInstance("SSL"); - context.init(null, __trustManagers, new SecureRandom()); - } catch(GeneralSecurityException gse) { - throw new IllegalStateException(gse.getMessage()); - } // catch - com.sun.net.ssl.HttpsURLConnection. - setDefaultSSLSocketFactory(context.getSocketFactory()); - } // __trustAllHttpsCertificates - - /** - * Return true if the protocol handler property java. - * protocol.handler.pkgs is set to the Sun's com.sun.net.ssl. - * internal.www.protocol deprecated one, false - * otherwise. - * - * @return true if the protocol handler - * property is set to the Sun's deprecated one, false - * otherwise. - */ - private static boolean isDeprecatedSSLProtocol() { - return("com.sun.net.ssl.internal.www.protocol".equals(System. - getProperty("java.protocol.handler.pkgs"))); - } // isDeprecatedSSLProtocol - - /** - * Set the default Hostname Verifier to an instance of a fake class that - * trust all hostnames. - */ - private static void _trustAllHostnames() { - // Create a trust manager that does not validate certificate chains - if(_hostnameVerifier == null) { - _hostnameVerifier = new FakeHostnameVerifier(); - } // if - // Install the all-trusting host name verifier: - HttpsURLConnection.setDefaultHostnameVerifier(_hostnameVerifier); - } // _trustAllHttpsCertificates - - /** - * Set the default X509 Trust Manager to an instance of a fake class that - * trust all certificates, even the self-signed ones. - */ - private static void _trustAllHttpsCertificates() { - SSLContext context; - - // Create a trust manager that does not validate certificate chains - if(_trustManagers == null) { - _trustManagers = new TrustManager[] {new FakeX509TrustManager()}; - } // if - // Install the all-trusting trust manager: - try { - context = SSLContext.getInstance("SSL"); - context.init(null, _trustManagers, new SecureRandom()); - } catch(GeneralSecurityException gse) { - throw new IllegalStateException(gse.getMessage()); - } // catch - HttpsURLConnection.setDefaultSSLSocketFactory(context. - getSocketFactory()); - } // _trustAllHttpsCertificates - - /** - * Set the default Hostname Verifier to an instance of a fake class that - * trust all hostnames. - */ - public static void trustAllHostnames() { - // Is the deprecated protocol setted? - if(isDeprecatedSSLProtocol()) { - __trustAllHostnames(); - } else { - _trustAllHostnames(); - } // else - } // trustAllHostnames - - /** - * Set the default X509 Trust Manager to an instance of a fake class that - * trust all certificates, even the self-signed ones. - */ - public static void trustAllHttpsCertificates() { - // Is the deprecated protocol setted? - if(isDeprecatedSSLProtocol()) { - __trustAllHttpsCertificates(); - } else { - _trustAllHttpsCertificates(); - } // else - } // trustAllHttpsCertificates - - /** - * This class implements a fake hostname verificator, trusting any host - * name. This class uses the old deprecated API from the com.sun. - * ssl package. - * - * @author Francis Labrie - * - * @deprecated see {@link SSLUtilities.FakeHostnameVerifier}. - */ - public static class _FakeHostnameVerifier - implements com.sun.net.ssl.HostnameVerifier { - - /** - * Always return true, indicating that the host name is an - * acceptable match with the server's authentication scheme. - * - * @param hostname the host name. - * @param session the SSL session used on the connection to - * host. - * @return the true boolean value - * indicating the host name is trusted. - */ - public boolean verify(String hostname, String session) { - return(true); - } // verify - } // _FakeHostnameVerifier - - - /** - * This class allow any X509 certificates to be used to authenticate the - * remote side of a secure socket, including self-signed certificates. This - * class uses the old deprecated API from the com.sun.ssl - * package. - * - * @author Francis Labrie - * - * @deprecated see {@link SSLUtilities.FakeX509TrustManager}. - */ - public static class _FakeX509TrustManager - implements com.sun.net.ssl.X509TrustManager { - - /** - * Empty array of certificate authority certificates. - */ - private static final X509Certificate[] _AcceptedIssuers = - new X509Certificate[] {}; - - - /** - * Always return true, trusting for client SSL - * chain peer certificate chain. - * - * @param chain the peer certificate chain. - * @return the true boolean value - * indicating the chain is trusted. - */ - public boolean isClientTrusted(X509Certificate[] chain) { - return(true); - } // checkClientTrusted - - /** - * Always return true, trusting for server SSL - * chain peer certificate chain. - * - * @param chain the peer certificate chain. - * @return the true boolean value - * indicating the chain is trusted. - */ - public boolean isServerTrusted(X509Certificate[] chain) { - return(true); - } // checkServerTrusted - - /** - * Return an empty array of certificate authority certificates which - * are trusted for authenticating peers. - * - * @return a empty array of issuer certificates. - */ - public X509Certificate[] getAcceptedIssuers() { - return(_AcceptedIssuers); - } // getAcceptedIssuers - } // _FakeX509TrustManager - - - /** - * This class implements a fake hostname verificator, trusting any host - * name. - * - * @author Francis Labrie - */ - public static class FakeHostnameVerifier implements HostnameVerifier { - - /** - * Always return true, indicating that the host name is - * an acceptable match with the server's authentication scheme. - * - * @param hostname the host name. - * @param session the SSL session used on the connection to - * host. - * @return the true boolean value - * indicating the host name is trusted. - */ - public boolean verify(String hostname, - javax.net.ssl.SSLSession session) { - return(true); - } // verify - } // FakeHostnameVerifier - - - /** - * This class allow any X509 certificates to be used to authenticate the - * remote side of a secure socket, including self-signed certificates. - * - * @author Francis Labrie - */ - public static class FakeX509TrustManager implements X509TrustManager { - - /** - * Empty array of certificate authority certificates. - */ - private static final X509Certificate[] _AcceptedIssuers = - new X509Certificate[] {}; - - - /** - * Always trust for client SSL chain peer certificate - * chain with any authType authentication types. - * - * @param chain the peer certificate chain. - * @param authType the authentication type based on the client - * certificate. - */ - public void checkClientTrusted(X509Certificate[] chain, - String authType) { - } // checkClientTrusted - - /** - * Always trust for server SSL chain peer certificate - * chain with any authType exchange algorithm types. - * - * @param chain the peer certificate chain. - * @param authType the key exchange algorithm used. - */ - public void checkServerTrusted(X509Certificate[] chain, - String authType) { - } // checkServerTrusted - - /** - * Return an empty array of certificate authority certificates which - * are trusted for authenticating peers. - * - * @return a empty array of issuer certificates. - */ - public X509Certificate[] getAcceptedIssuers() { - return(_AcceptedIssuers); - } // getAcceptedIssuers - } // FakeX509TrustManager -} // SSLUtilities diff --git a/sw/in_progress/pow/pow/src/pow/Serveur.java b/sw/in_progress/pow/pow/src/pow/Serveur.java deleted file mode 100644 index 30455022d6..0000000000 --- a/sw/in_progress/pow/pow/src/pow/Serveur.java +++ /dev/null @@ -1,693 +0,0 @@ -package pow; - -import nl.justobjects.pushlet.core.Dispatcher; -import nl.justobjects.pushlet.core.Event; -import nl.justobjects.pushlet.core.EventSource; -import java.io.*; -import java.net.*; -/* -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -*/ -import java.util.*; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.servlet.ServletContext; -//import javax.servlet.*; -//import javax.servlet.http.*; -import pow.Conf; - -import org.apache.commons.codec.binary.Hex; -import org.jdom.*; -import org.jdom.input.*; -import org.jdom.output.Format; -import org.jdom.output.XMLOutputter; -import org.jdom.filter.*; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Iterator; - -import java.util.Date; - -/** - * Class which receive a datagramm from ivy bus via udp - * transforms it into a pushlet event and send it to the pushlet server - * in order that it will be sended to web clients - * @author genin - * - */ -public class Serveur { -static public class IvyEventSource implements EventSource , Runnable { - - private ServletContext srvCtxt; - private String default_folder = "blabla"; - - Thread thread = null; - volatile boolean active = false; - private int restarts = 1; - /* *********************** */ - private static log myLog; - private static Conf myConf; - /* *********************** */ - private DatagramSocket socket; - private int newBusTest; - private ArrayList busesIvy; // Tableau identifiant les busIvy et les drones - private ArrayList deadBusesIvy; // Tableau identifiant les busIvy deconnectes - private String[] myDataSplited; // Tableau contenant toutes les donnees envoyees - /* *********************** */ - private static long time2resetFilters = 100000; // on nettoie les filtres ms !!!!! - /* *********************** */ - private MsgFilter waypointMsgFilter; - /* to retreive aes cipher for a specific ivy bus*/ - private HashMap tableIvySession; - /* ********* */ - private IvyMsg currentIvyMsg=null; - /* ********* */ - - public IvyEventSource() { - System.out.println(" Thread de recuperation des données IVY"); - waypointMsgFilter = new MsgFilter(); - } - /* *********************************** */ - /* EventSource specific functions */ - /* *********************************** */ - /** - * Activate the event source. - */ - synchronized public void activate() { - System.out.println("activating the event source...."); - // Stop a possibly running thread - stopThread(); - // Start new thread and - thread = new Thread(this, "DATA FROM IVY " + (restarts++)); - active = true; - thread.start(); - System.out.println("event source activated !!!"); - } - - /** - * Deactivate the event source. - */ - synchronized public void passivate() { - // inform the other servlet - this.srvCtxt.removeAttribute("list_bus_ivy"); - // - active = false; - stopThread(); - } - - /** - * Deactivate the event source. - */ - synchronized public void stop() { - } - - private void stopThread() { - if (thread != null) { - thread.interrupt(); - thread = null; - } - } - /* - * load configuration from a specific configuration file on the server - * and initiates a log file to. - */ - private void loadingConfiguration() throws Exception - { - myConf = new Conf(default_folder,"pow.conf"); - myLog.write("Loading Configuration !"); - myLog.write(""); - myLog.write("Configuration Details :"); - myLog.write("Port : " + myConf.port()); - myLog.write("Size of Datagrams : " + myConf.taille()); - myLog.write("DataBase used : " + myConf.dataBaseName()); - myLog.write(""); - } - - /** - * This procedure convert the byte array into a String and returns an array containing all the - * the datas separately. - * extract also the information concerning the sender to send them to data base - * @param Data The raw of byte containing udp msg which will be processed - * @return An array containing all the datas separately - */ - public static String[] dataProcessing(byte[] data) //throws Exception - { - // This array contain all the datas transmitted - String[] myDataSplited; - // Number of datas transmitted - int nbr_datas; - // Data separator - String sep_datas = " "; - // The datagram is converted into String - String myData = new String(data); - - myDataSplited = myData.split(sep_datas,4); // 4 = number of substring - int webid = Integer.parseInt(myDataSplited[0]); - long num_msg = Long.parseLong(myDataSplited[1]); - String timeMsg = myDataSplited[2]; - String ivymsg = myDataSplited[3]; - myDataSplited = myDataSplited[3].split(sep_datas); - //System.out.println("##############################"); - //for(int i = 0; i(); - // Tableau identifiant les busIvy deconnectes - deadBusesIvy = new ArrayList (); - - try {loadingConfiguration();} catch (Exception e) { - System.out.println("erreur loading configuration"); - e.printStackTrace();} - - // inform the other servlet - this.srvCtxt.setAttribute("list_bus_ivy", busesIvy); - // - - //The server is launched and listen on port number 8535 - try{ - socket = new DatagramSocket(myConf.port()); - socket.setSoTimeout(myConf.timeout()); - // System.out.println(" ecriture log"); - myLog.write("Server launched !"); - // System.out.println("Server launched !"); - - //The module wait the reception of datagrams - chrono_start = System.currentTimeMillis(); - while(true) - { - // - // decryptage AES - // si je recois un paquet via udp c'est qu'il y a eu login d'un client ivy - // et donc je peux recupere la table des sessions - if (firsttime){ - tableIvySession = (HashMap) this.srvCtxt.getAttribute("ivySessionTable"); - } - if (tableIvySession!=null){ - firsttime =false; - }// fin if tableSession!=null - newBusTest = 0; - - byte buffer[] = new byte[myConf.taille()]; - DatagramPacket dataReceived = new DatagramPacket(buffer,buffer.length); - try - { - socket.receive(dataReceived); - if(dataReceived != null){ - if (firsttime){ - tableIvySession = (HashMap) this.srvCtxt.getAttribute("ivySessionTable"); - } - if (tableIvySession!=null){ - firsttime =false; - System.out.print("d"); - //The module checks if there is a new Bus Ivy incoming - SessionIvy clientIvy = tableIvySession.get(dataReceived.getAddress()); - if (clientIvy!=null){ - BusIvy_ current_bus = clientIvy.getBusIvy(); - if (current_bus==null){ - current_bus = new BusIvy_(); - current_bus.setAddress(dataReceived.getAddress()); - current_bus.updateTime(); - clientIvy.setBusIvy(current_bus); - myLog.write("New Ivy Connection detected : " + dataReceived.getAddress()); - } - else - { - current_bus.updateTime(); - } - // check dead buses (after 10sec of inactivity) - // TODO could be perform less often.... - Iterator> itr = tableIvySession.entrySet().iterator(); - BusIvy_ checked_bus; - while(itr.hasNext()){ - checked_bus = itr.next().getValue().getBusIvy(); - if(!(checked_bus.isAlive())){ - myLog.write("Ivy Connection deconnected : " + checked_bus.getAddress()); - for(Integer deadDrone : checked_bus.getDrones()) - { - deconnectDrone(deadDrone); - } - } - } - // - /* - if(busesIvy.isEmpty()) - { - BusIvy_ oNewBus = new BusIvy_(); - oNewBus.setAddress(dataReceived.getAddress()); - oNewBus.updateTime(); - busesIvy.add(oNewBus); - myLog.write("New Ivy Connection detected : " + dataReceived.getAddress()); - } - else - { - for(BusIvy_ myBus : busesIvy) - { - if(myBus.getAddress().equals(dataReceived.getAddress())) - { - newBusTest = 1; - myBus.updateTime(); // to avoid being not alive and be removed - } - - if(!(myBus.isAlive())) - { - myLog.write("Ivy Connection deconnected : " + myBus.getAddress()); - for(Integer deadDrone : myBus.getDrones()) - { - deconnectDrone(deadDrone); - } - deadBusesIvy.add(myBus); - } - - } - if(!(deadBusesIvy.isEmpty())) - { - for(BusIvy_ deadBus : deadBusesIvy) - { - busesIvy.remove(deadBus); - } - deadBusesIvy.removeAll(deadBusesIvy); - } - if(newBusTest == 0) - { - BusIvy_ newBus = new BusIvy_(); - newBus.setAddress(dataReceived.getAddress()); - newBus.updateTime(); - busesIvy.add(newBus); - myLog.write("New Ivy Connection detected : " + dataReceived.getAddress()); - } - } - */ - AES cipher = clientIvy.getCipher(); - try{ - complete_data = dataReceived.getData(); // on recupere toute la trame utile - true_length_of_msg = dataReceived.getLength(); - data_with_no_padding = new byte[true_length_of_msg]; // on recupere que les infos utiles - for(i=0;i< true_length_of_msg;i++){ - data_with_no_padding[i]=complete_data[i]; - } - try{ - byte[] decrypted_data = cipher.decrypt(data_with_no_padding); - - //The datagram is processed - myDataSplited = dataProcessing(decrypted_data); - // switch .... - if((myDataSplited[0].equals("New_Plane")) - ||(myDataSplited[0].equals("Plane_Die")) - ||(myDataSplited[0].equals("Plane_Resurect")) - ||(myDataSplited[0].equals("DL_SETTING_ACK")) - ||(myDataSplited[0].equals("WAYPOINT_MOVED")) - ||(myDataSplited[0].equals("NAV_STATUS")) - ||(myDataSplited[0].equals("SETTINGS_VALUES"))) - { - myLog.write("Order Received From : " + dataReceived.getAddress() + " ---> " + new String(decrypted_data)); - - sendOrderToServer(myDataSplited); - if(!(current_bus.isOwnBy(Integer.parseInt(myDataSplited[1])))) - { - current_bus.addDrones(Integer.parseInt(myDataSplited[1])); - } - /* - for(BusIvy_ myBus : busesIvy) - { - if( myBus.getAddress().equals(dataReceived.getAddress())) - { - if(!(myBus.isOwnBy(Integer.parseInt(myDataSplited[1])))) - { - myBus.addDrones(Integer.parseInt(myDataSplited[1])); - } - - } - }*/ - } - else - { - sendDataToServer(myDataSplited); - if(!(current_bus.isOwnBy(Integer.parseInt(myDataSplited[0])))) - { - current_bus.addDrones(Integer.parseInt(myDataSplited[0])); - } - /* - for(BusIvy_ myBus : busesIvy) - { - if( myBus.getAddress().equals(dataReceived.getAddress())) - { - if(!(myBus.isOwnBy(Integer.parseInt(myDataSplited[0])))) - { - myBus.addDrones(Integer.parseInt(myDataSplited[0])); - } - } - }*/ - } - - - System.out.print("."); - } - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("msg no padding := "+(new String(Hex.encodeHex(data_with_no_padding)))); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("msg no padding := "+(new String(Hex.encodeHex(data_with_no_padding)))); - } - } - catch(IOException ex){ - System.out.print("pbm decrypting msg"); - System.out.print(ex.toString()); - } - }// fin if ivyclient != null - else - { - System.out.print("no ivy client stored for this datagramm from "+dataReceived.getAddress()); - } - } // fin if tablesession != null - else - { - // on a recu un diagramme mais il n'y a pas de session recorded donc on - // doit envoyer un message au sender comme quoi il doit se relogger - // TODO - System.out.println("no session recorder "+dataReceived.getAddress()+ "should relog to server"); - } - }// fin if datareceived!=null - }// fin du try socket received - catch(SocketTimeoutException ex) - { - if(!(busesIvy.isEmpty())) - { - for(BusIvy_ myBus : busesIvy) - { - myLog.write("Ivy Connection deconnected : " + myBus.getAddress()); - for(Integer deadDrone : myBus.getDrones()) - { - deconnectDrone(deadDrone); - } - } - - busesIvy.removeAll(busesIvy); - myLog.write("No Bus Ivy connected..."); - } - dataReceived = null; - } - catch(IOException ex){ - System.out.println("exception socket receive serveur.java"); - ex.printStackTrace(); - } - - }// fin while true - } catch (SocketException soe){ - System.out.print("Socket Exception !"); - soe.printStackTrace(); - } - //} - //catch(Exception e){ - // System.out.println("Non handled exception ... plantage...."); - // System.out.println("***************************************"); - // System.out.println(""+e.toString()); - // System.out.println("***************************************"); - //} - - } - - /** - * send a iskill event when a drone has disappeared from an ivy bus - * @param droneId - * @throws Exception - */ - public void deconnectDrone(int droneId) - { - Event event = Event.createDataEvent("/data/drone/iskill"); - event.setField("aircraftId",droneId); - event.setField("iskill", 1 + "" ); // 1 ==true - Dispatcher.getInstance().multicast(event); - //TODO effacer les fichiers de conf associés ???? - } - - - /** - * send a datagramm containing all useful information on a drone - * @param myDataSplited - * @throws Exception - */ - public void sendDataToServer(String myDataSplited[])// throws Exception - { - int i; - int nbr_datas = myDataSplited.length; - String[] myDataName = new String[nbr_datas]; - // try{ - // id of the drone - myDataName[0] = "id"; - // name of the drone - myDataName[1] = "dbName"; - // latitude - myDataName[2] = "dbLatitude"; - // longitude - myDataName[3] = "dbLongitude"; - // speed - myDataName[4] = "dbSpeed";// - // bearing - myDataName[5] = "dbCourse"; - // amsl - myDataName[6] = "dbAmsl";// - // vertical speed - myDataName[7] = "dbVert_speed";// - // agl - myDataName[8] = "dbAgl";// - // battery load - myDataName[9] = "dbStat_battery";// - // gps_status - myDataName[10] = "dbStat_gps";// - // Engine status - myDataName[11] = "dbEngine_status";// - // active block - myDataName[12] = "dbActive_block";// - // id of the setting - myDataName[13] = "dbId_Setting";// - // value of the setting - myDataName[14] = "dbSetting_Value";// - // color of the drone , rajout thomas - myDataName[15] = "drone_color";// - - Event event = Event.createDataEvent("/data/drones_maj"); - event.setField("aircraftId",myDataSplited[0]); - for(i=1;i listbusesIvy) throws Exception - { - byte buffer[] = new byte[myConf.taille()]; - for(BusIvy_ myBus : listbusesIvy) - { - if(myBus.isOwnBy(aircraftWebId)) - { - InetAddress address = myBus.getAddress(); - buffer = order.getBytes(); - DatagramPacket DataEmitted = new DatagramPacket(buffer, buffer.length, address, myConf.port()); - socket.send(DataEmitted); - myLog.write("Order Emitted To : " + DataEmitted.getAddress() + " ---> " + new String(DataEmitted.getData())); - System.out.print("*"); - } - } - } - - - /** - * This procedure write the orders given by the bus Ivy in the DataBase. - * @param myDataSplited The array containing one order - */ - - private void sendOrderToServer(String myDataSplited[]) //throws Exception - { - //try{ - if(myDataSplited[0].equals("WAYPOINT_MOVED")) - { - Event event = Event.createDataEvent("/data/order/waypoint_moved"); - event.setField("order",myDataSplited[0]); - event.setField("aircraftId",myDataSplited[1]); - event.setField("waypointId", myDataSplited[2] ); - event.setField("latitude", myDataSplited[3] ); - event.setField("longitude", myDataSplited[4] ); - event.setField("altitude", myDataSplited[5] ); - updateXML_FPL_file(myDataSplited[1],myDataSplited[2],myDataSplited[3],myDataSplited[4],myDataSplited[5]); - Dispatcher.getInstance().multicast(event); - } - else if(myDataSplited[0].equals("NAV_STATUS")) - { - //System.out.println(""+myDataSplited.toString()); - Event event = Event.createDataEvent("/data/order/block_changed"); - event.setField("order",myDataSplited[0]);//System.out.println("1"); - event.setField("aircraftId",myDataSplited[1]);//System.out.println("2"); - event.setField("currentBlockId", myDataSplited[2] );//System.out.println("3"); - Dispatcher.getInstance().multicast(event);//System.out.println("4"); - } - else if(myDataSplited[0].equals("DL_SETTING_ACK")) - { - Event event = Event.createDataEvent("/data/order/change_setting"); - event.setField("order",myDataSplited[0]); - event.setField("aircraftId",myDataSplited[1]); - event.setField("settingId", myDataSplited[2]); - event.setField("settingValue", myDataSplited[3]); - Dispatcher.getInstance().multicast(event); - } - else if(myDataSplited[0].equals("Plane_Die")) - { - Event event = Event.createDataEvent("/data/order/plane_die"); - event.setField("order",myDataSplited[0]); - event.setField("aircraftId",myDataSplited[1]); - Dispatcher.getInstance().multicast(event); - } - else if(myDataSplited[0].equals("Plane_Resurect")) - { - //TODO TRAITER CE CAS ???? - Event event = Event.createDataEvent("/data/order/plane_resurect"); - event.setField("order",myDataSplited[0]); - event.setField("aircraftId",myDataSplited[1]); - Dispatcher.getInstance().multicast(event); - } - else if(myDataSplited[0].equals("New_Plane")) - { - Event event = Event.createDataEvent("/data/order/new_plane"); - event.setField("order",myDataSplited[0]); - event.setField("aircraftId",myDataSplited[1]); - event.setField("aircraftName",myDataSplited[2]); - Dispatcher.getInstance().multicast(event); - } - else if(myDataSplited[0].equals("SETTINGS_VALUES")) - { - Event event = Event.createDataEvent("/data/order/settings"); - event.setField("order",myDataSplited[0]); - event.setField("aircraftId",myDataSplited[1]); - event.setField("csv",myDataSplited[2]); - Dispatcher.getInstance().multicast(event); - } - else - { - Event event = Event.createDataEvent("/data/order/other"); - event.setField("order",myDataSplited[0]); - event.setField("aircraftId",myDataSplited[1]); - Dispatcher.getInstance().multicast(event); - } - /*} - catch(Exception ex){ - System.out.println("exception dans sendOrderToServer : "); - System.out.println(""+ex.toString()); - throw new Exception(ex); - }*/ - } - - /** - * method qui renseigne la source sur la servlet qui l'a appelé - * modification de la librairie pushlet - * Pushlet.java - * EventSource.java - * EventSourceManager.java - */ - - public void setServletContext(ServletContext srvCtxt) { - this.srvCtxt = srvCtxt; - default_folder = srvCtxt.getRealPath(""); - } - - private void updateXML_FPL_file(String acId,String wpId,String lat,String lon,String alt){ - // change XML file on server - // http://cynober.developpez.com/tutoriel/java/xml/jdom/ - String default_folder = this.srvCtxt.getRealPath(""); - try - { - String filepath = default_folder+"/upload/"+acId+"/flight_plan.xml"; - //System.out.println("attempt to modify xml fpl for drone : " +acId); - Document document; - SAXBuilder sxb = new SAXBuilder(); - Element racine; - document = sxb.build(new File(filepath));// charge le fichier - //On initialise un nouvel élément racine avec l'élément racine du document. - racine = document.getRootElement(); - List list_wpt = racine.getChild("flight_plan").getChild("waypoints").getChildren("waypoint"); - Iterator i = list_wpt.iterator(); - boolean doIt = true; - int cpt_wpt=0; - while(i.hasNext()&&doIt) //parcours des waypoints - { - Element courant = (Element)i.next(); - if (cpt_wpt==(Integer.parseInt(wpId)-1)){ //TODO verifier que ca coincide bien !!! cf waypoint fictif ivy - String name = courant.getAttributeValue("name"); - // if(name.equals(wpt_name)) { - System.out.println("wpt changed : "+ name + " for drone "+ acId +" id="+cpt_wpt+" with\tlat="+lat + "\tlon="+lon); - doIt= false; - courant.removeAttribute("x"); // on enleve les coordonnées relative en x et y - courant.removeAttribute("y"); // si elles sont présentes - courant.setAttribute("lat", lat); - courant.setAttribute("long", lon); - courant.setAttribute("alt", alt); - } - cpt_wpt++; - } - // enregistre le nouveau fichier - XMLOutputter sortie = new XMLOutputter(Format.getPrettyFormat()); - sortie.output(document, new FileOutputStream(filepath)); - //System.out.println("xml filed updated on server for drone : " +acId); - } - catch(Exception e){System.out.println("error : unable to load xml file");} - - } -} -} diff --git a/sw/in_progress/pow/pow/src/pow/SessionIvy.java b/sw/in_progress/pow/pow/src/pow/SessionIvy.java deleted file mode 100644 index 882906c1a7..0000000000 --- a/sw/in_progress/pow/pow/src/pow/SessionIvy.java +++ /dev/null @@ -1,39 +0,0 @@ -package pow; - -import java.net.InetAddress; -import java.net.UnknownHostException; - -public class SessionIvy { - - private String login; - private int webId; - private AES cipherAES; - private InetAddress IvyHostName; - private BusIvy_ busIvy; - - public SessionIvy(String l,int w, AES c,InetAddress IvyAddr) throws UnknownHostException{ - this.login = l; - this.webId = w; - this.cipherAES = c; - this.IvyHostName = IvyAddr; - busIvy = null; - } - - public InetAddress getIvyInetAddress(){ - return this.IvyHostName; - } - - public void setIvyInetAddress(InetAddress addr){ - this.IvyHostName=addr; - } - - public AES getCipher() {return cipherAES;} - - public BusIvy_ getBusIvy(){ - return this.busIvy; - } - - public void setBusIvy( BusIvy_ b){ - this.busIvy = b; - } -} diff --git a/sw/in_progress/pow/pow/src/pow/StrictSSLProtocolSocketFactory.java b/sw/in_progress/pow/pow/src/pow/StrictSSLProtocolSocketFactory.java deleted file mode 100644 index 602a55316d..0000000000 --- a/sw/in_progress/pow/pow/src/pow/StrictSSLProtocolSocketFactory.java +++ /dev/null @@ -1,339 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl/StrictSSLProtocolSocketFactory.java,v 1.5 2004/06/10 18:25:24 olegk Exp $ - * $Revision: 480424 $ - * $Date: 2006-11-29 06:56:49 +0100 (Wed, 29 Nov 2006) $ - * - * ==================================================================== - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - * [Additional notices, if required by prior licensing conditions] - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Lesser General Public License Version 2 or later - * (the "LGPL"), in which case the provisions of the LGPL are - * applicable instead of those above. See terms of LGPL at - * . - * If you wish to allow use of your version of this file only under - * the terms of the LGPL and not to allow others to use your version - * of this file under the Apache Software License, indicate your - * decision by deleting the provisions above and replace them with - * the notice and other provisions required by the LGPL. If you do - * not delete the provisions above, a recipient may use your version - * of this file under either the Apache Software License or the LGPL. - */ - -package pow; - -import java.io.IOException; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.net.SocketAddress; -import java.net.UnknownHostException; - -import javax.net.SocketFactory; -import javax.net.ssl.SSLPeerUnverifiedException; -import javax.net.ssl.SSLSession; -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; -import javax.security.cert.X509Certificate; - -import org.apache.commons.httpclient.ConnectTimeoutException; -import org.apache.commons.httpclient.params.HttpConnectionParams; -import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * A SecureProtocolSocketFactory that uses JSSE to create - * SSL sockets. It will also support host name verification to help preventing - * man-in-the-middle attacks. Host name verification is turned on by - * default but one will be able to turn it off, which might be a useful feature - * during development. Host name verification will make sure the SSL sessions - * server host name matches with the the host name returned in the - * server certificates "Common Name" field of the "SubjectDN" entry. - * - * @author Sebastian Hauer - *

      - * DISCLAIMER: HttpClient developers DO NOT actively support this component. - * The component is provided as a reference material, which may be inappropriate - * for use without additional customization. - *

      - */ -public class StrictSSLProtocolSocketFactory - implements SecureProtocolSocketFactory { - - /** Log object for this class. */ - private static final Log LOG = LogFactory.getLog(StrictSSLProtocolSocketFactory.class); - - /** Host name verify flag. */ - private boolean verifyHostname = true; - - - /** - * Constructor for StrictSSLProtocolSocketFactory. - * @param verifyHostname The host name verification flag. If set to - * true the SSL sessions server host name will be compared - * to the host name returned in the server certificates "Common Name" - * field of the "SubjectDN" entry. If these names do not match a - * Exception is thrown to indicate this. Enabling host name verification - * will help to prevent from man-in-the-middle attacks. If set to - * false host name verification is turned off. - * - * Code sample: - * - *
      - * Protocol stricthttps = new Protocol( - * "https", new StrictSSLProtocolSocketFactory(true), 443); - * - * HttpClient client = new HttpClient(); - * client.getHostConfiguration().setHost("localhost", 443, stricthttps); - *
      - * - */ - public StrictSSLProtocolSocketFactory(boolean verifyHostname) { - super(); - this.verifyHostname = verifyHostname; - } - - /** - * Constructor for StrictSSLProtocolSocketFactory. - * Host name verification will be enabled by default. - */ - public StrictSSLProtocolSocketFactory() { - super(); - } - - /** - * Set the host name verification flag. - * - * @param verifyHostname The host name verification flag. If set to - * true the SSL sessions server host name will be compared - * to the host name returned in the server certificates "Common Name" - * field of the "SubjectDN" entry. If these names do not match a - * Exception is thrown to indicate this. Enabling host name verification - * will help to prevent from man-in-the-middle attacks. If set to - * false host name verification is turned off. - */ - public void setHostnameVerification(boolean verifyHostname) { - this.verifyHostname = verifyHostname; - } - - /** - * Gets the status of the host name verification flag. - * - * @return Host name verification flag. Either true if host - * name verification is turned on, or false if host name - * verification is turned off. - */ - public boolean getHostnameVerification() { - return verifyHostname; - } - - - /** - * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int,java.net.InetAddress,int) - */ - public Socket createSocket(String host, int port, - InetAddress clientHost, int clientPort) - throws IOException, UnknownHostException { - SSLSocketFactory sf = (SSLSocketFactory) SSLSocketFactory.getDefault(); - SSLSocket sslSocket = (SSLSocket) sf.createSocket(host, port, - clientHost, - clientPort); - verifyHostname(sslSocket); - - return sslSocket; - } - - /** - * Attempts to get a new socket connection to the given host within the given time limit. - *

      - * This method employs several techniques to circumvent the limitations of older JREs that - * do not support connect timeout. When running in JRE 1.4 or above reflection is used to - * call Socket#connect(SocketAddress endpoint, int timeout) method. When executing in older - * JREs a controller thread is executed. The controller thread attempts to create a new socket - * within the given limit of time. If socket constructor does not return until the timeout - * expires, the controller terminates and throws an {@link ConnectTimeoutException} - *

      - * - * @param host the host name/IP - * @param port the port on the host - * @param clientHost the local host name/IP to bind the socket to - * @param clientPort the port on the local machine - * @param params {@link HttpConnectionParams Http connection parameters} - * - * @return Socket a new socket - * - * @throws IOException if an I/O error occurs while creating the socket - * @throws UnknownHostException if the IP address of the host cannot be - * determined - */ - public Socket createSocket( - final String host, - final int port, - final InetAddress localAddress, - final int localPort, - final HttpConnectionParams params - ) throws IOException, UnknownHostException, ConnectTimeoutException { - if (params == null) { - throw new IllegalArgumentException("Parameters may not be null"); - } - int timeout = params.getConnectionTimeout(); - Socket socket = null; - - SocketFactory socketfactory = SSLSocketFactory.getDefault(); - if (timeout == 0) { - socket = socketfactory.createSocket(host, port, localAddress, localPort); - } else { - socket = socketfactory.createSocket(); - SocketAddress localaddr = new InetSocketAddress(localAddress, localPort); - SocketAddress remoteaddr = new InetSocketAddress(host, port); - socket.bind(localaddr); - socket.connect(remoteaddr, timeout); - } - verifyHostname((SSLSocket)socket); - return socket; - } - - /** - * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int) - */ - public Socket createSocket(String host, int port) - throws IOException, UnknownHostException { - SSLSocketFactory sf = (SSLSocketFactory) SSLSocketFactory.getDefault(); - SSLSocket sslSocket = (SSLSocket) sf.createSocket(host, port); - verifyHostname(sslSocket); - - return sslSocket; - } - - /** - * @see SecureProtocolSocketFactory#createSocket(java.net.Socket,java.lang.String,int,boolean) - */ - public Socket createSocket(Socket socket, String host, int port, - boolean autoClose) - throws IOException, UnknownHostException { - SSLSocketFactory sf = (SSLSocketFactory) SSLSocketFactory.getDefault(); - SSLSocket sslSocket = (SSLSocket) sf.createSocket(socket, host, - port, autoClose); - verifyHostname(sslSocket); - - return sslSocket; - } - - - /** - * Describe verifyHostname method here. - * - * @param socket a SSLSocket value - * @exception SSLPeerUnverifiedException If there are problems obtaining - * the server certificates from the SSL session, or the server host name - * does not match with the "Common Name" in the server certificates - * SubjectDN. - * @exception UnknownHostException If we are not able to resolve - * the SSL sessions returned server host name. - */ - private void verifyHostname(SSLSocket socket) - throws SSLPeerUnverifiedException, UnknownHostException { - if (! verifyHostname) - return; - - SSLSession session = socket.getSession(); - String hostname = session.getPeerHost(); - try { - InetAddress addr = InetAddress.getByName(hostname); - } catch (UnknownHostException uhe) { - throw new UnknownHostException("Could not resolve SSL sessions " - + "server hostname: " + hostname); - } - - X509Certificate[] certs = session.getPeerCertificateChain(); - if (certs == null || certs.length == 0) - throw new SSLPeerUnverifiedException("No server certificates found!"); - - //get the servers DN in its string representation - String dn = certs[0].getSubjectDN().getName(); - - //might be useful to print out all certificates we receive from the - //server, in case one has to debug a problem with the installed certs. - if (LOG.isDebugEnabled()) { - LOG.debug("Server certificate chain:"); - for (int i = 0; i < certs.length; i++) { - LOG.debug("X509Certificate[" + i + "]=" + certs[i]); - } - } - //get the common name from the first cert - String cn = getCN(dn); - if (hostname.equalsIgnoreCase(cn)) { - if (LOG.isDebugEnabled()) { - LOG.debug("Target hostname valid: " + cn); - } - } else { - throw new SSLPeerUnverifiedException( - "HTTPS hostname invalid: expected '" + hostname + "', received '" + cn + "'"); - } - } - - - /** - * Parses a X.500 distinguished name for the value of the - * "Common Name" field. - * This is done a bit sloppy right now and should probably be done a bit - * more according to RFC 2253. - * - * @param dn a X.500 distinguished name. - * @return the value of the "Common Name" field. - */ - private String getCN(String dn) { - int i = 0; - i = dn.indexOf("CN="); - if (i == -1) { - return null; - } - //get the remaining DN without CN= - dn = dn.substring(i + 3); - // System.out.println("dn=" + dn); - char[] dncs = dn.toCharArray(); - for (i = 0; i < dncs.length; i++) { - if (dncs[i] == ',' && i > 0 && dncs[i - 1] != '\\') { - break; - } - } - return dn.substring(0, i); - } - - public boolean equals(Object obj) { - if ((obj != null) && obj.getClass().equals(StrictSSLProtocolSocketFactory.class)) { - return ((StrictSSLProtocolSocketFactory) obj).getHostnameVerification() - == this.verifyHostname; - } else { - return false; - } - } - - public int hashCode() { - return StrictSSLProtocolSocketFactory.class.hashCode(); - } - -} diff --git a/sw/in_progress/pow/pow/src/pow/User.java b/sw/in_progress/pow/pow/src/pow/User.java deleted file mode 100644 index 8ab7e30b1f..0000000000 --- a/sw/in_progress/pow/pow/src/pow/User.java +++ /dev/null @@ -1,76 +0,0 @@ -package pow; -import java.util.HashSet; -import java.util.Iterator; - - -public class User implements java.io.Serializable { - private String login = ""; - private String password = ""; - private HashSet dronesNamePermitted; - private Rights right; - - public User(String log, String pwd,Rights rght) { - this.login = log; - this.password = Md5.encode(pwd); - this.right = rght; - this.dronesNamePermitted = new HashSet(); - } - - public Iterator getSetItr(){ - return dronesNamePermitted.iterator(); - } - - public void clearListDrone(){ - dronesNamePermitted.clear(); - } - - public String getListDrone(){ - Iterator itr = dronesNamePermitted.iterator(); - String res = ""; - while(itr.hasNext()){ - res = res + itr.next() + ";"; - } - return res; - } - - public void addDrone(String d){ - dronesNamePermitted.add(d); - } - - public boolean canControl(String droneName) - { - if ((right == Rights.ADMIN)|| ((right==Rights.USER)&&dronesNamePermitted.contains(droneName))) - { return true; } - else - { return false; } - } - - public Rights getRights(){ - return this.right; - } - - public void setRights(Rights r){ - this.right=r; - } - - public String getLogin() { - return login; - } - - public void setNom(String log) { - this.login = log; - } - - public String getPassword() { - return password; - } - - public void setPwd(String pwd) { - this.password = Md5.encode(pwd); - } - - public boolean IsPwdTrue(String pwd) { - return this.password.equals(Md5.encode(pwd)); - } -} - diff --git a/sw/in_progress/pow/pow/src/pow/UserTab.java b/sw/in_progress/pow/pow/src/pow/UserTab.java deleted file mode 100644 index 8468b955b3..0000000000 --- a/sw/in_progress/pow/pow/src/pow/UserTab.java +++ /dev/null @@ -1,122 +0,0 @@ -package pow; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.io.*; - -public class UserTab implements java.io.Serializable { - - private HashMap tabUser; - /** - * create a empty list of users - */ - public UserTab(){ - tabUser = new HashMap(); - } - /** - * insert a user in the list - * @param u - * @throws AlreadyRegisteredUserException - */ - public void insert(User u) throws AlreadyRegisteredUserException { - String log = u.getLogin(); - if (!tabUser.containsKey(log)) tabUser.put(u.getLogin(),u); - else { throw new AlreadyRegisteredUserException(u) ;} - } - /** - * remove the user with the spefied login - * @param log - */ - public void remove(String log){ - tabUser.remove(log) ; - } - /** - * return the user corresponding to the given login - * @param log - * @return - */ - public User seek(String log){ - return tabUser.get(log); - } - /** - * check if an user with this logging exists yet - * @param log - * @return - */ - public boolean isInside(String log){ - return tabUser.containsKey(log); - } - - /** - * Check if the login is correct - * @param log - * @param pwd - * @return - */ - public boolean checkUser(String log,String pwd){ - boolean res = false; - User usr = tabUser.get(log); - if (usr!=null){ - res=usr.IsPwdTrue(pwd); - } - return res; - } - /** - * return the list of all drone which may be controled by the user - * @param log - * @return - */ - public Iterator getItrUsr(String log){ - Iterator res = null; - User usr = tabUser.get(log); - if (usr!=null){ - res=usr.getSetItr(); - } - return res; - } - /** - * return the iterator on all login in the list - * @param log - * @return - */ - public Iterator getLoginIterator(){ - return tabUser.keySet().iterator(); - } - /** - * Save the object in a file - * @param nomfichier - */ - public void serialize(String nomfichier){ - try { - FileOutputStream fichier = new FileOutputStream(nomfichier); - ObjectOutputStream oos = new ObjectOutputStream(fichier); - oos.writeObject(this); - oos.flush(); - oos.close(); - } - catch (java.io.IOException e) { - e.printStackTrace(); - } - } - /** - * load the object from a file - * @param nomfichier - * @return - */ - public static UserTab unserialize(String nomfichier) { - try { - FileInputStream fichier = new FileInputStream(nomfichier); - ObjectInputStream ois = new ObjectInputStream(fichier); - UserTab usrtab = (UserTab) ois.readObject(); - return usrtab; - } - catch (java.io.IOException e) { - e.printStackTrace(); - } - catch (ClassNotFoundException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/sw/in_progress/pow/pow/src/pow/acNetId.java b/sw/in_progress/pow/pow/src/pow/acNetId.java deleted file mode 100644 index b0fd964b33..0000000000 --- a/sw/in_progress/pow/pow/src/pow/acNetId.java +++ /dev/null @@ -1,89 +0,0 @@ -package pow; -/** - * this object represents the data concerning a drone extracted from Ivy - * @author genin - * - */ -public class acNetId { - private int idOfBusIvy; - private String idOnIvy; - private String nameOnIvy; - private String idOnWeb; - private String flightplan_path; - private String setting_path; - private String color; - private int maxAircrafts; /// - - public acNetId(int idBusIvy,String idIvy,String n,String pln,String s,String c,int maxACOnIvy){ - idOfBusIvy= idBusIvy; - idOnIvy=idIvy; - nameOnIvy=n; - flightplan_path = pln; - setting_path= s; - color = c; - maxAircrafts = maxACOnIvy; - idOnWeb = generateIdOnWeb(); - - } - - public acNetId(int idBusIvy,String droneWebId,String idIvy,String n,String pln,String s,String c,int maxACOnIvy){ - idOfBusIvy= idBusIvy; - idOnIvy=idIvy; - nameOnIvy=n; - flightplan_path = pln; - setting_path= s; - color = c; - maxAircrafts = maxACOnIvy; - idOnWeb = droneWebId; - - } - /** - * - * @return the id number of the drone on its ivy bus - */ - public String getIdOnIvy() {return idOnIvy;} - /** - * - * @return the name of the drone on its ivy bus - */ - public String getName() {return nameOnIvy;} - /** - * - * @return the single id number of the drone on the web server - */ - public String getIdOnWeb() {return idOnWeb;} - /** - * - * @return the full path of the flight plan config file on the GCS station - */ - public String getPlnPath() {return flightplan_path;} - /** - * - * @return the full path of the settings file on the GCS station - */ - public String getSettingPath() {return setting_path;} - /** - * - * @return the color of the drone on the GCS station (either in string or in hexadecimal) - */ - public String getColor() {return color;} - - private String generateIdOnWeb() { - //String newId = "" + (Integer.parseInt(idOnIvy) * ((int)Math.pow(maxAircrafts,idOfBusIvy))); - String newId = "" + (Integer.parseInt(idOnIvy) +maxAircrafts*idOfBusIvy*10); - System.out.println("### new Id generated : " + newId + " ###"); - return newId; - } - /** - * @return information about the drone in a string format - */ - public String toString(){ - return "id on ivy :\t" + idOnIvy + - "\nname :\t" + nameOnIvy + - "\nid on web :\t" + idOnWeb + - "\nfpl file :\t" + flightplan_path + - "\nsetting file :\t" + setting_path + - "\ncolor :\t" + color ; - } - -} diff --git a/sw/in_progress/pow/pow/src/pow/acNetIdStorage.java b/sw/in_progress/pow/pow/src/pow/acNetIdStorage.java deleted file mode 100644 index e540be41e5..0000000000 --- a/sw/in_progress/pow/pow/src/pow/acNetIdStorage.java +++ /dev/null @@ -1,312 +0,0 @@ -package pow; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.StringReader; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.concurrent.ConcurrentHashMap; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpException; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.httpclient.methods.PostMethod; -import org.apache.commons.httpclient.methods.multipart.FilePart; -import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity; -import org.apache.commons.httpclient.methods.multipart.Part; -import org.apache.commons.httpclient.methods.multipart.StringPart; -import org.apache.commons.httpclient.protocol.Protocol; -import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; - -import fr.dgac.ivy.*; -/** - * this structure memorize all the drone which exist on the ivy bus - * @author genin - * - */ -public class acNetIdStorage { - - private int ivyWebId; - private Ivy bus; - String url; // @server to upload - private HashMap acNetIdMap; - ConcurrentHashMap dronesStates; - private int maxAircrafts; - private acNetId resultat; - - public acNetIdStorage(int ii,Ivy b,String u,int maxAC, ConcurrentHashMap states ){ - bus = b; - ivyWebId=ii; - acNetIdMap= new HashMap(); - url = u; - maxAircrafts = maxAC; - dronesStates = states; - } - /** - * Return the identifiant of the drone on the web - * @param idOnIvy - * @return - */ - public acNetId getAcNetId(String idOnIvy) - { - return acNetIdMap.get(idOnIvy); - } - /** - * Return the identifiant of the drone on the ivy bus - * @param idOnWeb - * @return - */ - public String getAcIvyId(int idOnWeb) - { String res = null; - boolean doIt = true; - Collection col = acNetIdMap.values(); - Iterator it = col.iterator(); - while(it.hasNext()&& doIt) - { - acNetId ac=it.next(); - if (Integer.parseInt(ac.getIdOnWeb())==idOnWeb){ doIt=false; res = ac.getIdOnIvy();} - } - return res; - } - /** - * search the drone net id of a drone from its ivy id - * if the drone is a new one, a new net id is requested to the server - * @param s the ivy id of the drone - */ - public void seekAcNetId(String s) { - String droneWebId; - acNetId res = acNetIdMap.get(s); - if (res==null){ - try { - AcStatus acs = dronesStates.get(s); - if (acs==AcStatus.UNKNOWN) - { - dronesStates.replace(s,AcStatus.ASKING_WEB_ID); - droneWebId = getNewDroneWebId(s); - dronesStates.replace(s,AcStatus.WEB_ID_RECEIVED); - // lance message sur ivy pour recuperer conf, name et creer un obj acNetId - String rqst_id = bus.getWBUId(); - String msgSend2Ivy = ivyWebId + " " + rqst_id + " CONFIG_REQ " + s + ""; - String msgtoBind= rqst_id +" (.*) CONFIG (.*) file://(.*) file://(.*) file://(.*) file://(.*) (.*) (.*)"; - try { - bus.bindMsgOnce(msgtoBind, new myListener(droneWebId)); - try { - dronesStates.replace(s,AcStatus.ASKING_IVY_CONF); - bus.sendMsg(msgSend2Ivy); - } catch (IvyException e) { - e.printStackTrace(); - System.out.println("### IvyException : can't send request msg ###"); - } - } catch (IvyException e) { - e.printStackTrace(); - } - } - } catch (IvyConnectionExeption e) { - System.out.println("### ERREUR on WEBID REQUEST for drone " +s+" ###"); - e.printStackTrace(); - } - } - } - - - /** - * upload de fichier de conf sur le serveur - * verifier que ca marche sur long fichier - * si probleme changer avec : - * factory.setSizeThreshold(yourMaxMemorySize); - * factory.setRepository(yourTempDirectory); - * upload.setSizeMax(yourMaxRequestSize); - * @throws InterruptedException - * @throws FileNotFoundException - */ - - public boolean uploadConfFile(acNetId ac) throws FileNotFoundException { - boolean res=false ; - String pathFPL = ac.getPlnPath(); - String pathSetting = ac.getSettingPath(); - String droneWebId = ac.getIdOnWeb(); - File f1 = new File(pathFPL); - File f2 = new File(pathSetting); - FilePart fp1 = new FilePart(f1.getName(), f1); - FilePart fp2 = new FilePart(f2.getName(), f2); - - // System.out.println("File1 Length = " + f1.length()); - //System.out.println("File2 Length = " + f2.length()); - - PostMethod filePost = new PostMethod(url); - - // filePost.addParameter("requestWebId", ""+webId); - - Part[] parts = { - new StringPart("order", "uploadConfFile"), - new StringPart("ivyWebId", ""+ivyWebId), - new StringPart("droneWebId", ""+droneWebId), - fp1, - fp2 - }; - filePost.setRequestEntity( - new MultipartRequestEntity(parts, filePost.getParams()) - ); - //filePost.addParameter("requestWebId", ""+webId); - HttpClient client = new HttpClient(); - // inutile mais bon pour 1 connection de temps en temps ... - Protocol stricthttps = new Protocol("https", (ProtocolSocketFactory)new StrictSSLProtocolSocketFactory(true), 443); - client.getHostConfiguration().setHost("localhost", 443, stricthttps); - // - try { - int status = client.executeMethod(filePost); - System.out.println("reponse de la methode post uploading " + HttpStatus.getStatusText(status)); - if (status != HttpStatus.SC_OK) { - System.err.println("Method failed: "); - } - else{ - String responseBody = filePost.getResponseBodyAsString(); - try{ - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document document = parser.parse(new InputSource(new StringReader(responseBody))); - Element ack_node = (Element)document.getElementsByTagName("UploadAck").item(0); - int ack = Integer.parseInt(ack_node.getTextContent()); - if (ack==1){ - System.out.println("uploading ok for " +ack_node.getAttribute("iddrone")); - res = true; - } - else{ - System.out.println("uploading notok for " +ack_node.getAttribute("iddrone")); - res = false; - } - } - catch(Exception e){ - System.err.println("error during the parsing of xml response to a upload request"); - e.printStackTrace(); - } - - } - } catch (HttpException e) { - System.err.println("HttpException : echec execution requete post : uploading"); - e.printStackTrace(); - } catch (IOException e) { - System.err.println("IOException : echec execution requete post : uploading"); - e.printStackTrace(); - } finally { - // Release the connection. - filePost.releaseConnection(); - } - return res; - } - /** - * ask a unique new web id to the server for a new drone detected on the ivy bus - * @param IvyDroneId - * @return the new web drone id - * @throws IvyConnectionExeption - */ - public String getNewDroneWebId(String IvyDroneId) throws IvyConnectionExeption - { - String newDroneId = "#errorWebID#"; - int statusCode=-1; - HttpClient client = new HttpClient(); - client.getParams().setParameter("http.useragent", "Ivy request"); - // inutile mais bon pour 1 connection de temps en temps... - Protocol stricthttps = new Protocol("https", (ProtocolSocketFactory)new StrictSSLProtocolSocketFactory(true), 443); - client.getHostConfiguration().setHost("localhost", 443, stricthttps); - // - PostMethod method = new PostMethod(url); - method.addParameter("order", "requestNewDroneWebId"); - method.addParameter("ivyWebId", ""+ivyWebId); - //method.addParameter("ivyDroneId",IvyDroneId); - try { - statusCode = client.executeMethod(method); - if (statusCode != HttpStatus.SC_OK) { - System.err.println("Method failed: " + method.getStatusLine()); - } - else - { - String responseBody = method.getResponseBodyAsString();//getResponseBody();//); - //System.out.println(responseBody); - if(responseBody.startsWith("")); - } - else - { - throw new IvyConnectionExeption("unable to reach server to get new drone webId"); - } - } - } catch (HttpException e) { - System.err.println("HttpException : echec execution requete post : request new drone webId"); - e.printStackTrace(); - } catch (IOException e) { - System.err.println("IOException : echec execution requete post : request new drone webId"); - e.printStackTrace(); - } finally { - // Release the connection. - method.releaseConnection(); - } - return newDroneId; - } - /** - * inner class - * seems requested so that the ivy send method works - * @author genin - * - */ - class myListener implements IvyMessageListener { - private String droneWebId; - - myListener(String dwi){ - droneWebId=dwi; - } - @Override - public void receive(IvyClient arg0, String[] args) { - dronesStates.replace(args[1],AcStatus.IVY_CONF_RECEIVED); - System.out.println("message rqst CONFIG received from ivy for drone "+args[1]); - String idOnIvy = args[1]; - String flightplan_path = args[2]; - String setting_path = args[5]; - String drone_name = args[7]; - String color_drone = checkColor(args[6]); - acNetId ac = new acNetId(ivyWebId,droneWebId,idOnIvy,drone_name,flightplan_path,setting_path,color_drone,maxAircrafts); - acNetIdMap.put(idOnIvy, ac); - // upload des fichiers de conf sur le serveur - try { - dronesStates.replace(args[1],AcStatus.UPLOADING_CONF); - boolean res = uploadConfFile(ac); - if(res) {dronesStates.replace(args[1],AcStatus.CONF_OK);} - else { - dronesStates.replace(args[1],AcStatus.CONF_NOTOK); - System.out.println("conf files upload of drone "+idOnIvy+" impossible, messages will be skipped");} - //seekAcNetId(idOnIvy); // on recommence la recherche qui cette fois aboutira - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - System.out.println("### FileNotFoundException ###"); - } - } - /* - * on ivy drone color can be either in text format or in hexa format - * this function send the color in an hex rgb format - */ - private String checkColor(String color){ - String res = ""; - if ((color.length()==7)&&(color.charAt(0)=='#')){ - res = color; - } - else - { - if(color.equals("blue")){ res = "#0000FF"; } - else if (color.equals("red")){ res = "#FF0000"; } - else if (color.equals("green")){ res = "#00FF00"; } - else {res = "#0F0F0F";} - } - return res; - } - - }// fin inner class - -} diff --git a/sw/in_progress/pow/pow/src/pow/ajaxRqst.java b/sw/in_progress/pow/pow/src/pow/ajaxRqst.java deleted file mode 100644 index 0842bce187..0000000000 --- a/sw/in_progress/pow/pow/src/pow/ajaxRqst.java +++ /dev/null @@ -1,484 +0,0 @@ -package pow; - - -import java.io.*; -import java.net.*; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Map; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -// SEE http://java.developpez.com/faq/xml/?page=dom -import javax.xml.parsers.*; -import javax.xml.transform.*; -import javax.xml.transform.dom.*; -import javax.xml.transform.stream.*; - -import org.w3c.dom.*; -import org.xml.sax.*; - -import org.apache.commons.codec.binary.Hex; -import org.apache.xml.serialize.XMLSerializer; - -/*import org.jdom.*; -import org.jdom.input.*; -import org.jdom.output.Format; -import org.jdom.output.XMLOutputter; -import org.jdom.filter.*; -*/ -import java.util.*; - -import pow.Conf; - -/** - * Servlet implementation class ajaxRqst - * handles the different request from a web client which wants to give orders to a drone - */ -public class ajaxRqst extends HttpServlet { - private static final long serialVersionUID = 1L; - private String default_folder="blabla"; - private ServletContext srvCtxt; - /** - * @see HttpServlet#HttpServlet() - */ - public ajaxRqst() { - super(); - } - - /** - * init the servlet - */ - public void init(ServletConfig config) throws ServletException { - super.init(config); // necessaire sinon getServletContext renvoie null dans doPost - default_folder = config.getServletContext().getRealPath(""); - srvCtxt = config.getServletContext(); - } - - /** - * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) - */ - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - // TODO Auto-generated method stub - } - - /** - * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) - */ - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - HttpSession session = request.getSession(true); - // recupere les parametres - PrintWriter out = response.getWriter(); - String order = request.getParameter("order"); // fpl_update... - if(order!=null) { - if (order.equals("fpl_update")) - { - System.out.println("move waypoint requested !!!"); - String wpt_name = request.getParameter("wpt_name"); - String aircraft_id = request.getParameter("aircraft_id"); - String wpt_id = request.getParameter("wpt_id"); - String new_alt = request.getParameter("new_alt"); - String new_lat = request.getParameter("new_lat"); - String new_lon = request.getParameter("new_lon"); - String new_alt_for_fpl = request.getParameter("new_alt_for_fpl"); - String dragged = request.getParameter("dragged"); - doFplUpdate(wpt_name,aircraft_id, wpt_id,new_alt, new_lat, new_lon, new_alt_for_fpl); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - - } - else if (order.equals("activate_block")){ - System.out.println("block activation requested !!!"); - String block_id = request.getParameter("block_id"); - String aircraft_id = request.getParameter("aircraft_id"); - doActivateBlock(block_id ,aircraft_id); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } - else if (order.equals("modif_setting")){ - System.out.println("modif setting requested !!!"); - String aircraft_id = request.getParameter("aircraft_id"); - String setting_id = request.getParameter("setting_id"); - String newsetting_value = request.getParameter("value"); - doModifSetting(aircraft_id,setting_id,newsetting_value); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } - else if (order.equals("create_user")){ - String login = request.getParameter("login"); - String pwd = request.getParameter("pwd"); - String right = request.getParameter("right"); - HashSet set_of_drone = null; - if (right.equals("user")){ - String liste_drone = request.getParameter("immats"); - StringTokenizer st = new StringTokenizer(liste_drone,";"); - set_of_drone = new HashSet(); - try{ - while (st.hasMoreTokens()) { - set_of_drone.add( st.nextToken()); - } - } - catch (NoSuchElementException ex){} - } - boolean res = doCreateUser(login,pwd,right,set_of_drone); - response.setContentType("text/xml"); - out.println(""); - if(res){ - out.println(""); - } - else{ - out.println(""); - } - out.println(""); - } - else if (order.equals("delete_user")){ - String login = request.getParameter("login"); - boolean res = doDeleteUser(login); - response.setContentType("text/xml"); - out.println(""); - if(res){ - out.println(""); - } - else{ - out.println(""); - } - out.println(""); - } - else if (order.equals("info_user")){ - String login = request.getParameter("login"); - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl"); - User usr = logTab.seek(login); - String right = getRight(usr.getRights()); - String liste = usr.getListDrone(); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } - else if (order.equals("modify_user")){ - String login = request.getParameter("login"); - String pwd = request.getParameter("pwd"); - String right = request.getParameter("right"); - String liste_drone = request.getParameter("liste_drone"); - StringTokenizer st = new StringTokenizer(liste_drone,";"); - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl"); - User usr = logTab.seek(login); - if (!pwd.equals("")) {usr.setPwd(pwd);} - usr.setRights(getRight(right)); - usr.clearListDrone(); - try{ - while (st.hasMoreTokens()) { - usr.addDrone(st.nextToken()); - } - } - catch (NoSuchElementException ex){} - logTab.serialize(default_folder + "/conf/"+"userTable.tbl"); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } - else if (order.equals("delete_drone")){ - String name = request.getParameter("name"); - try{ - DocumentBuilderFactory fabrique = DocumentBuilderFactory.newInstance(); - // création d'un constructeur de documents - DocumentBuilder constructeur = fabrique.newDocumentBuilder(); - // lecture du contenu d'un fichier XML avec DOM - File xml = new File(default_folder + "/conf/"+"immat.xml"); - Document document = constructeur.parse(xml); - NodeList dronenameList = document.getElementsByTagName("drone"); - Element root= (Element) document.getElementsByTagName("immat").item(0); - int i = 0; - boolean doIt = true; - // removing node - while(i"); - - if(!doIt) out.println(""); - else out.println(""); - - out.println(""); - }catch(ParserConfigurationException pce){ - System.out.println("Erreur de configuration du parseur DOM"); - System.out.println("lors de l'appel à fabrique.newDocumentBuilder();"); - }catch(SAXException se){ - System.out.println("Erreur lors du parsing du document"); - System.out.println("lors de l'appel à construteur.parse(xml)"); - }catch(IOException ioe){ - System.out.println("Erreur d'entrée/sortie"); - System.out.println("lors de l'appel à construteur.parse(xml)"); - } - } - else if (order.equals("add_drone")){ - String name = request.getParameter("name"); - try{ - DocumentBuilderFactory fabrique = DocumentBuilderFactory.newInstance(); - // création d'un constructeur de documents - DocumentBuilder constructeur = fabrique.newDocumentBuilder(); - // lecture du contenu d'un fichier XML avec DOM - File xml = new File(default_folder + "/conf/"+"immat.xml"); - Document document = constructeur.parse(xml); - Element root= (Element) document.getElementsByTagName("immat").item(0); - // inserting node - Element dronename = document.createElement("drone"); - dronename.setAttribute("name",name); - root.appendChild(dronename); - // save - writeXmlFile(document, default_folder + "/conf/"+"immat.xml"); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } catch(ParserConfigurationException pce){ - System.out.println("Erreur de configuration du parseur DOM"); - System.out.println("lors de l'appel à fabrique.newDocumentBuilder();"); - }catch(SAXException se){ - System.out.println("Erreur lors du parsing du document"); - System.out.println("lors de l'appel à construteur.parse(xml)"); - }catch(IOException ioe){ - System.out.println("Erreur d'entrée/sortie"); - System.out.println("lors de l'appel à construteur.parse(xml)"); - } - - } - else if (order.equals("delete_ivyusr")){ - String name = request.getParameter("login"); - boolean res ; - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userIvyTable.tbl"); - logTab.remove(name); - res = !logTab.isInside(name); - logTab.serialize(default_folder + "/conf/"+"userIvyTable.tbl"); - - response.setContentType("text/xml"); - out.println(""); - if(res){ - out.println(""); - } - else{ - out.println(""); - } - out.println(""); - - } - else if (order.equals("add_ivyusr")){ - String login = request.getParameter("login"); - String pwd = request.getParameter("pwd"); - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userIvyTable.tbl"); - User n = new User(login,pwd,Rights.IVY); - try{ - logTab.insert(n); - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } catch(AlreadyRegisteredUserException e){ - response.setContentType("text/xml"); - out.println(""); - out.println(""); - out.println(""); - } - logTab.serialize(default_folder + "/conf/"+"userIvyTable.tbl"); - } - } - out.close(); - // on envoie la reponse au client - /* response.setContentType("text/xml"); - response.setHeader("Cache-Control", "no-cache"); - PrintWriter out = response.getWriter(); - out.write("msg sended"); - out.close(); - */ - } - /* - * translate the right from string to a class - */ - private Rights getRight(String r) - { - if (r.equals("admin")) {return Rights.ADMIN;} - else if (r.equals("user")) {return Rights.USER;} - else {return Rights.VISITOR;} - } - /* - * translate the right from a class to a string - */ - private String getRight(Rights r) - { - if (r== Rights.ADMIN) {return "admin";} - else if (r== Rights.USER) {return "user";} - else {return "visitor";} - } - /* - * delete an user from the file which stores the users - */ - private boolean doDeleteUser(String login){ - boolean res ; - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl"); - logTab.remove(login); - res = !logTab.isInside(login); - logTab.serialize(default_folder + "/conf/"+"userTable.tbl"); - return res; - } - /* - * create an user in the file which stores the users - */ - private boolean doCreateUser(String login, String pwd,String right,Set set_of_drone){ - boolean res; - UserTab logTab = UserTab.unserialize(default_folder + "/conf/"+"userTable.tbl"); - Rights rght = this.getRight(right); - User usr = new User(login,pwd,rght); - if (rght==Rights.USER){ - Iterator itr = set_of_drone.iterator(); - while (itr.hasNext()){ - usr.addDrone(itr.next()); - } - } - try{ - logTab.insert(usr); - res = true; - logTab.serialize(default_folder + "/conf/"+"userTable.tbl"); - } - catch (AlreadyRegisteredUserException ex){ // existe deja - res = false; - } - return res; - - } - /* - * send an order to modif a setting of a drone which belongs to a specific ivy bus - */ - private void doModifSetting(String aircraft_web_id,String setting_id,String newsetting_value){ - String order = "DL_SETTING "+ aircraft_web_id + " " + setting_id + " " + newsetting_value; - sendOrder2Ivy(Integer.parseInt(aircraft_web_id),order); - } - /* - * send an order to jump to a new block for a drone which belongs to a specific ivy bus - */ - private void doActivateBlock(String block_id,String aircraft_web_id){ - // send msg via serveur.java - String order = "JUMP_TO_BLOCK " + aircraft_web_id + " " + block_id ; - sendOrder2Ivy(Integer.parseInt(aircraft_web_id),order); - } - /* - * send an order to move to a new waypoint for a drone which belongs to a specific ivy bus - */ - private void doFplUpdate(String wpt_name,String aircraft_web_id, String wpt_id, - String new_alt, String new_lat, String new_lon,String new_alt_for_fpl) { - // send msg via serveur.java - String order = "MOVE_WAYPOINT " + aircraft_web_id + " " + wpt_id + " " + new_lat + " " + new_lon + " " + new_alt ; - sendOrder2Ivy(Integer.parseInt(aircraft_web_id),order); - }// end method - - - // This method writes a DOM document to a file - private static void writeXmlFile(Document doc, String filename) - { - try { - // Prepare the DOM document for writing - Source source = new DOMSource(doc); - // Prepare the output file - File file = new File(filename); - Result result = new StreamResult(file); - // Write the DOM document to the file - Transformer xformer = TransformerFactory.newInstance().newTransformer(); - xformer.transform(source, result); } - catch (TransformerConfigurationException e) { } - catch (TransformerException e) { } - } - - - /* - * send an order to a specific ivybus via udp - */ - private void sendOrder2Ivy(int ac_web_id,String order) - { Conf myConf = new Conf(default_folder,"pow.conf"); - DatagramSocket socket; - try { - System.out.println("attempt to send order to ivy"); - socket = new DatagramSocket(myConf.portWebToIvy()); - socket.setSoTimeout(myConf.timeout()); - ServletContext srvCtxt = getServletContext(); - if (srvCtxt==null) System.out.println("srvCtxt null !!?"); - HashMap tableIvySession = (HashMap) srvCtxt.getAttribute("ivySessionTable"); - if ((socket!=null)&&(tableIvySession!=null)){ - byte buffer[] = new byte[myConf.taille()]; - Iterator> itr = tableIvySession.entrySet().iterator(); - BusIvy_ checked_bus=null; - boolean doIt=true; - while(itr.hasNext()&&doIt){ - checked_bus = itr.next().getValue().getBusIvy(); - if(checked_bus.isOwnBy(ac_web_id)){ - doIt = false ; - } - } - if(!doIt){ - InetAddress address = checked_bus.getAddress(); - SessionIvy session = tableIvySession.get(address); - AES aesCipher = session.getCipher(); - try{ - buffer = aesCipher.encrypt(order.getBytes()); - DatagramPacket DataEmitted = new DatagramPacket(buffer, buffer.length, address, myConf.portWebToIvy()); - try { - socket.send(DataEmitted); - System.out.println(" msg sended to ivy "+ address.toString()+":"+myConf.portWebToIvy()); - System.out.println("\t"+order); - //System.out.print("*"); - } catch (IOException e) { - System.out.println("erreur msg not sended to " +address.toString()+":"+myConf.portWebToIvy()); - e.printStackTrace(); - } - } catch (IOException e) { - System.out.println("erreur in encryption, msg not sended to " +address.toString()+":"+myConf.portWebToIvy()); - e.printStackTrace(); - } - catch(BadPaddingException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(order.getBytes())))); - } - catch(IllegalBlockSizeException ex){ - ex.printStackTrace(); - System.out.println("order := "+(new String(Hex.encodeHex(order.getBytes())))); - } - } - } - else - { - // error - System.out.println("unable to know socket udp or session "); - } - socket.close(); - } catch (SocketException e1) { - System.out.println("unable to open socket webtoIvy for an user request"); - e1.printStackTrace(); - } - } - -} diff --git a/sw/in_progress/pow/pow/src/pow/dbOrder.java b/sw/in_progress/pow/pow/src/pow/dbOrder.java deleted file mode 100644 index 9997edae3c..0000000000 --- a/sw/in_progress/pow/pow/src/pow/dbOrder.java +++ /dev/null @@ -1,14 +0,0 @@ -package pow; -/** - * represents 3 kind of message stored in database - * CONNECT first connection of an ivy bus --> inform db - * DECONNECT ivy bus deconnected --> inform db - * ADD add message to db - * @author genin - * - */ -public enum dbOrder { - CONNECT, - DECONNECT, - ADD -} diff --git a/sw/in_progress/pow/pow/src/pow/log.java b/sw/in_progress/pow/pow/src/pow/log.java deleted file mode 100644 index c9696309a0..0000000000 --- a/sw/in_progress/pow/pow/src/pow/log.java +++ /dev/null @@ -1,69 +0,0 @@ -package pow; -import java.io.*; -import java.util.Calendar; -/** - * Handles the writing of a log in a file - * @author genin - * - */ -public class log { - - private File oFile = null; - private FileWriter oFileWriter = null; - private BufferedWriter oBufferedWriter = null; - - public log(String path) - { - Calendar Today = Calendar.getInstance(); - String fileName = String.valueOf(Today.get(Calendar.DAY_OF_MONTH)) + - String.valueOf(Today.get(Calendar.MONTH)) + - String.valueOf(Today.get(Calendar.YEAR)) + - String.valueOf(Today.get(Calendar.HOUR_OF_DAY)) + - String.valueOf(Today.get(Calendar.MINUTE)) + - String.valueOf(Today.get(Calendar.SECOND)) + - ".log"; - - try - { - oFile = new File(path+"/log/" + fileName); - //System.out.println("log file to be created "); - oFile.createNewFile(); - //System.out.println("log file created "); - oFileWriter = new FileWriter(oFile); - oBufferedWriter = new BufferedWriter(oFileWriter); - - oBufferedWriter.write("##########################################"); oBufferedWriter.newLine(); - oBufferedWriter.write("########## PAPARAZZI ON THE WEB ##########"); oBufferedWriter.newLine(); - oBufferedWriter.write("##########################################"); oBufferedWriter.newLine(); - oBufferedWriter.newLine(); - oBufferedWriter.write("Beginning of log : "); oBufferedWriter.newLine(); - oBufferedWriter.newLine(); - oBufferedWriter.flush(); - } - catch(IOException ex) - { - System.out.println("No log file created "); - ex.printStackTrace(); - } - } - - public void write(String writing) - { - Calendar Now = Calendar.getInstance(); - String Time = String.valueOf(Now.get(Calendar.HOUR_OF_DAY)) + ":" + - String.valueOf(Now.get(Calendar.MINUTE)) + ":" + - String.valueOf(Now.get(Calendar.SECOND)); - writing = writing.trim(); - try - { - oBufferedWriter.write(Time + " -> " + writing); oBufferedWriter.newLine(); - oBufferedWriter.flush(); - System.out.println("log at : " + Time + " -> " + writing); - } - catch(IOException ex) - { - System.out.println(ex.getMessage()); - } - - } -} \ No newline at end of file diff --git a/sw/lib/ocaml/Makefile b/sw/lib/ocaml/Makefile index f69a0df8ae..d403f96eec 100644 --- a/sw/lib/ocaml/Makefile +++ b/sw/lib/ocaml/Makefile @@ -31,7 +31,7 @@ else endif INCLUDES= $(shell ocamlfind query -r -i-format xml-light) $(shell ocamlfind query -r -i-format netstring) $(shell ocamlfind query -r -i-format pcre) -XINCLUDES= -I +lablgl $(shell ocamlfind query -r -i-format lablgtk2) $(shell ocamlfind query -r -i-format xml-light) +XINCLUDES= $(shell ocamlfind query -r -i-format lablgtk2) $(shell ocamlfind query -r -i-format xml-light) OCAMLC=ocamlc OCAMLOPT=ocamlopt OCAMLLEX=ocamllex @@ -39,7 +39,7 @@ OCAMLYACC=ocamlyacc OCAMLLIBDIR=$(shell ocamlc -where) -SRC = fig.ml debug.ml base64.ml serial.ml ocaml_tools.ml expr_syntax.ml expr_parser.ml expr_lexer.ml extXml.ml env.ml xml2h.ml latlong.ml egm96.ml srtm.ml http.ml gm.ml iGN.ml geometry_2d.ml cserial.o convert.o ubx.ml pprz.ml xbee.ml logpprz.ml xmlCom.ml editAirframe.ml +SRC = fig.ml debug.ml base64.ml serial.ml ocaml_tools.ml expr_syntax.ml expr_parser.ml expr_lexer.ml extXml.ml env.ml xml2h.ml latlong.ml egm96.ml srtm.ml http.ml gm.ml iGN.ml geometry_2d.ml cserial.o convert.o ubx.ml pprz.ml xbee.ml logpprz.ml xmlCom.ml editAirframe.ml defivybus.ml CMO = $(SRC:.ml=.cmo) CMX = $(SRC:.ml=.cmx) diff --git a/sw/lib/ocaml/defivybus.ml b/sw/lib/ocaml/defivybus.ml new file mode 100644 index 0000000000..56ed92608a --- /dev/null +++ b/sw/lib/ocaml/defivybus.ml @@ -0,0 +1,51 @@ +(* + * $Id$ + * + * Default ivy bus address selection + * + * Copyright (C) 2011 Eric Parsonage + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + *) + +let read_process_output command = + let buffer_size = 2048 in + let buffer = Buffer.create buffer_size in + let string = String.create buffer_size in + let in_channel = Unix.open_process_in command in + let chars_read = ref 1 in + while !chars_read <> 0 do + chars_read := input in_channel string 0 buffer_size; + Buffer.add_substring buffer string 0 !chars_read + done; + ignore (Unix.close_process_in in_channel); + Buffer.contents buffer + +let contains s substring = + try ignore (Str.search_forward (Str.regexp_string substring) s 0); true + with Not_found -> false + +let default_ivy_bus = String.copy ( + try (Sys.getenv "IVY_BUS" ) + with Not_found -> + (if contains (read_process_output "uname") "Darwin" then + "224.255.255.255:2010" + else + "127.255.255.255:2010")) + diff --git a/sw/lib/ocaml/defivybus.mli b/sw/lib/ocaml/defivybus.mli new file mode 100644 index 0000000000..36578f90c5 --- /dev/null +++ b/sw/lib/ocaml/defivybus.mli @@ -0,0 +1 @@ +val default_ivy_bus : string \ No newline at end of file diff --git a/sw/lib/ocaml/gm.ml b/sw/lib/ocaml/gm.ml index 3af720cae4..00d266b78d 100644 --- a/sw/lib/ocaml/gm.ml +++ b/sw/lib/ocaml/gm.ml @@ -196,7 +196,7 @@ let ms_key = fun key -> done; (ms_key, ms_key.[n-2]) -let google_version = 65 +let google_version = 76 let url_of_tile_key = fun maps_source s -> let (x, y, z) = xyz_of_qsrt s in diff --git a/sw/lib/ocaml/gtk_tools.ml b/sw/lib/ocaml/gtk_tools.ml index d44d88a0d9..f3a0fe0ddf 100644 --- a/sw/lib/ocaml/gtk_tools.ml +++ b/sw/lib/ocaml/gtk_tools.ml @@ -106,3 +106,47 @@ let combo_connect = fun ((combo: #GEdit.combo_box), (_,column)) cb -> let data = combo#model#get ~row ~column in cb data)) + +type tree = GTree.view * (GTree.list_store * string GTree.column) +let tree_widget = fst +let tree_model = snd + +let tree = fun (t:GTree.view) -> + let cols = new GTree.column_list in + let col_name = cols#add Gobject.Data.string in + let store = GTree.list_store cols in + t#set_model (Some store#coerce); + let col1 = GTree.view_column ~renderer:(GTree.cell_renderer_text [], ["text",col_name]) () in + ignore (t#append_column col1); + (t , (store, col_name)) + +let tree_of = fun (t:GTree.view) (m:(GTree.list_store * string GTree.column)) -> + (t, m) + +let tree_values = fun (tree : tree) -> + let (store, column) = tree_model tree in + let values = ref "" in + store#foreach (fun _ row -> + values := !values^" "^(store#get ~row ~column); + false); + !values + +let get_selected_in_tree = fun (tree : tree) -> + let (store, column) = tree_model tree in + let t = tree_widget tree in + let sel_paths = t#selection#get_selected_rows in + List.map (fun p -> store#get_row_reference p) sel_paths + +let add_to_tree = fun (tree : tree) string -> + let (store, column) = tree_model tree in + let row = store#append () in + store#set ~row ~column string + +let remove_selected_from_tree = fun (tree : tree) -> + let selected = get_selected_in_tree tree in + let (store, _) = tree_model tree in + List.iter (fun r -> ignore (store#remove r#iter)) selected + +let clear_tree = fun (tree : tree) -> + let (store, _) = tree_model tree in + store#clear () diff --git a/sw/lib/ocaml/gtk_tools.mli b/sw/lib/ocaml/gtk_tools.mli index c5489d68a6..678be6a30a 100644 --- a/sw/lib/ocaml/gtk_tools.mli +++ b/sw/lib/ocaml/gtk_tools.mli @@ -58,3 +58,17 @@ val combo_separator : string val combo_value : combo -> string val select_in_combo : combo -> string -> unit val combo_connect : combo -> (string -> unit) -> unit + +(*** Utilities for a tree view widget ***) +type tree +val tree_widget : tree -> GTree.view +val tree_model : tree -> (GTree.list_store * string GTree.column) + +val tree : GTree.view -> tree +val tree_of : GTree.view -> (GTree.list_store * string GTree.column) -> tree + +val tree_values : tree -> string +val get_selected_in_tree : tree -> GTree.row_reference list +val add_to_tree : tree -> string -> unit +val remove_selected_from_tree : tree -> unit +val clear_tree : tree -> unit diff --git a/sw/lib/ocaml/ivy/cglibivy.c b/sw/lib/ocaml/ivy/cglibivy.c index 228246d85f..8241b70fc2 100644 --- a/sw/lib/ocaml/ivy/cglibivy.c +++ b/sw/lib/ocaml/ivy/cglibivy.c @@ -20,8 +20,8 @@ value ivy_GtkmainLoop(value unit) } extern void cb_delete_channel(void *delete_read); -extern void cb_read_channel(Channel ch, HANDLE fd, void *closure); -extern void cb_write_channel(Channel ch, HANDLE fd, void *closure); +extern void cb_read_channel(Channel ch, IVY_HANDLE fd, void *closure); +extern void cb_write_channel(Channel ch, IVY_HANDLE fd, void *closure); value ivy_GtkchannelSetUp(value fd, value closure_name) { @@ -29,9 +29,9 @@ value ivy_GtkchannelSetUp(value fd, value closure_name) value * closure = caml_named_value(String_val(closure_name)); #if IVYMINOR_VERSION == 8 - c = IvyChannelAdd((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); + c = IvyChannelAdd((IVY_HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); #else - c = IvyChannelAdd((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel, cb_write_channel); + c = IvyChannelAdd((IVY_HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel, cb_write_channel); #endif return Val_int(c); } diff --git a/sw/lib/ocaml/ivy/civy.c b/sw/lib/ocaml/ivy/civy.c index 15561182d4..563f7ec517 100644 --- a/sw/lib/ocaml/ivy/civy.c +++ b/sw/lib/ocaml/ivy/civy.c @@ -83,11 +83,11 @@ void cb_delete_channel(void *delete_read) { } -void cb_write_channel(Channel ch, HANDLE fd, void *closure) +void cb_write_channel(Channel ch, IVY_HANDLE fd, void *closure) { } -void cb_read_channel(Channel ch, HANDLE fd, void *closure) +void cb_read_channel(Channel ch, IVY_HANDLE fd, void *closure) { callback(*(value*)closure, Val_int(ch)); } diff --git a/sw/lib/ocaml/ivy/civyloop.c b/sw/lib/ocaml/ivy/civyloop.c index 4ff0a9311f..083b104ee1 100644 --- a/sw/lib/ocaml/ivy/civyloop.c +++ b/sw/lib/ocaml/ivy/civyloop.c @@ -39,8 +39,8 @@ value ivy_timerRepeatafter(value nb_ticks,value delay, value closure_name) read closures */ extern void cb_delete_channel(void *delete_read); -extern void cb_read_channel(Channel ch, HANDLE fd, void *closure); -extern void cb_write_channel(Channel ch, HANDLE fd, void *closure); +extern void cb_read_channel(Channel ch, IVY_HANDLE fd, void *closure); +extern void cb_write_channel(Channel ch, IVY_HANDLE fd, void *closure); value ivy_channelSetUp(value fd, value closure_name) @@ -49,9 +49,9 @@ value ivy_channelSetUp(value fd, value closure_name) value * closure = caml_named_value(String_val(closure_name)); #if IVYMINOR_VERSION == 8 - c = IvyChannelAdd((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); + c = IvyChannelAdd((IVY_HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); #else - c = IvyChannelAdd((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel, cb_write_channel); + c = IvyChannelAdd((IVY_HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel, cb_write_channel); #endif return Val_int(c); } diff --git a/sw/lib/ocaml/ivy/ctkivy.c b/sw/lib/ocaml/ivy/ctkivy.c index ae31560816..87b7eb617d 100644 --- a/sw/lib/ocaml/ivy/ctkivy.c +++ b/sw/lib/ocaml/ivy/ctkivy.c @@ -11,7 +11,7 @@ #include "ivytcl.h" extern void cb_delete_channel(void *delete_read); -extern void cb_read_channel(Channel ch, HANDLE fd, void *closure); +extern void cb_read_channel(Channel ch, IVY_HANDLE fd, void *closure); value ivy_TclmainLoop(value unit) { @@ -25,7 +25,7 @@ value ivy_TclchannelSetUp(value fd, value closure_name) Channel c; value * closure = caml_named_value(String_val(closure_name)); - c = IvyTclChannelSetUp((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); + c = IvyTclChannelSetUp((IVY_HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); return Val_int(c); } diff --git a/sw/lib/ocaml/ivy/debian/changelog.3.11.2 b/sw/lib/ocaml/ivy/debian/changelog.3.11.2 index eb649f9b77..e365e33921 100644 --- a/sw/lib/ocaml/ivy/debian/changelog.3.11.2 +++ b/sw/lib/ocaml/ivy/debian/changelog.3.11.2 @@ -1,3 +1,9 @@ +ivy-ocaml (1.1-12) unstable; urgency=low + + * Support for ivy-c_3.11.8 + + -- Gautier Hattenberger Wed, 02 Feb 2011 17:49:31 +0100 + ivy-ocaml (1.1-11) unstable; urgency=low * Support of ivy-c_3.11.6, OSX and Linux 64bit diff --git a/sw/logalizer/play_core.ml b/sw/logalizer/play_core.ml index 749901e3ab..132e42c1ae 100644 --- a/sw/logalizer/play_core.ml +++ b/sw/logalizer/play_core.ml @@ -118,7 +118,8 @@ let load_log = fun xml_file -> let timer = ref None let was_running = ref false -let bus = ref "127.255.255.255:2010" + +let bus = ref Defivybus.default_ivy_bus let port = ref "/dev/ttyUSB0" let baudrate = ref "9600" let file_to_load = ref "" @@ -173,7 +174,7 @@ let play = fun ?(no_gui=false) serial_port adj speed -> let init = fun () -> Arg.parse - [ "-b", Arg.String (fun x -> bus := x), "Bus\tDefault is 127.255.255.25:2010"; + [ "-b", Arg.String (fun x -> bus := x), (sprintf " Default is %s" !bus); "-d", Arg.Set_string port, (sprintf " Default is %s" !port); "-o", Arg.Set output_on_serial, "Output binary messages on serial port"; "-s", Arg.Set_string baudrate, (sprintf " Default is %s" !baudrate)] diff --git a/sw/logalizer/plotter.ml b/sw/logalizer/plotter.ml index 4880bfb996..ab796a1405 100644 --- a/sw/logalizer/plotter.ml +++ b/sw/logalizer/plotter.ml @@ -522,7 +522,7 @@ let rec plot_window = fun window -> let _ = - let ivy_bus = ref "127.255.255.255:2010" + let ivy_bus = ref Defivybus.default_ivy_bus and init = ref [default_window] in let add_init = fun s -> @@ -541,7 +541,7 @@ let _ = | x::xs -> init := {x with geometry = s} :: xs in Arg.parse - [ "-b", Arg.String (fun x -> ivy_bus := x), " Bus\tDefault is 127.255.255.255:2010"; + [ "-b", Arg.String (fun x -> ivy_bus := x), (sprintf " Default is %s" !ivy_bus); "-c", Arg.String (fun x -> add_init x), " Add a curve (e.g. '*:telemetry:BAT:voltage'). The curve is inserted into the last open window (cf -n option)"; (* no code yet *) diff --git a/sw/simulator/Makefile b/sw/simulator/Makefile index c0e61dc230..f0f124b9d1 100644 --- a/sw/simulator/Makefile +++ b/sw/simulator/Makefile @@ -1,6 +1,5 @@ - # Paparazzi simulator $Id$ -# +# # Copyright (C) 2003-2006 Pascal Brisset, Antoine Drouin # # This file is part of paparazzi. @@ -18,14 +17,14 @@ # You should have received a copy of the GNU General Public License # along with paparazzi; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# Boston, MA 02111-1307, USA. # Quiet compilation Q=@ LBITS := $(shell getconf LONG_BIT) ifeq ($(LBITS),64) - FPIC = -ccopt -fPIC + FPIC = -ccopt -fPIC else FPIC = endif @@ -42,6 +41,8 @@ SIMSCMX=$(SIMSML:%.ml=%.cmx) OCAMLC = ocamlc -g OCAMLOPT=ocamlopt +OCAML=$(shell which ocaml) +OCAMLRUN=$(shell which ocamlrun) INCLUDES= $(shell ocamlfind query -r -i-format lablgtk2) -I ../lib/ocaml $(shell ocamlfind query -r -i-format xml-light) AIRBORNE = ../airborne @@ -58,10 +59,10 @@ simhitl : fg.o $(SIMHCMO) simhitl.cmo sitl.cma : fg.o $(SIMSCMO) @echo OL $@ - $(Q)ocamlmklib -o sitl $^ + $(Q)ocamlmklib -o sitl $^ sitl.cmxa : $(SIMSCMX) - ocamlopt -o $@ -a $^ + ocamlopt -o $@ -a $^ gaia : gaia.cmo @echo OL $@ @@ -90,6 +91,9 @@ diffusion : stdlib.cmo diffusion.cmo clean : rm -f *.cm* *~ *.out .depend *.o *.a *.so gaia simhitl booz_sim test2 +launchsitl : + cat ../../src/$(@F) | sed s#OCAMLRUN#$(OCAMLRUN)# | sed s#OCAML#$(OCAML)# > $@ + chmod a+x $@ # @@ -99,6 +103,6 @@ clean : .depend: ocamldep *.ml* > .depend -ifneq ($(MAKECMDGOALS),clean) +ifneq ($(MAKECMDGOALS),clean) -include .depend endif diff --git a/sw/simulator/diffusion.ml b/sw/simulator/diffusion.ml index cfe0b76f49..47c4d829e7 100644 --- a/sw/simulator/diffusion.ml +++ b/sw/simulator/diffusion.ml @@ -27,8 +27,8 @@ let mixing_length = 5. (* m/s *) let wind_x = ref 0. let wind_y = ref 0. -let ivy_bus = ref "127.255.255.255:2010" +let ivy_bus = Defivybus.default_ivy_bus let plumes = Hashtbl.create 97 let t = ref 0 diff --git a/sw/simulator/flight_gear.h b/sw/simulator/flight_gear.h index c51349f384..b5515c89cb 100644 --- a/sw/simulator/flight_gear.h +++ b/sw/simulator/flight_gear.h @@ -95,6 +95,7 @@ struct FGNetCtrls { #define FG_NET_FDM_MAX_WHEELS 3 #define FG_NET_FDM_MAX_TANKS 4 +#ifndef _NET_FDM_HXX struct FGNetFDM { @@ -180,6 +181,8 @@ struct FGNetFDM { float spoilers; }; +#endif + struct FGNetMiniFDM { uint32_t version; // increment when data values change @@ -207,6 +210,11 @@ struct FGNetMiniFDM { #define FG_NET_GUI_VERSION 7 #define FG_NET_GUI_MAX_TANKS 4 + +#ifdef __x86_64__ +#pragma pack(push) +#pragma pack(4) +#endif struct FGNetGUI { uint32_t version; // increment when data values change @@ -241,6 +249,11 @@ struct FGNetGUI { float course_deviation_deg; // degrees off target course float gs_deviation_deg; // degrees off target glide slope }; +#ifdef __x86_64__ +#pragma pack(push) +#pragma pack(pop) +#endif + extern void net_fdm_dump (struct FGNetFDM* fdm); extern void net_fdm_ntoh (struct FGNetFDM* fdm); diff --git a/sw/simulator/gaia.ml b/sw/simulator/gaia.ml index d145f7de84..6ccc2b99a8 100644 --- a/sw/simulator/gaia.ml +++ b/sw/simulator/gaia.ml @@ -32,7 +32,7 @@ let sending_period = 5000 (* ms *) module Ground_Pprz = Pprz.Messages(struct let name = "ground" end) -let ivy_bus = ref "127.255.255.255:2010" +let ivy_bus = ref Defivybus.default_ivy_bus let parse_args = fun () -> let options = diff --git a/sw/simulator/nps/nps_autopilot.h b/sw/simulator/nps/nps_autopilot.h index a6c7101153..9e6c5b8438 100644 --- a/sw/simulator/nps/nps_autopilot.h +++ b/sw/simulator/nps/nps_autopilot.h @@ -6,7 +6,7 @@ #include "nps_radio_control.h" struct NpsAutopilot { - double commands[SERVOS_NB]; + double commands[COMMANDS_NB]; }; extern struct NpsAutopilot autopilot; diff --git a/sw/simulator/nps/nps_autopilot_booz.c b/sw/simulator/nps/nps_autopilot_booz.c index 81c892fa77..80f3f0bbfd 100644 --- a/sw/simulator/nps/nps_autopilot_booz.c +++ b/sw/simulator/nps/nps_autopilot_booz.c @@ -5,7 +5,8 @@ #include "nps_radio_control.h" #include "subsystems/radio_control.h" #include "subsystems/imu.h" -#include "firmwares/rotorcraft/baro.h" +#include "subsystems/sensors/baro.h" +#include "baro_board.h" #include "firmwares/rotorcraft/battery.h" #include "actuators/supervision.h" diff --git a/sw/simulator/nps/nps_fdm_jsbsim.c b/sw/simulator/nps/nps_fdm_jsbsim.c index 5d5a726c9a..a2d27decd6 100644 --- a/sw/simulator/nps/nps_fdm_jsbsim.c +++ b/sw/simulator/nps/nps_fdm_jsbsim.c @@ -4,7 +4,6 @@ #include #include #include "nps_fdm.h" -#include "6dof.h" #include "generated/airframe.h" #include "math/pprz_geodetic.h" #include "math/pprz_geodetic_double.h" @@ -64,7 +63,7 @@ static void feed_jsbsim(double* commands) { string property; int i; - for (i=0; iGetPropertyManager()->SetDouble(property,commands[i]); diff --git a/sw/simulator/nps/nps_flightgear.c b/sw/simulator/nps/nps_flightgear.c index 59083cca44..af165b94f1 100644 --- a/sw/simulator/nps/nps_flightgear.c +++ b/sw/simulator/nps/nps_flightgear.c @@ -7,55 +7,14 @@ #include #include + #include "std.h" - -#define FG_NET_GUI_VERSION 7 -#define FG_NET_GUI_MAX_TANKS 4 -struct FGNetGUI { - uint32_t version; // increment when data values change - - // Positions - double longitude; // geodetic (radians) - double latitude; // geodetic (radians) - float altitude; // above sea level (meters) - float agl; // above ground level (meters) - float phi; // roll (radians) - float theta; // pitch (radians) - float psi; // yaw or true heading (radians) - - // Velocities - float vcas; - float climb_rate; // feet per second - - // Consumables - uint32_t num_tanks; // Max number of fuel tanks - float fuel_quantity[FG_NET_GUI_MAX_TANKS]; - - // Environment - uint32_t cur_time; // current unix time - // FIXME: make this uint64_t before 2038 - uint32_t warp; // offset in seconds to unix time - float ground_elev; // ground elev (meters) - - // Approach - float tuned_freq; // currently tuned frequency - float nav_radial; // target nav radial - uint32_t in_range; // tuned navaid is in range? - float dist_nm; // distance to tuned navaid in nautical miles - float course_deviation_deg; // degrees off target course - float gs_deviation_deg; // degrees off target glide slope -}; - - - - +#include "../flight_gear.h" #include "nps_fdm.h" static struct { int socket; struct sockaddr_in addr; - - } flightgear; diff --git a/sw/simulator/nps/nps_sensors_utils.c b/sw/simulator/nps/nps_sensors_utils.c index 7252ee61ec..0911fed2eb 100644 --- a/sw/simulator/nps/nps_sensors_utils.c +++ b/sw/simulator/nps/nps_sensors_utils.c @@ -1,7 +1,6 @@ #include "nps_sensors_utils.h" //#include -#include "6dof.h" #include "math/pprz_algebra.h" void UpdateSensorLatency(double time, gpointer cur_reading, GSList **history, double latency, gpointer sensor_reading) { diff --git a/sw/simulator/sim.ml b/sw/simulator/sim.ml index e600d781b9..06fb54418f 100644 --- a/sw/simulator/sim.ml +++ b/sw/simulator/sim.ml @@ -77,7 +77,7 @@ external fg_msg : string -> float -> float -> float -> float -> float -> float - let ac_name = ref "A/C not set" -let ivy_bus = ref "127.255.255.255:2010" +let ivy_bus = ref Defivybus.default_ivy_bus let fg_client = ref "" @@ -86,7 +86,7 @@ let autolaunch = ref false let noground = ref false let common_options = [ - "-b", Arg.Set_string ivy_bus, "Bus\tDefault is 127.255.255.25:2010"; + "-b", Arg.Set_string ivy_bus, (sprintf " Default is %s" !ivy_bus); "-boot", Arg.Set autoboot, "Boot the A/C on start"; "-launch", Arg.Set autolaunch, "Launch the A/C on start"; "-noground", Arg.Set noground, "Disable ground detection"; diff --git a/sw/simulator/sim_ac_flightgear.c b/sw/simulator/sim_ac_flightgear.c new file mode 100644 index 0000000000..e747fb8a01 --- /dev/null +++ b/sw/simulator/sim_ac_flightgear.c @@ -0,0 +1,103 @@ +/* + * $Id$ + * + * Copyright (C) 2011 Eric Parsonage eric@eparsonage.com + * Mainly based around the equivalent file in nps + * which was written by Antoine + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +#include +#include +#include +#include +#include +#include +#include "std.h" +#include +#include "flight_gear.h" +#include "sim_ac_flightgear.h" + +static struct +{ + int socket; + struct sockaddr_in addr; +} flightgear; + + +void sim_ac_flightgear_init(const char* host, unsigned int port) +{ + int so_reuseaddr = 1; + struct protoent * pte = getprotobyname("UDP"); + flightgear.socket = socket( PF_INET, SOCK_DGRAM, pte->p_proto); + setsockopt(flightgear.socket, SOL_SOCKET, SO_REUSEADDR, + &so_reuseaddr, sizeof(so_reuseaddr)); + flightgear.addr.sin_family = PF_INET; + flightgear.addr.sin_port = htons(port); + flightgear.addr.sin_addr.s_addr = inet_addr(host); +} + +static inline double get_value(JSBSim::FGFDMExec* FDMExec, string name) +{ + return FDMExec->GetPropertyManager()->GetNode(name)->getDoubleValue(); +} + +void sim_ac_flightgear_send(JSBSim::FGFDMExec* FDMExec) +{ + + struct FGNetGUI gui; + + gui.version = FG_NET_GUI_VERSION; + + gui.latitude = get_value(FDMExec, "position/lat-gc-rad"); + gui.longitude = get_value(FDMExec, "position/long-gc-rad"); + gui.altitude = get_value(FDMExec, "position/h-sl-meters"); + // printf("%f %f %f\n", gui.latitude, gui.longitude, gui.altitude); + + gui.agl = 1.111652; + + gui.phi = get_value(FDMExec, "attitude/roll-rad"); + gui.theta = get_value(FDMExec, "attitude/pitch-rad"); + gui.psi = get_value(FDMExec, "attitude/heading-true-rad"); + + gui.vcas = 0.; + gui.climb_rate = 0.; + + gui.num_tanks = 1; + gui.fuel_quantity[0] = get_value(FDMExec, "propulsion/total-fuel-lbs");; + + //gui.cur_time = 3198060679ul; + //gui.cur_time = 3198060679ul + rint(fdm.time); + gui.cur_time = 3198101679ul; + gui.warp = 1122474394ul; + + gui.ground_elev = 0.; + + gui.tuned_freq = 125.65; + gui.nav_radial = 90.; + gui.in_range = 1; + gui.dist_nm = 10.; + gui.course_deviation_deg = 0.; + gui.gs_deviation_deg = 0.; + + if (sendto(flightgear.socket, (char*)(&gui), sizeof(gui), 0, + (struct sockaddr*)&flightgear.addr, sizeof(flightgear.addr)) == -1) + printf("error sending\n"); + +} diff --git a/sw/simulator/sim_ac_flightgear.h b/sw/simulator/sim_ac_flightgear.h new file mode 100644 index 0000000000..0139c15b6b --- /dev/null +++ b/sw/simulator/sim_ac_flightgear.h @@ -0,0 +1,8 @@ +#ifndef SIM_AC_FLIGHTGEAR_H +#define SIM_AC_FLIGHTGEAR_H + + +void sim_ac_flightgear_init(const char* host, unsigned int port); +void sim_ac_flightgear_send(JSBSim::FGFDMExec* FDMExec); + +#endif /* SIM_AC_FLIGHTGEAR_H */ diff --git a/sw/simulator/sim_ac_jsbsim.c b/sw/simulator/sim_ac_jsbsim.c index 3d81350f87..3806af2909 100644 --- a/sw/simulator/sim_ac_jsbsim.c +++ b/sw/simulator/sim_ac_jsbsim.c @@ -22,7 +22,7 @@ * */ -#include "sim_ac_jsbsim.h" + #include #include @@ -30,16 +30,24 @@ #include #include + +#include +//#include +#include +#include "sim_ac_flightgear.h" + using namespace std; //#include #include +#include "sim_ac_jsbsim.h" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GLOBAL DATA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ bool run_model; +bool run_fg = false; string ICName; string AircraftName; @@ -50,6 +58,8 @@ static void sim_init(void); static gboolean sim_periodic(gpointer data); string ivyBus = "127.255.255.255"; +string fgAddress = "127.0.0.1"; + static void ivy_transport_init(void); @@ -69,26 +79,35 @@ static void sim_init(void) { } static gboolean sim_periodic(gpointer data __attribute__ ((unused))) { + static uint8_t ncalls = 0; /* read actuators positions and feed JSBSim inputs */ copy_inputs_to_jsbsim(FDMExec); - + /* run JSBSim flight model */ bool result = true; if (run_model) { result = FDMExec->Run(); } /* check if still flying */ - //result = check_crash_jsbsim(FDMExec); + result = check_crash_jsbsim(FDMExec); - /* read outputs from model state (and display ?) */ + /* read outputs from model state */ copy_outputs_from_jsbsim(FDMExec); + + /* send outputs to flightgear for visualisation */ + if (run_fg == true) + sim_ac_flightgear_send(FDMExec); - /* run the airborne code */ - + /* run the airborne code + with 60 Hz, even if JSBSim runs with a multiple of this */ + if (ncalls == 0) { // airborne_run_one_step(); autopilot_event_task(); autopilot_periodic_task(); + } + ++ncalls; + if (ncalls == JSBSIM_SPEEDUP) ncalls = 0; return result; } @@ -99,6 +118,9 @@ int main ( int argc, char** argv) { sim_parse_options(argc, argv); sim_init(); + + if (run_fg == true) + sim_ac_flightgear_init(fgAddress.c_str(), 5501); GMainLoop *ml = g_main_loop_new(NULL, FALSE); @@ -154,8 +176,8 @@ static void sim_parse_options(int argc, char** argv) { ivyBus = string(argv[++i]); } else if (argument == "-fg") { - // TODO - i++; + run_fg = true; + fgAddress = string(argv[++i]); } else { cerr << "Unknown argument" << endl; @@ -166,6 +188,13 @@ static void sim_parse_options(int argc, char** argv) { } + + + + + + + void jsbsim_init(void) { // *** SET UP JSBSIM *** // @@ -214,13 +243,21 @@ void jsbsim_init(void) { } } else { + + // FGInitialCondition::SetAltitudeASLFtIC + // requires this function to be called + // before itself + IC->SetVgroundFpsIC(0.); + // Use flight plan initial conditions IC->SetLatitudeDegIC(NAV_LAT0 / 1e7); IC->SetLongitudeDegIC(NAV_LON0 / 1e7); - IC->SetAltitudeAGLFtIC(0.0 / FT2M); + + IC->SetAltitudeASLFtIC(GROUND_ALT / FT2M); IC->SetTerrainElevationFtIC(GROUND_ALT / FT2M); IC->SetPsiDegIC(QFU); IC->SetVgroundFpsIC(0.); + //initRunning for all engines FDMExec->GetPropulsion()->InitRunning(-1); if (!FDMExec->RunIC()) { @@ -245,10 +282,25 @@ void jsbsim_init(void) { } bool check_crash_jsbsim(JSBSim::FGFDMExec* FDMExec) { - double agl = FDMExec->GetPropertyManager()->GetNode("position/h-agl-ft")->getDoubleValue(); - if (agl>=0) return true; - else { - cerr << "Crash detected" << endl; + + double agl = FDMExec->GetPropagate()->GetDistanceAGL(), // in ft + lat = FDMExec->GetPropagate()->GetLatitude(), // in rad + lon = FDMExec->GetPropagate()->GetLongitude(); // in rad + + if (agl< -1e-5) { + cerr << "Crash detected: agl < 0" << endl << endl; return false; } + if (agl > 1e5 || abs(lat) > M_PI_2 || abs(lon) > M_PI) { + cerr << "Simulation divergence: Lat=" << lat + << " rad, lon=" << lon << " rad, agl=" << agl << " ft" << endl + << endl; + return false; + } + + if (isnan(agl) || isnan(lat) || isnan(lon)) { + cerr << "JSBSim is producing NaNs. Exiting." << endl << endl; + return false; + } + return true; } diff --git a/sw/simulator/sim_ac_jsbsim.h b/sw/simulator/sim_ac_jsbsim.h index 78eea8915b..44f3a8c7f5 100644 --- a/sw/simulator/sim_ac_jsbsim.h +++ b/sw/simulator/sim_ac_jsbsim.h @@ -35,11 +35,13 @@ #include -/* 60Hz <-> 17ms */ #ifndef JSBSIM_PERIOD -#define JSBSIM_PERIOD 17 +#define JSBSIM_SPEEDUP 4 ///< how many JSBSim calls per A/P control loop call? +#define JSBSIM_PERIOD (1000.0/CONTROL_RATE/JSBSIM_SPEEDUP) ///< JSBSim timestep in milliseconds +#else +#define JSBSIM_SPEEDUP ((uint8_t) (1000./CONTROL_RATE/JSBSIM_PERIOD)) #endif -#define DT (JSBSIM_PERIOD*1e-3) +#define DT (JSBSIM_PERIOD*1e-3) ///< JSBSim timestep in seconds #define RAD2DEG 57.29578 #define FT2M 0.3048 diff --git a/sw/supervision/paparazzicenter.glade b/sw/supervision/paparazzicenter.glade index 95fbacff9d..cee69a6eb5 100644 --- a/sw/supervision/paparazzicenter.glade +++ b/sw/supervision/paparazzicenter.glade @@ -102,6 +102,7 @@ gtk-new True + True True @@ -111,6 +112,7 @@ gtk-delete True + True True @@ -154,6 +156,7 @@ gtk-new True + True True @@ -162,6 +165,7 @@ gtk-save True + True True @@ -542,38 +546,76 @@ True - + + 4 True - _________________ - True + True + False 0 - - ... + True - True - False - Browse (multiple selection allowed) - True False - False 1 - - gtk-edit + True - True - False - Launch an editor on the _first_ settings file - True + + + gtk-add + True + True + True + True + Add a settings file + True + True + + + False + False + 0 + + + + + gtk-edit + True + True + True + True + Launch an editor on all the settings file + True + + + False + False + 1 + + + + + gtk-remove + True + True + True + Remove the selected settings file + True + + + False + False + 2 + + False diff --git a/sw/supervision/pc_aircraft.ml b/sw/supervision/pc_aircraft.ml index 4c17ccb93d..97d54c82a8 100644 --- a/sw/supervision/pc_aircraft.ml +++ b/sw/supervision/pc_aircraft.ml @@ -40,7 +40,7 @@ let aircraft_sample = fun name ac_id -> Xml.Element ("aircraft", ["name", name; "ac_id", ac_id; - "airframe", "airframes/microjet5.xml"; + "airframe", "airframes/microjet_example.xml"; "radio", "radios/cockpitSX.xml"; "telemetry", "telemetry/default.xml"; "flight_plan", "flight_plans/basic.xml"; @@ -96,12 +96,21 @@ let gcs_or_edit = fun file -> | 2 -> ignore (Sys.command (sprintf "%s -edit '%s'&" gcs file)) | _ -> failwith "Internal error: gcs_or_edit" -let ac_files = fun gui -> - ["airframe", "airframes", gui#label_airframe, gui#button_browse_airframe, gui#button_edit_airframe, edit, false; - "flight_plan", "flight_plans", gui#label_flight_plan, gui#button_browse_flight_plan, gui#button_edit_flight_plan, gcs_or_edit, false; - "settings", "settings", gui#label_settings, gui#button_browse_settings, gui#button_edit_settings, edit, true; - "radio", "radios", gui#label_radio, gui#button_browse_radio, gui#button_edit_radio, edit, false; - "telemetry", "telemetry", gui#label_telemetry, gui#button_browse_telemetry, gui#button_edit_telemetry, edit, false] +type ac_data = + Label of GMisc.label + | Tree of Gtk_tools.tree + +let string_of_ac_data = fun d -> + match d with + Label l -> l#text + | Tree t -> Gtk_tools.tree_values t + +let ac_files = fun gui model -> + ["airframe", "airframes", Label gui#label_airframe, gui#button_browse_airframe, gui#button_edit_airframe, edit, None; + "flight_plan", "flight_plans", Label gui#label_flight_plan, gui#button_browse_flight_plan, gui#button_edit_flight_plan, gcs_or_edit, None; + "settings", "settings", Tree (Gtk_tools.tree_of gui#tree_settings model), gui#button_browse_settings, gui#button_edit_settings, edit, Some gui#button_remove_settings; + "radio", "radios", Label gui#label_radio, gui#button_browse_radio, gui#button_edit_radio, edit, None; + "telemetry", "telemetry", Label gui#label_telemetry, gui#button_browse_telemetry, gui#button_edit_telemetry, edit, None] (* Awful but easier *) @@ -124,7 +133,8 @@ let correct_ac_name = fun s -> with Exit -> false -let save_callback = fun ?user_save gui ac_combo () -> + (*TODO function text of date_type*) +let save_callback = fun ?user_save gui ac_combo model () -> let ac_name = Gtk_tools.combo_value ac_combo and ac_id = gui#entry_ac_id#text in @@ -133,6 +143,7 @@ let save_callback = fun ?user_save gui ac_combo () -> GToolbox.message_box ~title:"Error on A/C id" "A/C id must be a non null number less than 255" else let color = !current_color in + let tree = Gtk_tools.tree_of gui#tree_settings model in let aircraft = Xml.Element ("aircraft", ["name", ac_name; @@ -141,7 +152,7 @@ let save_callback = fun ?user_save gui ac_combo () -> "radio", gui#label_radio#text; "telemetry", gui#label_telemetry#text; "flight_plan", gui#label_flight_plan#text; - "settings", gui#label_settings#text; + "settings", Gtk_tools.tree_values tree; "gui_color", color], []) in begin try Hashtbl.remove Utils.aircrafts ac_name with _ -> () end; @@ -205,31 +216,43 @@ let parse_ac_targets = fun target_combo ac_file -> (* Link A/C to airframe & flight_plan labels *) let ac_combo_handler = fun gui (ac_combo:Gtk_tools.combo) target_combo -> + (* build tree for settings *) + let tree_set = Gtk_tools.tree gui#tree_settings in + let model = Gtk_tools.tree_model tree_set in + (* attach vertical scrollbar *) + gui#tree_settings#set_vadjustment gui#tree_settings_scrollbar#adjustment; + + (* Update_params callback *) let update_params = fun ac_name -> try let aircraft = Hashtbl.find Utils.aircrafts ac_name in let sample = aircraft_sample ac_name "42" in let value = fun a -> - try (ExtXml.attrib aircraft a) with _ -> Xml.attrib sample a in - List.iter - (fun (a, _subdir, label, _, _, _, _) -> label#set_text (value a)) - (ac_files gui); - let ac_id = ExtXml.attrib aircraft "ac_id" - and gui_color = ExtXml.attrib_or_default aircraft "gui_color" "white" in - gui#button_clean#misc#set_sensitive true; - gui#button_build#misc#set_sensitive true; - gui#eventbox_gui_color#misc#modify_bg [`NORMAL, `NAME gui_color]; - current_color := gui_color; - gui#entry_ac_id#set_text ac_id; - (Gtk_tools.combo_widget target_combo)#misc#set_sensitive true; - parse_ac_targets target_combo (ExtXml.attrib aircraft "airframe"); + try (ExtXml.attrib aircraft a) with _ -> Xml.attrib sample a in + List.iter (fun (a, _subdir, label, _, _, _, _) -> + match label with + Label l -> l#set_text (value a) + | Tree t -> + ignore (Gtk_tools.clear_tree tree_set); + let names = Str.split regexp_space (value a) in + List.iter (fun n -> Gtk_tools.add_to_tree t n) names + ) (ac_files gui model); + let ac_id = ExtXml.attrib aircraft "ac_id" + and gui_color = ExtXml.attrib_or_default aircraft "gui_color" "white" in + gui#button_clean#misc#set_sensitive true; + gui#button_build#misc#set_sensitive true; + gui#eventbox_gui_color#misc#modify_bg [`NORMAL, `NAME gui_color]; + current_color := gui_color; + gui#entry_ac_id#set_text ac_id; + (Gtk_tools.combo_widget target_combo)#misc#set_sensitive true; + parse_ac_targets target_combo (ExtXml.attrib aircraft "airframe"); with Not_found -> - gui#label_airframe#set_text ""; - gui#label_flight_plan#set_text ""; - gui#button_clean#misc#set_sensitive false; - gui#button_build#misc#set_sensitive false; - (Gtk_tools.combo_widget target_combo)#misc#set_sensitive false + gui#label_airframe#set_text ""; + gui#label_flight_plan#set_text ""; + gui#button_clean#misc#set_sensitive false; + gui#button_build#misc#set_sensitive false; + (Gtk_tools.combo_widget target_combo)#misc#set_sensitive false in Gtk_tools.combo_connect ac_combo update_params; @@ -275,19 +298,22 @@ let ac_combo_handler = fun gui (ac_combo:Gtk_tools.combo) target_combo -> let colorname = string_of_gdkcolor csd#colorsel#color in gui#eventbox_gui_color#misc#modify_bg [`NORMAL, `NAME colorname]; current_color := colorname; - save_callback gui ac_combo (); + save_callback gui ac_combo model (); csd#destroy () in ignore (csd#ok_button#connect#clicked ~callback); ignore (csd#cancel_button#connect#clicked ~callback:csd#destroy) in ignore(gui#button_gui_color#connect#clicked ~callback); (* A/C id *) - ignore(gui#entry_ac_id#connect#changed ~callback:(fun () -> save_callback gui ac_combo ())); + ignore(gui#entry_ac_id#connect#changed ~callback:(fun () -> save_callback gui ac_combo model ())); (* Conf *) - List.iter (fun (name, subdir, label, button_browse, button_edit, editor, multiple) -> + List.iter (fun (name, subdir, label, button_browse, button_edit, editor, remove) -> let callback = fun _ -> - let rel_files = Str.split regexp_space label#text in + let rel_files = match label with + Label l -> Str.split regexp_space l#text + | Tree t -> Str.split regexp_space (Gtk_tools.tree_values t) + in let abs_files = List.map (Filename.concat Utils.conf_dir) rel_files in let quoted_files = List.map (fun s -> "'"^s^"'") abs_files in let arg = String.concat " " quoted_files in @@ -295,17 +321,35 @@ let ac_combo_handler = fun gui (ac_combo:Gtk_tools.combo) target_combo -> ignore (button_edit#connect#clicked ~callback); let callback = fun _ -> let cb = fun names -> - let names = String.concat " " names in - label#set_text names; - save_callback gui ac_combo () + ignore (match label with + Label l -> + let names = String.concat " " names in + l#set_text names + | Tree t -> + List.iter (fun n -> Gtk_tools.add_to_tree t n) names + ); + save_callback gui ac_combo model () in - Utils.choose_xml_file ~multiple name subdir cb in - ignore (button_browse#connect#clicked ~callback)) - (ac_files gui); + Utils.choose_xml_file name subdir cb in + ignore (button_browse#connect#clicked ~callback); + ignore (match remove with + Some r -> + let callback = fun _ -> + match label with + Tree t -> + Gtk_tools.remove_selected_from_tree t; + save_callback gui ac_combo model () + | _ -> () + in + ignore (r#connect#clicked ~callback) + | _ -> () + ) + ) + (ac_files gui model); (* Save button *) - ignore(gui#menu_item_save_ac#connect#activate ~callback:(save_callback ~user_save:true gui ac_combo)) + ignore(gui#menu_item_save_ac#connect#activate ~callback:(save_callback ~user_save:true gui ac_combo model)) let build_handler = fun ~file gui ac_combo (target_combo:Gtk_tools.combo) (log:string->unit) -> diff --git a/sw/tools/Makefile b/sw/tools/Makefile index 6cdf1dadfd..e0f0b33ccf 100644 --- a/sw/tools/Makefile +++ b/sw/tools/Makefile @@ -24,13 +24,13 @@ Q=@ OCAML=ocaml OCAMLC=ocamlc -INCLUDES=-I ../lib/ocaml $(shell ocamlfind query -r -i-format xml-light) +INCLUDES=-I ../lib/ocaml $(shell ocamlfind query -r -i-format xml-light) -I . OCAMLNETINCLUDES=$(shell ocamlfind query -r -i-format netstring) OCAMLNETCMA=$(shell ocamlfind query -r -a-format -predicates byte netstring) OCAMLLEX=ocamllex OCAMLYACC=ocamlyacc -all: gen_aircraft.out gen_airframe.out gen_messages2.out gen_messages.out gen_ubx.out gen_flight_plan.out gen_radio.out gen_periodic.out gen_settings.out gen_tuning.out gen_xsens.out gen_modules.out find_free_msg_id.out +all: gen_common.cmo gen_aircraft.out gen_airframe.out gen_messages2.out gen_messages.out gen_ubx.out gen_flight_plan.out gen_radio.out gen_periodic.out gen_settings.out gen_tuning.out gen_xsens.out gen_modules.out find_free_msg_id.out FP_CMO = fp_proc.cmo gen_flight_plan.cmo ABS_FP = $(FP_CMO:%=$$PAPARAZZI_SRC/sw/tools/%) @@ -42,13 +42,13 @@ gen_flight_plan.out : $(FP_CMO) ../lib/ocaml/lib-pprz.cma fp_proc.cmo : fp_proc.cmi gen_flight_plan.cmo : fp_proc.cmi +gen_common.cmo : gen_common.cmi - -%.out : %.ml Makefile +%.out : %.ml gen_common.ml Makefile @echo OC $< - $(Q)$(OCAMLC) $(INCLUDES) -o $@ unix.cma str.cma ivy-ocaml.cma xml-light.cma lib-pprz.cma $< + $(Q)$(OCAMLC) $(INCLUDES) -o $@ unix.cma str.cma ivy-ocaml.cma xml-light.cma lib-pprz.cma gen_common.cmo $< @cat ../../pprz_src_test.sh > $@ - @echo '$(OCAML) $(shell ocamlfind query -r -i-format xml-light) $(OCAMLNETINCLUDES) -I $$PAPARAZZI_SRC/sw/lib/ocaml unix.cma str.cma ivy-ocaml.cma xml-light.cma $(OCAMLNETCMA) lib-pprz.cma $$PAPARAZZI_BIN/$< $$*' >> $@ + @echo '$(OCAML) -I $$PAPARAZZI_SRC/sw/tools $(shell ocamlfind query -r -i-format xml-light) $(OCAMLNETINCLUDES) -I $$PAPARAZZI_SRC/sw/lib/ocaml unix.cma str.cma ivy-ocaml.cma xml-light.cma $(OCAMLNETCMA) lib-pprz.cma gen_common.cmo $$PAPARAZZI_BIN/$< $$*' >> $@ @chmod a+x $@ %.cmo : %.ml ../lib/ocaml/lib-pprz.cma diff --git a/sw/tools/gen_aircraft.ml b/sw/tools/gen_aircraft.ml index 10df25b3f2..72b25931d4 100644 --- a/sw/tools/gen_aircraft.ml +++ b/sw/tools/gen_aircraft.ml @@ -27,11 +27,12 @@ open Printf module U = Unix +open Gen_common + let (//) = Filename.concat let paparazzi_conf = Env.paparazzi_home // "conf" let conf_xml = paparazzi_conf // "conf.xml" -let modules_dir = paparazzi_conf // "modules" let mkdir = fun d -> assert (Sys.command (sprintf "mkdir -p %s" d) = 0) @@ -59,64 +60,14 @@ let check_unique_id_and_name = fun conf -> -let pipe_regexp = Str.regexp "|" -let targets_of_field = fun field -> - try - Str.split pipe_regexp (ExtXml.attrib_or_default field "target" "ap|sim") - with - _ -> [] - -(** singletonize a sorted list *) -let rec singletonize = fun l -> - match l with - [] | [_] -> l - | x :: ((y :: t) as yt) -> if x = y then singletonize yt else x :: singletonize yt - -(** union of two lists *) -let union = fun l1 l2 -> - let l = l1 @ l2 in - let sl = List.sort compare l in - singletonize sl - -let union_of_lists = fun l -> - let sl = List.sort compare (List.flatten l) in - singletonize sl - (** [get_modules dir xml] * [dir] is the conf directory for modules, [xml] is the parsed airframe.xml *) -let get_modules = fun dir xml -> - (* extract all "modules" sections *) - let modules = List.map (fun x -> - match String.lowercase (Xml.tag x) with - "modules" -> Xml.children x - | _ -> [] - ) (Xml.children xml) in - (* flatten the list (result is a list of "load" xml nodes) *) - let modules = List.flatten modules in +(*let get_modules = fun dir xml -> + let modules = Gen_common.get_modules_of_airframe xml in (* build a list (file name, (xml, xml list of flags)) *) - let extract = List.map (fun m -> - match String.lowercase (Xml.tag m) with - "load" -> let file = dir // ExtXml.attrib m "name" in - (file, (ExtXml.parse_file file, Xml.children m)) - | tag -> failwith (sprintf "Warning: tag load is undefined; found '%s'" tag) - ) modules in + let extract = List.map Gen_common.get_full_module_conf modules in (* return a list of name and a list of pairs (xml, xml list) *) - List.split extract - -(** [get_targets_of_module xml] Returns the list of targets of a module *) -let get_targets_of_module = fun m -> - let targets = List.map (fun x -> - match String.lowercase (Xml.tag x) with - "makefile" -> targets_of_field x - | _ -> [] - ) (Xml.children m) in - (* return a singletonized list *) - singletonize (List.sort compare (List.flatten targets)) - -(** [get_modules_dir xml] Returns the list of modules directories *) -let get_modules_dir = fun modules -> - let dir = List.map (fun (m, _) -> try Xml.attrib m "dir" with _ -> ExtXml.attrib m "name") modules in - singletonize (List.sort compare dir) + List.split extract*) (** Search and dump the module section : @@ -125,14 +76,14 @@ let get_modules_dir = fun modules -> **) let dump_module_section = fun xml f -> (* get modules *) - let (files, modules) = get_modules modules_dir xml in + let modules = Gen_common.get_modules_of_airframe xml in (* print modules directories and includes for all targets *) fprintf f "\n####################################################\n"; fprintf f "# modules makefile section\n"; fprintf f "####################################################\n"; fprintf f "\n# include modules directory for all targets\n"; (* get dir and target list *) - let dir_list = get_modules_dir modules in + let dir_list = Gen_common.get_modules_dir modules in (** let target_list = union_of_lists (List.map (fun (m,_) -> get_targets_of_module m) modules) in List.iter (fun target -> fprintf f "%s.CFLAGS += -I modules -I arch/$(ARCH)/modules\n" target) target_list; @@ -141,36 +92,43 @@ let dump_module_section = fun xml f -> fprintf f "$(TARGET).CFLAGS += -I modules -I arch/$(ARCH)/modules\n"; List.iter (fun dir -> let dir_name = (String.uppercase dir)^"_DIR" in fprintf f "%s = modules/%s\n" dir_name dir) dir_list; (* parse each module *) - List.iter (fun (m, flags) -> - let name = ExtXml.attrib m "name" in - let dir = try Xml.attrib m "dir" with _ -> name in + List.iter (fun m -> + let name = ExtXml.attrib m.xml "name" in + let dir = try Xml.attrib m.xml "dir" with _ -> name in let dir_name = (String.uppercase dir)^"_DIR" in - (* get the list of all the targets for this module *) - let module_target_list = get_targets_of_module m in + (* get the list of all the targets for this module and concat the extra targets *) + let module_target_list = Gen_common.get_targets_of_module m in (* print global flags as compilation defines and flags *) fprintf f "\n# makefile for module %s in modules/%s\n" name dir; List.iter (fun flag -> match String.lowercase (Xml.tag flag) with - "define" -> + "configure" -> let value = Xml.attrib flag "value" and name = Xml.attrib flag "name" in fprintf f "%s = %s\n" name value - | "flag" | "param" -> + | "define" -> List.iter (fun target -> let name = ExtXml.attrib flag "name" and value = try "="^(Xml.attrib flag "value") with _ -> "" in fprintf f "%s.CFLAGS += -D%s%s\n" target name value ) module_target_list | _ -> () - ) flags; + ) m.param; (* Look for makefile section *) List.iter (fun l -> if ExtXml.tag_is l "makefile" then begin - let targets = targets_of_field l in + (* add extra targets only if default is used *) + let et = try ignore(Xml.attrib l "target"); [] with _ -> m.extra_targets in + let targets = Gen_common.singletonize ( + Gen_common.targets_of_field l Gen_common.default_module_targets @ et) in (* Look for defines, flags, files, ... *) List.iter (fun field -> match String.lowercase (Xml.tag field) with - "flag" -> + "configure" -> + let value = Xml.attrib field "value" + and name = Xml.attrib field "name" in + fprintf f "%s = %s\n" name value + | "define" -> List.iter (fun target -> let value = try "="^(Xml.attrib field "value") with _ -> "" and name = Xml.attrib field "name" in @@ -182,17 +140,12 @@ let dump_module_section = fun xml f -> ) targets | "file" -> let name = Xml.attrib field "name" in - List.iter (fun target -> fprintf f "%s.srcs += $(%s)/%s\n" target dir_name name) targets + let dir_name = ExtXml.attrib_or_default field "dir" ("$("^dir_name^")") in + List.iter (fun target -> fprintf f "%s.srcs += %s/%s\n" target dir_name name) targets | "file_arch" -> let name = Xml.attrib field "name" in - List.iter (fun target -> fprintf f "%s.srcs += arch/$(ARCH)/$(%s)/%s\n" target dir_name name) targets - | "file_hw" -> - let name = Xml.attrib field "name" in - List.iter (fun target -> fprintf f "%s.srcs += arch/$(ARCH)/$(%s)/%s\n" target dir_name name) targets - | "define" -> - let value = Xml.attrib field "value" - and name = Xml.attrib field "name" in - fprintf f "%s = %s\n" name value + let dir_name = ExtXml.attrib_or_default field "dir" ("$("^dir_name^")") in + List.iter (fun target -> fprintf f "%s.srcs += arch/$(ARCH)/%s/%s\n" target dir_name name) targets | "raw" -> begin match Xml.children field with [Xml.PCData s] -> fprintf f "%s\n" s @@ -200,10 +153,10 @@ let dump_module_section = fun xml f -> end | _ -> () ) (Xml.children l) - end) (Xml.children m) + end) (Xml.children m.xml) ) modules; (** returns a list of modules file name *) - files + List.map (fun m -> m.file) modules (** Search and dump the makefile sections @@ -227,8 +180,8 @@ let dump_makefile_section = fun xml makefile_ac airframe_infile location -> * Firmware Children * **) -(* print a param (firmware) *) -let print_firmware_param = fun f p -> +(* print a configure (firmware) *) +let print_firmware_configure = fun f p -> let name = (String.uppercase (Xml.attrib p "name")) and value = (Xml.attrib p "value") in fprintf f "%s = %s\n" name value @@ -244,9 +197,9 @@ let print_firmware_subsystem = fun f firmware s -> let name = ExtXml.attrib s "name" and s_type = try "_"^(Xml.attrib s "type") with _ -> "" in fprintf f "# -subsystem: '%s'\n" name; - (* print params *) - let s_params = List.filter (fun x -> ExtXml.tag_is x "param") (Xml.children s) in - List.iter (print_firmware_param f) s_params; + (* print config *) + let s_config = List.filter (fun x -> ExtXml.tag_is x "configure") (Xml.children s) in + List.iter (print_firmware_configure f) s_config; (* print defines *) let s_defines = List.filter (fun x -> ExtXml.tag_is x "define") (Xml.children s) in List.iter (print_firmware_define f) s_defines; @@ -260,6 +213,8 @@ let print_firmware_subsystem = fun f firmware s -> fprintf f "endif\n" let parse_firmware = fun makefile_ac firmware -> + (* get the list of configure for this firmware *) + let config = List.filter (fun x -> ExtXml.tag_is x "configure") (Xml.children firmware) in (* get the list of targets for this firmware *) let targets = List.filter (fun x -> ExtXml.tag_is x "target") (Xml.children firmware) in (* get the list of subsystems for this firmware *) @@ -268,8 +223,8 @@ let parse_firmware = fun makefile_ac firmware -> let defines = List.filter (fun x -> ExtXml.tag_is x "define") (Xml.children firmware) in (* iter on all targets *) List.iter (fun target -> - (* get the list of params for this target *) - let t_params = List.filter (fun x -> ExtXml.tag_is x "param") (Xml.children target) in + (* get the list of configure for this target *) + let t_config = List.filter (fun x -> ExtXml.tag_is x "configure") (Xml.children target) in (* get the list of defines for this target *) let t_defines = List.filter (fun x -> ExtXml.tag_is x "define") (Xml.children target) in (* get the list of subsystems for this target *) @@ -278,7 +233,8 @@ let parse_firmware = fun makefile_ac firmware -> fprintf makefile_ac "\n###########\n# -target: '%s'\n" (Xml.attrib target "name"); fprintf makefile_ac "ifeq ($(TARGET), %s)\n" (Xml.attrib target "name"); try fprintf makefile_ac "BOARD_PROCESSOR = %s\n" (Xml.attrib target "processor") with _ -> (); - List.iter (print_firmware_param makefile_ac) t_params; + List.iter (print_firmware_configure makefile_ac) config; + List.iter (print_firmware_configure makefile_ac) t_config; List.iter (print_firmware_define makefile_ac) defines; List.iter (print_firmware_define makefile_ac) t_defines; fprintf makefile_ac "include $(PAPARAZZI_SRC)/conf/boards/%s.makefile\n" (Xml.attrib target "board"); diff --git a/sw/tools/gen_airframe.ml b/sw/tools/gen_airframe.ml index f438224ed0..0f2d0ddad9 100644 --- a/sw/tools/gen_airframe.ml +++ b/sw/tools/gen_airframe.ml @@ -29,7 +29,6 @@ let max_pprz = 9600. (* !!!! MAX_PPRZ From paparazzi.h !!!! *) open Printf open Xml2h - type channel = { min : float; max : float; neutral : float } type control = { failsafe_value : int; foo : int } @@ -217,26 +216,6 @@ let parse_ap_only_commands = fun ap_only -> printf " commands[COMMAND_%s] = ap_commands[COMMAND_%s];\\\n" com com | _ -> xml_error "copy" -(** -let parse_subsystem_defines = fun options -> - match Xml.tag options with - "param" -> - printf "// -param: %s\n" (ExtXml.attrib options "name") - | "define" -> - printf "#define %s %s\n" (ExtXml.attrib options "name") (ExtXml.attrib options "value") - | _ -> xml_error "define|param" - - -let parse_subsystems = fun subsystem -> - match Xml.tag subsystem with - "param" -> - printf "// subsystem parameter: %s\n" (ExtXml.attrib subsystem "name") - | "subsystem" -> - printf "// -%s:\n" (ExtXml.attrib subsystem "name"); - List.iter parse_subsystem_defines (Xml.children subsystem) - | _ -> xml_error "subsystem" -**) - let parse_command = fun command no -> let command_name = "COMMAND_"^ExtXml.attrib command "name" in define command_name (string_of_int no); diff --git a/sw/tools/gen_common.ml b/sw/tools/gen_common.ml new file mode 100644 index 0000000000..cde7fe873d --- /dev/null +++ b/sw/tools/gen_common.ml @@ -0,0 +1,130 @@ +(* + * $Id$ + * + * generic tools for modules + * + * Copyright (C) 2010 Gautier Hattenberger + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + *) + +open Printf + +type module_conf = { xml : Xml.xml; file : string; param : Xml.xml list; extra_targets : string list; } + +let (//) = Filename.concat + +let paparazzi_conf = Env.paparazzi_home // "conf" +let modules_dir = paparazzi_conf // "modules" + +let default_module_targets = "ap|sim" + +(** remove all duplicated elements of a list *) +let singletonize = fun l -> + let rec loop = fun l -> + match l with + [] | [_] -> l + | x::((x'::_) as xs) -> + if x = x' then loop xs else x::loop xs in + loop (List.sort compare l) + +(** union of two lists *) +let union = fun l1 l2 -> + let l = l1 @ l2 in + let sl = List.sort compare l in + singletonize sl + +(** union of a list of list *) +let union_of_lists = fun l -> + let sl = List.sort compare (List.flatten l) in + singletonize sl + +(** [targets_of_field] + * Returns the targets of a makefile node in modules + * Default "ap|sim" *) +let pipe_regexp = Str.regexp "|" +let targets_of_field = fun field default -> + try + Str.split pipe_regexp (ExtXml.attrib_or_default field "target" default) + with + _ -> [] + +(** [get_modules_of_airframe xml] + * Returns a list of module configuration from airframe file *) +let get_modules_of_airframe = fun xml -> + (* extract all "modules" sections *) + let section = List.filter (fun s -> compare (Xml.tag s) "modules" = 0) (Xml.children xml) in + (* Raise error if more than one modules section *) + match section with + [modules] -> + (* if only one section, returns a list of configuration *) + let t_global = targets_of_field modules "" in + List.map (fun m -> + if compare (Xml.tag m) "load" <> 0 then Xml2h.xml_error "load"; + let file = modules_dir // ExtXml.attrib m "name" in + let targets = singletonize (t_global @ targets_of_field m "") in + { xml = ExtXml.parse_file file; file = file; param = Xml.children m; extra_targets = targets } + ) (Xml.children modules) + | [] -> [] + | _ -> failwith "Error: you have more than one 'modules' section in your airframe file" + +(** [get_targets_of_module xml] + * Returns the list of targets of a module *) +let get_targets_of_module = fun conf -> + let targets = List.map (fun x -> + match String.lowercase (Xml.tag x) with + "makefile" -> targets_of_field x default_module_targets + | _ -> [] + ) (Xml.children conf.xml) in + let targets = (List.flatten targets) @ conf.extra_targets in + (* return a singletonized list *) + singletonize (List.sort compare targets) + +(** [unload_unused_modules modules ?print_error] + * Returns a list of [modules] where unused modules are removed + * If [print_error] is true, a warning is printed *) +let unload_unused_modules = fun modules print_error -> + let target = try Sys.getenv "TARGET" with _ -> "" in + let is_target_in_module = fun m -> + let target_is_in_module = List.exists (fun x -> String.compare target x = 0) (get_targets_of_module m) in + if print_error && not target_is_in_module then + Printf.fprintf stderr "Module %s unloaded, target %s not supported\n" (Xml.attrib m.xml "name") target; + target_is_in_module + in + if String.length target = 0 then + modules + else + List.find_all is_target_in_module modules + +(** [get_modules_name xml] + * Returns a list of loaded modules' name *) +let get_modules_name = fun xml -> + (* extract all "modules" sections *) + let modules = get_modules_of_airframe xml in + (* filter the list if target is not supported *) + let modules = unload_unused_modules modules false in + (* return a list of modules name *) + List.map (fun m -> ExtXml.attrib m.xml "name") modules + +(** [get_modules_dir xml] + * Returns the list of modules directories *) +let get_modules_dir = fun modules -> + let dir = List.map (fun m -> try Xml.attrib m.xml "dir" with _ -> ExtXml.attrib m.xml "name") modules in + singletonize (List.sort compare dir) + diff --git a/sw/tools/gen_common.mli b/sw/tools/gen_common.mli new file mode 100644 index 0000000000..6b288de8ad --- /dev/null +++ b/sw/tools/gen_common.mli @@ -0,0 +1,67 @@ +(* + * $Id$ + * + * generic tools for modules + * + * Copyright (C) 2010 Gautier Hattenberger + * + * This file is part of paparazzi. + * + * paparazzi 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, or (at your option) + * any later version. + * + * paparazzi 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 paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + *) + +(* Module configuration: + * Xml node + * file name + * parameters + * extrat targets + *) +type module_conf = { xml : Xml.xml; file : string; param : Xml.xml list; extra_targets : string list; } + +(* Modules directory *) +val modules_dir : string +(* Default targets for modules *) +val default_module_targets : string + +(** remove all duplicated elements of a list *) +val singletonize : 'a list -> 'a list + +(** [targets_of_field] Xml node, default + * Returns the targets of a makefile node in modules + * Default "ap|sim" *) +val targets_of_field : Xml.xml -> string -> string list + +(** [get_modules_of_airframe xml] + * Returns a list of pair (modules ("load" node), targets) from airframe file *) +val get_modules_of_airframe : Xml.xml -> module_conf list + +(** [get_targets_of_module xml] Returns the list of targets of a module *) +val get_targets_of_module : module_conf -> string list + +(** [unload_unused_modules modules ?print_error] + * Returns a list of [modules] where unused modules are removed + * If [print_error] is true, a warning is printed *) +val unload_unused_modules : module_conf list -> bool -> module_conf list + +(** [get_modules_name xml] + * Returns a list of loaded modules' name *) +val get_modules_name : Xml.xml -> string list + +(** [get_modules_dir xml] + * Returns the list of modules directories *) +val get_modules_dir : module_conf list -> string list + diff --git a/sw/tools/gen_modules.ml b/sw/tools/gen_modules.ml index 8c203f018c..ecbb843641 100644 --- a/sw/tools/gen_modules.ml +++ b/sw/tools/gen_modules.ml @@ -26,6 +26,7 @@ open Printf open Xml2h +module GC = Gen_common (** Default main frequency = 60Hz *) let freq = ref 60 @@ -97,14 +98,6 @@ let print_init_functions = fun modules -> left (); lprintf out_h "}\n" -let remove_dup = fun l -> - let rec loop = fun l -> - match l with - [] | [_] -> l - | x::((x'::_) as xs) -> - if x = x' then loop xs else x::loop xs in - loop (List.sort compare l) - let print_periodic_functions = fun modules -> let min_period = 1. /. float !freq and max_period = 65536. /. float !freq @@ -131,7 +124,7 @@ let print_periodic_functions = fun modules -> ((x, module_name), min 65535 (max 1 (int_of_float (float_of_int !freq /. f)))) ) periodic) modules) in - let modulos = remove_dup (List.map snd functions_modulo) in + let modulos = GC.singletonize (List.map snd functions_modulo) in (** Print modulos *) List.iter (fun modulo -> let v = sprintf "i%d" modulo in @@ -261,15 +254,6 @@ let parse_modules modules = nl (); fprintf out_h "#endif // MODULES_DATALINK_C\n" -let get_modules = fun dir m -> - match Xml.tag m with - "load" -> begin - let name = ExtXml.attrib m "name" in - let xml = Xml.parse_file (dir^name) in - xml - end - | _ -> xml_error "load" - let test_section_modules = fun xml -> List.fold_right (fun x r -> ExtXml.tag_is x "modules" || r) (Xml.children xml) false @@ -324,44 +308,13 @@ let write_settings = fun xml_file out_set modules -> fprintf out_set "
      \n"; fprintf out_set "\n" -let get_targets_of_module = fun m -> - let pipe_regexp = Str.regexp "|" in - let targets_of_field = fun field -> try - Str.split pipe_regexp (ExtXml.attrib_or_default field "target" "ap|sim") with _ -> [] in - let rec singletonize = fun l -> - match l with - [] | [_] -> l - | x :: ((y :: t) as yt) -> if x = y then singletonize yt else x :: singletonize yt - in - let targets = List.map (fun x -> - match String.lowercase (Xml.tag x) with - "makefile" -> targets_of_field x - | _ -> [] - ) (Xml.children m) in - (* return a singletonized list *) - singletonize (List.sort compare (List.flatten targets)) - -let unload_unused_modules = fun modules -> - let target = try Sys.getenv "TARGET" with _ -> "" in - let is_target_in_module = fun m -> - let target_is_in_module = List.exists (fun x -> String.compare target x = 0) (get_targets_of_module m) in - if not target_is_in_module then - Printf.fprintf stderr "Module %s unloaded, target %s not supported\n" (Xml.attrib m "name") target; - target_is_in_module - in - if String.length target = 0 then - modules - else - List.find_all is_target_in_module modules - let h_name = "MODULES_H" let () = - if Array.length Sys.argv <> 4 then - failwith (Printf.sprintf "Usage: %s conf_modules_dir out_settings_file xml_file" Sys.argv.(0)); - let xml_file = Sys.argv.(3) - and out_set = open_out Sys.argv.(2) - and modules_dir = Sys.argv.(1) in + if Array.length Sys.argv <> 3 then + failwith (Printf.sprintf "Usage: %s out_settings_file xml_file" Sys.argv.(0)); + let xml_file = Sys.argv.(2) + and out_set = open_out Sys.argv.(1) in try let xml = start_and_begin xml_file h_name in fprintf out_h "#define MODULES_IDLE 0\n"; @@ -375,14 +328,19 @@ let () = fprintf out_h "#define EXTERN_MODULES extern\n"; fprintf out_h "#endif"; nl (); + (* Extract main_freq parameter *) let modules = try (ExtXml.child xml "modules") with _ -> Xml.Element("modules",[],[]) in let main_freq = try (int_of_string (Xml.attrib modules "main_freq")) with _ -> !freq in freq := main_freq; - let modules_list = List.map (get_modules modules_dir) (Xml.children modules) in - let modules_list = unload_unused_modules modules_list in + (* Extract modules list *) + let modules = GC.get_modules_of_airframe xml in + let modules = GC.unload_unused_modules modules true in + (* Extract modules names (file name and module name) *) let modules_name = - (List.map (fun l -> try Xml.attrib l "name" with _ -> "") (Xml.children modules)) @ - (List.map (fun m -> try Xml.attrib m "name" with _ -> "") modules_list) in + (List.map (fun m -> try Xml.attrib m.GC.xml "name" with _ -> "") modules) @ + (List.map (fun m -> m.GC.file) modules) in + (* Extract xml modules nodes *) + let modules_list = List.map (fun m -> m.GC.xml) modules in check_dependencies modules_list modules_name; parse_modules modules_list; finish h_name; diff --git a/sw/tools/gen_periodic.ml b/sw/tools/gen_periodic.ml index dc7275e27c..4729a82173 100644 --- a/sw/tools/gen_periodic.ml +++ b/sw/tools/gen_periodic.ml @@ -25,13 +25,10 @@ *) open Printf +module GC = Gen_common let (//) = Filename.concat -let paparazzi_conf = Env.paparazzi_home // "conf" -let modules_dir = paparazzi_conf // "modules" - - let margin = ref 0 let step = 2 @@ -42,18 +39,7 @@ let lprintf = fun c f -> fprintf c "%s" (String.make !margin ' '); fprintf c f -(**let freq = ref 60 *) - -let remove_dup = fun l -> - let rec loop = fun l -> - match l with - [] | [_] -> l - | x::((x'::_) as xs) -> - if x = x' then loop xs else x::loop xs in - loop (List.sort compare l) - - -let output_modes = fun avr_h process_name channel_name modes freq modules -> +let output_modes = fun avr_h process_name channel_name modes freq modules -> let min_period = 1./.float freq in let max_period = 65536. /. float freq in (** For each mode in this process *) @@ -74,7 +60,7 @@ let output_modes = fun avr_h process_name channel_name modes freq modules -> fprintf stderr "Warning: period is bound between %.3fs and %.3fs for message %s\n%!" min_period max_period (ExtXml.attrib x "name"); (x, min 65535 (max 1 (int_of_float (p*.float_of_int freq)))) ) filtered_msg in - let modulos = remove_dup (List.map snd messages) in + let modulos = GC.singletonize (List.map snd messages) in List.iter (fun m -> let v = sprintf "i%d" m in let _type = if m >= 256 then "uint16_t" else "uint8_t" in @@ -107,52 +93,6 @@ let output_modes = fun avr_h process_name channel_name modes freq modules -> lprintf avr_h "}\\\n") modes -(** [get_targets_of_module xml] Returns the list of targets of a module *) -let get_targets_of_module = fun m -> - let pipe_regexp = Str.regexp "|" in - let targets_of_field = fun field -> try - Str.split pipe_regexp (ExtXml.attrib_or_default field "target" "ap|sim") with _ -> [] in - let rec singletonize = fun l -> - match l with - [] | [_] -> l - | x :: ((y :: t) as yt) -> if x = y then singletonize yt else x :: singletonize yt - in - let targets = List.map (fun x -> - match String.lowercase (Xml.tag x) with - "makefile" -> targets_of_field x - | _ -> [] - ) (Xml.children m) in - (* return a singletonized list *) - singletonize (List.sort compare (List.flatten targets)) - -let unload_unused_modules = fun modules -> - let target = try Sys.getenv "TARGET" with _ -> "" in - let is_target_in_module = fun m -> - let target_is_in_module = List.exists (fun x -> String.compare target x = 0) (get_targets_of_module m) in - target_is_in_module - in - if String.length target = 0 then - modules - else - List.find_all is_target_in_module modules - -(** [get_modules_name dir xml] Returns a list of modules name *) -let get_modules_name = fun dir xml -> - (* extract all "modules" sections *) - let modules = List.map (fun x -> - match String.lowercase (Xml.tag x) with - "modules" -> Xml.children x - | _ -> [] - ) (Xml.children xml) in - (* flatten the list (result is a list of "load" xml nodes) *) - let modules = List.flatten modules in - (* parse modules *) - let modules = List.map (fun m -> ExtXml.parse_file (dir // ExtXml.attrib m "name")) modules in - (* filter the list if target is not supported *) - let modules = unload_unused_modules modules in - (* return a list of modules name *) - List.map (fun m -> ExtXml.attrib m "name") modules - let _ = if Array.length Sys.argv <> 5 then begin @@ -166,7 +106,7 @@ let _ = with Dtd.Check_error e -> failwith (Dtd.check_error e) in - let modules_name = get_modules_name modules_dir (ExtXml.parse_file Sys.argv.(1)) in + let modules_name = GC.get_modules_name (ExtXml.parse_file Sys.argv.(1)) in let avr_h = stdout in diff --git a/sw/tools/wiki_gen/Makefile b/sw/tools/wiki_gen/Makefile index dcecff4d3b..c4e2cd54f3 100644 --- a/sw/tools/wiki_gen/Makefile +++ b/sw/tools/wiki_gen/Makefile @@ -13,7 +13,7 @@ Q=@ OCAML=ocaml OCAMLC=ocamlc -INCLUDES=-I ../../lib/ocaml -I +xml-light +INCLUDES=-I ../../lib/ocaml $(shell ocamlfind query -r -i-format xml-light) OCAMLNETINCLUDES=$(shell ocamlfind query -r -i-format netstring) OCAMLNETCMA=$(shell ocamlfind query -r -a-format -predicates byte netstring) @@ -22,7 +22,7 @@ OCAMLNETCMA=$(shell ocamlfind query -r -a-format -predicates byte netstring) @echo OC $< $(Q)$(OCAMLC) $(INCLUDES) -o $@ unix.cma str.cma ivy-ocaml.cma xml-light.cma lib-pprz.cma $< @cat ../../../pprz_src_test.sh > $@ - @echo '$(OCAML) -I +xml-light $(OCAMLNETINCLUDES) -I $$PAPARAZZI_SRC/sw/lib/ocaml unix.cma str.cma ivy-ocaml.cma xml-light.cma $(OCAMLNETCMA) lib-pprz.cma $$PAPARAZZI_BIN/$< $$*' >> $@ + @echo '$(OCAML) $(shell ocamlfind query -r -i-format xml-light) $(OCAMLNETINCLUDES) -I $$PAPARAZZI_SRC/sw/lib/ocaml unix.cma str.cma ivy-ocaml.cma xml-light.cma $(OCAMLNETCMA) lib-pprz.cma $$PAPARAZZI_BIN/$< $$*' >> $@ @chmod a+x $@ %.cmo : %.ml ../lib/ocaml/lib-pprz.cma