创建新话题

Managing a list of assets

When you have assets (it could be signals, parameters, constants, etc.) within your system that you want to manage there are a few different options.

Option one: make a grid that goes through the system and presents all assets that are found in the system.

The drawback with this approach is that it is hard to keep track of changes. As soon as an asset is added to the system the grid will show it. Thus, it is hard to see what has been added and how the list of assets looked before.

An alternative to this is to keep a list of assets that are periodically synchronized with the system. The list will then keep track of the previous state and the system represents what assets are currently in the system. To aid in keeping this list up to date one can use the part list editor (File -> Configure the Explorer -> Part list editor).


Example: Adding parameters into a parameter list

Meta model


image

The meta model contains a design with functions built up of Software components (SWCs) that have parameters. Beside the design there is a parameter list. Small example below:


image

First, we can do a grid that shows the parameters within the design when standing on the parameter list:

 


<Grid>
<Parameters>
    <Parameter name="p1" caption="System" hintContextPath="PALI">
        <Values>
            <ForEachPathReference path="PALI">
                <AddValue/>            
            </ForEachPathReference>        
        </Values>    
    </Parameter>
</Parameters>
<Context name="x">
    <AddParts owner="p1" sid="3VDA" part="Designs" defobj="Design"/>
    <AddParts owner="Design" sid="ITFD" part="FuncLevels" defobj="FuncLevel"/>
    <AddParts owner="FuncLevel" sid="ITAP" part="Functions" defobj="Function"/>
    <AddParts owner="Function" sid="ITFC" part="SWCs" defobj="SWC"/>
    <AddParts owner="SWC" sid="PARA" part="Params" defobj="Param"/>
</Context>
  <Columns>
    <ItemNameColumn width="200"/>
  </Columns>
  <ForEachInContext name="x" group="Param">
    <Row/>
  </ForEachInContext>
</Grid>



 Applying the grid script on the small example gives:

image


The script can now be used as a starting point for configuring the part list editor (File -> Configure the Explorer -> Part list editor):

 


  <Config id="ParamList">
    <ViewSettings>
       <Caption>Synchronize parameters</Caption>
       <RibbonGroup>Test</RibbonGroup>
       <Description>Hint shown in the ribbon</Description>
    </ViewSettings>
    <TopItemType>2P09</TopItemType>
    <PartTypes>
       <PartType itemType="2P08">2IPG</PartType>
    </PartTypes>
    <UIMessages>
      <UIMessageAdd>Include</UIMessageAdd>
      <UIMessageIgnore>Exclude</UIMessageIgnore>
      <UIMessageMappingColumnHeading>Mapping status</UIMessageMappingColumnHeading>
      <UIMessageAllocatedHeading>Mapping status</UIMessageAllocatedHeading>
    </UIMessages>
    <RightSide>
      <ContextTree>
        <Parameters>
          <Parameter name="p1" caption="System" hintContextPath="PALI">
            <Values>
              <ForEachPathReference path="PALI">
                <AddValue/>            
              </ForEachPathReference>        
            </Values>    
          </Parameter>
        </Parameters>      
        <Context name="x">
          <AddParts owner="p1" sid="3VDA" part="Designs" defobj="Design"/>
          <AddParts owner="Design" sid="ITFD" part="FuncLevels" defobj="FuncLevel"/>
          <AddParts owner="FuncLevel" sid="ITAP" part="Functions" defobj="Function"/>
          <AddParts owner="Function" sid="ITFC" part="SWCs" defobj="SWC"/>
          <AddParts owner="SWC" sid="PARA" part="Params" defobj="Param"/>
        </Context>
        <Tree startGroup="Param">
        </Tree>
      </ContextTree>
    </RightSide>  
    <AdditionalLeftColumns> 
    </AdditionalLeftColumns> 
  </Config>


The context defined in the grid is used to configure a ContextTree to show all parameters in the system.


Adding this as a configuration of the part list editor gives you a button active on parameter lists named “Synchronize parameters” which looks like this:


image


The left list is the parameters in the parameter list, the right the parameters in the system. The parameters included in the list are shown as “Included”, the parameters that are included but of different versions than in the list are shown in yellow.


This setup can be used to manage any assets in the system that are important to keep extra attention to.





登录 发表评论