Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 155974 | Differences between
and this patch

Collapse All | Expand All

(-)KERNEL_SRC_3.2.2/bin/launchConfigureParser.py (-211 / +282 lines)
Lines 16-21 Link Here
16
#
16
#
17
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18
#
18
#
19
19
import os, glob, string, sys, re
20
import os, glob, string, sys, re
20
import xml.sax
21
import xml.sax
21
22
Lines 30-35 Link Here
30
31
31
# certain values in XML configuration file ("launch" section)
32
# certain values in XML configuration file ("launch" section)
32
lanch_nam      = "launch"
33
lanch_nam      = "launch"
34
help_nam       = "help"
33
gui_nam        = "gui"
35
gui_nam        = "gui"
34
splash_nam     = "splash"
36
splash_nam     = "splash"
35
logger_nam     = "logger"
37
logger_nam     = "logger"
Lines 44-49 Link Here
44
key_nam        = "key"
46
key_nam        = "key"
45
interp_nam     = "interp"
47
interp_nam     = "interp"
46
except_nam     = "noexcepthandler"
48
except_nam     = "noexcepthandler"
49
terminal_nam   = "terminal"
50
case_nam       = "test"
47
51
48
# values in XML configuration file giving specific module parameters (<module_name> section)
52
# values in XML configuration file giving specific module parameters (<module_name> section)
49
# which are stored in opts with key <module_name>_<parameter> (eg SMESH_plugins)
53
# which are stored in opts with key <module_name>_<parameter> (eg SMESH_plugins)
Lines 62-80 Link Here
62
# values of list type
66
# values of list type
63
listKeys = ( containers_nam, embedded_nam, key_nam, modules_nam, standalone_nam, plugins_nam )
67
listKeys = ( containers_nam, embedded_nam, key_nam, modules_nam, standalone_nam, plugins_nam )
64
68
65
# return application version (uses GUI_ROOT_DIR (or KERNEL_ROOT_DIR in batch mode) +/bin/salome/VERSION)
69
###
70
# Get the application version
71
# Uses GUI_ROOT_DIR (or KERNEL_ROOT_DIR in batch mode) +/bin/salome/VERSION file
72
###
66
def version():
73
def version():
67
    root_dir = os.environ.get( 'KERNEL_ROOT_DIR', '' )     # KERNEL_ROOT_DIR or "" if not found
74
    try:
68
    root_dir = os.environ.get( 'GUI_ROOT_DIR', root_dir )  # GUI_ROOT_DIR or KERNEL_ROOT_DIR or "" if both not found
75
        filename = None
69
    filename = root_dir+'/bin/salome/VERSION'
76
        root_dir = os.environ.get( 'KERNEL_ROOT_DIR', '' ) # KERNEL_ROOT_DIR or "" if not found
70
    str = open( filename, "r" ).readline() # str = "THIS IS SALOME - SALOMEGUI VERSION: 3.0.0"
77
        if root_dir and os.path.exists( root_dir + "/bin/salome/VERSION" ):
71
    match = re.search( r':\s+([a-zA-Z0-9.]+)\s*$', str )
78
            filename = root_dir + "/bin/salome/VERSION"
72
    if match :
79
        root_dir = os.environ.get( 'GUI_ROOT_DIR', '' )    # GUI_ROOT_DIR "" if not found
73
        return match.group( 1 )
80
        if root_dir and os.path.exists( root_dir + "/bin/salome/VERSION" ):
81
            filename = root_dir + "/bin/salome/VERSION"
82
        if filename:
83
            str = open( filename, "r" ).readline() # str = "THIS IS SALOME - SALOMEGUI VERSION: 3.0.0"
84
            match = re.search( r':\s+([a-zA-Z0-9.]+)\s*$', str )
85
            if match :
86
                return match.group( 1 )
87
    except:
88
        pass
74
    return ''
89
    return ''
75
90
76
# calculate and return configuration file id in order to unically identify it
91
###
77
# for example: for 3.1.0a1 the id is 301000101
92
# Calculate and return configuration file unique ID
93
# For example: for SALOME version 3.1.0a1 the id is 300999701
94
###
78
def version_id( fname ):
95
def version_id( fname ):
79
    vers = fname.split(".")
96
    vers = fname.split(".")
80
    major   = int(vers[0])
97
    major   = int(vers[0])
Lines 96-102 Link Here
96
    if dev > 0: ver = ver - 10000 + dev
113
    if dev > 0: ver = ver - 10000 + dev
97
    return ver
114
    return ver
98
115
99
# get user configuration file name
116
###
117
# Get user configuration file name
118
###
100
def userFile():
119
def userFile():
101
    v = version()
120
    v = version()
102
    if not v:
121
    if not v:
Lines 123-129 Link Here
123
142
124
# -----------------------------------------------------------------------------
143
# -----------------------------------------------------------------------------
125
144
126
### xml reader for launch configuration file usage
145
###
146
# XML reader for launch configuration file usage
147
###
127
148
128
section_to_skip = ""
149
section_to_skip = ""
129
150
Lines 212-307 Link Here
212
233
213
# -----------------------------------------------------------------------------
234
# -----------------------------------------------------------------------------
214
235
215
### searching for launch configuration files
236
###
216
# the rule:
237
# Command line options parser
217
# - environment variable {'appname'+'Config'} (SalomeAppConfig) contains list of directories (';' as devider)
238
###
218
# - these directories contain 'appname'+'.xml' (SalomeApp.xml) configuration files
219
# - these files are analyzed beginning with the last one (last directory in the list)
220
# - if a key is found in next analyzed cofiguration file - it will be replaced
221
# - the last configuration file to be analyzed - ~/.'appname'+'rc' (~/SalomeApprc) (if it exists)
222
# - but anyway, if user specifies a certain option in a command line - it will replace the values
223
# - specified in configuration file(s)
224
# - once again the order of settings (next setting replaces the previous ones):
225
# -     SalomeApp.xml files in directories specified by SalomeAppConfig env variable
226
# -     .SalomeApprc file in user's catalogue
227
# -     command line
228
229
config_var = appname+'Config'
230
# set resources variables if not yet set
231
dirs = []
232
if os.getenv(config_var):
233
    dirs += re.split('[;|:]', os.getenv(config_var))
234
if os.getenv("GUI_ROOT_DIR"):
235
    dirs += [os.getenv("GUI_ROOT_DIR") + "/share/salome/resources/gui"]
236
os.environ[config_var] = ":".join(dirs)
237
238
dirs.reverse() # reverse order, like in "path" variable - FILO-style processing
239
240
_opts = {} # assiciative array of options to be filled
241
242
# SalomeApp.xml files in directories specified by SalomeAppConfig env variable
243
for dir in dirs:
244
    filename = dir+'/'+appname+'.xml'
245
    if not os.path.exists(filename):
246
        print "Configure parser: Warning : could not find configuration file %s" % filename
247
    else:
248
        try:
249
            p = xml_parser(filename, _opts)
250
            _opts = p.opts
251
        except:
252
            print "Configure parser: Error : can not read configuration file %s" % filename
253
        pass
254
255
# SalomeApprc file in user's catalogue
256
filename = userFile()
257
if not filename or not os.path.exists(filename):
258
    print "Configure parser: Warning : could not find user configuration file"
259
else:
260
    try:
261
        p = xml_parser(filename, _opts)
262
        _opts = p.opts
263
    except:
264
        print 'Configure parser: Error : can not read user configuration file'
265
266
args = _opts
267
268
# --- setting default values of keys if they were NOT set in config files ---
269
for aKey in listKeys:
270
    if not args.has_key( aKey ):
271
        args[aKey]=[]
272
273
for aKey in boolKeys:
274
    if not args.has_key( aKey ):
275
        args[aKey]=0
276
277
if args[file_nam]:
278
    afile=args[file_nam]
279
    args[file_nam]=[afile]
280
281
args[appname_nam] = appname
282
283
### searching for my port
284
285
my_port = 2809
286
try:
287
  file = open(os.environ["OMNIORB_CONFIG"], "r")
288
  s = file.read()
289
  while len(s):
290
    l = string.split(s, ":")
291
    if string.split(l[0], " ")[0] == "ORBInitRef" or string.split(l[0], " ")[0] == "InitRef" :
292
      my_port = int(l[len(l)-1])
293
      pass
294
    s = file.read()
295
    pass
296
except:
297
  pass
298
299
args[port_nam] = my_port
300
301
# -----------------------------------------------------------------------------
302
303
### command line options reader
304
305
def options_parser(line):
239
def options_parser(line):
306
  source = line
240
  source = line
307
  list = []
241
  list = []
Lines 319-329 Link Here
319
    if source[i][0] != '-':
253
    if source[i][0] != '-':
320
      key = None
254
      key = None
321
    elif source[i][1] == '-':
255
    elif source[i][1] == '-':
322
      key = source[i][2]
256
      key = source[i][2:]
323
    else:
257
    else:
324
      key = source[i][1]
258
      key = source[i][1:]
325
      pass
259
      pass
326
260
261
    if key is None and not result:
262
        raise Exception()
327
    result[key] = []
263
    result[key] = []
328
    if key:
264
    if key:
329
      i += 1
265
      i += 1
Lines 337-454 Link Here
337
273
338
# -----------------------------------------------------------------------------
274
# -----------------------------------------------------------------------------
339
275
340
### read command-line options : each arg given in command line supersedes arg from xml config file
276
###
341
cmd_opts = {}
277
# Get the environment
342
try:
278
###
343
    cmd_opts = options_parser(sys.argv[1:])
279
344
    kernel_root_dir=os.environ["KERNEL_ROOT_DIR"]
280
# this attribute is obsolete
345
except:
281
args = []
346
    cmd_opts["h"] = 1
282
def get_env():
347
    pass
283
    ###
284
    # Collect launch configuration files:
285
    # - The environment variable "<appname>Config" (SalomeAppConfig) which can
286
    #   define a list of directories (separated by ':' or ';' symbol) is checked
287
    # - If the environment variable "<appname>Config" is not set, only
288
    #   ${GUI_ROOT_DIR}/share/salome/resources/gui is inspected
289
    # - ${GUI_ROOT_DIR}/share/salome/resources/gui directory is always inspected
290
    #   so it is not necessary to put it in the "<appname>Config" variable
291
    # - The directories which are inspected are checked for files "<appname>.xml"
292
    #  (SalomeApp.xml) which define SALOME configuration
293
    # - These directories are analyzed beginning from the last one in the list,
294
    #   so the first directory listed in "<appname>Config" environment variable 
295
    #   has higher priority: it means that if some configuration options
296
    #   is found in the next analyzed cofiguration file - it will be replaced
297
    # - The last configuration file which is parsed is user configuration file
298
    #   situated in the home directory: "~/.<appname>rc[.<version>]" (~/SalomeApprc.3.2.0)
299
    #   (if it exists)
300
    # - Command line options have the highest priority and replace options
301
    #   specified in configuration file(s)
