objdictgen/node.py
author etisserant
Sun, 13 May 2007 10:29:08 +0200
changeset 195 1510dd61ead0
parent 182 988f2b302aa6
child 205 dac0f9b4e3f8
permissions -rwxr-xr-x
Added debug level opt in configure and re-enabled debug macros.
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     1
#!/usr/bin/env python
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     2
# -*- coding: utf-8 -*-
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     3
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     4
#This file is part of CanFestival, a library implementing CanOpen Stack. 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     5
#
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     6
#Copyright (C): Edouard TISSERANT, Francis DUPIN and Laurent BESSARD
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     7
#
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     8
#See COPYING file for copyrights details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     9
#
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    10
#This library is free software; you can redistribute it and/or
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    11
#modify it under the terms of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    12
#License as published by the Free Software Foundation; either
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    13
#version 2.1 of the License, or (at your option) any later version.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    14
#
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    15
#This library is distributed in the hope that it will be useful,
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    16
#but WITHOUT ANY WARRANTY; without even the implied warranty of
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    17
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    18
#Lesser General Public License for more details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    19
#
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    20
#You should have received a copy of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    21
#License along with this library; if not, write to the Free Software
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    22
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    23
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    24
import cPickle
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    25
from types import *
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    26
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    27
"""
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    28
Dictionary of translation between access symbol and their signification
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    29
"""
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    30
AccessType = {"ro" : "Read Only", "wo" : "Write Only", "rw" : "Read/Write"}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    31
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    32
BoolType = {True : "True", False : "False"} 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    33
OptionType = {True : "Yes", False : "No"}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    34
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    35
CustomisableTypes = [(0x02, 0), (0x03, 0), (0x04, 0), (0x05, 0), (0x06, 0), (0x07, 0),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    36
    (0x08, 0), (0x09, 1), (0x0A, 1), (0x0B, 1), (0x10, 0), (0x11, 0), (0x12, 0),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    37
    (0x13, 0), (0x14, 0), (0x15, 0), (0x16, 0), (0x18, 0), (0x19, 0), (0x1A, 0),
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    38
    (0x1B, 0)]
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    39
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    40
DefaultParams = {"comment" : "", "save" : False}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    41
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    42
#-------------------------------------------------------------------------------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    43
#                      Dictionary Mapping and Organisation
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    44
#-------------------------------------------------------------------------------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    45
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    46
"""
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    47
Properties of entry structure in the Object Dictionary
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    48
"""
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    49
OD_Subindex = 1             # Entry has at least one subindex
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    50
OD_MultipleSubindexes = 2   # Entry has more than one subindex
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    51
OD_IdenticalSubindexes = 4  # Subindexes of entry have the same description
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    52
OD_IdenticalIndexes = 8     # Entry has the same description on multiple indexes
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    53
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    54
"""
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    55
Structures of entry in the Object Dictionary, sum of the properties described above
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    56
for all sorts of entries use in CAN Open specification
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    57
"""
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    58
nosub = 0 # Entry without subindex (only for type declaration)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    59
var = 1
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    60
array = 3
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    61
rec = 7
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    62
# Entries identical on multiple indexes
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    63
plurivar = 9
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    64
pluriarray = 11 # Example : PDO Parameters
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    65
plurirec = 15   # Example : PDO Mapping
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    66
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    67
"""
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    68
MappingDictionary is the structure used for writing a good organised Object
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    69
Dictionary. It follows the specifications of the CANOpen standard.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    70
Change the informations within it if there is a mistake. But don't modify the
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    71
organisation of this object, it will involve in a malfunction of the application.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    72
"""
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    73
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    74
MappingDictionary = {
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    75
    0x0001 : {"name" : "BOOLEAN", "struct" : nosub, "size" : 1, "default" : False, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    76
    0x0002 : {"name" : "INTEGER8", "struct" : nosub, "size" : 8, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    77
    0x0003 : {"name" : "INTEGER16", "struct" : nosub, "size" : 16, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    78
    0x0004 : {"name" : "INTEGER32", "struct" : nosub, "size" : 32, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    79
    0x0005 : {"name" : "UNSIGNED8", "struct" : nosub, "size" : 8, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    80
    0x0006 : {"name" : "UNSIGNED16", "struct" : nosub, "size" : 16, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    81
    0x0007 : {"name" : "UNSIGNED32", "struct" : nosub, "size" : 32, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    82
    0x0008 : {"name" : "REAL32", "struct" : nosub, "size" : 32, "default" : 0.0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    83
    0x0009 : {"name" : "VISIBLE_STRING", "struct" : nosub, "size" : 8, "default" : "", "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    84
    0x000A : {"name" : "OCTET_STRING", "struct" : nosub, "size" : 8, "default" : "", "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    85
    0x000B : {"name" : "UNICODE_STRING", "struct" : nosub, "size" : 16, "default" : "", "values" : []},
67
51642fb5a0af TIME_OF_DAY and TIME_DIFFERENCE disabled
lbessard
parents: 65
diff changeset
    86
#    0x000C : {"name" : "TIME_OF_DAY", "struct" : nosub, "size" : 48, "default" : 0, "values" : []},
51642fb5a0af TIME_OF_DAY and TIME_DIFFERENCE disabled
lbessard
parents: 65
diff changeset
    87
#    0x000D : {"name" : "TIME_DIFFERENCE", "struct" : nosub, "size" : 48, "default" : 0, "values" : []},
176
5d57fe1e3a5b Support for DCF (DS-302)
greg
parents: 68
diff changeset
    88
    0x000F : {"name" : "DOMAIN", "struct" : nosub, "size" : 0, "default" : "", "values" : []},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    89
    0x0010 : {"name" : "INTEGER24", "struct" : nosub, "size" : 24, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    90
    0x0011 : {"name" : "REAL64", "struct" : nosub, "size" : 64, "default" : 0.0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    91
    0x0012 : {"name" : "INTEGER40", "struct" : nosub, "size" : 40, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    92
    0x0013 : {"name" : "INTEGER48", "struct" : nosub, "size" : 48, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    93
    0x0014 : {"name" : "INTEGER56", "struct" : nosub, "size" : 56, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    94
    0x0015 : {"name" : "INTEGER64", "struct" : nosub, "size" : 64, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    95
    0x0016 : {"name" : "UNSIGNED24", "struct" : nosub, "size" : 24, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    96
    0x0018 : {"name" : "UNSIGNED40", "struct" : nosub, "size" : 40, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    97
    0x0019 : {"name" : "UNSIGNED48", "struct" : nosub, "size" : 48, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    98
    0x001A : {"name" : "UNSIGNED56", "struct" : nosub, "size" : 56, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    99
    0x001B : {"name" : "UNSIGNED64", "struct" : nosub, "size" : 64, "default" : 0, "values" : []},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   100
    0x1000 : {"name" : "Device Type", "struct" : var, "need" : True, "values" : 
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   101
                [{"name" : "Device Type", "type" : 0x07, "access" : 'ro', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   102
    0x1001 : {"name" : "Error Register", "struct" : var,  "need" : True, "values" : 
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   103
                [{"name" : "Error Register", "type" : 0x05, "access": 'ro', "pdo" : True}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   104
    0x1002 : {"name" : "Manufacturer Status Register", "struct" : var, "need" : False,  "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   105
                [{"name" : "Manufacturer Status Register", "type" : 0x07, "access" : 'ro', "pdo" : True}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   106
    0x1003 : {"name" : "Pre-defined Error Field", "struct" : rec, "need" : False,  "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   107
                [{"name" : "Number of Errors", "type" : 0x05, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   108
                 {"name" : "Standard Error Field", "type" : 0x07, "access" : 'ro', "pdo" : False, "nbmax" : 0xFE}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   109
    0x1005 : {"name" : "SYNC COB ID", "struct" : var, "need" : True, "callback" : True, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   110
                [{"name" : "SYNC COB ID", "type" : 0x07, "access" : 'rw', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   111
    0x1006 : {"name" : "Communication / Cycle Period", "struct" : var, "need" : False, "callback" : True, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   112
                [{"name" : "Communication Cycle Period", "type" : 0x07, "access" : 'rw', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   113
    0x1007 : {"name" : "Synchronous Window Length", "struct" : var, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   114
                [{"name" : "Synchronous Window Length", "type" : 0x07, "access" : 'rw', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   115
    0x1008 : {"name" : "Manufacturer Device Name", "struct" : var, "need" : False, "values" :
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   116
                [{"name" : "Manufacturer Device Name", "type" : 0x09, "access" : 'ro', "pdo" : False}]},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   117
    0x1009 : {"name" : "Manufacturer Hardware Version", "struct" : var, "need" : False, "values" :
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   118
                [{"name" : "Manufacturer Hardware Version", "type" : 0x09, "access" : 'ro', "pdo" : False}]},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   119
    0x100A : {"name" : "Manufacturer Software Version", "struct" : var, "need" : False, "values" :
62
93d4db3677e6 index 0x1004 is a visible_string
frdupin
parents: 59
diff changeset
   120
                [{"name" : "Manufacturer Software Version", "type" : 0x09, "access" : 'ro', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   121
    0x100C : {"name" : "Guard Time", "struct" : var, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   122
                [{"name" : "Guard Time", "type" : 0x06, "access" : 'rw', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   123
    0x100D : {"name" : "Life Time Factor", "struct" : var, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   124
                [{"name" : "Life Time Factor", "type" : 0x05, "access" : 'rw', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   125
    0x1010 : {"name" : "Store parameters", "struct" : array, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   126
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   127
                 {"name" : "Save All Parameters", "type" : 0x07, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   128
                 {"name" : "Save Communication Parameters", "type" : 0x07, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   129
                 {"name" : "Save Application Parameters", "type" : 0x07, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   130
                 {"name" : "Save Manufacturer Parameters", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmax" : 0x7C}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   131
    0x1011 : {"name" : "Restore Default Parameters", "struct" : array, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   132
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   133
                 {"name" : "Restore All Default Parameters", "type" : 0x07, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   134
                 {"name" : "Restore Communication Default Parameters", "type" : 0x07, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   135
                 {"name" : "Restore Application Default Parameters", "type" : 0x07, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   136
                 {"name" : "Restore Manufacturer Default Parameters", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmax" : 0x7C}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   137
    0x1012 : {"name" : "TIME COB ID", "struct" : var, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   138
                [{"name" : "TIME COB ID", "type" : 0x07, "access" : 'rw', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   139
    0x1013 : {"name" : "High Resolution Timestamp", "struct" : var, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   140
                [{"name" : "High Resolution Time Stamp", "type" : 0x07, "access" : 'rw', "pdo" : True}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   141
    0x1014 : {"name" : "Emergency COB ID", "struct" : var, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   142
                [{"name" : "Emergency COB ID", "type" : 0x07, "access" : 'rw', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   143
    0x1015 : {"name" : "Inhibit Time Emergency", "struct" : var, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   144
                [{"name" : "Inhibit Time Emergency", "type" : 0x06, "access" : 'rw', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   145
    0x1016 : {"name" : "Consumer Heartbeat Time", "struct" : rec, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   146
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   147
                 {"name" : "Consumer Heartbeat Time", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmax" : 0x7F}]},
177
d485a3fc5739 Add default callback for index entry 0x1017
greg
parents: 176
diff changeset
   148
    0x1017 : {"name" : "Producer Heartbeat Time", "struct" : var, "need" : False, "callback" : True, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   149
                [{"name" : "Producer Heartbeat Time", "type" : 0x06, "access" : 'rw', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   150
    0x1018 : {"name" : "Identity", "struct" : array, "need" : True, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   151
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   152
                 {"name" : "Vendor ID", "type" : 0x07, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   153
                 {"name" : "Product Code", "type" : 0x07, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   154
                 {"name" : "Revision Number", "type" : 0x07, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   155
                 {"name" : "Serial Number", "type" : 0x07, "access" : 'ro', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   156
    0x1020 : {"name" : "Verify Configuration", "struct" : array, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   157
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   158
                 {"name" : "Configuration Date", "type" : 0x07, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   159
                 {"name" : "Configuration Time", "type" : 0x07, "access" : 'ro', "pdo" : False}]},
59
3a553c789116 Some bugs reported by Francis Dupin corrected.
lbessard
parents: 0
diff changeset
   160
#    0x1021 : {"name" : "Store EDS", "struct" : var, "need" : False, "values" :
3a553c789116 Some bugs reported by Francis Dupin corrected.
lbessard
parents: 0
diff changeset
   161
#                [{"name" : "Store EDS", "type" : 0x0F, "access" : 'rw', "pdo" : False}]},
3a553c789116 Some bugs reported by Francis Dupin corrected.
lbessard
parents: 0
diff changeset
   162
#    0x1022 : {"name" : "Storage Format", "struct" : var, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   163
#                [{"name" : "Storage Format", "type" : 0x06, "access" : 'rw', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   164
    0x1023 : {"name" : "OS Command", "struct" : array, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   165
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   166
                 {"name" : "Command", "type" : 0x0A, "access" : 'rw', "pdo" : False},
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   167
                 {"name" : "Status", "type" : 0x05, "access" : 'ro', "pdo" : False},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   168
                 {"name" : "Reply", "type" : 0x0A, "access" : 'ro', "pdo" : False}]},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   169
    0x1024 : {"name" : "OS Command Mode", "struct" : var, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   170
                [{"name" : "OS Command Mode", "type" : 0x05, "access" : 'wo', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   171
    0x1025 : {"name" : "OS Debugger Interface", "struct" : array, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   172
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   173
                 {"name" : "Command", "type" : 0x0A, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   174
                 {"name" : "Status", "type" : 0x07, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   175
                 {"name" : "Reply", "type" : 0x0A, "access" : 'ro', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   176
    0x1026 : {"name" : "OS Prompt", "struct" : array, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   177
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   178
                 {"name" : "StdIn", "type" : 0x05, "access" : 'wo', "pdo" : True},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   179
                 {"name" : "StdOut", "type" : 0x05, "access" : 'ro', "pdo" : True},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   180
                 {"name" : "StdErr", "type" : 0x05, "access" : 'ro', "pdo" : True}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   181
    0x1027 : {"name" : "Module List", "struct" : rec, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   182
                [{"name" : "Number of Connected Modules", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   183
                 {"name" : "Module %d[(sub)]", "type" : 0x06, "access" : 'ro', "pdo" : False, "nbmax" : 0xFE}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   184
    0x1028 : {"name" : "Emergency Consumer", "struct" : rec, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   185
                [{"name" : "Number of Consumed Emergency Objects", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   186
                 {"name" : "Emergency Consumer", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmax" : 0x7E}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   187
    0x1029 : {"name" : "Error Behavior", "struct" : array, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   188
                [{"name" : "Number of Error Classes", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   189
                 {"name" : "Communication Error", "type" : 0x05, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   190
                 {"name" : "Device Profile", "type" : 0x05, "access" : 'rw', "pdo" : False, "nbmax" : 0xFE}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   191
    0x1200 : {"name" : "Server SDO Parameter", "struct" : array, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   192
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   193
                 {"name" : "COB ID Client to Server (Receive SDO)", "type" : 0x07, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   194
                 {"name" : "COB ID Server to Client (Transmit SDO)", "type" : 0x07, "access" : 'ro', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   195
    0x1201 : {"name" : "Additional Server SDO %d Parameter[(idx)]", "struct" : pluriarray, "incr" : 1, "nbmax" : 0x7F, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   196
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   197
                 {"name" : "COB ID Client to Server (Receive SDO)", "type" : 0x07, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   198
                 {"name" : "COB ID Server to Client (Transmit SDO)", "type" : 0x07, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   199
                 {"name" : "Node ID of the SDO Client", "type" : 0x05, "access" : 'ro', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   200
    0x1280 : {"name" : "Client SDO %d Parameter[(idx)]", "struct" : pluriarray, "incr" : 1, "nbmax" : 0x100, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   201
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   202
                 {"name" : "COB ID Client to Server (Transmit SDO)", "type" : 0x07, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   203
                 {"name" : "COB ID Server to Client (Receive SDO)", "type" : 0x07, "access" : 'rw', "pdo" : False},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   204
                 {"name" : "Node ID of the SDO Server", "type" : 0x04, "access" : 'rw', "pdo" : False}]},
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   205
    0x1400 : {"name" : "Receive PDO %d Parameter[(idx)]", "struct" : pluriarray, "incr" : 1, "nbmax" : 0x200, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   206
                [{"name" : "Highest SubIndex Supported", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   207
                 {"name" : "COB ID used by PDO", "type" : 0x07, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   208
                 {"name" : "Transmission Type", "type" : 0x05, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   209
                 {"name" : "Inhibit Time", "type" : 0x06, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   210
                 {"name" : "Compatibility Entry", "type" : 0x05, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   211
                 {"name" : "Event Timer", "type" : 0x06, "access" : 'rw', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   212
    0x1600 : {"name" : "Receive PDO %d Mapping[(idx)]", "struct" : plurirec, "incr" : 1, "nbmax" : 0x200, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   213
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   214
                 {"name" : "PDO %d Mapping for an application object %d[(idx,sub)]", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmax" : 0x40}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   215
    0x1800 : {"name" : "Transmit PDO %d Parameter[(idx)]", "struct" : pluriarray, "incr" : 1, "nbmax" : 0x200, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   216
                [{"name" : "Highest SubIndex Supported", "type" : 0x05, "access" : 'ro', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   217
                 {"name" : "COB ID used by PDO", "type" : 0x07, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   218
                 {"name" : "Transmission Type", "type" : 0x05, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   219
                 {"name" : "Inhibit Time", "type" : 0x06, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   220
                 {"name" : "Compatibility Entry", "type" : 0x05, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   221
                 {"name" : "Event Timer", "type" : 0x06, "access" : 'rw', "pdo" : False}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   222
    0x1A00 : {"name" : "Transmit PDO %d Mapping[(idx)]", "struct" : plurirec, "incr" : 1, "nbmax" : 0x200, "need" : False, "values" :
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   223
                [{"name" : "Number of Entries", "type" : 0x05, "access" : 'rw', "pdo" : False},
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   224
                 {"name" : "PDO %d Mapping for a process data variable %d[(idx,sub)]", "type" : 0x07, "access" : 'rw', "pdo" : False, "nbmax" : 0x40}]},
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   225
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   226
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   227
#-------------------------------------------------------------------------------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   228
#                          Definition of Node Object
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   229
#-------------------------------------------------------------------------------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   230
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   231
"""
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   232
Class recording the Object Dictionary entries. It checks at each modification
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   233
that the structure of the Object Dictionary stay coherent
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   234
"""
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   235
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   236
class Node:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   237
    
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   238
    def __init__(self, name = "", type = "slave", id = 0, description = "", profilename = "DS-301", profile = {}, specificmenu = []):
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   239
        self.Name = name
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   240
        self.Type = type
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   241
        self.ID = id
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   242
        self.Description = description
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   243
        self.ProfileName = profilename
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   244
        self.Profile = profile
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   245
        self.SpecificMenu = specificmenu
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   246
        self.Dictionary = {}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   247
        self.ParamsDictionary = {}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   248
        self.DS302 = {}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   249
        self.UserMapping = {}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   250
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   251
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   252
    Return the node name
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   253
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   254
    def GetNodeName(self):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   255
        return self.Name
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   256
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   257
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   258
    Define the node name
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   259
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   260
    def SetNodeName(self, name):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   261
        self.Name = name
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   262
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   263
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   264
    Return the node type ("master" or "slave")
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   265
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   266
    def GetNodeType(self):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   267
        return self.Type
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   268
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   269
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   270
    Define the node type ("master" or "slave")
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   271
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   272
    def SetNodeType(self, type):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   273
        self.Type = type
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   274
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   275
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   276
    Return the node ID
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   277
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   278
    def GetNodeID(self):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   279
        return self.ID
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   280
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   281
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   282
    Define the node ID
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   283
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   284
    def SetNodeID(self, id):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   285
        self.ID = id
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   286
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   287
    """
182
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   288
    Return the node description
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   289
    """
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   290
    def GetNodeDescription(self):
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   291
        if getattr(self, "Description", False):
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   292
            return self.Description
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   293
        else:
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   294
            return ""
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   295
    
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   296
    """
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   297
    Define the node description
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   298
    """
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   299
    def SetNodeDescription(self, description):
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   300
        self.Description = description
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   301
988f2b302aa6 Adding support for importing and exporting EDS files
lbessard
parents: 177
diff changeset
   302
    """
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   303
    Return the Specific Profile Name
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   304
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   305
    def GetProfileName(self):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   306
        return self.ProfileName
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   307
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   308
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   309
    Define the Specific Profile Name
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   310
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   311
    def SetProfileName(self, profilename):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   312
        self.ProfileName = profilename
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   313
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   314
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   315
    Return the Specific Profile
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   316
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   317
    def GetProfile(self):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   318
        return self.Profile
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   319
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   320
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   321
    Define the Specific Profile
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   322
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   323
    def SetProfile(self, profile):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   324
        self.Profile = profile
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   325
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   326
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   327
    Define the DS-302 Profile
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   328
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   329
    def SetDS302Profile(self, profile):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   330
        self.DS302 = profile
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   331
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   332
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   333
    Define the DS-302 Profile
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   334
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   335
    def GetDS302Profile(self):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   336
        return self.DS302
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   337
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   338
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   339
    Return the Specific Menu Entries
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   340
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   341
    def GetSpecificMenu(self):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   342
        return self.SpecificMenu
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   343
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   344
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   345
    Define the Specific Menu Entries
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   346
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   347
    def SetSpecificMenu(self, specificmenu):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   348
        self.SpecificMenu = specificmenu
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   349
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   350
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   351
    Extend the Specific Menu Entries
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   352
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   353
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   354
    def ExtendSpecificMenu(self, specificmenu):
176
5d57fe1e3a5b Support for DCF (DS-302)
greg
parents: 68
diff changeset
   355
        self.SpecificMenu.extend(specificmenu)
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   356
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   357
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   358
    Function which return the different Mappings available for this node
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   359
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   360
    def GetMappings(self, userdefinedtoo = True):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   361
        if userdefinedtoo:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   362
            return [self.Profile, self.DS302, self.UserMapping]
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   363
        else:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   364
            return [self.Profile, self.DS302]
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   365
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   366
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   367
    Add a new entry in the Object Dictionary
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   368
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   369
    def AddEntry(self, index, subIndex = None, value = None):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   370
        if index not in self.Dictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   371
            if not subIndex:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   372
                self.Dictionary[index] = value
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   373
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   374
            elif subIndex == 1:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   375
                self.Dictionary[index] = [value]
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   376
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   377
        elif subIndex > 1 and type(self.Dictionary[index]) == ListType and subIndex == len(self.Dictionary[index]) + 1:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   378
            self.Dictionary[index].append(value)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   379
            return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   380
        return False
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   381
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   382
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   383
    Warning ! Modifies an existing entry in the Object Dictionary. Can't add a new one.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   384
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   385
    def SetEntry(self, index, subIndex = None, value = None):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   386
        if index in self.Dictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   387
            if not subIndex:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   388
                if value != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   389
                    self.Dictionary[index] = value
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   390
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   391
            elif type(self.Dictionary[index]) == ListType and 0 < subIndex <= len(self.Dictionary[index]):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   392
                if value != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   393
                    self.Dictionary[index][subIndex - 1] = value
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   394
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   395
        return False
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   396
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   397
    def SetParamsEntry(self, index, subIndex = None, comment = None, save = None, callback = None):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   398
        if not getattr(self, "ParamsDictionary", False):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   399
            self.ParamsDictionary = {}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   400
        if index in self.Dictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   401
            if (comment != None or save != None or callback != None) and index not in self.ParamsDictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   402
                self.ParamsDictionary[index] = {}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   403
            if subIndex == None or type(self.Dictionary[index]) != ListType and subIndex == 0:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   404
                if comment != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   405
                    self.ParamsDictionary[index]["comment"] = comment
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   406
                if save != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   407
                    self.ParamsDictionary[index]["save"] = save
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   408
                if callback != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   409
                    self.ParamsDictionary[index]["callback"] = callback
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   410
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   411
            elif type(self.Dictionary[index]) == ListType and 0 <= subIndex <= len(self.Dictionary[index]):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   412
                if (comment != None or save != None or callback != None) and subIndex not in self.ParamsDictionary[index]:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   413
                    self.ParamsDictionary[index][subIndex] = {}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   414
                if comment != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   415
                    self.ParamsDictionary[index][subIndex]["comment"] = comment
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   416
                if save != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   417
                    self.ParamsDictionary[index][subIndex]["save"] = save
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   418
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   419
        return False
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   420
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   421
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   422
    Removes an existing entry in the Object Dictionary. If a subIndex is specified
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   423
    it will remove this subIndex only if it's the last of the index. If no subIndex
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   424
    is specified it removes the whole index and subIndexes from the Object Dictionary.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   425
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   426
    def RemoveEntry(self, index, subIndex = None):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   427
        if not getattr(self, "ParamsDictionary", False):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   428
            self.ParamsDictionary = {}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   429
        if index in self.Dictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   430
            if not subIndex:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   431
                self.Dictionary.pop(index)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   432
                if index in self.ParamsDictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   433
                    self.ParamsDictionary.pop(index)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   434
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   435
            elif type(self.Dictionary[index]) == ListType and subIndex == len(self.Dictionary[index]):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   436
                self.Dictionary[index].pop(subIndex - 1)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   437
                if index in self.ParamsDictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   438
                    if subIndex in self.ParamsDictionary[index]:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   439
                        self.ParamsDictionary[index].pop(subIndex)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   440
                    if len(self.ParamsDictionary[index]) == 0:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   441
                        self.ParamsDictionary.pop(index)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   442
                if len(self.Dictionary[index]) == 0:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   443
                    self.Dictionary.pop(index)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   444
                    if index in self.ParamsDictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   445
                        self.ParamsDictionary.pop(index)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   446
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   447
        return False
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   448
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   449
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   450
    Check if an entry exists in the Object Dictionary and returns the answer.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   451
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   452
    def IsEntry(self, index):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   453
        if index in self.Dictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   454
            return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   455
        return False
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   456
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   457
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   458
    Returns the value of the entry asked. If the entry has the value "count", it
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   459
    returns the number of subIndex in the entry except the first.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   460
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   461
    def GetEntry(self, index, subIndex = None):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   462
        if index in self.Dictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   463
            if subIndex == None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   464
                if type(self.Dictionary[index]) == ListType:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   465
                    values = [len(self.Dictionary[index])]
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   466
                    values.extend(self.Dictionary[index])
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   467
                    return values
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   468
                else:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   469
                    return self.Dictionary[index]
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   470
            elif subIndex == 0:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   471
                if type(self.Dictionary[index]) == ListType:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   472
                    return len(self.Dictionary[index])
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   473
                else:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   474
                    return self.Dictionary[index]
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   475
            elif type(self.Dictionary[index]) == ListType and 0 < subIndex <= len(self.Dictionary[index]):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   476
                return self.Dictionary[index][subIndex - 1]
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   477
        return None
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   478
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   479
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   480
    Returns the value of the entry asked. If the entry has the value "count", it
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   481
    returns the number of subIndex in the entry except the first.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   482
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   483
    def GetParamsEntry(self, index, subIndex = None):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   484
        if not getattr(self, "ParamsDictionary", False):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   485
            self.ParamsDictionary = {}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   486
        if index in self.Dictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   487
            if subIndex == None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   488
                if type(self.Dictionary[index]) == ListType:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   489
                    if index in self.ParamsDictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   490
                        result = []
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   491
                        for i in xrange(len(self.Dictionary[index]) + 1):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   492
                            line = DefaultParams.copy()
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   493
                            if i in self.ParamsDictionary[index]:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   494
                                line.update(self.ParamsDictionary[index][i])
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   495
                            result.append(line)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   496
                        return result
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   497
                    else:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   498
                        return [DefaultParams.copy() for i in xrange(len(self.Dictionary[index]) + 1)]
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   499
                else:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   500
                    result = DefaultParams.copy()
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   501
                    if index in self.ParamsDictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   502
                        result.update(self.ParamsDictionary[index])
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   503
                    return result
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   504
            elif subIndex == 0 and type(self.Dictionary[index]) != ListType:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   505
                result = DefaultParams.copy()
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   506
                if index in self.ParamsDictionary:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   507
                    result.update(self.ParamsDictionary[index])
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   508
                return result
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   509
            elif type(self.Dictionary[index]) == ListType and 0 <= subIndex <= len(self.Dictionary[index]):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   510
                result = DefaultParams.copy()
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   511
                if index in self.ParamsDictionary and subIndex in self.ParamsDictionary[index]:
64
c72dd78e547f Bug reported by Dean corrected
lbessard
parents: 63
diff changeset
   512
                    result.update(self.ParamsDictionary[index][subIndex])
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   513
                return result
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   514
        return None
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   515
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   516
    def HasEntryCallbacks(self, index):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   517
        if not getattr(self, "ParamsDictionary", False):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   518
            self.ParamsDictionary = {}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   519
        if index in self.Dictionary and index in self.ParamsDictionary and "callback" in self.ParamsDictionary[index]:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   520
            return self.ParamsDictionary[index]["callback"]
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   521
        return False
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   522
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   523
    """
68
234dad27b398 Adding the possibility for users to choose between Dynamic Mapping and Static Mapping
lbessard
parents: 67
diff changeset
   524
    Check if an entry exists in the User Mapping Dictionary and returns the answer.
234dad27b398 Adding the possibility for users to choose between Dynamic Mapping and Static Mapping
lbessard
parents: 67
diff changeset
   525
    """
234dad27b398 Adding the possibility for users to choose between Dynamic Mapping and Static Mapping
lbessard
parents: 67
diff changeset
   526
    def IsMappingEntry(self, index):
234dad27b398 Adding the possibility for users to choose between Dynamic Mapping and Static Mapping
lbessard
parents: 67
diff changeset
   527
        if index in self.UserMapping:
234dad27b398 Adding the possibility for users to choose between Dynamic Mapping and Static Mapping
lbessard
parents: 67
diff changeset
   528
            return True
234dad27b398 Adding the possibility for users to choose between Dynamic Mapping and Static Mapping
lbessard
parents: 67
diff changeset
   529
        return False
234dad27b398 Adding the possibility for users to choose between Dynamic Mapping and Static Mapping
lbessard
parents: 67
diff changeset
   530
234dad27b398 Adding the possibility for users to choose between Dynamic Mapping and Static Mapping
lbessard
parents: 67
diff changeset
   531
    """
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   532
    Add a new entry in the User Mapping Dictionary
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   533
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   534
    def AddMappingEntry(self, index, subIndex = None, name = "Undefined", struct = 0, size = None, nbmax = None, default = None, values = None):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   535
        if index not in self.UserMapping:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   536
            if values == None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   537
                values = []
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   538
            if subIndex == None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   539
                self.UserMapping[index] = {"name" : name, "struct" : struct, "need" : False, "values" : values}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   540
                if size != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   541
                    self.UserMapping[index]["size"] = size
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   542
                if nbmax != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   543
                    self.UserMapping[index]["nbmax"] = nbmax
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   544
                if default != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   545
                    self.UserMapping[index]["default"] = default
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   546
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   547
        elif subIndex != None and subIndex == len(self.UserMapping[index]["values"]):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   548
            if values == None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   549
                values = {}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   550
            self.UserMapping[index]["values"].append(values)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   551
            return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   552
        return False
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   553
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   554
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   555
    Warning ! Modifies an existing entry in the User Mapping Dictionary. Can't add a new one.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   556
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   557
    def SetMappingEntry(self, index, subIndex = None, name = None, struct = None, size = None, nbmax = None, default = None, values = None):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   558
        if index in self.UserMapping:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   559
            if subIndex == None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   560
                if name != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   561
                    self.UserMapping[index]["name"] = name
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   562
                    if self.UserMapping[index]["struct"] & OD_IdenticalSubindexes:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   563
                        self.UserMapping[index]["values"][1]["name"] = name + " %d[(sub)]"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   564
                    elif not self.UserMapping[index]["struct"] & OD_MultipleSubindexes:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   565
                        self.UserMapping[index]["values"][0]["name"] = name
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   566
                if struct != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   567
                    self.UserMapping[index]["struct"] = struct
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   568
                if size != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   569
                    self.UserMapping[index]["size"] = size
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   570
                if nbmax != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   571
                    self.UserMapping[index]["nbmax"] = nbmax
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   572
                if default != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   573
                    self.UserMapping[index]["default"] = default
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   574
                if values != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   575
                    self.UserMapping[index]["values"] = values
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   576
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   577
            elif 0 <= subIndex < len(self.UserMapping[index]["values"]) and values != None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   578
                self.UserMapping[index]["values"][subIndex].update(values)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   579
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   580
        return False
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   581
    
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   582
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   583
    Removes an existing entry in the User Mapping Dictionary. If a subIndex is specified
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   584
    it will remove this subIndex only if it's the last of the index. If no subIndex
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   585
    is specified it removes the whole index and subIndexes from the User Mapping Dictionary.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   586
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   587
    def RemoveMappingEntry(self, index, subIndex = None):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   588
        if index in self.UserMapping:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   589
            if subIndex == None:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   590
                self.UserMapping.pop(index)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   591
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   592
            elif subIndex == len(self.UserMapping[index]["values"]) - 1:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   593
                self.UserMapping[index]["values"].pop(subIndex)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   594
                return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   595
        return False
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   596
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   597
    def RemoveMapVariable(self, index, subIndex):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   598
        model = index << 16
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   599
        mask = 0xFFFF << 16
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   600
        if subIndex:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   601
            model += subIndex << 8
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   602
            mask = 0xFF << 8
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   603
        for i in self.Dictionary.iterkeys():
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   604
            if 0x1600 <= i <= 0x17FF or 0x1A00 <= i <= 0x1BFF:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   605
                for j,value in enumerate(self.Dictionary[i]):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   606
                    if (value & mask) == model:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   607
                        self.Dictionary[i][j] = 0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   608
    
63
2be18e405e40 Bug on map variable type changing and on comments with special characters corrected
lbessard
parents: 62
diff changeset
   609
    def UpdateMapVariable(self, index, subIndex, size):
2be18e405e40 Bug on map variable type changing and on comments with special characters corrected
lbessard
parents: 62
diff changeset
   610
        model = index << 16
2be18e405e40 Bug on map variable type changing and on comments with special characters corrected
lbessard
parents: 62
diff changeset
   611
        mask = 0xFFFF << 16
2be18e405e40 Bug on map variable type changing and on comments with special characters corrected
lbessard
parents: 62
diff changeset
   612
        if subIndex:
2be18e405e40 Bug on map variable type changing and on comments with special characters corrected
lbessard
parents: 62
diff changeset
   613
            model += subIndex << 8
2be18e405e40 Bug on map variable type changing and on comments with special characters corrected
lbessard
parents: 62
diff changeset
   614
            mask = 0xFF << 8
2be18e405e40 Bug on map variable type changing and on comments with special characters corrected
lbessard
parents: 62
diff changeset
   615
        for i in self.Dictionary.iterkeys():
2be18e405e40 Bug on map variable type changing and on comments with special characters corrected
lbessard
parents: 62
diff changeset
   616
            if 0x1600 <= i <= 0x17FF or 0x1A00 <= i <= 0x1BFF:
2be18e405e40 Bug on map variable type changing and on comments with special characters corrected
lbessard
parents: 62
diff changeset
   617
                for j,value in enumerate(self.Dictionary[i]):
2be18e405e40 Bug on map variable type changing and on comments with special characters corrected
lbessard
parents: 62
diff changeset
   618
                    if (value & mask) == model:
2be18e405e40 Bug on map variable type changing and on comments with special characters corrected
lbessard
parents: 62
diff changeset
   619
                        self.Dictionary[i][j] = model + size
2be18e405e40 Bug on map variable type changing and on comments with special characters corrected
lbessard
parents: 62
diff changeset
   620
    
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   621
    def RemoveLine(self, index, max, incr = 1):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   622
        i = index
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   623
        while i < max and self.IsEntry(i + incr):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   624
            self.Dictionary[i] = self.Dictionary[i + incr]
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   625
            i += incr
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   626
        self.Dictionary.pop(i)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   627
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   628
    def RemoveUserType(self, index):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   629
        type = self.GetEntry(index, 1)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   630
        for i in self.UserMapping:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   631
            for value in self.UserMapping[i]["values"]:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   632
                if value["type"] == index:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   633
                    value["type"] = type
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   634
        self.RemoveMappingEntry(index)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   635
        self.RemoveEntry(index)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   636
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   637
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   638
    Return a copy of the node
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   639
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   640
    def Copy(self):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   641
        return cPickle.loads(cPickle.dumps(self))
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   642
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   643
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   644
    Return a sorted list of indexes in Object Dictionary
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   645
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   646
    def GetIndexes(self):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   647
        listindex = self.Dictionary.keys()
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   648
        listindex.sort()
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   649
        return listindex
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   650
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   651
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   652
    Print the Dictionary values
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   653
    """
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   654
    def Print(self):
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   655
        listindex = self.Dictionary.keys()
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   656
        listindex.sort()
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   657
        for index in listindex:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   658
            print "%04X : %s"%(index, self.Dictionary[index])