forked from thedeemon/gep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TempHistory.cs
60 lines (49 loc) · 1.41 KB
/
TempHistory.cs
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections;
using System.Collections.Generic;
namespace gep
{
abstract class TempHistoryItem : IComparable<TempHistoryItem>
{
protected HistoryItem hi;
public HistoryItem HItem { get { return hi; }}
protected int order;
public int Order { get{ return order; }}
public abstract int CalcOrder();
public static IEnumerable<HistoryItem> hitems(IEnumerable<TempHistoryItem> thitems)
{
foreach (TempHistoryItem item in thitems)
yield return item.HItem;
}
public int CompareTo(TempHistoryItem other)
{
return order - other.Order;
}
}
class THIAddFilter : TempHistoryItem
{
Filter filter;
public THIAddFilter(HIAddFilter _hi, Filter f)
{
filter = f;
hi = _hi;
}
public override int CalcOrder()
{
return order = filter.Stage*10000;
}
}
class THIConnect : TempHistoryItem
{
PinConnection con;
public THIConnect(HIConnect _hi, PinConnection _con)
{
hi = _hi;
con = _con;
}
public override int CalcOrder()
{
return order = con.pins[1].Filter.Stage*10000 + (con.pins[1].Num+1)*100 + con.pins[0].Num+1;
}
}
}