302
    ###
303
304
    global args
305
    config_var = appname+'Config'
306
307
    # set resources variable SaloemAppConfig if it is not set yet 
308
    dirs = []
309
    if os.getenv(config_var):
310
        dirs += re.split('[;|:]', os.getenv(config_var))
311
    if os.getenv("GUI_ROOT_DIR") and os.path.isdir( os.getenv("GUI_ROOT_DIR") + "/share/salome/resources/gui" ):
312
        dirs += [os.getenv("GUI_ROOT_DIR") + "/share/salome/resources/gui"]
313
    os.environ[config_var] = ":".join(dirs)
314
315
    dirs.reverse() # reverse order, like in "path" variable - FILO-style processing
316
317
    _opts = {} # associative array of options to be filled
318
319
    # parse SalomeApp.xml files in directories specified by SalomeAppConfig env variable
320
    for dir in dirs:
321
        filename = dir+'/'+appname+'.xml'
322
        if not os.path.exists(filename):
323
            print "Configure parser: Warning : could not find configuration file %s" % filename
324
        else:
325
            try:
326
                p = xml_parser(filename, _opts)
327
                _opts = p.opts
328
            except:
329
                print "Configure parser: Error : can not read configuration file %s" % filename
330
            pass
348
331
349
### check all options are right
332
    # parse .SalomeApprc.<version> file in user's home directory if it exists
333
    # if user file for the current version is not found the nearest to it is used
334
    filename = userFile()
335
    if not filename or not os.path.exists(filename):
336
        print "Configure parser: Warning : could not find user configuration file"
337
    else:
338
        try:
339
            p = xml_parser(filename, _opts)
340
            _opts = p.opts
341
        except:
342
            print 'Configure parser: Error : can not read user configuration file'
350
343
351
opterror=0
344
    args = _opts
352
for opt in cmd_opts:
353
    if not opt in ("h","g","l","f","x","m","e","s","c","p","k","t","i","r"):
354
        print "Configure parser: Error : command line error : -%s" % opt
355
        opterror=1
356
357
if opterror == 1:
358
    cmd_opts["h"] = 1
359
360
if cmd_opts.has_key("h"):
361
    print """USAGE: runSalome.py [options]
362
    [command line options] :
363
    --help or -h                  : print this help
364
    --gui or -g                   : launching with GUI
365
    --terminal -t                 : launching without gui (to deny --gui)
366
    or -t=PythonScript[,...]
367
                                  : import of PythonScript(s)
368
    --logger or -l                : redirect messages in a CORBA collector
369
    --file=filename or -f=filename: redirect messages in a log file
370
    --xterm or -x                 : execute servers in xterm console (messages appear in xterm windows)
371
    --modules=module1,module2,... : salome module list (modulen is the name of Salome module to load)
372
    or -m=module1,module2,...
373
    --embedded=registry,study,moduleCatalog,cppContainer
374
    or -e=registry,study,moduleCatalog,cppContainer
375
                                  : embedded CORBA servers (default: registry,study,moduleCatalog,cppContainer)
376
                                  : (logger,pyContainer,supervContainer can't be embedded
377
    --standalone=registry,study,moduleCatalog,cppContainer,pyContainer,supervContainer
378
    or -s=registry,study,moduleCatalog,cppContainer,pyContainer,supervContainer
379
                                  : standalone CORBA servers (default: pyContainer,supervContainer)
380
    --containers=cpp,python,superv: (obsolete) launching of containers cpp, python and supervision
381
    or -c=cpp,python,superv       : = get default from -e and -s
382
    --portkill or -p              : kill the salome with current port
383
    --killall or -k               : kill all salome sessions
384
    --interp=n or -i=n            : number of additional xterm to open, with session environment
385
    -z                            : display splash screen
386
    -r                            : disable centralized exception handling mechanism
387
388
    For each Salome module, the environment variable <modulen>_ROOT_DIR must be set.
389
    The module name (<modulen>) must be uppercase.
390
    KERNEL_ROOT_DIR is mandatory.
391
    """
392
    sys.exit(1)
393
    pass
394
345
395
### apply command-line options to the arguments
346
    # set default values for options which are NOT set in config files
396
for opt in cmd_opts:
347
    for aKey in listKeys:
397
    if opt == 'g':
348
        if not args.has_key( aKey ):
398
        args[gui_nam] = 1
349
            args[aKey]=[]
399
    elif opt == 'z':
400
	args[splash_nam] = 1
401
    elif opt == 'r':
402
	args[except_nam] = 1
403
    elif opt == 'l':
404
        args[logger_nam] = 1
405
    elif opt == 'f':
406
        args[file_nam] = cmd_opts['f']
407
    elif opt == 'x':
408
        args[xterm_nam] = 1
409
    elif opt == 'i':
410
        args[interp_nam] = cmd_opts['i']
411
    elif opt == 'm':
412
        args[modules_nam] = cmd_opts['m']
413
    elif opt == 'e':
414
        args[embedded_nam] = cmd_opts['e']
415
    elif opt == 's':
416
        args[standalone_nam] = cmd_opts['s']
417
    elif opt == 'c':
418
        args[containers_nam] = cmd_opts['c']
419
    elif opt == 'p':
420
        args[portkill_nam] = 1
421
    elif opt == 'k':
422
        args[killall_nam] = 1
423
        pass
424
    pass
425
350
426
# if --modules (-m) command line option is not given
351
    for aKey in boolKeys:
427
# try SALOME_MODULES environment variable
352
        if not args.has_key( aKey ):
428
if not cmd_opts.has_key( "m" ) and os.getenv( "SALOME_MODULES" ):
353
            args[aKey]=0
429
    args[modules_nam] = re.split( "[:;,]", os.getenv( "SALOME_MODULES" ) )
430
    pass
431
354
432
# 'terminal' must be processed in the end: to deny any 'gui' options
355
    if args[file_nam]:
433
args[script_nam] = []
356
        afile=args[file_nam]
434
if 't' in cmd_opts:
357
        args[file_nam]=[afile]
435
    args[gui_nam] = 0
436
    args[script_nam] = cmd_opts['t']
437
    pass
438
358
439
if args[except_nam] == 1:
359
    args[appname_nam] = appname
440
    os.environ["DISABLE_FPE"] = "1"
360
441
    pass
361
    # get the port number
362
    my_port = 2809
363
    try:
364
      file = open(os.environ["OMNIORB_CONFIG"], "r")
365
      s = file.read()
366
      while len(s):
367
        l = string.split(s, ":")
368
        if string.split(l[0], " ")[0] == "ORBInitRef" or string.split(l[0], " ")[0] == "InitRef" :
369
          my_port = int(l[len(l)-1])
370
          pass
371
        s = file.read()
372
        pass
373
    except:
374
      pass
375
376
    args[port_nam] = my_port
377
378
    # read command-line options
379
    # each option given in command line overrides the option from xml config file
380
    cmd_opts = {}
381
    try:
382
        cmd_opts = options_parser(sys.argv[1:])
383
        kernel_root_dir=os.environ["KERNEL_ROOT_DIR"]
384
    except:
385
        cmd_opts["h"] = 1
386
        pass
442
387
443
# now modify SalomeAppConfig environment variable
388
    # check if all command line options are correct
444
dirs = re.split('[;|:]', os.environ[config_var] )
389
    short_opts = ("h","g","l","f","x","m","e","s","c","p","k","t","i","r","z")
390
    long_opts = (help_nam,gui_nam,logger_nam,file_nam,xterm_nam,modules_nam,
391
                 embedded_nam,standalone_nam,containers_nam,portkill_nam,
392
                 killall_nam,terminal_nam,interp_nam,except_nam,splash_nam,
393
                 case_nam)
394
    opterror=0
395
    for opt in cmd_opts:
396
        if opt not in short_opts and opt not in long_opts:
397
            print "Configure parser: Error : command line error : -%s" % opt
398
            opterror=1
399
400
    if opterror == 1:
401
        cmd_opts["h"] = 1
402
403
    if cmd_opts.has_key("h") or cmd_opts.has_key(help_nam):
404
        print """
405
        USAGE: runSalome.py [options]
406
407
        Command line options:
408
409
        --gui             (-g)                 Launch in GUI mode [default].
410
        --terminal        (-t)                 Launching without GUI (in the terminal mode).
411
        --terminal=<python_script>[,...]       Launching without GUI (in the terminal mode) and 
412
               (-t=<python_script>[,...])      additionally import python script(s).
413
        --logger          (-l)                 Redirect messages to the CORBA collector.
414
        --file=<file>     (-f=<file>)          Redirect messages to the log file.
415
        --xterm           (-x)                 Launch each SALOME server in own xterm console.
416
        --modules=<module1>,<module2>,...      SALOME module list (where <module1>, <module2> 
417
              (-m=<module1>,<module2>,...)     are the names of SALOME modules which should be
418
                                               available in the SALOME session).
419
        --embedded=<server1>,<server2>,...     CORBA servers to be launched in the Session
420
               (-e=<server1>,<server2>,...)    embedded mode.
421
                                               Valid values for <serverN>: registry, study,
422
                                               moduleCatalog, cppContainer
423
                                               [default: all mentioned].
424
        --standalone=<server1>,<server2>,...   CORBA servers to be launched in the standalone
425
                 (-s=<server1>,<server2>,...)  mode (as separate processes).
426
                                               Valid values for <serverN>: registry, study,
427
                                               moduleCatalog, cppContainer, pyContainer,
428
                                               supervContainer
429
                                               [default: pyContainer,supervContainer].
430
        --containers=<container1>,...          [obsolete] SALOME containers to be launched.
431
                 (-c=<container1>,...)         Valid values: cpp, python, superv
432
                                               [default: use --embedded and --standalone
433
                                               parameters].
434
        --portkill        (-p)                 Kill SALOME with the current port.
435
        --killall         (-k)                 Kill all running SALOME sessions.
436
        --interp=<N>      (-i=<N>)             The number of additional xterm sessions to open.
437
                                               In each xterm session SALOME environment is set
438
                                               properly.
439
        --splash          (-z)                 Display splash screen.
440
        --noexcepthandler (-r)                 Disable centralized exception handling
441
                                               mechanism.
442
        --test=<hdf_file_andor_python_scripts> HDF file to be opened on GUI starting and/or
443
                                               Python script(s) to be imported in the GUI
444
                                               study. The files can appear in arbitrary order.
445
                                               If the HDF file is given it is opened, otherwise
446
                                               the new empty study is created.
447
                                               Python scripts are imported in the order of
448
                                               their appearance.
449
                                               This option is avaiable only in GUI mode,
450
                                               for batch mode use --terminal(-t) option.
451
        --help            (-h)                 Print this help info
452
453
        For each SALOME module, the environment variable <moduleN>_ROOT_DIR must be set.
454
        KERNEL_ROOT_DIR is mandatory.
455
        """
456
        sys.exit(1)
457
        pass
458
459
    # apply command-line options to the arguments
