renhao
2023-09-21 1aa9f2bb83dd9e4b7517f1cbf06b0db53979bb31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Quintiq file version 2.0
#parent: #root
Method ShowSnapshots (
  structured[LibOpt_Snapshot] snapshots
) id:Method_LibOpt_FormAnalysisScopeElement_ShowSnapshots
{
  #keys: '[139164.4.578216543]'
  Body:
  [*
    
    iterations := selectset( snapshots, Elements.IterationPart.IterationPartNM.Iteration, iteration, true );
    
    // Find in Iterations form
    traverse( Form, Parent.SubComponents.astype( LibOpt_FormIteration ), form )
    {
      list := form.ListIteration();
      list.SelectByKey( iterations.Element( 0 ).Key() );
      traverse( iterations, Elements, iteration )
      {
        list.ExtendSelectByKey( iteration.Key() );
      }
    }
    
    // Find in Snapshot form
    traverse( Form, Parent.SubComponents.astype( LibOpt_FormSnapshot ), form )
    {
      list := form.ListSnapshot();
      list.SelectByKey( snapshots.Element( 0 ).Key() );
      traverse( snapshots, Elements, snapshot )
      {
        list.ExtendSelectByKey( snapshot.Key() );
      }
    }
  *]
}