PSCAD 4.2.0

Settings
 {
 Id = "939991451.1114198054"
 Author = "gdi.jayas"
 Desc = "Use of PSCAD macros"
 Arch = "windows"
 Options = 0
 Build = 2
 Warn = 1
 Check = 15
 Libs = ""
 Source = ""
 RunInfo = 
  {
  Fin = 0.5
  Step = 5e-005
  Plot = 0.001
  Chat = 0.001
  Brch = 0.0005
  Lat = 100
  Options = 0
  Advanced = 511
  Debug = 0
  StartFile = ""
  OFile = "noname.out"
  SFile = "noname.snp"
  SnapTime = 0.3
  Mruns = 10
  Mrunfile = 0
  StartType = 0
  PlotType = 0
  SnapType = 0
  MrunType = "mrun"
  }

 }

Definitions
 {
 Component("legend")
  {
  Desc = ""
  FileDate = 0
  Parameters = 
   {
   Category("Main Parameters")
    {
    Text("Prompt1",10,4,198,12,2)
     {
     Desc = "Enter Prompt1 Text Here"
     Def = "Case Description"
     Len = 30
     }
    Text("Text1",10,18,198,12,2)
     {
     Desc = "Enter Text1 Here"
     Def = "Example to show use of Legend"
     Len = 30
     }
    Text("Prompt2",10,38,198,12,2)
     {
     Desc = "Enter Prompt2 Text Here"
     Def = "Prompt 2"
     Len = 30
     }
    Text("Text2",10,52,198,12,2)
     {
     Desc = "Enter Text2 Here"
     Def = "Text 2"
     Len = 30
     }
    Text("Prompt3",10,72,198,12,2)
     {
     Desc = "Enter Prompt3 Text Here"
     Def = "Prompt 3"
     Len = 30
     }
    Text("Text3",10,86,198,12,2)
     {
     Desc = "Enter Text3 Here"
     Def = "Text 3"
     Len = 30
     }
    Text("Prompt4",10,106,198,12,2)
     {
     Desc = "Enter Prompt4 Text Here"
     Def = "Prompt 4"
     Len = 30
     }
    Text("Text4",10,120,198,12,2)
     {
     Desc = "Enter Text4 Here"
     Def = "Text 4"
     Len = 30
     }
    Text("Prompt5",10,140,198,12,2)
     {
     Desc = "Enter Prompt5 Text Here"
     Def = "Prompt 5"
     Len = 30
     }
    Text("Text5",10,154,198,12,2)
     {
     Desc = "Enter Text5 Here"
     Def = "Text 5"
     Len = 30
     }
    }
   }

  Nodes = 
   {
   }

  Graphics = 
   {
   Font(,,Left)
   Text(-178,-39,"%Prompt1")
   Rectangle(-180,-54,180,36)
   Text(-58,-39,"%Text1")
   Line(-180,-18,180,-18)
   Line(-180,0,180,0)
   Line(-180,18,180,18)
   Line(-180,-36,180,-36)
   Line(-60,36,-60,-54)
   Text(-178,-21,"%Prompt2")
   Text(-178,-3,"%Prompt3")
   Text(-178,15,"%Prompt4")
   Text(-178,31,"%Prompt5")
   Text(-58,-21,"%Text2")
   Text(-58,-3,"%Text3")
   Text(-58,15,"%Text4")
   Text(-58,31,"%Text5")
   Font(,,Centre)
   Text(-1,-61,"An example component which allows users to enter prompt and text")
   }

  Section(EMTDC)
   {
   Fortran = ""
   Branch = ""
   Computations = ""
   }
  }
 Component("legend_hardcoded")
  {
  Desc = ""
  FileDate = 0
  Parameters = 
   {
   }

  Nodes = 
   {
   }

  Graphics = 
   {
   Rectangle(-162,-36,181,72)
   Text(6,-42,"A second legend component showing macros only available from hard-coded text in a component:")
   Font(,,Left)
   Text(-160,-21,"Project:")
   Line(-162,0,181,0)
   Line(-162,18,180,18)
   Line(-162,-18,180,-18)
   Text(-160,-3,"PageName")
   Text(-160,33,"RunTime")
   Text(-160,15,"Dir")
   Line(-93,72,-93,-36)
   Text(-91,-21,"%:Project")
   Text(-91,-3,"%:PageName")
   Text(-91,15,"%:Dir")
   Text(-91,33,"%:RunTime")
   Line(-162,36,180,36)
   Text(-160,51,"RunDate")
   Text(-91,51,"%:RunDate")
   Text(-160,69,"DateTime")
   Line(-162,54,180,54)
   Text(-91,67,"%:DateTime")
   }

  Section(EMTDC)
   {
   Fortran = ""
   Branch = ""
   Computations = ""
   }
  }
 Module("Main")
  {
  Desc = "Main Page"
  FileDate = 0
  Nodes = 
   {
   }

  Graphics = 
   {
   Rectangle(-18,-18,18,18)
   }


  Page(A/A4,Portrait,16,[633,473],100)
   {
   .legend([828,594],0,0,-1)
    {
    Prompt1 = "Case Description"
    Text1 = "Example to show use of Legend"
    Prompt2 = ""
    Text2 = ""
    Prompt3 = "Date"
    Text3 = "%:Date"
    Prompt4 = "Time"
    Text4 = "%:Time"
    Prompt5 = "DateTime"
    Text5 = "%:DateTime"
    }
   .legend([360,594],0,0,-1)
    {
    Prompt1 = "Year"
    Text1 = "%:Year"
    Prompt2 = "Month"
    Text2 = "%:Month"
    Prompt3 = "Day"
    Text3 = "%:Day"
    Prompt4 = "Hour"
    Text4 = "%:Hour"
    Prompt5 = "Minute"
    Text5 = "%:Min"
    }
   .legend([576,738],0,0,-1)
    {
    Prompt1 = "User Id"
    Text1 = "%:Userid"
    Prompt2 = "Computer Name"
    Text2 = "%:Computer"
    Prompt3 = ""
    Text3 = ""
    Prompt4 = ""
    Text4 = ""
    Prompt5 = ""
    Text5 = ""
    }
   -Sticky-([198,900],0)
    {
    Name = ""
    Font = 1
    Bounds = 198,900,468,990
    Alignment = 0
    Style = 1
    Arrow = 8
    Color = 0,15792890
    Text = "Some users may want to \"hard code\" the text fields in each area instead of asking for the prompt and text. An example of such legend component can be found below. In this case macros from both sets can be used."
    }
   -Sticky-([648,1098],0)
    {
    Name = ""
    Font = 1
    Bounds = 648,1098,1152,1512
    Alignment = 0
    Style = 0
    Arrow = 0
    Color = 0,15792890
    Text = "\
NOTE:
Both components (legend and legend_hardcoded) are stored in this example case (when you point at a component and stop moving the mouse, the fly-by text shows you the casename or library in which this component is located).             

Some users may want to have a Legend component that is used for all their simulation cases, or maybe common for all users at a company.  The best way to accomplish this is to save the legend component to
a unique name (such as companyname_legend_portrait).  Then move this component into the appropriate library.

To move the component definition to different library or case please do the following steps:
 - first go to the Project Tree, and for the case or library where the
   original component is located, expand the tree and the  Definitions section;
 - next, point at the component, and with the right button, copy the component definition;  
 - go to the library or case where you want the component to reside (or create a new one), and paste the 
   component into the Definitions section;
 - finally, create an instance of this component (by right button Special->Create Instance)
   and paste this into the main page for the library.

Now the legend component can be copied from the library and use it in all their simulation cases.
If the component definition is modified in the library, then it will change for all users.
"
    }
   -Sticky-([72,108],0)
    {
    Name = ""
    Font = 1
    Bounds = 72,108,558,342
    Alignment = 0
    Style = 0
    Arrow = 0
    Color = 0,15792890
    Text = "\
This example case shows how you can generate a legend that will appear at the bottom of any simulation page.

It also shows how you can use pre-defined macros in your text. For example, the use of a macro DateTime (with a %: before it)  will generate:     
%:DateTime

The legend component below was designed so that both the prompt and the corresponding text are entered as Parameters.  Any user can modify the prompt and text for each of the 5 lines in the component. Only macros from the first set can be used here.
"
    }
   -Sticky-([648,108],0)
    {
    Name = ""
    Font = 1
    Bounds = 648,108,1152,486
    Alignment = 0
    Style = 0
    Arrow = 0
    Color = 0,15792890
    Text = "\
There are two sets of PSCAD macros:

1) macros which can be used in any text (preceed each macro with a %:):
     Time
     Date
     DateTime
     Year
     Month
     Day
     Hour
     Min
     Userid
     Computer

2) macros which has to be used directly in the Component Workshop (i.e. not through text entered in a text parameter)
     Name
     Desc
     Project
     Dir
     PageName
     RunTime
     RunDate
     RunDateTime
     RunDir
     Username"
    }
   .legend_hardcoded([756,918],0,0,-1)
    {
    }
   -Sticky-([72,1098],0)
    {
    Name = ""
    Font = 1
    Bounds = 72,1098,558,1260
    Alignment = 0
    Style = 0
    Arrow = 0
    Color = 0,15792890
    Text = "\
Both components seen above 'legend' and 'legend_hardcoded' can be copied and used by users in their own simulation cases.

The information about how to copy a component is included on the right.

These components can be modified right clicking on \"Edit Definition...\".  Then,  the parameters can  be removed or change, and the corresponding text shown in the Graphics section of the component modified as required.
"
    }
   -Sticky-([486,1026],0)
    {
    Name = ""
    Font = 1
    Bounds = 486,1026,648,1062
    Alignment = 0
    Style = 1
    Arrow = 0
    Color = 0,15792890
    Text = "component: legend_hardcoded"
    }
   -Sticky-([522,792],0)
    {
    Name = ""
    Font = 1
    Bounds = 522,792,630,828
    Alignment = 0
    Style = 1
    Arrow = 0
    Color = 0,15792890
    Text = "components: legend"
    }
   -Sticky-([72,36],0)
    {
    Name = ""
    Font = 2
    Bounds = 72,36,1152,72
    Alignment = 1
    Style = 0
    Arrow = 0
    Color = 0,15792890
    Text = "USE OF PSCAD MACROS"
    }
   }
  }
 }