460
    BATCHMODE_FORCED = False
461
    args[script_nam] = []
462
    for opt in cmd_opts:
463
        if   opt in [ 'g', gui_nam ] :
464
            if not BATCHMODE_FORCED: args[gui_nam] = 1
465
        elif opt in [ 't', terminal_nam ] :
466
            args[gui_nam] = 0
467
            args[script_nam] = cmd_opts[opt]
468
            BATCHMODE_FORCED = True
469
        elif opt in [ 'z', splash_nam ] :
470
            args[splash_nam] = 1
471
        elif opt in [ 'r', except_nam ] :
472
            args[except_nam] = 1
473
        elif opt in [ 'l', logger_nam ] :
474
            args[logger_nam] = 1
475
        elif opt in [ 'f', file_nam ] :
476
            args[file_nam] = cmd_opts[opt]
477
        elif opt in [ 'x', xterm_nam ] :
478
            args[xterm_nam] = 1
479
        elif opt in [ 'i', interp_nam ] :
480
            args[interp_nam] = cmd_opts[opt]
481
        elif opt in [ 'm', modules_nam ] :
482
            args[modules_nam] = cmd_opts[opt]
483
        elif opt in [ 'e', embedded_nam ] :
484
            args[embedded_nam] = cmd_opts[opt]
485
        elif opt in [ 's', standalone_nam ] :
486
            args[standalone_nam] = cmd_opts[opt]
487
        elif opt in [ 'c', containers_nam ] :
488
            args[containers_nam] = cmd_opts[opt]
489
        elif opt in [ 'p', portkill_nam ] :
490
            args[portkill_nam] = 1
491
        elif opt in [ 'k', killall_nam ] :
492
            args[killall_nam] = 1
493
        elif opt in [ case_nam ] :
494
           args[case_nam] = cmd_opts[opt]
495
        pass
496
497
    # if --modules (-m) command line option is not given
498
    # try SALOME_MODULES environment variable
499
    if not cmd_opts.has_key( "m" ) and \
500
       not cmd_opts.has_key( modules_nam ) and \
501
           os.getenv( "SALOME_MODULES" ):
502
        args[modules_nam] = re.split( "[:;,]", os.getenv( "SALOME_MODULES" ) )
503
        pass
504
505
    # disable signals handling
506
    if args[except_nam] == 1:
507
        os.environ["NOT_INTERCEPT_SIGNALS"] = "1"
508
        pass
509
510
    # now modify SalomeAppConfig environment variable
511
    # to take into account the SALOME modules
512
    dirs = re.split('[;|:]', os.environ[config_var] )
513
514
    for m in args[modules_nam]:
515
        if m not in ["KERNEL", "GUI", ""] and os.getenv("%s_ROOT_DIR"%m):
516
            d1 = os.getenv("%s_ROOT_DIR"%m) + "/share/salome/resources/" + m.lower()
517
            d2 = os.getenv("%s_ROOT_DIR"%m) + "/share/salome/resources"
518
            if os.path.exists( "%s/%s.xml"%(d1, appname) ):
519
                dirs.append( d1 )
520
            elif os.path.exists( "%s/%s.xml"%(d2, appname) ):
521
                dirs.append( d2 )
522
    os.environ[config_var] = ":".join(dirs)
445
523
446
for m in args[modules_nam]:
524
    # return arguments
447
    if m not in ["KERNEL", "GUI", ""] and os.getenv("%s_ROOT_DIR"%m):
525
    return args
448
        d1 = os.getenv("%s_ROOT_DIR"%m) + "/share/salome/resources/" + m.lower()
449
        d2 = os.getenv("%s_ROOT_DIR"%m) + "/share/salome/resources"
450
        if os.path.exists( "%s/%s.xml"%(d1, appname) ):
451
            dirs.append( d1 )
452
        elif os.path.exists( "%s/%s.xml"%(d2, appname) ):
453
            dirs.append( d2 )
454
os.environ[config_var] = ":".join(dirs)
(-)KERNEL_SRC_3.2.2/bin/runSalome.py (-5 / +4 lines)
Lines 80-86 Link Here
80
    # read args from launch configure xml file and command line options
80
    # read args from launch configure xml file and command line options
81
    
81
    
82
    import launchConfigureParser
82
    import launchConfigureParser
83
    args = launchConfigureParser.args
83
    args = launchConfigureParser.get_env()
84
    
84
    
85
    # Check variables <module>_ROOT_DIR
85
    # Check variables <module>_ROOT_DIR
86
    # and set list of used modules (without KERNEL)
86
    # and set list of used modules (without KERNEL)
Lines 473-482 Link Here
473
        if self.args['noexcepthandler']:
473
        if self.args['noexcepthandler']:
474
            self.SCMD2+=['noexcepthandler']
474
            self.SCMD2+=['noexcepthandler']
475
        if self.args.has_key('modules'):
475
        if self.args.has_key('modules'):
476
            self.SCMD2+=['--modules (']
476
            self.SCMD2+=['--modules (%s)'%":".join(self.args['modules'])]
477
            for mod in self.args['modules']:
477
        if self.args.has_key('test') and len(args['test']) > 0:
478
                self.SCMD2+=[mod + ':']
478
            self.SCMD2+=['--test=%s'%(",".join(args['test']))]
479
            self.SCMD2+=[')']    
480
479
481
    def setpath(self,modules_list,modules_root_dir):
480
    def setpath(self,modules_list,modules_root_dir):
482
        cata_path=[]
481
        cata_path=[]
(-)KERNEL_SRC_3.2.2/doc/salome/tui/Makefile.am (-1 / +1 lines)
Lines 25-31 Link Here
25
25
26
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
26
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
27
27
28
EXTRA_DIST = $(srcdir)/KERNEL $(srcdir)/pythfilter.py
28
EXTRA_DIST = KERNEL pythfilter.py
29
29
30
dist-hook:
30
dist-hook:
31
	rm -rf `find $(distdir) -name CVS`
31
	rm -rf `find $(distdir) -name CVS`
(-)KERNEL_SRC_3.2.2/idl/SALOMEDS.idl (-4 / +4 lines)
Lines 400-406 Link Here
400
   \param thePID is a process ID of the caller
400
   \param thePID is a process ID of the caller
401
   \param isLocal is set True if the Study is launched locally with the caller
401
   \param isLocal is set True if the Study is launched locally with the caller
402
*/
402
*/
403
    long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
403
    long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
404
404
405
405
406
/*!
406
/*!
Lines 842-848 Link Here
842
   \param thePID is a process ID of the caller
842
   \param thePID is a process ID of the caller
843
   \param isLocal is set True if the StudyManager is launched locally with the caller
843
   \param isLocal is set True if the StudyManager is launched locally with the caller
844
*/
844
*/
845
    long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal); 
845
    long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal); 
846
846
847
847
848
  };
848
  };
Lines 959-965 Link Here
959
   \param thePID is a process ID of the caller
959
   \param thePID is a process ID of the caller
960
   \param isLocal is set True if the SObject is launched locally with the caller
960
   \param isLocal is set True if the SObject is launched locally with the caller
961
*/
961
*/
962
    long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
962
    long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
963
  };
963
  };
964
964
965
965
Lines 996-1002 Link Here
996
   \param thePID is a process ID of the caller
996
   \param thePID is a process ID of the caller
997
   \param isLocal is set True if the GenericAttribute is launched locally with the caller
997
   \param isLocal is set True if the GenericAttribute is launched locally with the caller
998
*/
998
*/
999
    long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
999
    long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1000
  };
1000
  };
1001
1001
1002
1002
(-)KERNEL_SRC_3.2.2/idl/SALOMEDS_Attributes.idl (+18 lines)
Lines 266-271 Link Here
266
    void   SetValue(in string value);
266
    void   SetValue(in string value);
267
  };
267
  };
268
  //==========================================================================
268
  //==========================================================================
269
/*! \brief String attribute
270
271
    This attribute stores a string value containing arbitrary information.
272
*/
273
  //==========================================================================
274
  interface AttributeString : GenericAttribute
275
  {
276
/*!
277
    Returns the value of this attribute
278
*/
279
    string Value();
280
/*!
281
   Sets the value of this attribute
282
   \param value This string parameter defines the value of this attribute.
283
*/
284
    void   SetValue(in string value);
285
  };
286
  //==========================================================================
