author | Bob Rosenberg <bob.rosenberg@nokia.com> |
Tue, 26 Oct 2010 10:43:50 +0100 | |
changeset 8 | a2e65c705db8 |
parent 7 | 3c36c452f013 |
permissions | -rw-r--r-- |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1 |
# Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
2 |
# All rights reserved. |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
3 |
# This component and the accompanying materials are made available |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
4 |
# under the terms of "Eclipse Public License v1.0" |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
5 |
# which accompanies this distribution, and is available |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
6 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
7 |
# |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
8 |
# Initial Contributors: |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
9 |
# Nokia Corporation - initial contribution. |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
10 |
# |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
11 |
# Contributors: |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
12 |
# |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
13 |
# Description: |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
14 |
# Package: SysModelGen |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
15 |
# Build an SVG System Model diagram |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
16 |
# |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
17 |
# |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
18 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
19 |
package SysModelGen; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
20 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
21 |
use Cwd; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
22 |
use Cwd 'abs_path'; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
23 |
use File::Copy; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
24 |
use File::Path; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
25 |
use FindBin; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
26 |
use lib $FindBin::Bin."/../common"; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
27 |
use Getopt::Long qw(:config no_ignore_case); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
28 |
use File::Basename; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
29 |
use File::Spec; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
30 |
use Logger; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
31 |
use Env qw(@PATH); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
32 |
use Env qw(@PATHEXT); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
33 |
use Env qw(@CLASSPATH); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
34 |
use strict; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
35 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
36 |
my @Filters; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
37 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
38 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
39 |
use constant KSystemModelGenerator => 201; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
40 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
41 |
#------------------------------------------------------------------------------------------------- |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
42 |
# Subroutine: new |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
43 |
# Purpose: |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
44 |
# Input: None (extracted from command line args) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
45 |
# Output: A reference to itself |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
46 |
#------------------------------------------------------------------------------------------------- |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
47 |
sub new |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
48 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
49 |
my $package = shift; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
50 |
my $self = {}; # Create reference to object |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
51 |
bless $self, $package; # Associate a reference with class name |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
52 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
53 |
my $dataroot =&SystemModelXmlDataDir(); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
54 |
my @yr = gmtime(); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
55 |
my %Args = ( |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
56 |
'iHelp' => {'param' => "h", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
57 |
'desc' => 'Help on usage'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
58 |
'iIniFile' => { 'param' => "i=s", 'type'=>'file', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
59 |
'desc' => 'An INI file listing one argument per line, with the syntax: <argument> = <value>. Command line arguments will override ini file settings.' }, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
60 |
'iDiagram' => { 'param' => "output=s" , default=>"sysmodel.svg",'type'=>'outfile', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
61 |
'class' => 'Build Control', 'desc' => 'The name of the file to save the built System Model SVG. If in the format filename.svgz, it will attempt to compress the file. If compression is not supported, it will rename the output to filename.svg. Defaults to sysmodel.svg or sysmodel.svgz if -compress is set.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
62 |
'iOutputCsv' => { 'param' => "csv_output=s" , 'type'=>'outfile', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
63 |
'class' => 'Build Control', 'desc' => 'The name of the file to save a CSV description of the built System Model. Only items shown on the system model will be included.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
64 |
'iCsvColumns' => { 'param' => "csv_columns=s" , 'type'=>'outfile', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
65 |
'class' => 'Build Control', 'desc' => 'Comma-separated list of columns to include in the output CSV. This does nothing if -csv_output is not present. By default (if -csv_columns is not present), the columns will be a sorted list of all attributes on all items. '}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
66 |
'iCsvLabels' => { 'param' => "csv_labels=s" , 'type'=>'outfile', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
67 |
'class' => 'Build Control', 'desc' => 'Comma-separated list of columns labels include in the output CSV. Do not use quotes or commas in label names. This does nothing if -csv_output is not present. If this list is shorter than -csv_columns, the remaining columns will use the attribute name as the label. '}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
68 |
'iOutputXml' => { 'param' => 'xml_output=s' ,'type'=>'outfile', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
69 |
'class' => 'Build Control', 'desc' => 'The name of the file to save a combined system definition XML. Only items shown in the built system model will be included.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
70 |
'iWarningLevel' => { 'param' => "w=s", 'type' => 'number', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
71 |
'class' =>'Build Control', 'desc' => 'Warning level. 1: errors only (default), 2: warnings as well as errors, 3: info messages, warnings and errors, 4: all plus deep syntax validation and reporting -- note that this can take a long time to compute so do not use this warning level by default'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
72 |
'iLowMem' => { 'param' => "lowmem", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
73 |
'class' =>'Build Control', 'desc' => 'Build the model storing more data in the temp directory and using less runtime memory. If building fails due to an out of memory condition, try running again with the -lowmem option.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
74 |
"iClean" => { 'param' => 'clean' , |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
75 |
'class' => 'Build Control', 'desc' =>'Caution: if set, it will delete the contents of the temporary directory.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
76 |
'iCompress' => { 'param' => "compress", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
77 |
'class' => 'Build Control', 'desc' => 'If set, it will attempt to compress the output as an SVGZ file. In order to success gzip must be installed and in the PATH. This will also rename the output file from filename.svg to filename.svgz.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
78 |
'iTemporaryDirectory' => { 'param' => "tempdir=s", 'default' => 'drawsvg_temp','type'=>'dir', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
79 |
'class' => 'Build Control', 'desc' => 'Temporary directory for build files.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
80 |
'iLogFile' => { 'param' => "log=s", 'type'=>'outfile', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
81 |
'class' => 'Build Control', 'desc' => 'File in which to store output. Defaults to stdout'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
82 |
'iModel' => { 'param' => "model=s" ,'type'=>'file/uri', 'default' => "$dataroot/ModelTemplate.xml", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
83 |
'class' => 'Files or URIs', 'desc' => 'The location of the Model XML file to use to build the file. Content of this file will be overridden by anything set on the command line on in an ini file'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
84 |
'iSysDefFile' => { 'param' => "sysdef=s", 'multi' => 1,'type'=>'file/uri', 'xpath' => '/model/sysdef', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
85 |
'class' => 'Model Control', 'desc' => 'The System Definition XML file(s) used to build the model.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
86 |
"iSourceRoot" => {'param'=>'srcvar=s' ,'multi' => 1, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
87 |
'class' => 'Model Control'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
88 |
'iPathPrefix' => {'param' => 'sysdef-prefix=s', 'multi' => 1, 'class' => 'Model Control','type'=>'file/uri',}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
89 |
"iSysDefPath" => {'param' => "sysdef-path=s", 'multi' => 1,'type'=>'path', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
90 |
'class' => 'Model Control', 'desc' => 'The directory which the system definition file should be considered to be in when turning unit\'s relative links into absolute paths. This is only necessary to provide if the result requires the absolute paths to be meaningful. The order of this parameter must match the order of the -sysdef parameter'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
91 |
'iShapes' => { 'param' => "shapes=s", 'xpath' => '/model/@shapes','type'=>'file/uri', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
92 |
'class' => 'Files or URIs', 'desc' => 'The location of the Shapes XML file used to provide rules to control the display of the system model items. If not present, default behaviour (in Shapes.xml) is used. This and the default bahaviours are overrriden by using the -color, -border, -pattern, and -style options. '}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
93 |
'iLink' => { 'param' => "link=s", 'xpath' => '/model/@link', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
94 |
'class' => 'Files or URIs', 'desc' => 'The base URL to use for all hyperlinks in the model. A base URL will be appended by the type and name (e.g. Blocks/Comms%20Services.html) of the items to create the full URL of the linked file. Window directories will be converted into file URIs.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
95 |
'iLinkExpr' => { 'param' => "link-expr=s", 'multi' => 1, 'xpath' => 'model/link', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
96 |
'class' => 'Model Control', 'desc' => 'The link used on any system model item. Any values within {...} are evaluled as an expression on the item. All xpath locations in the expresion must be set otherwise the link will not be created for the item'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
97 |
'iName' => { 'param' => "system_name=s" , 'xpath' => '/model/@name', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
98 |
'class' => "Labels", 'desc' =>'The name of the product described in the model. It appears at the bottom right.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
99 |
'iRelease' => { 'param' => "system_version=s" , 'xpath' => '/model/@ver', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
100 |
'class' =>"Labels", 'desc' =>'The version of the product described in the model. It appears at the bottom right after the name.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
101 |
'iLabel' => { 'param' => "model_name=s" , 'xpath' => '/model/@label', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
102 |
'class' =>"Labels", 'desc' =>'The label for the model. It appears at the bottom right, under the name.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
103 |
'iRevision' => { 'param' => "model_version=s", 'xpath' => '/model/@revision', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
104 |
'class' =>"Labels", 'desc' =>'A number which appears before the model-revision-type. If specified this overrides the build number used by depmodel. If not building depmodel, this defaults to "1"'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
105 |
'iRevisionType' => { 'param' => "model_version_type=s", 'xpath' => '/model/@revision-type', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
106 |
'class' =>"Labels", 'desc' =>'One of "draft", "issued", "build", "date" or free-text value. Appears below the model label. If specified this overrides the build number used by DepToolkit.If not building depmodel, this defaults to "draft"'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
107 |
'iCopyright' => { 'param' => "copyright=s", 'default' => (1900+$yr[5])." Nokia Corporation", 'xpath' => '/model/@copyright', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
108 |
'class' =>"Labels", 'desc' =>'The copyright to appear in the lower left. Set to empty string to leave out.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
109 |
'iDistribution' => { 'param' => "distribution=s", 'xpath' => '/model/@distribution', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
110 |
'class' => "Labels", 'desc' =>'Text to appear on the bottom centre to indicate to whom the model can be shown. Informational only. Suggested values are "internal", "secret" or "unrestrictred". Not shown if not set.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
111 |
'iLgdTitle' => { 'param' => "legend_title=s", 'xpath' => '/model/layout/legend/@label', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
112 |
'class' =>"Labels", 'desc' =>'The title to appear in the leftmost part of the legend.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
113 |
'iLgdFloat' => { 'param' => "legend_float=s", 'xpath' => '/model/layout/legend/@float', 'type' => 'boolean', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
114 |
'class' =>"Model Control", 'desc' =>'If set, the legend will appear when the mouse hovers over the bottom of the window. The floating legend will span the full width of the window. This may not be readable, depending on the amonent of content in the legend.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
115 |
'iCoreOs' => { 'param' => "coreos=s", 'type' => 'on/off/new', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
116 |
'class' =>'Model Control', 'desc' => 'Turn on or off Core OS colouring for 9.4 and later models -- For backwards compatibility only! Use "on" for Symbian OS 9.4 models and "new" for Symbian OS 9.5 and later models (non-Foundation)'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
117 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
118 |
'iExtra' => { 'multi' => 1, 'param' => "sysinfo=s",'type'=>'file/uri', info=>'extra', 'xpath' => '/model/sysdef', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
119 |
'class' => 'Files or URIs', 'desc' => 'The location of extra component information used to provided additional properies for components. By default, the provided "SystemInfo.xml" is used.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
120 |
'iLocalize' => { 'multi' => 1, 'param' => "localize=s", 'xpath' => '/model/layout','type'=>'file/uri', info=>'abbrev', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
121 |
'class' => 'Files or URIs', 'desc' => 'The location of the Localization file used to provide displayable names for the model entities.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
122 |
'iDict' => { 'param' => "dictionary=s", 'type'=>'file/uri', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
123 |
'class' => 'Build Control', 'desc' => 'A term dictionary file used to semi-intelligently generate the abbreviations for the names of system model entries. Anything mentioned in the Localization files overrides generated abbreviations.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
124 |
'iS12' => { 'multi' => 1, 'param' => "s12=s",'type'=>'file/uri' , info=>'s12', 'xpath' => '/model/sysdef', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
125 |
'depr' => "Only works on 2.0 syntax and older models", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
126 |
'class' => 'Files or URIs', 'desc' => 'The location of the Schedule 12 XML file used to provide the border shapres of the components. If this a directory, the S12 XML file is found by appending "Symbian_OS_v[system_version]_Schedule12.xml" to the directory.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
127 |
'iLevels' => { 'multi' => 1, 'param' => "levels=s",'type'=>'file/uri' , info=>'levels', 'xpath' => '/model/sysdef', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
128 |
'depr' => "Only works on 2.0 syntax and older models. Use info file instead", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
129 |
'class' =>'Files or URIs', 'desc' => 'The location of the Levels XML file used to override the stacking of collections. '}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
130 |
'iDepsFile' => { 'multi' => 1, 'param' => "deps=s", 'xpath' => '/model/sysdef','type'=>'file/uri', info=>'extra', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
131 |
'class' => 'Files or URIs', 'desc' => 'The location of a sysinfo file containing Dependencies. If not present, dependencies will not be drawn'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
132 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
133 |
'iColor' => { 'multi' => 1, 'param' => "color=s", 'xpath' => '/model/layout','type'=>'file/uri', 'info'=>'color', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
134 |
'class' =>'Files or URIs', 'desc' => 'The location of a Values XML file used to specify per-component colours. If not present, the default colours are used.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
135 |
'iBorder' => { 'multi' => 1, 'param' => "border-shape=s", 'xpath' => '/model/layout','type'=>'file/uri','info'=>'border', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
136 |
'class' =>'Files or URIs', 'desc' => 'The location of a Values XML file used to specify the shape (border) of each component. If not present, the default borders are used.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
137 |
'iOverlay' => { 'multi' => 1, 'param' => "pattern=s", 'xpath' => '/model/layout','type'=>'file/uri','info'=>'overlay', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
138 |
'class' => 'Files or URIs', 'desc' => 'The location of a Values XML file used to specify per-component overlay patterns. If not present, the default patterns (for new and reference components) are used.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
139 |
'iStyle' => { 'multi' => 1, 'param' => "border-style=s", 'xpath' => '/model/layout','type'=>'file/uri','info'=>'style', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
140 |
'class' => 'Files or URIs', 'desc' => 'The location of a Values XML file used to specify per-component border styles. If not present, the default border styles are used. '}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
141 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
142 |
'iFilter' =>{ 'type' => 'filter-name', 'multi' => 1, 'param' => "filter=s", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
143 |
'depr' => "Only works on 2.0 syntax and older models", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
144 |
'class' =>'Model Control', 'desc' => 'The name of a filter to turn on when building the model. All filters on an item must be present in this list in order for that item to appear. Can have any number of these Defaults to "java" and "gt"'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
145 |
'iFilterHas' =>{ 'type' => 'filter-name', 'ordered' => 1,'param' => "filter-has=s", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
146 |
'class' => 'Model Control', 'desc' =>'Like -filter, except any filter on an item must be present in this list in order for that item to appear. Include "*" in the list in order to show items with no filters. Equivalent to "-show-attr filter xxx"'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
147 |
'iShow' => { 'type' => 'attr[=val]', 'ordered' => 1,'param' => "show-attr=s", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
148 |
'class' =>'Model Control', 'desc' => 'A mechanism of filtering which allows filtering based on component attribute values. If a value is set for that attribute, the component will be shown. Use in conjunction with -hide-attr for fine contol of what is shown. "class" and "filter" attribtues are handled specially -- see the documentation for details'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
149 |
'iHide' => { 'type' => 'attr[=val]', 'ordered' => 1,'param' => "hide-attr=s", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
150 |
'class' =>'Model Control', 'desc' => 'A mechanism of filtering which allows filtering based on component attribute values. If a value is set for that attribute, the component will not be shown on the model. Use in conjunction with -show-attr for fine contol of what is shown. "class" and "filter" attribtues are handled specially -- see the documentation for details'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
151 |
'iIgnore' => { 'type' => 'item', 'multi' => 1, 'param' => "ignore=s", 'xpath' => '/model/ignore', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
152 |
'class' =>'Model Control', 'desc' => 'The ID of a model entity to not draw. Any number of these can be used'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
153 |
'iIgnoreMeta' => { 'type' => 'item', 'multi' => 1, 'param' => "ignore-meta=s", 'xpath' => '/model/ignore', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
154 |
'class' =>'Model Control', 'desc' => 'The "rel" meta value to ignore. Takes the form of [relvalue] or [relvalue]:[type]. Any number of these can be used'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
155 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
156 |
'iNavCtrl' =>{'param' => "navctrl=s" , 'type'=>'boolean' , 'xpath' => '/model/layout/@navctrl', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
157 |
'class' =>'Model Control', 'desc' => 'If set, a navigation control widget will appear in the upper left corner of the model. The control might not work on some SVG viewers.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
158 |
'iDetail' =>{'param' => "detail=s", 'type' => 'item-type' , 'xpath' => '/model/layout/@detail', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
159 |
'class' =>'Model Control', 'desc' => 'The type of the smallest System Model entity to draw. One of "layer", "package", "collection" or "component". Defaults to "component"'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
160 |
'iLevelDetail' =>{'param' => "level-detail=s", 'type' => 'show/hide' , 'xpath' => '/model/layout/@levels', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
161 |
'class' =>'Model Control', 'desc' => 'Toggles display of level names on packages or layers. A value of "show" will display level names inside either layers (at "layer" level of detail only) or packages (at "package" level of detail only). A value of "hide" (default) will not show any level names.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
162 |
'iDetailType' => { 'param' => "detail-type=s", 'type' => 'type' , 'xpath' => '/model/layout/@detail-type', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
163 |
'class' =>'Model Control', 'desc' => 'If set to "fixed", the smallest System Model entity drawn will have a fixed with (rather then sized by their invisible components). This can be used to reduce the size and complexity of the overall model.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
164 |
'iPlaceholderDetail' => { 'param' => "placeholder=s", 'type' => 'item-type' , 'xpath' => '/model/layout/@placeholder-detail', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
165 |
'class' =>'Model Control', 'desc' => 'The type of the smallest *empty* System Model entity to draw. One of "layer", "package", "collection" or "component". For example, if set to "package" empty layers and packages will be drawn, but empty collections will be ignored. If not set, no empty items will be drawn.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
166 |
'iPageWidth' =>{'param' => "page-width=s", 'type' => 'length', 'xpath' => '/model/layout/@page-width', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
167 |
'depr' => "Only works on 2.0 syntax and older models", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
168 |
'class' =>'Model Control', 'desc' => 'The width of the drawn image (with units). If not specified it will fit the viewer window. Valid units: "in", "mm", "cm", "px", "pt"'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
169 |
'iStatic' => { 'param' => "static=s", 'type' => 'boolean', 'xpath' => '/model/layout/@static', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
170 |
'class' =>'Model Control', 'desc' => 'If present, the model will not have any mouseover effects (this is overriden by builing the depmodel).'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
171 |
'iPrintResolution' =>{ 'param' => "dpi=s", 'type' => 'number', 'xpath' => '/model/layout/@resolution', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
172 |
'class' =>'Model Control', 'desc' => 'The DPI to use when printing from the Adobe SVG Viewer. If not present, it will print well at A4 size. A value of 300 will look good on A3 size paper'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
173 |
'iModelFont' =>{'param' => "model_font=s", 'type' =>'font', 'xpath' => '/model/layout/@font', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
174 |
'class' =>'Model Control', 'desc' => 'The name of the base font to use to draw the model. This will be overriden by any custom CSS in the Shapes XML'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
175 |
'iVersions' => { 'param' => "version-list=s", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
176 |
'class' =>'Model Control'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
177 |
'iLogoSrc' =>{ 'param' => "logo=s", 'type'=>'file/uri', 'xpath' => '/model/layout/logo/@src', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
178 |
'class' => 'Model Control', 'desc' => 'If present, the logo will be drawn in the lower-left corner of the model. If the logo is an SVG file, -logo-width and -logo-height are optional, otherwise the must both be specified'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
179 |
'iLogoEmbed' =>{ 'xpath' => '/model/layout/logo/@embed', 'class' => 'Model Control' }, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
180 |
'iLogoHeight' => { 'param' => "logo-height=s", 'type' => 'length', 'xpath' => '/model/layout/logo/@height', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
181 |
'class' =>'Model Control', 'desc' => 'Specifies the height of the logo (if any) in mm. Width is scaled along with height unless otherwise specified. Both width and height MUST be specified if a bitmap image is used'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
182 |
'iLogoWidth' => { 'param' => "logo-width=s", 'type' => 'length', 'xpath' => '/model/layout/logo/@width', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
183 |
'class' =>'Model Control', 'desc' => 'Specifies the width of the logo (if any) in mm. Height is scaled along with width unless otherwise specified. Both width and height MUST be specified if a bitmap image is used'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
184 |
'iLegendWidth' =>{ 'param' => "legend-width=s", 'type' => '%', 'xpath' => '/model/layout/legend/@width', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
185 |
'class' => 'Model Control', 'desc' =>'The percent width of the model the legend takes up. This will scale the size of the legend and model title, but not the logo, to fill the specified space. If a logo is included, but no width specified, the legend cannot be scaled since it will not be able to determine the available space. Note that that -max-legend-scale will further limit the potential width.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
186 |
'iLegendMaxScale' =>{ 'param' => "legend-max-scale=s", 'type' => 'scale', 'xpath' => '/model/layout/legend/@maxscale', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
187 |
'class' => 'Model Control', 'desc' =>'Specifies the maximum scale factor for resizing the legend. If this is present and -legend-width is not, the legend and title will scale to 100% of the available width. If both are present the scale factor will take precedent. If neither is present, the legend will not resize. Note that when this is used, the legend can shrink if it would normally be wider than the model.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
188 |
'iTitleScale' => { 'param' => "title-scale=s", 'type' => 'scale', 'xpath' => '/model/layout/legend/@title-scale', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
189 |
'class' => 'Model Control', 'desc' =>'Specifies the scale factor for the size of the title font (the text in the lower right). Use this instead of CSS to control the size, since the model generator needs to explicitly know how much space to allocate for the title.'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
190 |
'iXsltParam' =>{ 'multi' => 2, 'param' => "xslt-param=s", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
191 |
'class' =>'Build Control', 'desc' => 'Advanced: Parameters to feed directly to the XSLT transforms'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
192 |
'iLegendNote' =>{ 'multi' => 1, 'param' => "note=s", 'xpath' => '/model/layout/legend/note', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
193 |
'class' => 'Labels', 'desc' => 'Free text to appear inside the legend box, on the rightmost side. If multiple ones are provided, they will appear as separate boxes from left to right. Newlines and other special characters can be entity-encoded (e.g. 
). When using entities in an INI file, you *must* quote the value, otherwise the # will be treated as a comment delimiter.',} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
194 |
); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
195 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
196 |
$self->{iArgs} = \%Args; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
197 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
198 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
199 |
# basic test of command line: |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
200 |
if (scalar(@ARGV) == 0) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
201 |
{ |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
202 |
$self->Help(); |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
203 |
exit Logger::KErrorNone; # nothing to do. Leave |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
204 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
205 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
206 |
# process the input: |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
207 |
$self->ParseCommandLineOptions(); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
208 |
|
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
209 |
$self->{iReturnCode} = Logger::KErrorNone; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
210 |
return $self; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
211 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
212 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
213 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
214 |
sub ParseCommandLineOptions() |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
215 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
216 |
my $self = shift; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
217 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
218 |
my %opt; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
219 |
while(my ($n,$b) = each %{$self->{iArgs}} ) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
220 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
221 |
if(!$b->{'param'}) {next} # not a command line arg |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
222 |
my @ps = ($b->{'param'}); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
223 |
($ps[1]=$ps[0]) =~ tr/_-/-_/; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
224 |
if($ps[1] eq $ps[0]) {shift(@ps)} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
225 |
foreach my $p (@ps) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
226 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
227 |
if($b->{'multi'}==1) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
228 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
229 |
$opt{$p} = \@{$self->{$n}}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
230 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
231 |
elsif($b->{'multi'}==2) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
232 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
233 |
$opt{$p} = \%{$self->{$n}}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
234 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
235 |
elsif($b->{'ordered'}) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
236 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
237 |
$opt{$p} = \&OrderedOption; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
238 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
239 |
else |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
240 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
241 |
$opt{$p} = \$self->{$n}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
242 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
243 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
244 |
} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
245 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
246 |
foreach (@ARGV) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
247 |
# some MS products replace "-" with en-dash in an effort to be "intelligent". |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
248 |
# This replaces all leading en-dashes in the command line with "-" |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
249 |
# There is a small risk that the en-dash is intentional and this will clobber it. |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
250 |
s/^\x96/-/; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
251 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
252 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
253 |
GetOptions(%opt); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
254 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
255 |
if ($self->{'iHelp'}) |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
256 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
257 |
$self->Help(); |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
258 |
exit Logger::KErrorNone; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
259 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
260 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
261 |
# set read files to absolute paths |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
262 |
my $dir = cwd; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
263 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
264 |
while(my ($n,$b) = each %{$self->{iArgs}} ) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
265 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
266 |
my $type =$b->{'type'}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
267 |
if( $type eq 'file' or $type eq 'dir' or $type eq 'file/uri') |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
268 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
269 |
if($self->{$n} eq '') {next} # no value, so do nothing |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
270 |
if ($b->{'multi'} == 1) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
271 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
272 |
foreach my $v (@{$self->{$n}}) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
273 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
274 |
$v =&fixFile($type,$dir,$v); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
275 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
276 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
277 |
elsif ($b->{'multi'} == 2) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
278 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
279 |
while(my ($var,$val)=each (%{$self->{$n}})) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
280 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
281 |
$self->{$n}->{$var}=&fixFile($type,$dir,$val); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
282 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
283 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
284 |
else |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
285 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
286 |
$self->{$n} = &fixFile($type,$dir,$self->{$n} ); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
287 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
288 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
289 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
290 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
291 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
292 |
@{$self->{'iFiltering'}} = @Filters; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
293 |
@Filters=(); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
294 |
my $i=0; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
295 |
for($i=0;$i<=$#ARGV;$i++) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
296 |
{ # check remaining args to ensure they are valid |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
297 |
if($ARGV[$i]=~/^(http|file):\/\//) { # assume URLs are correct |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
298 |
next; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
299 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
300 |
if($ARGV[$i] eq "-" || $ARGV[$i] eq "") |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
301 |
{ #special values to use nothing or use the tmp file, but only valid for odd numbered args |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
302 |
if($i%2==1) {next} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
303 |
$self->HelpBase(); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
304 |
&Logger::LogFatal("Invalid syntax", KSystemModelGenerator, 0,Logger::KIncorrectSyntax); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
305 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
306 |
if(!(-e $ARGV[$i])) { |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
307 |
$self->HelpBase(); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
308 |
&Logger::LogFatal("file $ARGV[$i] does not exist", KSystemModelGenerator, 0,Logger::KFileDoesNotExist); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
309 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
310 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
311 |
$self->ReadIniFile(); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
312 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
313 |
if($self->{'iDetail'}) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
314 |
{ # for ease of BC with ini files |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
315 |
$self->{'iDetail'} =~ s/^(block|subblock|logical(sub)?set)$/package/ || |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
316 |
$self->{'iDetail'} =~ s/^(module)$/collection/; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
317 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
318 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
319 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
320 |
while(my ($n,$b) = each %{$self->{iArgs}} ) # set defaults |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
321 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
322 |
if($b->{'default'} and !defined $self->{$n}) |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
323 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
324 |
$self->{$n} =$b->{'default'}; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
325 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
326 |
if($b->{'type'} eq 'boolean' and (defined $self->{$n})) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
327 |
{ #set booleans to true/false |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
328 |
if($self->{$n} == 1 or $self->{$n} =~/^(yes|on|true|y)$/i) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
329 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
330 |
$self->{$n} = 'true'; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
331 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
332 |
else |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
333 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
334 |
$self->{$n} = 'false'; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
335 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
336 |
} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
337 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
338 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
339 |
# computed defaults: |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
340 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
341 |
# if saving to .svgz, try to compress |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
342 |
$self->{iCompress} = $self->{iCompress} || ( $self->{iDiagram} =~ /\.svgz$/i ); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
343 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
344 |
if($self->{'iLogoSrc'} =~ /\.svg$/i) # embed SVG logos only |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
345 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
346 |
$self->{'iLogoEmbed'}= "yes"; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
347 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
348 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
349 |
if(defined $self->{iCoreOs} and ($self->{'iModel'} eq $self->{'iArgs'}->{'iModel'}->{'default'})) |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
350 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
351 |
my $dataroot =&SystemModelXmlDataDir(); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
352 |
if($self->{iCoreOs}=~/(on|yes|true)$/i ) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
353 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
354 |
$self->{'iModel'} = "$dataroot/ModelTemplate.94.xml", |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
355 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
356 |
elsif($self->{iCoreOs}=~/(off|no|false)$/i ) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
357 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
358 |
$self->{'iModel'} = "$dataroot/ModelTemplate.xml", |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
359 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
360 |
elsif(! ($self->{iCoreOs}=~/^[0-9]+$/ )) # any other non-number |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
361 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
362 |
$self->{'iModel'} = "$dataroot/ModelTemplate.95.xml", |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
363 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
364 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
365 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
366 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
367 |
$self->{iTemporaryDirectory} = &fixFile('dir', cwd,$self->{iTemporaryDirectory} ); # now gives the full path name $self->{iTemporaryDirectory} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
368 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
369 |
mkpath $self->{iTemporaryDirectory} if ! -d $self->{iTemporaryDirectory}; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
370 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
371 |
# set the log file if needed: |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
372 |
$Logger::LOGFILE = $self->{iLogFile} if $self->{iLogFile}; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
373 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
374 |
# set the correct warning level: |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
375 |
# -w=1: errors only (default) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
376 |
# -w=2: warnings as well as errors |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
377 |
# -w=3: info messages, warnings and errors. |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
378 |
if (defined $self->{iWarningLevel} and $self->{iWarningLevel} > 1) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
379 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
380 |
if ($self->{iWarningLevel} == 2) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
381 |
{ |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
382 |
$self->{iWarningLevel} = LogItem::WARNING; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
383 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
384 |
elsif ($self->{iWarningLevel} == 3) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
385 |
{ |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
386 |
$self->{iWarningLevel} = LogItem::INFO; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
387 |
} |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
388 |
else # for anything higher than set it to LogItem::VERBOSE |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
389 |
{ |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
390 |
$self->{iWarningLevel} = LogItem::VERBOSE; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
391 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
392 |
} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
393 |
else |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
394 |
{ |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
395 |
$self->{iWarningLevel} = LogItem::ERROR; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
396 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
397 |
# set the logger up: |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
398 |
$Logger::SEVERITY = $self->{iWarningLevel}; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
399 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
400 |
#determine the XSLT Processor we need to use |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
401 |
$self->{'iXslt'} = XsltProcessor(); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
402 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
403 |
} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
404 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
405 |
sub OrderedOption() { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
406 |
my $var = shift; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
407 |
my $val = shift; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
408 |
if($var=~/^(show|hide)-attr$/) { |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
409 |
my $f = "<filter xmlns='' display='$1' "; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
410 |
if($val=~s/^([^=]+)=//) {$f.="select='$1' value='$val'/>"} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
411 |
else {$f.="select='$val'/>"} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
412 |
push(@Filters,$f); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
413 |
} elsif($var eq 'filter-has' && $val eq '*') { |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
414 |
push(@Filters,"<filter xmlns='' display='show' select='*'/>"); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
415 |
}elsif($var eq 'filter-has') { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
416 |
if(!scalar(@Filters)) { # if the 1st is showing a filter than that implies everythig without a filter is turned off |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
417 |
push(@Filters,'<filter xmlns="" select="*" display="hide"/>'); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
418 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
419 |
foreach my $v (split(/,/,$val)) { |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
420 |
push(@Filters,"<filter xmlns='' display='show' select='filter' value='$v'/>"); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
421 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
422 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
423 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
424 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
425 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
426 |
sub fixFile { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
427 |
my $type = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
428 |
my $dir = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
429 |
my $val = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
430 |
if($val eq '') {return} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
431 |
$val = &FullPath("$dir/", $val ); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
432 |
if($type eq 'file/uri') { $val =&FileAsUrl($val)} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
433 |
return $val; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
434 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
435 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
436 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
437 |
sub FullPath { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
438 |
my $root = shift; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
439 |
my $file = shift; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
440 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
441 |
# If the file is not specified then return null |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
442 |
if (!$file) { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
443 |
return; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
444 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
445 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
446 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
447 |
# If the file is a URL or Windows path then return it as is |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
448 |
if ($file =~ /:/) { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
449 |
return $file; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
450 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
451 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
452 |
# If the file is a windows remote path then return it as is |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
453 |
if ($file =~ /\\\\/ || $file =~ /\/\//) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
454 |
return $file; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
455 |
} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
456 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
457 |
if ($root && !-e $root) { |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
458 |
&Logger::LogFatal("root$root does not exist"); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
459 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
460 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
461 |
if (-f $root) { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
462 |
$root = File::Basename::dirname($root) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
463 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
464 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
465 |
# if root is empty or the same dir, then file is relative |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
466 |
if($root eq '' or $root eq '.') { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
467 |
return $file; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
468 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
469 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
470 |
# If the file is relative from the root then we want to add the drive letter to the file (if one exists) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
471 |
if ($file =~ s/^[\\\/]// ) { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
472 |
if ($root =~ /^([a-z]:)/i) { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
473 |
return File::Spec->catdir($1, $file); |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
474 |
} else { # it's a unix path, put the / back on |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
475 |
return "/$file"; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
476 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
477 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
478 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
479 |
# Return the concatenated root and filename |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
480 |
return File::Spec->catdir($root, $file); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
481 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
482 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
483 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
484 |
sub ReadIniFile() |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
485 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
486 |
my $self = shift; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
487 |
my %setHere; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
488 |
return if ! defined $self->{iIniFile}; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
489 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
490 |
# Log a fatal error if the ini file is defined but doesn't exist: |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
491 |
&Logger::LogFatal("ini file does not exist\"$self->{iIniFile}\": $!", KSystemModelGenerator) if ! -e $self->{iIniFile}; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
492 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
493 |
open(INI, $self->{iIniFile}) or |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
494 |
&Logger::LogFatal("Could not open the ini file \"$self->{iIniFile}\": $!", KSystemModelGenerator); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
495 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
496 |
&Logger::LogInfo("Reading ini file \"$self->{iIniFile}...", KSystemModelGenerator); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
497 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
498 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
499 |
my %IniMap; # map from ini var to internal var |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
500 |
foreach my $a (keys %{$self->{'iArgs'}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
501 |
my $v = $self->{'iArgs'}->{$a}->{'param'}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
502 |
$v=~s/=.*//; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
503 |
$IniMap{$v}=$a; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
504 |
$v=~tr/-_/_-/; # allow both model_name and model-name |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
505 |
$IniMap{$v}=$a; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
506 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
507 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
508 |
my $iniDir = $self->{iIniFile}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
509 |
$iniDir =~ s,[^\\//]+$,,; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
510 |
#$iniDir .= '\\'; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
511 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
512 |
foreach my $line (<INI>) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
513 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
514 |
$line =~ s/^\s*//; # remove spaces |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
515 |
$line =~ s/\s*$//; # a/a |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
516 |
$line =~ s/\n$//; # remove new line |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
517 |
if($line =~/"/) { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
518 |
$line =~ s/^(([^"#]*"[^"]*")+)#.*$/$1/; # remove comments indicated by # (to the end of the line) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
519 |
} else { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
520 |
$line =~ s/#.*$//; # remove comments indicated by # (to the end of the line) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
521 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
522 |
next if $line eq ""; # ignore blank lines |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
523 |
if ($line =~ m/([^=]+)\s*=\s*(.*)/) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
524 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
525 |
my $argType = lc $1; # case-insensitive |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
526 |
my $argValue = $2; # case-sensitive as it can have strings intended for html output |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
527 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
528 |
$argType =~ s/^\s*//; # remove spaces on either end (Cannot use s/\s+// as this will not be suitable for html text) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
529 |
$argType =~ s/\s*$//; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
530 |
$argValue =~ s/^\s*//; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
531 |
$argValue =~ s/\s*$//; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
532 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
533 |
$argValue =~ s/^'//; # no need for quotes around the values |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
534 |
$argValue =~ s/'$//; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
535 |
$argValue =~ s/^"//; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
536 |
$argValue =~ s/"$//; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
537 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
538 |
if(!defined $IniMap{$argType}) {next} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
539 |
my $param = $IniMap{$argType}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
540 |
if($self->{'iArgs'}->{$param}->{'ordered'}) { |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
541 |
&OrderedOption($argType, $argValue); |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
542 |
} else { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
543 |
my $type = $self->{'iArgs'}->{$param}->{'type'}; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
544 |
# make sure all files mentioned are taken relative to the ini file |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
545 |
if($type eq 'file' or $type eq 'outfile' or $type eq 'dir' or $type eq 'file/uri') |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
546 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
547 |
$argValue =&fixFile($type,$iniDir,$argValue); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
548 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
549 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
550 |
# do not override! Only set values that have not been set on command line already |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
551 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
552 |
if ($self->{'iArgs'}->{$param}->{'multi'} == 1) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
553 |
if(scalar(@{$self->{$param}})==0 || $setHere{$param}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
554 |
push(@{$self->{$param}}, $argValue) ; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
555 |
$setHere{$param}=1; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
556 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
557 |
} elsif ($self->{'iArgs'}->{$param}->{'multi'} == 2) { |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
558 |
$argValue=~s/^([^=]+)=//; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
559 |
if(scalar(%{$self->{$param}})==0 || $setHere{$param}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
560 |
$self->{$param}->{$1}=$argValue; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
561 |
$setHere{$param} = 1; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
562 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
563 |
} else |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
564 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
565 |
$self->{$param} = $argValue if ! $self->{$param}; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
566 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
567 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
568 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
569 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
570 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
571 |
close(INI); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
572 |
@{$self->{'iFiltering'}} = @Filters if ! @{$self->{'iFiltering'}}; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
573 |
@Filters=(); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
574 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
575 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
576 |
sub getModel() |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
577 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
578 |
my $self = shift; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
579 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
580 |
my $tempDirectoryPathname = $self->{iTemporaryDirectory}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
581 |
my $modelXml = "$tempDirectoryPathname/Model.xml"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
582 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
583 |
if(defined $self->{'iModelCreated'}) {return $modelXml} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
584 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
585 |
my $needsMod=0; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
586 |
# the following needs a bit of work |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
587 |
foreach my $param (keys %{$self->{'iArgs'}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
588 |
if (! ($self->{'iArgs'}->{$param}->{'class'} =~ /^(Build Control|)$/ )) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
589 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
590 |
if ($self->IsSet($param)) {$needsMod=1; last} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
591 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
592 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
593 |
# if no parameters are set that would impact the model, just use the raw Model XML provided |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
594 |
if(!$needsMod) {return $self->{iModel}} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
595 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
596 |
my $dir = $self->{iModel}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
597 |
$dir=~s,[^/\\]+$,,; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
598 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
599 |
my $command = $self->XsltTransformCmd("-",$self->{'iModel'},$modelXml,1); # does not take any params |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
600 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
601 |
open XSLT, "|$command" |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
602 |
#open XSLT, ">$tempDirectoryPathname/xslt.xsl" |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
603 |
|| &Logger::LogFatal("error in running $command", KSystemModelGenerator); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
604 |
my $basedir = &FileAsUrl($dir); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
605 |
$basedir=~s,/$,,; # make sure no // |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
606 |
print XSLT '<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform"> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
607 |
<variable name="fullpath">',$basedir,'/</variable> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
608 |
<template match="@*" priority="-2"><copy-of select="."/></template> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
609 |
<template match="@href|model/@shapes|logo/@src|legend/@use[not(starts-with(.,'@') or starts-with(.,'#'))]" priority="-1"> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
610 |
<choose> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
611 |
<when test="$fullpath!='' and not(contains(.,':') or starts-with(.,'/'))"> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
612 |
<attribute name="{name()}"><value-of select="concat($fullpath,.)"/></attribute> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
613 |
</when> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
614 |
<otherwise><copy-of select="."/></otherwise> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
615 |
</choose> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
616 |
</template> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
617 |
<template match="*" mode="attr"><apply-templates select="@*"/></template> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
618 |
<template match="*" mode="content" priority="-1"><apply-templates select="*"/></template> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
619 |
<template match="*" mode="legend"><copy-of select="."/></template> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
620 |
<template match="note" mode="legend"><copy><copy-of select="@*"/><apply-templates select="." mode="content"/></copy></template> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
621 |
<template match="model" mode="content"> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
622 |
<call-template name="sysdef"/> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
623 |
<call-template name="filter"/> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
624 |
<apply-templates select="*"/> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
625 |
</template> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
626 |
<template match="/shapes/*"><param name="m"/> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
627 |
<if test="not(preceding-sibling::*[name()=name(current())] or $m//legend[@use=concat(\'@shapes#\',name(current()))])"> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
628 |
<element name="legend" namespace=""> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
629 |
<attribute name="use">@shapes#<value-of select="name()"/></attribute> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
630 |
</element></if> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
631 |
</template> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
632 |
<template match="/shapes/*[namespace-uri(.)!=',"''",']"/> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
633 |
<template match="note" mode="content" priority="-1"><apply-templates select="node()"/></template> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
634 |
<template match="*"> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
635 |
<copy><apply-templates select="." mode="attr"/><apply-templates select="." mode="content"/></copy> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
636 |
</template> |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
637 |
'; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
638 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
639 |
my %at; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
640 |
my %info=''; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
641 |
foreach my $param (keys %{$self->{'iArgs'}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
642 |
my $cur = $self->{'iArgs'}->{$param}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
643 |
if (! ($cur->{'class'} =~ /^(Build Control|)$/) && $self->IsSet($param) ) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
644 |
if($cur->{'xpath'}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
645 |
my $x = $cur->{'xpath'}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
646 |
my $match = $x; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
647 |
$x=~s,/([^/]+)$,,; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
648 |
my $item = $1; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
649 |
if($item=~s/^@//) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
650 |
if($self->{$param} ne '') { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
651 |
if($self->{'iArgs'}->{$param}->{'type'} ne 'boolean' || $self->{$param} eq 'true') { # if boolean and false, don't set attribute in XML |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
652 |
$at{$x}.="\t<attribute name=\"$item\">".&SafeXml($self->{$param})."</attribute>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
653 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
654 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
655 |
print XSLT "<template match=\"$match\"/>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
656 |
} elsif($item eq 'note') { # just in case there's other things that can take plan text later, can add them here |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
657 |
if($cur->{'multi'}==1) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
658 |
my $count =0; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
659 |
foreach my $n (@{$self->{$param}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
660 |
print XSLT "<template match=\"$item\[count(preceding::$item)=$count\]\" mode=\"content\">",&SafeXml($n),"</template>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
661 |
$count++; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
662 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
663 |
} elsif(!$cur->{'multi'}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
664 |
my $n =$self->{$param}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
665 |
print XSLT "<template match=\"$match\" mode=\"content\">&SafeXml($n)</template>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
666 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
667 |
} elsif($cur->{'info'}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
668 |
my $t = $cur->{'info'}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
669 |
if( ! ($self->{'iArgs'}->{$param}->{'dontclear'} )) { # can force it to be included anyway if necessary |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
670 |
print XSLT "<template match=\"$match/info\[\@type='$t'\]\"/>\n"; # remove from doc, add explicitly |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
671 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
672 |
if($cur->{'multi'}==1){ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
673 |
foreach my $n (@{$self->{$param}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
674 |
if($n ne '') { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
675 |
$info{$match}.="\t<info xmlns='' type='$t' href='$n'/>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
676 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
677 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
678 |
} elsif(!$cur->{'multi'}){ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
679 |
$info{$match}.="\t<info xmlns='' type='$t' href='",$self->{$param},"'/>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
680 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
681 |
} elsif($param eq 'iIgnore' or $param eq 'iIgnoreMeta' or $param eq 'iLinkExpr' or $param eq 'iSysDefFile') { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
682 |
print XSLT "<template match='",$cur->{'xpath'},"'/>\n" # ignore any already present if set |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
683 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
684 |
} elsif($param eq 'iModel' || $param eq 'iSysDefPath' || $param eq 'iPathPrefix' || $param eq 'iSourceRoot') { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
685 |
} else { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
686 |
print STDERR "$param ",$self->{$param},"\n"; # should not get here |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
687 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
688 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
689 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
690 |
if(scalar @{$self->{'iFiltering'}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
691 |
print XSLT "<template match='filter'/>\n" # ignore all already present if set |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
692 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
693 |
while (my ($a,$b) = each(%at) ){ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
694 |
print XSLT "<template match=\"$a\" mode=\"attr\">\n\t<apply-templates select=\"@*\"/>\n$b</template>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
695 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
696 |
print XSLT '<template name="sysdef">'; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
697 |
my $count=0; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
698 |
foreach my $sys (@{$self->{'iSysDefFile'}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
699 |
$count++; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
700 |
print XSLT "\n\t<element name='sysdef' namespace=''>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
701 |
print XSLT "\t\t<attribute name='href'>$sys</attribute>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
702 |
my $src=$count; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
703 |
if(scalar(@{$self->{'iSourceRoot'}}) == 1) {$src=0} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
704 |
if($self->{'iSourceRoot'}->[$src]) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
705 |
print XSLT "\t\t<attribute name='root'>",$self->{'iSourceRoot'}->[$src],"</attribute>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
706 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
707 |
$src=$count; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
708 |
if(scalar(@{$self->{'iPathPrefix'}}) == 1) {$src=0} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
709 |
if($self->{'iPathPrefix'}->[$src]) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
710 |
print XSLT "\t\t<attribute name='path-prefix'>",$self->{'iPathPrefix'}->[$src],"</attribute>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
711 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
712 |
$src=$count; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
713 |
if(scalar(@{$self->{'iSysDefPath'}}) == 1) {$src=0} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
714 |
if($self->{'iSysDefPath'}->[$src]) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
715 |
print XSLT "\t\t<attribute name='path'>",$self->{'iSysDefPath'}->[$src],"</attribute>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
716 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
717 |
print XSLT $info{'/model/sysdef'}, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
718 |
"<apply-templates select=\"/model/sysdef/info\"/>\n\t</element>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
719 |
$count++; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
720 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
721 |
foreach my $link (@{$self->{'iLinkExpr'}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
722 |
print XSLT "\t<element name='link' namespace=''><attribute name='expr'>",&SafeXml($link),"</attribute></element>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
723 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
724 |
print XSLT "</template>\n", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
725 |
"<template name=\"filter\">\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
726 |
foreach my $ig (@{$self->{'iIgnore'}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
727 |
print XSLT "\t<ignore xmlns='' "; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
728 |
if($ig=~/^(layer|package|block|logicalset|logicalsubset|subblock|collection|module|component):(.*)$/) {print XSLT "type='$1' name='$2'/>\n"} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
729 |
elsif($ig=~/:.*\//) {print XSLT "namespace='$ig'/>\n"} # assume it's a namespace if it has a colon and a slash |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
730 |
else {print XSLT "ref='$ig'/>\n"} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
731 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
732 |
foreach my $ig (@{$self->{'iIgnoreMeta'}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
733 |
print XSLT "\t<ignore xmlns='' "; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
734 |
if($ig=~/^(.*):(.*)$/) {print XSLT "meta-type='$2' meta='$1'/>\n"} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
735 |
else {print XSLT "meta='$ig'/>\n"} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
736 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
737 |
print XSLT join("\n\t",@{$self->{'iFiltering'}}), |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
738 |
"</template>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
739 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
740 |
print XSLT '<template match="layout/legend" mode="content">',"\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
741 |
if($self->{'iShapes'}) {print XSLT ' <apply-templates select="document(\'',$self->{'iShapes'},'\',.)/shapes/*|*"><with-param name="m" select="current()"/></apply-templates>',"\n";} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
742 |
foreach my $link ('iColor','iBorder','iOverlay' , 'iStyle') { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
743 |
my $type=$self->{'iArgs'}->{$link}->{'info'}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
744 |
if(scalar @{$self->{$link}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
745 |
my $use ="#$type"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
746 |
print XSLT "\t<if test=\"not(//legend[\@use='$use'])\">"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
747 |
} else { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
748 |
print XSLT "\t<if test=\"../info[\@type='$type']\">"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
749 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
750 |
print XSLT "<legend xmlns=\"\" use=\"#$type\"/></if>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
751 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
752 |
$count =1; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
753 |
my $notes=''; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
754 |
foreach my $n (@{$self->{'iLegendNote'}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
755 |
$notes.="\t<if test='count(//note) < $count'><note xmlns='' width='auto'>".&SafeXml($n)."</note></if>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
756 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
757 |
print XSLT "$notes</template>\n", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
758 |
'<template match="layout/legend[legend]" mode="content">', |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
759 |
"\n\t<apply-templates select='*' mode='legend'/>\n$notes</template>\n", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
760 |
'<template match="layout" mode="content">',"\n",$info{'/model/layout'}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
761 |
if($self->{'iLogoSrc'}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
762 |
print XSLT "\t<if test='not(//logo)'><element name='logo' namespace=''>\n",$at{'/model/layout/logo'},"\t</element></if>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
763 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
764 |
print XSLT "\t<apply-templates select='*'/></template>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
765 |
print XSLT "</stylesheet>\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
766 |
close XSLT; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
767 |
$self->{'iModelCreated'}=1; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
768 |
return $modelXml; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
769 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
770 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
771 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
772 |
sub GetXsltDir() |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
773 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
774 |
my $self = shift; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
775 |
my $xsltDir = $FindBin::Bin."/core"; # calcluated w.r.t root of Dep directory |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
776 |
return $xsltDir; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
777 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
778 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
779 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
780 |
sub GetExtrasDir() |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
781 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
782 |
my $self = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
783 |
my $dir = $FindBin::Bin."/extra"; # calcluated w.r.t root of Dep directory |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
784 |
return $dir; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
785 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
786 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
787 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
788 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
789 |
sub FileAsUrl() |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
790 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
791 |
my $file = $_[0]; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
792 |
if($file=~/^..+:/){ return $file} # already a URL |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
793 |
if(-f $file) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
794 |
{ # abs_path only works on dirs, so strip off file name and put it back when done |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
795 |
if(! ($file=~/^[a-z]:[\\\/][^\\\/]+$/i)) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
796 |
{ # if it's in the root dir, do nothing |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
797 |
my $tail = "/$file"; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
798 |
# if it's just a file name, need to find cwd; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
799 |
if($file =~ s,([\\/][^\\/]+)$,,) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
800 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
801 |
$tail = $1; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
802 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
803 |
else {$file = "."} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
804 |
$file = abs_path($file)."$tail"; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
805 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
806 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
807 |
elsif (-d $file) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
808 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
809 |
$file = abs_path($file); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
810 |
} # else does not exist, so just convert to unix-style path |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
811 |
$file=~tr/\\/\//; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
812 |
return "file:///$file"; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
813 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
814 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
815 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
816 |
sub RunCmd() { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
817 |
my $command = shift; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
818 |
open(EXE,"$command 2>&1|"); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
819 |
while(<EXE>){ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
820 |
chomp; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
821 |
s/^XSLT Message: //; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
822 |
s/\.Source tree node:.*$//; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
823 |
if($_ ne '') { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
824 |
if(s/^note: //i) { |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
825 |
&Logger::LogInfo($_, KSystemModelGenerator,2, 100); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
826 |
} elsif(s/^Warning: //) { |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
827 |
&Logger::LogWarning($_, KSystemModelGenerator,2, 600); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
828 |
} elsif(s/^Error: //i) { |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
829 |
&Logger::LogError($_, KSystemModelGenerator,2, 400); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
830 |
} else { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
831 |
print STDERR "$_\n"; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
832 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
833 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
834 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
835 |
close(EXE); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
836 |
return $?; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
837 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
838 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
839 |
sub ShouldCreateDepmodel() |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
840 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
841 |
my $self = shift; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
842 |
if (@{$self->{iDepsFile}}) |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
843 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
844 |
return 1; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
845 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
846 |
my $should = 0; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
847 |
my $model = $self->getModel(); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
848 |
my $t = $/; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
849 |
$/='>'; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
850 |
open(M,$model); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
851 |
while(<M>) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
852 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
853 |
if(/<model\s.*deps=/){$should=1;last;} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
854 |
if(/<info\s.*data-type="Dependencies"/){$should=1;last;} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
855 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
856 |
close M; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
857 |
$/ = $t; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
858 |
return $should |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
859 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
860 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
861 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
862 |
sub XsltTransformCmd() |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
863 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
864 |
my $self = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
865 |
my $command = $self->{'iXslt'} . ' ' ; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
866 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
867 |
if(join('',@PATH)=~/\\/) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
868 |
# use windows path |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
869 |
$command =~ s#\/#\\#g; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
870 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
871 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
872 |
if($command =~ /xalan\.jar/i) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
873 |
return $command. XalanJTransformCmd(@_); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
874 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
875 |
if($command =~ /xsltproc/i) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
876 |
return $command. XsltprocTransformCmd(@_); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
877 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
878 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
879 |
return $command. XalanTransformCmd(@_); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
880 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
881 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
882 |
sub XalanTransformCmd() |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
883 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
884 |
my $xslt = shift; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
885 |
my $from = shift; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
886 |
my $to = shift; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
887 |
my $indent = shift; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
888 |
my %params = (scalar @_) ? %{$_[0]} : (); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
889 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
890 |
if($from=~/ /) {$from= "\"$from\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
891 |
if($to=~/ /) {$to= "\"$to\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
892 |
if($xslt=~/ /) {$xslt= "\"$xslt\""} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
893 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
894 |
my $command; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
895 |
while (my($p,$v) = each(%{$_[0]})) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
896 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
897 |
$v =~ s/"/"/g; # replace quotes with entities |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
898 |
$command.= " -p $p \"$v\""; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
899 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
900 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
901 |
if($indent >=0) { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
902 |
$command .= " -i $indent"; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
903 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
904 |
if($to ne '') { |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
905 |
$command .= " -o $to"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
906 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
907 |
return "$command $from $xslt"; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
908 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
909 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
910 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
911 |
sub XalanJTransformCmd() |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
912 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
913 |
my $xslt = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
914 |
my $from = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
915 |
my $to = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
916 |
my $indent = shift; # not used in versions of xalan.jar we expect to see |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
917 |
my %params = (scalar @_) ? %{$_[0]} : (); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
918 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
919 |
if($from=~/ /) {$from= "\"$from\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
920 |
if($to=~/ /) {$to= "\"$to\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
921 |
if($xslt=~/ /) {$xslt= "\"$xslt\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
922 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
923 |
my $command; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
924 |
while (my($p,$v) = each(%{$_[0]})) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
925 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
926 |
$v =~ s/"/"/g; # replace quotes with entities |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
927 |
$command.= " -param $p \"$v\""; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
928 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
929 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
930 |
if($to ne '') { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
931 |
$command .= " -out $to"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
932 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
933 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
934 |
die &Logger::LogError("Model transforms are not supported using Xalan-J", KSystemModelGenerator, 1) if ($xslt eq '-'); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
935 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
936 |
$command .= " -xsl $xslt"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
937 |
$command .= " -in $from"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
938 |
return $command; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
939 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
940 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
941 |
sub XsltTransform() |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
942 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
943 |
my $self = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
944 |
my $to=$_[2]; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
945 |
my $command = $self->XsltTransformCmd(@_); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
946 |
&Logger::LogInfo("System Call: $command", KSystemModelGenerator,3,800); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
947 |
if($to eq '') {return `$command`} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
948 |
return &RunCmd($command); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
949 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
950 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
951 |
sub XsltprocTransformCmd() |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
952 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
953 |
my $xslt = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
954 |
my $from = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
955 |
my $to = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
956 |
my $indent = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
957 |
my %params = (scalar @_) ? %{$_[0]} : (); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
958 |
my $command; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
959 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
960 |
if($from=~/ /) {$from= "\"$from\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
961 |
if($to=~/ /) {$to= "\"$to\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
962 |
if($xslt=~/ /) {$xslt= "\"$xslt\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
963 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
964 |
while (my($p,$v) = each(%{$_[0]})) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
965 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
966 |
$v =~ s/"/"/g; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
967 |
$command.= " --param $p \"$v\""; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
968 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
969 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
970 |
if($to ne '') { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
971 |
$command .= " -o $to"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
972 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
973 |
return "$command $xslt $from"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
974 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
975 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
976 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
977 |
sub makeAbbrev |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
978 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
979 |
my $self = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
980 |
my $xsltDir = $self->GetExtrasDir(); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
981 |
my %params = ( |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
982 |
'dict' => "'".$self->{'iDict'}."'" |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
983 |
); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
984 |
if(scalar @{$self->{'iSysDefFile'}}) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
985 |
{ # if sysdefs provided, create one abbrev file for each |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
986 |
my $count = 1; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
987 |
if(! (scalar @{$self->{'iLocalize'}})) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
988 |
{ # do not fitler out any abbrev already in the model template |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
989 |
$self->{'iArgs'}->{'iLocalize'}->{'dontclear'}=1; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
990 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
991 |
foreach my $sysdef (@{$self->{'iSysDefFile'}}) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
992 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
993 |
my $afile = $self->{'iTemporaryDirectory'} . "/abbrev$count.xml"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
994 |
my $error = $self->XsltTransform("$xsltDir/makeabbrev.xsl",$sysdef,$afile,1,\%params); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
995 |
&Logger::LogError("Xalan error ($error) occured in creating abbrev file", KSystemModelGenerator, 1) if $error; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
996 |
# prepend generated file to the list (order does not matter since the same name appearing twice will have the same abbreviation) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
997 |
unshift(@{$self->{'iLocalize'}}, &FileAsUrl($afile)); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
998 |
$count++; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
999 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1000 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1001 |
else |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1002 |
{ # no sysdefs provided, run against template model xml |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1003 |
if(scalar @{$self->{'iLocalize'}}) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1004 |
{# if localize files provided, include = 0, which means it will ignore any localize files in the model template |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1005 |
# if there are none provided, then any in the model template will be appended to the generated file |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1006 |
# this is only needed for the case where it's run on the model. When run on the sysdef, inclusion has no meaning |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1007 |
$params{'include'} = 0; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1008 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1009 |
my $afile = $self->{'iTemporaryDirectory'} . "/abbrev.xml"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1010 |
my $error = $self->XsltTransform("$xsltDir/makeabbrev.xsl",$self->{'iModel'},$afile,1,\%params); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1011 |
&Logger::LogError("Xalan error ($error) occured in creating abbrev file", KSystemModelGenerator, 1) if $error; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1012 |
# prepend generated file to the list |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1013 |
unshift(@{$self->{'iLocalize'}}, &FileAsUrl($afile)); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1014 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1015 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1016 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1017 |
sub Draw() |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1018 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1019 |
my $self = shift; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1020 |
my $genSvg = $self->{'iDiagram'} ne ''; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1021 |
my $genCsv = $self->{'iOutputCsv'} ne ''; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1022 |
my $genXml = $self->{'iOutputXml'} ne ''; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1023 |
my $error; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1024 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1025 |
if(!$genSvg && !$genCsv && !$genXml) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1026 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1027 |
&Logger::LogFatal("Must specify at least one type of output file. Cannot continue...", KSystemModelGenerator, 0,Logger::KNothingToDo); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1028 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1029 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1030 |
# Step 0: |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1031 |
# Prepare some file names and create output directory: |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1032 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1033 |
# construct full path name: |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1034 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1035 |
my $xsltDir = $self->GetXsltDir(); |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1036 |
my $extraDir = $self->GetExtrasDir(); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1037 |
my $tempDirectoryPathname = $self->{'iTemporaryDirectory'}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1038 |
my $tempStuctureFile = "$tempDirectoryPathname/system_definition_tmp.xml"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1039 |
my $tempXslFile = "$tempDirectoryPathname/styling_tmp.xsl"; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1040 |
my $tempModelFile = "$tempDirectoryPathname/model_tmp.svg"; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1041 |
my $tempModelFile2 = "$tempDirectoryPathname/model_tmp2.svg"; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1042 |
my $modelXsl = $xsltDir."/layoutsysdef.xsl"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1043 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1044 |
if($self->{'iDict'}) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1045 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1046 |
&Logger::LogInfo("Create an abbreviation file...", KSystemModelGenerator, 0); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1047 |
$self->makeAbbrev(); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1048 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1049 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1050 |
&Logger::LogInfo("Generating Model XML...", KSystemModelGenerator, 0); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1051 |
my $modelXml = $self->getModel(); |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1052 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1053 |
# Step 2 - |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1054 |
&Logger::LogInfo("Generating merged sysdef XML...", KSystemModelGenerator, 0); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1055 |
$error = $self->XsltTransform($modelXsl,$modelXml,$tempStuctureFile,1); # does not take any params |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1056 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1057 |
&Logger::LogError("Xalan error ($error) occured in combining sysdefs", KSystemModelGenerator, 1) if $error; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1058 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1059 |
# Step 3 - validation |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1060 |
if($self->{iWarningLevel} == LogItem::VERBOSE ) |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1061 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1062 |
&Logger::LogInfo("Validating merged XML...", KSystemModelGenerator, 0); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1063 |
my $errors = $self->XsltTransform($extraDir."/validate.xsl",$tempStuctureFile,'',-1); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1064 |
&Logger::LogList(split(/\n/,$errors)); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1065 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1066 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1067 |
if($genSvg) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1068 |
{ # only needed for model building |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1069 |
&Logger::LogInfo("Generating Model Diagram...", KSystemModelGenerator, 0); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1070 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1071 |
# Step 4 |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1072 |
&Logger::LogInfo("Creating styling XSLT...", KSystemModelGenerator, 1); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1073 |
$error = $self->XsltTransform("$xsltDir/shapes.xsl",$modelXml,$tempXslFile,1, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1074 |
{%{$self->{'iXsltParam'}},'Model-Transform' => "'".&FileAsUrl("$xsltDir/draw.xsl")."'" }); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1075 |
&Logger::LogError("Xalan error ($error) occured generating Styling transform", KSystemModelGenerator, 2) if $error; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1076 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1077 |
if($self->{iLowMem}) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1078 |
{ # split step 5 into parts so we don't use as much runtime memory |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1079 |
# Step 5a |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1080 |
my $tempDetailsFile = "$tempDirectoryPathname/system_definition_draw.xml"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1081 |
&Logger::LogInfo("Generating temp details XML", KSystemModelGenerator, 1); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1082 |
$error = $self->XsltTransform($tempXslFile,$tempStuctureFile,$tempDetailsFile,1, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1083 |
{%{$self->{'iXsltParam'}},'Run' => "'calc'" } ); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1084 |
&Logger::LogError("Xalan error ($error) occured in building temp datafile", KSystemModelGenerator, 2) if $error; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1085 |
# Step 5b |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1086 |
&Logger::LogInfo("Generating SVG model...", KSystemModelGenerator, 1); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1087 |
$error = $self->XsltTransform($tempXslFile,$tempDetailsFile,$tempModelFile,1, |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1088 |
{%{$self->{'iXsltParam'}},'Run' => "'draw'" } ); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1089 |
&Logger::LogError("Xalan error ($error) occured in building SVG", KSystemModelGenerator, 2) if $error; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1090 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1091 |
else |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1092 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1093 |
# Step 5 |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1094 |
&Logger::LogInfo("Generating SVG model...", KSystemModelGenerator, 1); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1095 |
$error = $self->XsltTransform($tempXslFile,$tempStuctureFile,$tempModelFile,1,$self->{'iXsltParam'}); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1096 |
&Logger::LogError("Xalan error ($error) occured in building SVG", KSystemModelGenerator, 2) if $error; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1097 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1098 |
if ($self->ShouldCreateDepmodel()) { # insert as 1st transform |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1099 |
@ARGV=( $extraDir."/dependencies.xsl",'-',@ARGV) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1100 |
} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1101 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1102 |
my $tmpsvg = $tempModelFile; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1103 |
while(scalar(@ARGV)) { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1104 |
my $transform = shift(@ARGV); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1105 |
my $datafile = shift(@ARGV); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1106 |
if($datafile eq '-') {$datafile = &FileAsUrl($tempStuctureFile)} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1107 |
elsif($datafile ne '') {$datafile = &FileAsUrl($datafile)} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1108 |
# save to the output if this is the last transform |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1109 |
# otherwise save to tempModelFile2 if reading from tempModelFile, and vis versa |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1110 |
my $saveto = $self->{'iDiagram'}; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1111 |
if(scalar(@ARGV)) { |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1112 |
$saveto = ($tmpsvg eq $tempModelFile) ? $tempModelFile2 : $tempModelFile; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1113 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1114 |
# Step 6 |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1115 |
&Logger::LogInfo("Applying post-processing transformation...", KSystemModelGenerator,1); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1116 |
my %p = %{$self->{'iXsltParam'}}; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1117 |
if($datafile ne '') { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1118 |
$p{'Data'}="'$datafile'"; # optional -- only if needed for transform |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1119 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1120 |
$error = $self->XsltTransform($transform,$tmpsvg,$saveto,1,\%p); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1121 |
&Logger::LogError("Xalan error ($error) occured in post-processing SVG file", KSystemModelGenerator, 2) if $error; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1122 |
$tmpsvg = $saveto; # read from this next time. |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1123 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1124 |
if ($tmpsvg ne $self->{'iDiagram'}) { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1125 |
open(OUT,">".$self->{iDiagram}); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1126 |
open(IN,$tmpsvg); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1127 |
print OUT <IN>; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1128 |
close OUT; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1129 |
close IN; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1130 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1131 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1132 |
my $zipname = $self->{iDiagram}; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1133 |
my $unzipname = $zipname; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1134 |
$zipname =~ s/\.svg$/.svgz/i; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1135 |
$unzipname =~ s/\.svgz$/.svg/i; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1136 |
my $compressed = 0; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1137 |
if($self->{iCompress}) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1138 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1139 |
my $gzip = &GzipCommand(); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1140 |
if($gzip) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1141 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1142 |
&Logger::LogInfo("Compressing output model", KSystemModelGenerator,1); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1143 |
my $command = "$gzip ".$self->{iDiagram}; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1144 |
&Logger::LogInfo("System Call: $command", KSystemModelGenerator,2); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1145 |
$error = &RunCmd($command);# this should generate the sysmodel.svg in the output directory |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1146 |
&Logger::LogError("Gzip error ($error) occured when comrpessing SVG", KSystemModelGenerator, 2) if $error; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1147 |
&Logger::LogInfo("Renaming output to : $zipname", KSystemModelGenerator,2); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1148 |
rename $self->{iDiagram}.".gz", $zipname; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1149 |
$compressed = 1; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1150 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1151 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1152 |
if(!$compressed && $unzipname ne $self->{iDiagram}) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1153 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1154 |
&Logger::LogInfo("Renaming output to : $unzipname", KSystemModelGenerator,1); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1155 |
rename $self->{iDiagram}, $unzipname; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1156 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1157 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1158 |
# create CSV if desired |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1159 |
if($genCsv) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1160 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1161 |
&Logger::LogInfo("Generating CSV output", KSystemModelGenerator, 0); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1162 |
my %p; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1163 |
if($self->{iCsvColumns}) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1164 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1165 |
$p{'atts'}="'".$self->{iCsvColumns}."'"; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1166 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1167 |
if($self->{iCsvLabels}) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1168 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1169 |
$p{'labels'}="'".$self->{iCsvLabels}."'"; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1170 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1171 |
$error = $self->XsltTransform($extraDir."/output-csv.xsl",$tempStuctureFile,$self->{iOutputCsv},-1,\%p); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1172 |
&Logger::LogError("Xalan error ($error) occured in CSV output...", KSystemModelGenerator, 1) if $error; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1173 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1174 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1175 |
# create sysdef XML if desired |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1176 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1177 |
if($genXml) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1178 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1179 |
&Logger::LogInfo("Generating XML output", KSystemModelGenerator, 0); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1180 |
$error = $self->XsltTransform($extraDir."/output-sysdef.xsl",$tempStuctureFile,$self->{iOutputXml},1,$self->{'iXsltParam'}); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1181 |
&Logger::LogError("Xalan error ($error) occured in Sysdef output...", KSystemModelGenerator, 1) if $error; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1182 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1183 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1184 |
# delete the contents of the temp directory if -clean is specified by the user: |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1185 |
if ($self->{iClean}) |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1186 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1187 |
&Logger::LogInfo("Deleting contents of the temp directory $self->{iTemporaryDirectory}...", KSystemModelGenerator,0); |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1188 |
$self->DeleteTempDirectory(); |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1189 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1190 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1191 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1192 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1193 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1194 |
sub SafeXml { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1195 |
my $txt = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1196 |
if(!($txt=~/&#?[0-9a-z]+;/i)) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1197 |
{ # if not entity-encoded, entity encode the stuff |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1198 |
$txt=~ s/([&<>\x7f-\xff])/"&#".ord($1).";"/eg; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1199 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1200 |
return $txt; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1201 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1202 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1203 |
sub IsSet() |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1204 |
{ |
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1205 |
my $self = shift; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1206 |
my $param = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1207 |
if ($self->{'iArgs'}->{$param}->{'multi'} == 1) |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1208 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1209 |
if (scalar @{$self->{$param}} ) {return 1} |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1210 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1211 |
elsif ($self->{'iArgs'}->{$param}->{'multi'} == 2) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1212 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1213 |
if (scalar %{$self->{$param}} ) {return 1} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1214 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1215 |
elsif (defined $self->{$param}){return 1} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1216 |
return 0; |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1217 |
} |
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1218 |
|
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1219 |
|
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1220 |
sub SystemModelXmlDataDir() |
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1221 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1222 |
my $file =$FindBin::Bin."/rsc"; |
6
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1223 |
return $file; |
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1224 |
} |
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1225 |
|
5b32dc297d05
Prepare old system model generator for 2.0 update
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
1
diff
changeset
|
1226 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1227 |
#----------------------------------------------------------------------------- |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1228 |
# Xalan |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1229 |
#----------------------------------------------------------------------------- |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1230 |
my $KXalanDirectory = $FindBin::Bin."/rsc/installed/Xalan"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1231 |
my $KXalan = $KXalanDirectory."/xalan.exe"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1232 |
sub Xalan() |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1233 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1234 |
my $xalan = &FindInPath("xalan"); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1235 |
if($xalan ne '') { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1236 |
if($xalan=~/ /) {return "\"$xalan\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1237 |
return $xalan |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1238 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1239 |
# not found, use windows built-in version |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1240 |
$xalan = $KXalan; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1241 |
return $xalan; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1242 |
} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1243 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1244 |
sub XsltProcessor() |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1245 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1246 |
#first try xalan-c |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1247 |
my $proc = &FindInPath("xalan"); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1248 |
if($proc ne '') { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1249 |
if($proc=~/ /) {return "\"$proc\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1250 |
return $proc |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1251 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1252 |
# now try xsltproc |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1253 |
my $proc = &FindInPath("xsltproc"); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1254 |
if($proc ne '') |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1255 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1256 |
if($proc=~/ /) {return "\"$proc\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1257 |
return $proc |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1258 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1259 |
# now try xalan-j |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1260 |
foreach my $dir(@CLASSPATH) |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1261 |
{ |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1262 |
my $file = "$dir/xalan.jar"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1263 |
if(-e $file) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1264 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1265 |
if($file=~/ /) {$file="\"$file\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1266 |
return "java -jar $file"; # assume java is installed. Why would ever have a CLASSPATH and not have java? |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1267 |
} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1268 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1269 |
# not found, use windows built-in version. If we're not in windows this will fail, but since we have no other options we may as well try it. |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1270 |
$proc = $KXalan; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1271 |
$proc = $FindBin::Bin."/../../resources/installed/Xalan/xalan.exe" if ! -e $proc; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1272 |
if($proc=~/ /) {return "\"$proc\""} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1273 |
return $proc; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1274 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1275 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1276 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1277 |
#----------------------------------------------------------------------------- |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1278 |
# Gzip |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1279 |
#----------------------------------------------------------------------------- |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1280 |
sub GzipCommand |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1281 |
{ # returns empty if gzip not in path |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1282 |
my $dir = &FindInPath("gzip"); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1283 |
if($dir ne '') {return "gzip -9"} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1284 |
return ""; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1285 |
} |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1286 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1287 |
sub FindInPath |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1288 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1289 |
my $exe = shift; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1290 |
foreach my $d (@PATH) |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1291 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1292 |
my $dir = $d; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1293 |
$dir=~s,[\\\/]$,,; # remove trailing slash |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1294 |
$dir.="/$exe"; # try w/o extension |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1295 |
foreach my $ext ('',@PATHEXT) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1296 |
if(-f "$dir$ext" && -x "$dir$ext") {return "$dir$ext"} # must be a file and must be executable |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1297 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1298 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1299 |
return ""; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1300 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1301 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1302 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1303 |
#------------------- |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1304 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1305 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1306 |
sub DeleteTempDirectory() |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1307 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1308 |
my $self = shift; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1309 |
# This will delete all files in the $self->{iTemporaryDirectory} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1310 |
rmtree $self->{iTemporaryDirectory}; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1311 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1312 |
|
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1313 |
sub Help() |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1314 |
{ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1315 |
my $self = shift; |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1316 |
my ($param,$text); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1317 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1318 |
my @helporder = ('','', 'Build Control', '','Files or URIs',"All of these take a file name (relative or absolute path) or URI of a data source", |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1319 |
"Labels","All of these take a plain text value which is displayed on the model",'Model Control',''); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1320 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1321 |
format STDERR = |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1322 |
@<<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1323 |
$param, $text, |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1324 |
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1325 |
$text |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1326 |
. |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1327 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1328 |
|
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1329 |
my @list =( |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1330 |
'Switch', 'Explanation' ); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1331 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1332 |
for(my $i=0;$i<=$#helporder;$i+=2) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1333 |
my $item=$helporder[$i]; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1334 |
my $next = $helporder[$i+1]; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1335 |
if($next ne '') {$next="\n$next"} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1336 |
if($item ne '') { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1337 |
push (@list,"==== $item ====$next"); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1338 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1339 |
foreach my $b (sort values %{$self->{'iArgs'}}) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1340 |
if(!$b->{'param'}) {next} # not an arg |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1341 |
my $a = $b->{'param'}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1342 |
if ($b->{'class'} eq $item) { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1343 |
if ($a=~s/=.*// && $b->{'type'} ne '') { |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1344 |
$a .= ' ['.$b->{'type'}.']'; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1345 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1346 |
my $ex = $b->{'desc'}; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1347 |
if($b->{'default'}) { $ex.= ($ex=~/./ ? '. ' : '' ). 'Defaults to "'.$b->{'default'}.'"'} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1348 |
if($b->{'multi'}) { $ex.= ($ex=~/./ ? '. ' : '' ). "Can specify multiple times."} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1349 |
if($b->{'depr'}) { $ex.= ($ex=~/./ ? '. ' : '' ). "DEPRECATED: ".$b->{'depr'}} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1350 |
push(@list,'-'.$a,$ex); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1351 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1352 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1353 |
} |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1354 |
|
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1355 |
$self->HelpBase(); |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1356 |
print STDERR "\nArguments:\n"; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1357 |
my $head=2; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1358 |
while(@list) { |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1359 |
$param = shift(@list); |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1360 |
if($head<=0 and !($param=~/^-/)){print STDERR "\n$param\n";next;} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1361 |
$text = shift(@list); |
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1362 |
write STDERR ; |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1363 |
$head--; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1364 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1365 |
return; |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1366 |
} |
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1367 |
|
7
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1368 |
sub HelpBase() |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1369 |
{ |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1370 |
print STDERR "Usage: $0 [Arguments] [Transform Data-file] ...\n"; |
3c36c452f013
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
6
diff
changeset
|
1371 |
} |
1
b538b70cbe51
Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff
changeset
|
1372 |
1; |