Define rule to display graphics card

You can create a rule that can be attached to each graphics card option item that determines whether it can be displayed.

Procedure

  1. Navigate to the model MXWS-7700.
  2. Click the Rules tab.
  3. Click the Define sub-tab.
  4. Click New.
  5. Enter the following information:
    • Name: Display if Support XVGA
    • Description: Display this card if XVGA support is required and the card supports XVGA.
  6. Select Rule Triggered on: Failure.
  7. Click Save and Edit.
  8. Click the New Fragment icon.
  9. Specify the fragment as follows:
    • Choose value from the Function1 drop-down list.
    • Choose RequiresXVGA from the Property1 drop-down list.
    • Choose = from the Operator drop-down list.
    • Choose literal from the Function2 drop-down list.
    • Enter 1 in the Property2 field.

      Specifying the fragment in this way is equivalent to the following formula:

      
      value(RequiresXVGA) = literal(1) in any location
      
  10. Set If not specified to Rule is true.

    In effect, this says that if the RequiresXVGA property is not set, then assume that all graphics cards are valid selections.

  11. Click Save and Return.
  12. Click the New Fragment icon.
  13. Specify the fragment as follows:
    • Choose propval from the Function1 drop-down list.
    • Choose Resolution from the Property1 drop-down list.
    • Choose = from the Operator drop-down list.
    • Choose literal from the Function2 drop-down list.
    • Enter XVGA in the Property2 field.

      Specifying the fragment in this way is equivalent to the following formula:

      
      propval(Resolution) = literal(XVGA) in any location
      

      Note that we have to use the propval function here rather than value: this is because the option item will not have been picked at the time the rule fires.

  14. Set If not specified to Rule is true.
  15. Click Save and Return.
  16. In the Assignment Actions panel, select _isViewable property from the drop-down list.
  17. Enter 0 for the Value.
  18. Leave the Assign To field value blank. This is to indicate that the property is at the node at which the rule is attached.
  19. Click Add Item.
  20. Click Save.
  21. Now attach this rule to the each graphics card.

    Before compiling our model, the last thing we have to do is to manage the order in which the rules fire. We want to ensure that the rule that tests to see if XVGA is required fires before the rules that determine if each graphics card option item is compatible.

  22. Navigate to the Model node.
  23. Click the Rules tab.
  24. Click the Firing Sequence sub-tab.
  25. Change the Priority value of the Display Compatible Graphics Cards rule to 10.

    This ensures that this rule will fire first.

  26. Click Save All Changes.

    Now compile and test the model. You see that the Graphics Card option class is hidden until you select a monitor, and then it is displayed so that a graphics card can be selected. If you select the Optiquest Q115 monitor, then the GC-1000 graphics card is not displayed.