269
/*! \brief IOR attribute
287
/*! \brief IOR attribute
270
288
271
    This attribute stores a string value identifying a runtime object.In particular
289
    This attribute stores a string value identifying a runtime object.In particular
(-)KERNEL_SRC_3.2.2/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 (-2 / +81 lines)
Lines 35-40 Link Here
35
 echo "conftest.o: conftest.c" > conftest.verif
35
 echo "conftest.o: conftest.c" > conftest.verif
36
 echo "int  main() { return 0; }" > conftest.c
36
 echo "int  main() { return 0; }" > conftest.c
37
37
38
f77int="F77INT32"
39
case  $host_os in
40
   irix5.* | irix6.* | osf4.* | osf5.* | linux*  )
41
42
        linux64="true"
43
        expr "$host_os" : 'linux' >/dev/null && test ! x"$host_cpu" = x"x86_64" && linux64="false"
44
	if test ! x"$linux64" = "xfalse" ; then
45
	  echo "$as_me:$LINENO: checking for 64bits integers size in F77/F90" >&5
46
echo $ECHO_N "checking for 64bits integers size in F77/F90... $ECHO_C" >&6
47
	  # Check whether --enable-int64 or --disable-int64 was given.
48
if test "${enable_int64+set}" = set; then
49
  enableval="$enable_int64"
50
51
fi;
52
	  case "X-$enable_int64" in
53
	    X-no)
54
	     echo "$as_me:$LINENO: result: \"disabled\"" >&5
55
echo "${ECHO_T}\"disabled\"" >&6
56
	     SUFFIXES="_32"
57
	     ;;
58
	    *)
59
	     echo "$as_me:$LINENO: result: \"enabled\"" >&5
60
echo "${ECHO_T}\"enabled\"" >&6
61
	     SUFFIXES=""
62
	     f77int="F77INT64"
63
	     ;;
64
	  esac
65
	fi
66
     ;;
67
   *)
68
     ;;
69
esac
70
71
case $host_os in
72
    linux*)
73
        if test x"$linux64" = x"true"; then \
74
          MACHINE="PCLINUX64${SUFFIXES}";
75
	  CFLAGS=" -m64 ${CXXFLAGS}";
76
	  CXXFLAGS=" -m64 ${CXXFLAGS}";\
77
	else \
78
	  MACHINE=PCLINUX; \
79
	fi
80
	;;
81
    hpux*)
82
	MACHINE=HP9000
83
	;;
84
    aix4.*)
85
	MACHINE=RS6000
86
	host_os_novers=aix4.x
87
	;;
88
    irix5.*)
89
	MACHINE="IRIX64${SUFFIXES}"
90
	host_os_novers=irix5.x
91
	;;
92
    irix6.*)
93
	MACHINE="IRIX64${SUFFIXES}"
94
	host_os_novers=irix6.x
95
	;;
96
    osf4.*)
97
	MACHINE="OSF1${SUFFIXES}"
98
	host_os_novers=osf4.x
99
	;;
100
    osf5.*)
101
	MACHINE="OSF1${SUFFIXES}"
102
	 host_os_novers=osf5.x
103
	 ;;
104
    solaris2.*)
105
	MACHINE=SUN4SOL2
106
	 host_os_novers=solaris2.x
107
	 ;;
108
    uxpv*)
109
	MACHINE=VPP5000
110
	 ;;
111
    *)
112
	MACHINE=
113
	 host_os_novers=$host_os
114
	 ;;
115
esac
116
38
dnl Evolution portage sur CCRT/osf system
117
dnl Evolution portage sur CCRT/osf system
39
 case $host_os in
118
 case $host_os in
40
   osf*)
119
   osf*)
Lines 44-57 Link Here
44
     DEPCXX=g++
123
     DEPCXX=g++
45
     DEPCXXFLAGS="-Wno-deprecated"
124
     DEPCXXFLAGS="-Wno-deprecated"
46
     DIFFFLAGS="-w"
125
     DIFFFLAGS="-w"
47
     MACHINE="OSF1"
126
dnl  MACHINE="OSF1"
48
     ;;
127
     ;;
49
   *)
128
   *)
50
     DEPCC=${CC-cc}
129
     DEPCC=${CC-cc}
51
     DEPCXX=${CXX-c++}
130
     DEPCXX=${CXX-c++}
52
     DEPCXXFLAGS="\${CXXFLAGS}"
131
     DEPCXXFLAGS="\${CXXFLAGS}"
53
     DIFFFLAGS="-b -B"
132
     DIFFFLAGS="-b -B"
54
     MACHINE="PCLINUX"
133
dnl  MACHINE="PCLINUX"
55
     ;;
134
     ;;
56
 esac
135
 esac
57
 C_DEPEND_FLAG=
136
 C_DEPEND_FLAG=
(-)KERNEL_SRC_3.2.2/salome_adm/unix/config_files/check_cppunit.m4 (+7 lines)
Lines 24-33 Link Here
24
  exits_ok=no	
24
  exits_ok=no	
25
  if test "x$exits_ok" = "xno"; then
25
  if test "x$exits_ok" = "xno"; then
26
     for d in /usr/local /usr ; do
26
     for d in /usr/local /usr ; do
27
        AC_CHECK_FILE(${d}/lib64/libcppunit.so,exits_ok=yes,exits_ok=no)
28
        if test "x$exits_ok" = "xyes"; then
29
           CPPUNITHOME=$d
30
           AC_MSG_RESULT(libcppunit.so detected in $d/lib64)
31
	   break
32
        fi
27
        AC_CHECK_FILE(${d}/lib/libcppunit.so,exits_ok=yes,exits_ok=no)
33
        AC_CHECK_FILE(${d}/lib/libcppunit.so,exits_ok=yes,exits_ok=no)
28
        if test "x$exits_ok" = "xyes"; then
34
        if test "x$exits_ok" = "xyes"; then
29
           CPPUNITHOME=$d
35
           CPPUNITHOME=$d
30
           AC_MSG_RESULT(libcppunit.so detected in $d/lib)
36
           AC_MSG_RESULT(libcppunit.so detected in $d/lib)
37
	   break
31
        fi
38
        fi
32
     done
39
     done
33
  fi
40
  fi
(-)KERNEL_SRC_3.2.2/src/Batch/Batch_Parametre.hxx (-1 / +1 lines)
Lines 54-60 Link Here
54
    Parametre();
54
    Parametre();
55
55
56
    // Constructeur par recopie
56
    // Constructeur par recopie
57
    Parametre::Parametre(const Parametre & PM);
57
    Parametre(const Parametre & PM);
58
58
59
    // Operateur de recherche dans la map
59
    // Operateur de recherche dans la map
60
    Versatile & operator [] (const string &);
60
    Versatile & operator [] (const string &);
(-)KERNEL_SRC_3.2.2/src/Container/Container_i.cxx (+9 lines)
Lines 267-273 Link Here
267
void Engines_Container_i::Shutdown()
267
void Engines_Container_i::Shutdown()
268
{
268
{
269
  MESSAGE("Engines_Container_i::Shutdown()");
269
  MESSAGE("Engines_Container_i::Shutdown()");
270
271
  /* For each component contained in this container
272
   * tell it to self-destroy
273
   */
274
  std::map<std::string, Engines::Component_var>::iterator itm;
275
  for (itm = _listInstances_map.begin(); itm != _listInstances_map.end(); itm++)
276
    itm->second->destroy();
277
270
  _NS->Destroy_FullDirectory(_containerName.c_str());
278
  _NS->Destroy_FullDirectory(_containerName.c_str());
279
  _NS->Destroy_Name(_containerName.c_str());
271
  //_remove_ref();
280
  //_remove_ref();
272
  //_poa->deactivate_object(*_id);
281
  //_poa->deactivate_object(*_id);
273
  if(_isServantAloneInProcess)
282
  if(_isServantAloneInProcess)
(-)KERNEL_SRC_3.2.2/src/KERNEL_PY/import_hook.py (-1 / +6 lines)
Lines 149-155 Link Here
149
       #when fromlist is not specified and name is a dotted name,
149
       #when fromlist is not specified and name is a dotted name,
150
       # module is the root package not the real module
150
       # module is the root package not the real module
151
       #so we need to retrieve it
151
       #so we need to retrieve it
152
       m=get_real_module(module,name)
152
       # note: some modules like xml.dom do not play the rule
153
       # (import xml: no attribute dom, but import xml.dom OK)
154
       try:
155
           m=get_real_module(module,name)
156
       except AttributeError:
157
           m=None
153
158
154
    if type(m) == type(sys) and is_shared(m.__name__):
159
    if type(m) == type(sys) and is_shared(m.__name__):
155
       set_shared_imported(m.__name__,m)
160
       set_shared_imported(m.__name__,m)
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/Makefile.am (+4 lines)
Lines 140-145 Link Here
140
	SALOMEDS_AttributeStudyProperties_i.cxx \
140
	SALOMEDS_AttributeStudyProperties_i.cxx \
141
	SALOMEDS_AttributePythonObject_i.cxx \
141
	SALOMEDS_AttributePythonObject_i.cxx \
142
	SALOMEDS_AttributeParameter_i.cxx \
142
	SALOMEDS_AttributeParameter_i.cxx \
143
	SALOMEDS_AttributeString_i.cxx \
143
	SALOMEDS_SObject.cxx \
144
	SALOMEDS_SObject.cxx \
144
	SALOMEDS_SComponent.cxx \
145
	SALOMEDS_SComponent.cxx \
145
	SALOMEDS_GenericAttribute.cxx \
146
	SALOMEDS_GenericAttribute.cxx \
Lines 180-185 Link Here
180
	SALOMEDS_AttributeUserID.cxx \
181
	SALOMEDS_AttributeUserID.cxx \
181
	SALOMEDS_TMPFile_i.cxx \
182
	SALOMEDS_TMPFile_i.cxx \
182
	SALOMEDS_AttributeParameter.cxx \
183
	SALOMEDS_AttributeParameter.cxx \
184
	SALOMEDS_AttributeString.cxx \
183
	SALOMEDS_IParameters.cxx \
185
	SALOMEDS_IParameters.cxx \
184
	\
186
	\
185
	Handle_SALOMEDS_DataMapNodeOfDataMapOfIntegerString.hxx \
187
	Handle_SALOMEDS_DataMapNodeOfDataMapOfIntegerString.hxx \
Lines 322-327 Link Here
322
	SALOMEDS_UseCaseIterator_i.hxx \
324
	SALOMEDS_UseCaseIterator_i.hxx \
323
	SALOMEDS_AttributeParameter.hxx \
325
	SALOMEDS_AttributeParameter.hxx \
324
	SALOMEDS_AttributeParameter_i.hxx \
326
	SALOMEDS_AttributeParameter_i.hxx \
327
	SALOMEDS_AttributeString.hxx \
328
	SALOMEDS_AttributeString_i.hxx \
325
	SALOMEDS_TMPFile_i.hxx
329
	SALOMEDS_TMPFile_i.hxx
326
330
327
libSalomeDS_la_CPPFLAGS = $(COMMON_CPPFLAGS)
331
libSalomeDS_la_CPPFLAGS = $(COMMON_CPPFLAGS)
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_AttributeString.cxx (+62 lines)
Added Link Here
1
// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3
// 
4
// This library is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU Lesser General Public
6
// License as published by the Free Software Foundation; either 
7
// version 2.1 of the License.
8
// 
9
// This library is distributed in the hope that it will be useful 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12
// Lesser General Public License for more details.
13
//
14
// You should have received a copy of the GNU Lesser General Public  
15
// License along with this library; if not, write to the Free Software 
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17
//
18
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19
//
20
//  File   : SALOMEDS_AttributeString.cxx
21
//  Author : Sergey RUIN
22
//  Module : SALOME
23
24
#include "SALOMEDS_AttributeString.hxx"
25
#include "SALOMEDS.hxx"
26
27
#include <string>
28
#include <TCollection_AsciiString.hxx> 
29
#include <TCollection_ExtendedString.hxx>
30
31
SALOMEDS_AttributeString::SALOMEDS_AttributeString(const Handle(SALOMEDSImpl_AttributeString)& theAttr)
32
:SALOMEDS_GenericAttribute(theAttr)
33
{}
34
35
SALOMEDS_AttributeString::SALOMEDS_AttributeString(SALOMEDS::AttributeString_ptr theAttr)
36
:SALOMEDS_GenericAttribute(theAttr)
37
{}
38
39
SALOMEDS_AttributeString::~SALOMEDS_AttributeString()
40
{}
41
42
std::string SALOMEDS_AttributeString::Value()
43
{
44
  std::string aValue;
45
  if (_isLocal) {
46
    SALOMEDS::Locker lock;
47
    aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeString)::
48
                                     DownCast(_local_impl)->Value()).ToCString();
49
  }
50
  else aValue = SALOMEDS::AttributeString::_narrow(_corba_impl)->Value();
51
  return aValue;
52
}
53
 
54
void SALOMEDS_AttributeString::SetValue(const std::string& value)
55
{
56
  if (_isLocal) {
57
    CheckLocked();
58
    SALOMEDS::Locker lock; 
59
    Handle(SALOMEDSImpl_AttributeString)::DownCast(_local_impl)->SetValue((char*)value.c_str());
60
  }
61
  else SALOMEDS::AttributeString::_narrow(_corba_impl)->SetValue(value.c_str());
62
}
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_AttributeString.hxx (+47 lines)
Added Link Here
1
// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3
// 
4
// This library is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU Lesser General Public
6
// License as published by the Free Software Foundation; either 
7
// version 2.1 of the License.
8
// 
9
// This library is distributed in the hope that it will be useful 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12
// Lesser General Public License for more details.
13
//
14
// You should have received a copy of the GNU Lesser General Public  
15
// License along with this library; if not, write to the Free Software 
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17
//
18
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19
//
20
//  File   : SALOMEDS_AttributeString.hxx
21
//  Author : Sergey RUIN
22
//  Module : SALOME
23
24
#ifndef SALOMEDS_AttributeString_HeaderFile
25
#define SALOMEDS_AttributeString_HeaderFile
26
27
#include "SALOMEDSClient_AttributeString.hxx"
28
#include "SALOMEDS_GenericAttribute.hxx"
29
#include "SALOMEDSImpl_AttributeString.hxx"
30
31
// IDL headers
32
#include <SALOMEconfig.h>
33
#include CORBA_SERVER_HEADER(SALOMEDS)
34
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
35
36
class SALOMEDS_AttributeString: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeString
37
{
38
public:  
39
  SALOMEDS_AttributeString(const Handle(SALOMEDSImpl_AttributeString)& theAttr);
40
  SALOMEDS_AttributeString(SALOMEDS::AttributeString_ptr theAttr);
41
  ~SALOMEDS_AttributeString();
42
43
  virtual std::string Value();
44
  virtual void SetValue(const std::string& value);
45
};
46
47
#endif
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_AttributeString_i.cxx (+49 lines)
Added Link Here
1
// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3
// 
4
// This library is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU Lesser General Public
6
// License as published by the Free Software Foundation; either 
7
// version 2.1 of the License.
8
// 
9
// This library is distributed in the hope that it will be useful 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12
// Lesser General Public License for more details.
13
//
14
// You should have received a copy of the GNU Lesser General Public  
15
// License along with this library; if not, write to the Free Software 
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17
//
18
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19
//
20
//  File   : SALOMEDS_AttributeString_i.cxx
21
//  Author : Sergey RUIN
22
//  Module : SALOME
23
24
25
#include "SALOMEDS_AttributeString_i.hxx"
26
27
#include <TCollection_ExtendedString.hxx>
28
#include "SALOMEDS_SObject_i.hxx"
29
#include "SALOMEDS.hxx"
30
31
using namespace std;
32
33
char* SALOMEDS_AttributeString_i::Value()
34
{
35
  SALOMEDS::Locker lock;
36
  
37
  CORBA::String_var c_s =
38
    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeString)::DownCast(_impl)->Value()).ToCString());
39
  return c_s._retn();
40
}
41
42
void SALOMEDS_AttributeString_i::SetValue(const char* value) 
43
{
44
  SALOMEDS::Locker lock; 
45
46
  CheckLocked();
47
  TCollection_AsciiString aStr((char*)value);
48
  Handle(SALOMEDSImpl_AttributeString)::DownCast(_impl)->SetValue(TCollection_ExtendedString(aStr));
49
}
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_AttributeString_i.hxx (+47 lines)
Added Link Here
1
// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3
// 
4
// This library is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU Lesser General Public
6
// License as published by the Free Software Foundation; either 
7
// version 2.1 of the License.
8
// 
9
// This library is distributed in the hope that it will be useful 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12
// Lesser General Public License for more details.
13
//
14
// You should have received a copy of the GNU Lesser General Public  
15
// License along with this library; if not, write to the Free Software 
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17
//
18
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19
//
20
//  File   : SALOMEDS_AttributeString_i.hxx
21
//  Author : Sergey RUIN
22
//  Module : SALOME
23
24
#ifndef SALOMEDS_AttributeString_i_HeaderFile
25
#define SALOMEDS_AttributeString_i_HeaderFile
26
27
// IDL headers
28
#include <SALOMEconfig.h>
29
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
30
31
#include "SALOMEDS_GenericAttribute_i.hxx"
32
#include "SALOMEDSImpl_AttributeString.hxx"
33
34
class SALOMEDS_AttributeString_i: public virtual POA_SALOMEDS::AttributeString,
35
				   public virtual SALOMEDS_GenericAttribute_i 
36
{
37
public:  
38
  SALOMEDS_AttributeString_i(const Handle(SALOMEDSImpl_AttributeString)& theAttr, CORBA::ORB_ptr orb) 
39
    :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
40
41
  virtual ~SALOMEDS_AttributeString_i() {};
42
43
  char* Value();
44
  void SetValue(const char* value);
45
};
46
47
#endif
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_Attributes.hxx (-1 / +4 lines)
Lines 55-60 Link Here
55
#include "SALOMEDSImpl_AttributeFlags.hxx"
55
#include "SALOMEDSImpl_AttributeFlags.hxx"
56
#include "SALOMEDSImpl_AttributeGraphic.hxx"
56
#include "SALOMEDSImpl_AttributeGraphic.hxx"
57
#include "SALOMEDSImpl_AttributeParameter.hxx"
57
#include "SALOMEDSImpl_AttributeParameter.hxx"
58
#include "SALOMEDSImpl_AttributeString.hxx"
58
59
59
#include "SALOMEDS_GenericAttribute_i.hxx"
60
#include "SALOMEDS_GenericAttribute_i.hxx"
60
#include "SALOMEDS_AttributeName_i.hxx"
61
#include "SALOMEDS_AttributeName_i.hxx"
Lines 86-91 Link Here
86
#include "SALOMEDS_AttributeFlags_i.hxx"
87
#include "SALOMEDS_AttributeFlags_i.hxx"
87
#include "SALOMEDS_AttributeGraphic_i.hxx"
88
#include "SALOMEDS_AttributeGraphic_i.hxx"
88
#include "SALOMEDS_AttributeParameter_i.hxx"
89
#include "SALOMEDS_AttributeParameter_i.hxx"
90
#include "SALOMEDS_AttributeString_i.hxx"
89
91
90
#define __CreateCORBAAttribute(CORBA_Name) if (strcmp(aTypeOfAttribute, #CORBA_Name) == 0) { \
92
#define __CreateCORBAAttribute(CORBA_Name) if (strcmp(aTypeOfAttribute, #CORBA_Name) == 0) { \
91
    Handle(SALOMEDSImpl_##CORBA_Name) A = Handle(SALOMEDSImpl_##CORBA_Name)::DownCast(theAttr); \
93
    Handle(SALOMEDSImpl_##CORBA_Name) A = Handle(SALOMEDSImpl_##CORBA_Name)::DownCast(theAttr); \
Lines 124-129 Link Here
124
__CreateCORBAAttribute(AttributeGraphic) \
126
__CreateCORBAAttribute(AttributeGraphic) \
125
__CreateCORBAAttribute(AttributeTreeNode) \
127
__CreateCORBAAttribute(AttributeTreeNode) \
126
__CreateCORBAAttribute(AttributeUserID) \
128
__CreateCORBAAttribute(AttributeUserID) \
127
__CreateCORBAAttribute(AttributeParameter)
129
__CreateCORBAAttribute(AttributeParameter) \
130
__CreateCORBAAttribute(AttributeString)
128
131
129
#endif
132
#endif
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_ClientAttributes.hxx (-2 / +6 lines)
Lines 56-61 Link Here
56
#include "SALOMEDSImpl_AttributeFlags.hxx"
56
#include "SALOMEDSImpl_AttributeFlags.hxx"
57
#include "SALOMEDSImpl_AttributeGraphic.hxx"
57
#include "SALOMEDSImpl_AttributeGraphic.hxx"
58
#include "SALOMEDSImpl_AttributeParameter.hxx"
58
#include "SALOMEDSImpl_AttributeParameter.hxx"
59
#include "SALOMEDSImpl_AttributeString.hxx"
59
60
60
#include "SALOMEDS_GenericAttribute.hxx"
61
#include "SALOMEDS_GenericAttribute.hxx"
61
#include "SALOMEDS_AttributeName.hxx"
62
#include "SALOMEDS_AttributeName.hxx"
Lines 87-92 Link Here
87
#include "SALOMEDS_AttributeFlags.hxx"
88
#include "SALOMEDS_AttributeFlags.hxx"
88
#include "SALOMEDS_AttributeGraphic.hxx"
89
#include "SALOMEDS_AttributeGraphic.hxx"
89
#include "SALOMEDS_AttributeParameter.hxx"
90
#include "SALOMEDS_AttributeParameter.hxx"
91
#include "SALOMEDS_AttributeString.hxx"
90
92
91
#define __CreateClientAttributeLocal(CORBA_Name) if (strcmp(aTypeOfAttribute.c_str(), #CORBA_Name) == 0) { \
93
#define __CreateClientAttributeLocal(CORBA_Name) if (strcmp(aTypeOfAttribute.c_str(), #CORBA_Name) == 0) { \
92
    Handle(SALOMEDSImpl_##CORBA_Name) A = Handle(SALOMEDSImpl_##CORBA_Name)::DownCast(theGA); \
94
    Handle(SALOMEDSImpl_##CORBA_Name) A = Handle(SALOMEDSImpl_##CORBA_Name)::DownCast(theGA); \
Lines 127-133 Link Here
127
__CreateClientAttributeLocal(AttributeGraphic) \
129
__CreateClientAttributeLocal(AttributeGraphic) \
128
__CreateClientAttributeLocal(AttributeTreeNode) \
130
__CreateClientAttributeLocal(AttributeTreeNode) \
129
__CreateClientAttributeLocal(AttributeUserID) \
131
__CreateClientAttributeLocal(AttributeUserID) \
130
__CreateClientAttributeLocal(AttributeParameter)
132
__CreateClientAttributeLocal(AttributeParameter) \
133
__CreateClientAttributeLocal(AttributeString)
131
134
132
#define __CreateGenericClientAttributeCORBA \
135
#define __CreateGenericClientAttributeCORBA \
133
__CreateClientAttributeCORBA(AttributeReal) \
136
__CreateClientAttributeCORBA(AttributeReal) \
Lines 158-163 Link Here
158
__CreateClientAttributeCORBA(AttributeGraphic) \
161
__CreateClientAttributeCORBA(AttributeGraphic) \
159
__CreateClientAttributeCORBA(AttributeTreeNode) \
162
__CreateClientAttributeCORBA(AttributeTreeNode) \
160
__CreateClientAttributeCORBA(AttributeUserID) \
163
__CreateClientAttributeCORBA(AttributeUserID) \
161
__CreateClientAttributeCORBA(AttributeParameter)
164
__CreateClientAttributeCORBA(AttributeParameter) \
165
__CreateClientAttributeCORBA(AttributeString)
162
166
163
#endif
167
#endif
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx (-1 / +1 lines)
Lines 58-64 Link Here
58
  long pid =  (long)getpid();
58
  long pid =  (long)getpid();
59
#endif  
59
#endif  
60
60
61
  long addr = theGA->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
61
  CORBA::LongLong addr = theGA->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
62
  if(_isLocal) {
62
  if(_isLocal) {
63
    _local_impl = ((SALOMEDSImpl_GenericAttribute*)(addr));
63
    _local_impl = ((SALOMEDSImpl_GenericAttribute*)(addr));
64
    _corba_impl = SALOMEDS::GenericAttribute::_nil();
64
    _corba_impl = SALOMEDS::GenericAttribute::_nil();
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx (-2 / +2 lines)
Lines 131-137 Link Here
131
//===========================================================================
131
//===========================================================================
132
//   PRIVATE FUNCTIONS
132
//   PRIVATE FUNCTIONS
133
//===========================================================================
133
//===========================================================================
134
CORBA::Long SALOMEDS_GenericAttribute_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
134
CORBA::LongLong SALOMEDS_GenericAttribute_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
135
{
135
{
136
#ifdef WIN32
136
#ifdef WIN32
137
  long pid = (long)_getpid();
137
  long pid = (long)_getpid();
Lines 140-144 Link Here
140
#endif
140
#endif
141
  isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
141
  isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
142
  TDF_Attribute* local_impl = _impl.operator->();
142
  TDF_Attribute* local_impl = _impl.operator->();
143
  return ((long)local_impl);
143
  return ((CORBA::LongLong)local_impl);
144
}
144
}
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_GenericAttribute_i.hxx (-1 / +1 lines)
Lines 57-63 Link Here
57
57
58
  static SALOMEDS::GenericAttribute_ptr CreateAttribute(const Handle(TDF_Attribute)& theAttr, CORBA::ORB_ptr theOrb);  
58
  static SALOMEDS::GenericAttribute_ptr CreateAttribute(const Handle(TDF_Attribute)& theAttr, CORBA::ORB_ptr theOrb);  
59
59
60
  virtual CORBA::Long GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
60
  virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
61
};
61
};
62
62
63
#endif
63
#endif
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_SObject.cxx (-1 / +3 lines)
Lines 62-68 Link Here
62
  long pid =  (long)getpid();
62
  long pid =  (long)getpid();
63
#endif  
63
#endif  
64
64
65
  long addr = theSObject->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
65
  CORBA::LongLong addr =  // mpv: fix for IPAL13534: for 64-bit platforms use 8-bytes long for pointer storage
66
  theSObject->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
67
66
  if(_isLocal) {
68
  if(_isLocal) {
67
    _local_impl = ((SALOMEDSImpl_SObject*)(addr));
69
    _local_impl = ((SALOMEDSImpl_SObject*)(addr));
68
    _corba_impl = SALOMEDS::SObject::_duplicate(theSObject);
70
    _corba_impl = SALOMEDS::SObject::_duplicate(theSObject);
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_SObject_i.cxx (-2 / +2 lines)
Lines 318-324 Link Here
318
//===========================================================================
318
//===========================================================================
319
//   PRIVATE FUNCTIONS
319
//   PRIVATE FUNCTIONS
320
//===========================================================================
320
//===========================================================================
321
CORBA::Long SALOMEDS_SObject_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
321
CORBA::LongLong SALOMEDS_SObject_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
322
{
322
{
323
#ifdef WIN32
323
#ifdef WIN32
324
  long pid = (long)_getpid();
324
  long pid = (long)_getpid();
Lines 327-331 Link Here
327
#endif
327
#endif
328
  isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
328
  isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
329
  SALOMEDSImpl_SObject* local_impl = _impl.operator->();
329
  SALOMEDSImpl_SObject* local_impl = _impl.operator->();
330
  return ((long)local_impl);
330
  return ((CORBA::LongLong)local_impl);
331
}
331
}
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_SObject_i.hxx (-1 / +1 lines)
Lines 76-82 Link Here
76
  virtual CORBA::Short Tag();
76
  virtual CORBA::Short Tag();
77
  virtual CORBA::Short Depth();
77
  virtual CORBA::Short Depth();
78
78
79
  virtual CORBA::Long GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
79
  virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
80
};
80
};
81
81
82
#endif
82
#endif
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_Study.cxx (-1 / +3 lines)
Lines 83-89 Link Here
83
  long pid =  (long)getpid();
83
  long pid =  (long)getpid();
84
#endif  
84
#endif  
85
85
86
  long addr = theStudy->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
86
  CORBA::LongLong addr =  // mpv: fix for IPAL13534: for 64 bit platform use 8-bytes long for pointer storage
87
    theStudy->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
88
87
  if(_isLocal) {
89
  if(_isLocal) {
88
    _local_impl = ((SALOMEDSImpl_Study*)(addr));
90
    _local_impl = ((SALOMEDSImpl_Study*)(addr));
89
    _corba_impl = SALOMEDS::Study::_duplicate(theStudy);
91
    _corba_impl = SALOMEDS::Study::_duplicate(theStudy);
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_StudyManager.cxx (-2 / +2 lines)
Lines 61-67 Link Here
61
  long pid =  (long)getpid();
61
  long pid =  (long)getpid();
62
#endif  
62
#endif  
63
63
64
  long addr = theManager->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
64
  CORBA::LongLong addr = theManager->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
65
  if(_isLocal) {
65
  if(_isLocal) {
66
    _local_impl = ((SALOMEDSImpl_StudyManager*)(addr));
66
    _local_impl = ((SALOMEDSImpl_StudyManager*)(addr));
67
    _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
67
    _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
Lines 89-95 Link Here
89
  long pid =  (long)getpid();
89
  long pid =  (long)getpid();
90
#endif  
90
#endif  
91
91
92
  long addr = theManager->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
92
  CORBA::LongLong addr = theManager->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
93
  if(_isLocal) {
93
  if(_isLocal) {
94
    _local_impl = ((SALOMEDSImpl_StudyManager*)(addr));
94
    _local_impl = ((SALOMEDSImpl_StudyManager*)(addr));
95
    _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
95
    _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx (-2 / +2 lines)
Lines 456-462 Link Here
456
//===========================================================================
456
//===========================================================================
457
//   PRIVATE FUNCTIONS
457
//   PRIVATE FUNCTIONS
458
//===========================================================================
458
//===========================================================================
459
CORBA::Long SALOMEDS_StudyManager_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
459
CORBA::LongLong SALOMEDS_StudyManager_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
460
{
460
{
461
#ifdef WIN32
461
#ifdef WIN32
462
  long pid = (long)_getpid();
462
  long pid = (long)_getpid();
Lines 465-471 Link Here
465
#endif
465
#endif
466
  isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
466
  isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
467
  SALOMEDSImpl_StudyManager* aManager = _impl.operator->();
467
  SALOMEDSImpl_StudyManager* aManager = _impl.operator->();
468
  return ((long)aManager);
468
  return ((CORBA::LongLong)aManager);
469
}
469
}
470
470
471
//===========================================================================
471
//===========================================================================
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_StudyManager_i.hxx (-1 / +1 lines)
Lines 142-148 Link Here
142
  
142
  
143
  void ping(){};
143
  void ping(){};
144
144
145
  virtual CORBA::Long GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
145
  virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
146
146
147
  static PortableServer::POA_ptr GetPOA(const SALOMEDS::Study_ptr theStudy);
147
  static PortableServer::POA_ptr GetPOA(const SALOMEDS::Study_ptr theStudy);
148
};
148
};
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_Study_i.cxx (-2 / +2 lines)
Lines 883-889 Link Here
883
//===========================================================================
883
//===========================================================================
884
//   PRIVATE FUNCTIONS
884
//   PRIVATE FUNCTIONS
885
//===========================================================================
885
//===========================================================================
886
CORBA::Long SALOMEDS_Study_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
886
CORBA::LongLong SALOMEDS_Study_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
887
{
887
{
888
#ifdef WIN32
888
#ifdef WIN32
889
  long pid = (long)_getpid();
889
  long pid = (long)_getpid();
Lines 892-896 Link Here
892
#endif  
892
#endif  
893
  isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
893
  isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
894
  SALOMEDSImpl_Study* local_impl = _impl.operator->();
894
  SALOMEDSImpl_Study* local_impl = _impl.operator->();
895
  return ((long)local_impl);
895
  return ((CORBA::LongLong)local_impl);
896
}
896
}
(-)KERNEL_SRC_3.2.2/src/SALOMEDS/SALOMEDS_Study_i.hxx (-2 / +2 lines)
Lines 247-253 Link Here
247
  
247
  
248
  virtual SALOMEDS::Study::ListOfSObject* FindDependances(SALOMEDS::SObject_ptr anObject);
248
  virtual SALOMEDS::Study::ListOfSObject* FindDependances(SALOMEDS::SObject_ptr anObject);
249
249
250
  virtual SALOMEDS::AttributeStudyProperties_ptr SALOMEDS_Study_i::GetProperties();
250
  virtual SALOMEDS::AttributeStudyProperties_ptr GetProperties();
251
251
252
  virtual char* GetLastModificationDate();
252
  virtual char* GetLastModificationDate();
253
253
Lines 298-303 Link Here
298
298
299
  virtual Handle(SALOMEDSImpl_Study) GetImpl() { return _impl; }
299
  virtual Handle(SALOMEDSImpl_Study) GetImpl() { return _impl; }
300
300
301
  virtual CORBA::Long GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
301
  virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
302
};
302
};
303
#endif
303
#endif
(-)KERNEL_SRC_3.2.2/src/SALOMEDSClient/Makefile.am (+1 lines)
Lines 55-60 Link Here
55
                SALOMEDSClient_AttributeTreeNode.hxx \
55
                SALOMEDSClient_AttributeTreeNode.hxx \
56
                SALOMEDSClient_AttributeUserID.hxx \
56
                SALOMEDSClient_AttributeUserID.hxx \
57
		SALOMEDSClient_AttributeParameter.hxx \
57
		SALOMEDSClient_AttributeParameter.hxx \
58
		SALOMEDSClient_AttributeString.hxx \
58
                SALOMEDSClient_ChildIterator.hxx \
59
                SALOMEDSClient_ChildIterator.hxx \
59
                SALOMEDSClient_GenericAttribute.hxx \
60
                SALOMEDSClient_GenericAttribute.hxx \
60
                SALOMEDSClient_SComponent.hxx \
61
                SALOMEDSClient_SComponent.hxx \
(-)KERNEL_SRC_3.2.2/src/SALOMEDSClient/SALOMEDSClient.hxx (+1 lines)
Lines 50-55 Link Here
50
#include "SALOMEDSClient_AttributeTreeNode.hxx"
50
#include "SALOMEDSClient_AttributeTreeNode.hxx"
51
#include "SALOMEDSClient_AttributeUserID.hxx"
51
#include "SALOMEDSClient_AttributeUserID.hxx"
52
#include "SALOMEDSClient_AttributeParameter.hxx"
52
#include "SALOMEDSClient_AttributeParameter.hxx"
53
#include "SALOMEDSClient_AttributeString.hxx"
53
#include "SALOMEDSClient_ChildIterator.hxx"
54
#include "SALOMEDSClient_ChildIterator.hxx"
54
#include "SALOMEDSClient_GenericAttribute.hxx"
55
#include "SALOMEDSClient_GenericAttribute.hxx"
55
#include "SALOMEDSClient_SComponent.hxx"
56
#include "SALOMEDSClient_SComponent.hxx"
(-)KERNEL_SRC_3.2.2/src/SALOMEDSClient/SALOMEDSClient_AttributeString.hxx (+38 lines)
Added Link Here
1
// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3
// 
4
// This library is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU Lesser General Public
6
// License as published by the Free Software Foundation; either 
7
// version 2.1 of the License.
8
// 
9
// This library is distributed in the hope that it will be useful 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12
// Lesser General Public License for more details.
13
//
14
// You should have received a copy of the GNU Lesser General Public  
15
// License along with this library; if not, write to the Free Software 
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17
//
18
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19
//
20
//  File   : SALOMEDSClient_AttributeString.hxx
21
//  Author : Sergey RUIN
22
//  Module : SALOME
23
24
#ifndef SALOMEDSClient_AttributeString_HeaderFile
25
#define SALOMEDSClient_AttributeString_HeaderFile
26
27
#include "SALOMEDSClient_definitions.hxx" 
28
#include "SALOMEDSClient_GenericAttribute.hxx" 
29
#include <string>
30
31
class SALOMEDSClient_AttributeString: public virtual SALOMEDSClient_GenericAttribute
32
{
33
public:  
34
  virtual std::string Value() = 0;
35
  virtual void SetValue(const std::string& value) = 0;
36
};
37
38
#endif
(-)KERNEL_SRC_3.2.2/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx (-1 / +1 lines)
Lines 30-36 Link Here
30
  template<class Y>
30
  template<class Y>
31
    explicit clt_shared_ptr(Y * p)
31
    explicit clt_shared_ptr(Y * p)
32
      {
32
      {
33
	reset(p);
33
	boost::shared_ptr<T>::reset(p);
34
      }
34
      }
35
  
35
  
36
  template<class Y>
36
  template<class Y>
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/Makefile.am (+4 lines)
Lines 66-71 Link Here
66
	SALOMEDSImpl_AttributeComment.hxx \
66
	SALOMEDSImpl_AttributeComment.hxx \
67
	SALOMEDSImpl_AttributeReference.hxx \
67
	SALOMEDSImpl_AttributeReference.hxx \
68
	SALOMEDSImpl_AttributeParameter.hxx \
68
	SALOMEDSImpl_AttributeParameter.hxx \
69
	SALOMEDSImpl_AttributeString.hxx \
69
	SALOMEDSImpl_UseCaseBuilder.hxx \
70
	SALOMEDSImpl_UseCaseBuilder.hxx \
70
	SALOMEDSImpl_UseCaseIterator.hxx \
71
	SALOMEDSImpl_UseCaseIterator.hxx \
71
	SALOMEDSImpl_SComponentIterator.hxx \
72
	SALOMEDSImpl_SComponentIterator.hxx \
Lines 147-152 Link Here
147
	SALOMEDSImpl_AttributeComment.cxx \
148
	SALOMEDSImpl_AttributeComment.cxx \
148
	SALOMEDSImpl_AttributeReference.cxx \
149
	SALOMEDSImpl_AttributeReference.cxx \
149
	SALOMEDSImpl_AttributeParameter.cxx \
150
	SALOMEDSImpl_AttributeParameter.cxx \
151
	SALOMEDSImpl_AttributeString.cxx \
150
	SALOMEDSImpl_ChildNodeIterator.cxx \
152
	SALOMEDSImpl_ChildNodeIterator.cxx \
151
	SALOMEDSImpl_UseCaseBuilder.cxx \
153
	SALOMEDSImpl_UseCaseBuilder.cxx \
152
	SALOMEDSImpl_UseCaseIterator.cxx \
154
	SALOMEDSImpl_UseCaseIterator.cxx \
Lines 187-192 Link Here
187
	SALOMEDSImpl_AttributeTextHighlightColor.hxx \
189
	SALOMEDSImpl_AttributeTextHighlightColor.hxx \
188
	SALOMEDSImpl_AttributeTreeNode.hxx \
190
	SALOMEDSImpl_AttributeTreeNode.hxx \
189
	SALOMEDSImpl_AttributeUserID.hxx \
191
	SALOMEDSImpl_AttributeUserID.hxx \
192
	SALOMEDSImpl_AttributeParameter.hxx \
193
	SALOMEDSImpl_AttributeString.hxx \
190
	SALOMEDSImpl_Callback.hxx \
194
	SALOMEDSImpl_Callback.hxx \
191
	SALOMEDSImpl_ChildIterator.hxx \
195
	SALOMEDSImpl_ChildIterator.hxx \
192
	SALOMEDSImpl_ChildNodeIterator.hxx \
196
	SALOMEDSImpl_ChildNodeIterator.hxx \
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx (-1 / +1 lines)
Lines 67-73 Link Here
67
SALOMEDSImpl_AttributeExpandable::SALOMEDSImpl_AttributeExpandable()
67
SALOMEDSImpl_AttributeExpandable::SALOMEDSImpl_AttributeExpandable()
68
:SALOMEDSImpl_GenericAttribute("AttributeExpandable")
68
:SALOMEDSImpl_GenericAttribute("AttributeExpandable")
69
{
69
{
70
  myValue = 0;
70
  myValue = 1;
71
}
71
}
72
72
73
//=======================================================================
73
//=======================================================================
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx (-1 / +1 lines)
Lines 68-74 Link Here
68
SALOMEDSImpl_AttributeSelectable::SALOMEDSImpl_AttributeSelectable()
68
SALOMEDSImpl_AttributeSelectable::SALOMEDSImpl_AttributeSelectable()
69
:SALOMEDSImpl_GenericAttribute("AttributeSelectable")
69
:SALOMEDSImpl_GenericAttribute("AttributeSelectable")
70
{
70
{
71
  myValue = 0;
71
  myValue = 1;
72
}
72
}
73
73
74
//=======================================================================
74
//=======================================================================
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.cxx (+108 lines)
Added Link Here
1
// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3
// 
4
// This library is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU Lesser General Public
6
// License as published by the Free Software Foundation; either 
7
// version 2.1 of the License.
8
// 
9
// This library is distributed in the hope that it will be useful 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12
// Lesser General Public License for more details.
13
//
14
// You should have received a copy of the GNU Lesser General Public  
15
// License along with this library; if not, write to the Free Software 
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17
//
18
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19
//
20
//  File   : SALOMEDSImpl_AttributeString.cxx
21
//  Author : Sergey RUIN
22
//  Module : SALOME
23
24
#include "SALOMEDSImpl_AttributeString.hxx"
25
26
#ifndef WNT
27
using namespace std;
28
#endif
29
30
IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeString, SALOMEDSImpl_GenericAttribute )
31
IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeString, SALOMEDSImpl_GenericAttribute )
32
33
//=======================================================================
34
//function : GetID
35
//purpose  :
36
//=======================================================================
37
const Standard_GUID& SALOMEDSImpl_AttributeString::GetID ()
38
{
39
  static Standard_GUID CommentID ("1808A12F-AD0E-4a6a-B58A-395DCF469FE9");
40
  return CommentID;
41
}   
42
43
Handle(SALOMEDSImpl_AttributeString) SALOMEDSImpl_AttributeString::Set (const TDF_Label& L, 
44
									const TCollection_ExtendedString& Val) 
45
{
46
  Handle(SALOMEDSImpl_AttributeString) A;
47
  if (!L.FindAttribute(SALOMEDSImpl_AttributeString::GetID(), A)) {
48
    A = new  SALOMEDSImpl_AttributeString(); 
49
    L.AddAttribute(A);
50
  }
51
52
  A->SetValue(Val);     
53
    
54
  return A;
55
}
56
57
//=======================================================================
58
//function : SetValue
59
//purpose  :
60
//=======================================================================
61
void SALOMEDSImpl_AttributeString::SetValue (const TCollection_ExtendedString& S)
62
{
63
  CheckLocked();
64
65
  if(myString == S) return;
66
67
  Backup();
68
69
  myString = S;
70
  
71
  SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved 
72
}
73
           
74
75
//=======================================================================
76
//function : ID
77
//purpose  :
78
//=======================================================================
79
const Standard_GUID& SALOMEDSImpl_AttributeString::ID () const { return GetID(); } 
80
81
//=======================================================================
82
//function : NewEmpty
83
//purpose  : 
84
//=======================================================================
85
Handle(TDF_Attribute) SALOMEDSImpl_AttributeString::NewEmpty () const
86
{  
87
  return new SALOMEDSImpl_AttributeString(); 
88
}
89
90
//=======================================================================
91
//function : Restore
92
//purpose  : 
93
//=======================================================================
94
void SALOMEDSImpl_AttributeString::Restore(const Handle(TDF_Attribute)& with) 
95
{
96
  myString = Handle(SALOMEDSImpl_AttributeString)::DownCast (with)->Value ();
97
}
98
99
//=======================================================================
100
//function : Paste
101
//purpose  : 
102
//=======================================================================
103
104
void SALOMEDSImpl_AttributeString::Paste (const Handle(TDF_Attribute)& into,
105
					   const Handle(TDF_RelocationTable)& RT) const
106
{
107
  Handle(SALOMEDSImpl_AttributeString)::DownCast (into)->SetValue(myString);
108
}
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.hxx (+70 lines)
Added Link Here
1
// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3
// 
4
// This library is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU Lesser General Public
6
// License as published by the Free Software Foundation; either 
7
// version 2.1 of the License.
8
// 
9
// This library is distributed in the hope that it will be useful 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12
// Lesser General Public License for more details.
13
//
14
// You should have received a copy of the GNU Lesser General Public  
15
// License along with this library; if not, write to the Free Software 
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17
//
18
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19
//
20
//  File   : SALOMEDSImpl_AttributeIOR.hxx
21
//  Author : Sergey RUIN
22
//  Module : SALOME
23
24
#ifndef _SALOMEDSImpl_AttributeString_HeaderFile
25
#define _SALOMEDSImpl_AttributeString_HeaderFile
26
27
#include <Standard_DefineHandle.hxx>
28
#include <TDF_Attribute.hxx>
29
#include <TCollection_AsciiString.hxx>
30
#include <TCollection_ExtendedString.hxx>
31
#include <TDF_Label.hxx> 
32
#include <Standard_GUID.hxx> 
33
#include "SALOMEDSImpl_GenericAttribute.hxx"
34
35
class Handle(TDF_Attribute);
36
class Handle(TDF_RelocationTable);
37
38
DEFINE_STANDARD_HANDLE( SALOMEDSImpl_AttributeString, SALOMEDSImpl_GenericAttribute )
39
40
class SALOMEDSImpl_AttributeString : public SALOMEDSImpl_GenericAttribute 
41
{
42
private:
43
44
 TCollection_ExtendedString myString;
45
46
public:
47
48
Standard_EXPORT static const Standard_GUID& GetID() ;
49
50
Standard_EXPORT  SALOMEDSImpl_AttributeString() :SALOMEDSImpl_GenericAttribute("AttributeString") {}
51
52
Standard_EXPORT  static Handle(SALOMEDSImpl_AttributeString) Set(const TDF_Label& L, const TCollection_ExtendedString& Val); 
53
Standard_EXPORT  void SetValue (const TCollection_ExtendedString& S);
54
Standard_EXPORT  TCollection_ExtendedString Value() const { return myString; }
55
56
Standard_EXPORT  virtual TCollection_AsciiString Save() { return myString; }
57
Standard_EXPORT  virtual void Load(const TCollection_AsciiString& theValue) { myString = theValue; }
58
59
Standard_EXPORT  const Standard_GUID& ID() const;
60
Standard_EXPORT  void Restore(const Handle(TDF_Attribute)& with) ;
61
Standard_EXPORT  Handle_TDF_Attribute NewEmpty() const;
62
Standard_EXPORT  void Paste(const Handle(TDF_Attribute)& into,const Handle(TDF_RelocationTable)& RT) const;
63
64
Standard_EXPORT ~SALOMEDSImpl_AttributeString() {}
65
66
public:
67
  DEFINE_STANDARD_RTTI( SALOMEDSImpl_AttributeString )
68
};
69
70
#endif
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx (-3 / +3 lines)
Lines 52-60 Link Here
52
Standard_EXPORT static const Standard_GUID& GetID() ;
52
Standard_EXPORT static const Standard_GUID& GetID() ;
53
Standard_EXPORT static  Handle_SALOMEDSImpl_AttributeTarget Set(const TDF_Label& label) ;
53
Standard_EXPORT static  Handle_SALOMEDSImpl_AttributeTarget Set(const TDF_Label& label) ;
54
Standard_EXPORT SALOMEDSImpl_AttributeTarget();
54
Standard_EXPORT SALOMEDSImpl_AttributeTarget();
55
Standard_EXPORT void SALOMEDSImpl_AttributeTarget::Add(const Handle(SALOMEDSImpl_SObject)& theSO);
55
Standard_EXPORT void Add(const Handle(SALOMEDSImpl_SObject)& theSO);
56
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) SALOMEDSImpl_AttributeTarget::Get();
56
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Get();
57
Standard_EXPORT void SALOMEDSImpl_AttributeTarget::Remove(const Handle(SALOMEDSImpl_SObject)& theSO);
57
Standard_EXPORT void Remove(const Handle(SALOMEDSImpl_SObject)& theSO);
58
Standard_EXPORT TCollection_ExtendedString GetRelation() { return myRelation; }
58
Standard_EXPORT TCollection_ExtendedString GetRelation() { return myRelation; }
59
Standard_EXPORT void SetRelation(const TCollection_ExtendedString& theRelation); 
59
Standard_EXPORT void SetRelation(const TCollection_ExtendedString& theRelation); 
60
Standard_EXPORT TDF_AttributeList& GetVariables() { return myVariables; }
60
Standard_EXPORT TDF_AttributeList& GetVariables() { return myVariables; }
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx (-1 / +1 lines)
Lines 49-55 Link Here
49
SALOMEDSImpl_AttributeTextColor::SALOMEDSImpl_AttributeTextColor()
49
SALOMEDSImpl_AttributeTextColor::SALOMEDSImpl_AttributeTextColor()
50
:SALOMEDSImpl_GenericAttribute("AttributeTextColor")
50
:SALOMEDSImpl_GenericAttribute("AttributeTextColor")
51
{
51
{
52
  myValue = new TColStd_HArray1OfReal(1, 3, RealFirst());
52
  myValue = new TColStd_HArray1OfReal(1, 3, 0.);
53
}
53
}
54
54
55
//=======================================================================
55
//=======================================================================
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx (-1 / +1 lines)
Lines 50-56 Link Here
50
SALOMEDSImpl_AttributeTextHighlightColor::SALOMEDSImpl_AttributeTextHighlightColor()
50
SALOMEDSImpl_AttributeTextHighlightColor::SALOMEDSImpl_AttributeTextHighlightColor()
51
:SALOMEDSImpl_GenericAttribute("AttributeTextHighlightColor")
51
:SALOMEDSImpl_GenericAttribute("AttributeTextHighlightColor")
52
{ 
52
{ 
53
  myValue = new TColStd_HArray1OfReal(1, 3, RealFirst());
53
  myValue = new TColStd_HArray1OfReal(1, 3, 0.);
54
}
54
}
55
55
56
//=======================================================================
56
//=======================================================================
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx (-1 / +4 lines)
Lines 64-69 Link Here
64
#include "SALOMEDSImpl_AttributeFlags.hxx"
64
#include "SALOMEDSImpl_AttributeFlags.hxx"
65
#include "SALOMEDSImpl_AttributeGraphic.hxx"
65
#include "SALOMEDSImpl_AttributeGraphic.hxx"
66
#include "SALOMEDSImpl_AttributeParameter.hxx"
66
#include "SALOMEDSImpl_AttributeParameter.hxx"
67
#include "SALOMEDSImpl_AttributeString.hxx"
67
68
68
69
69
#define __AttributeTypeToGUIDForSObject \
70
#define __AttributeTypeToGUIDForSObject \
Lines 95-101 Link Here
95
	if(theType == "AttributeFlags") return SALOMEDSImpl_AttributeFlags::GetID(); \
96
	if(theType == "AttributeFlags") return SALOMEDSImpl_AttributeFlags::GetID(); \
96
        if(theType == "AttributeGraphic") return SALOMEDSImpl_AttributeGraphic::GetID(); \
97
        if(theType == "AttributeGraphic") return SALOMEDSImpl_AttributeGraphic::GetID(); \
97
	if(theType == "AttributeReference") return SALOMEDSImpl_AttributeReference::GetID(); \
98
	if(theType == "AttributeReference") return SALOMEDSImpl_AttributeReference::GetID(); \
98
	if(theType == "AttributeParameter") return SALOMEDSImpl_AttributeParameter::GetID();
99
	if(theType == "AttributeParameter") return SALOMEDSImpl_AttributeParameter::GetID(); \
100
        if(theType == "AttributeString") return SALOMEDSImpl_AttributeString::GetID();
99
101
100
102
101
#define __FindOrCreateAttributeLocked(ClassName) if (strcmp(aTypeOfAttribute.ToCString(), #ClassName) == 0) { \
103
#define __FindOrCreateAttributeLocked(ClassName) if (strcmp(aTypeOfAttribute.ToCString(), #ClassName) == 0) { \
Lines 132-137 Link Here
132
__FindOrCreateAttributeLocked(AttributeTableOfString) \
134
__FindOrCreateAttributeLocked(AttributeTableOfString) \
133
__FindOrCreateAttributeLocked(AttributePythonObject) \
135
__FindOrCreateAttributeLocked(AttributePythonObject) \
134
__FindOrCreateAttributeLocked(AttributeParameter) \
136
__FindOrCreateAttributeLocked(AttributeParameter) \
137
__FindOrCreateAttributeLocked(AttributeString) \
135
__FindOrCreateAttribute(AttributePersistentRef) \
138
__FindOrCreateAttribute(AttributePersistentRef) \
136
__FindOrCreateAttribute(AttributeDrawable) \
139
__FindOrCreateAttribute(AttributeDrawable) \
137
__FindOrCreateAttribute(AttributeSelectable) \
140
__FindOrCreateAttribute(AttributeSelectable) \
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.hxx (-2 / +2 lines)
Lines 76-87 Link Here
76
  /*!
76
  /*!
77
    Returns all parameter names of the given entry
77
    Returns all parameter names of the given entry
78
   */
78
   */
79
  virtual std::vector<std::string> SALOMEDSImpl_IParameters::getAllParameterNames(const std::string& entry);
79
  virtual std::vector<std::string> getAllParameterNames(const std::string& entry);
80
80
81
  /*!
81
  /*!
82
    Returns all parameter  values of the given entry
82
    Returns all parameter  values of the given entry
83
   */
83
   */
84
  virtual std::vector<std::string> SALOMEDSImpl_IParameters::getAllParameterValues(const std::string& entry);
84
  virtual std::vector<std::string> getAllParameterValues(const std::string& entry);
85
85
86
  /*!
86
  /*!
87
    Returns a number of parameters of the given entry
87
    Returns a number of parameters of the given entry
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx (-1 / +1 lines)
Lines 1361-1367 Link Here
1361
1361
1362
    if(aDriver == NULL) continue;
1362
    if(aDriver == NULL) continue;
1363
1363
1364
    bool isValidScript;
1364
    bool isValidScript = false;
1365
    long aStreamLength  = 0;
1365
    long aStreamLength  = 0;
1366
    Handle(SALOMEDSImpl_TMPFile) aStream = aDriver->DumpPython(this, isPublished, isValidScript, aStreamLength);
1366
    Handle(SALOMEDSImpl_TMPFile) aStream = aDriver->DumpPython(this, isPublished, isValidScript, aStreamLength);
1367
    if ( !isValidScript )
1367
    if ( !isValidScript )
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx (-1 / +1 lines)
Lines 219-225 Link Here
219
  
219
  
220
  Standard_EXPORT virtual Handle(TColStd_HSequenceOfTransient) FindDependances(const Handle(SALOMEDSImpl_SObject)& anObject);
220
  Standard_EXPORT virtual Handle(TColStd_HSequenceOfTransient) FindDependances(const Handle(SALOMEDSImpl_SObject)& anObject);
221
221
222
  Standard_EXPORT virtual Handle(SALOMEDSImpl_AttributeStudyProperties) SALOMEDSImpl_Study::GetProperties();
222
  Standard_EXPORT virtual Handle(SALOMEDSImpl_AttributeStudyProperties) GetProperties();
223
223
224
  Standard_EXPORT virtual TCollection_AsciiString GetLastModificationDate();
224
  Standard_EXPORT virtual TCollection_AsciiString GetLastModificationDate();
225
225
(-)KERNEL_SRC_3.2.2/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx (-1 / +1 lines)
Lines 503-509 Link Here
503
  if (aLocked) aStudy->GetProperties()->SetLocked(false);
503
  if (aLocked) aStudy->GetProperties()->SetLocked(false);
504
504
505
  Handle(SALOMEDSImpl_StudyBuilder) SB= aStudy->NewBuilder();
505
  Handle(SALOMEDSImpl_StudyBuilder) SB= aStudy->NewBuilder();
506
  map<char*, SALOMEDSImpl_Driver*> aMapTypeDriver;
506
  map<string, SALOMEDSImpl_Driver*> aMapTypeDriver; // IPAL13339
507
507
508
  if(aStudy.IsNull()) {
508
  if(aStudy.IsNull()) {
509
    _errorCode = "Study is null";
509
    _errorCode = "Study is null";

Return to bug 155974