SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
Alert.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Xml;
5 using System.Xml.Serialization;
6 using System.ComponentModel;
7 
8 namespace Seci.Definitions
9 {
10  public class BaseAlert
11  {
12  [XmlIgnore]
13  public DateTime TimeWentOutOfRange { get; set; }
14  [XmlIgnore]
15  public Boolean OutOfRange { get; set; }
16  [XmlIgnore]
17  public DateTime LastMessageSent { get; set; }
18  [XmlIgnore]
19  public TimeSpan DelayBeforeSms { get; protected set; }
20  [XmlIgnore]
21  public String OwningConfiguration { get; set; }
22 
23  public BaseAlert()
24  {
25  LastMessageSent = new DateTime();
26  DelayBeforeSms = new TimeSpan(0, 0, 0);
27  OwningConfiguration = "";
28  }
29 
30  [XmlElement("DelayInTicks"), Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
31  public long DelayInTicks
32  {
33  get { return DelayBeforeSms.Ticks; }
34  set { DelayBeforeSms = new TimeSpan(value); }
35  }
36  }
37 
38  public class BlockAlert : BaseAlert
39  {
40  private int _defaultTimeToWait = 5; //minutes
41 
42  //Standard settings
43  public String Blockname { get; set; }
44  public String BlockType { get; set; }
45 
46  //Limits
47  public Double LowLimit { get; set; }
48  public Double HighLimit { get; set; }
49  public Boolean Enabled { get; set; }
50 
51  public BlockAlert()
52  {
53  BlockType = "NUMERIC";
54  Enabled = true;
55  }
56 
57  public BlockAlert(String blockname, String type, double lowlimit, double highlimit, Boolean enabled)
58  {
59  //Used when the user sets limits manually
60  Blockname = blockname;
61  BlockType = type;
62  LowLimit = lowlimit;
63  HighLimit = highlimit;
64  Enabled = enabled;
65  DelayBeforeSms = new TimeSpan(0, _defaultTimeToWait, 0);
66  }
67  }
68 
69  public class WaitingAlert : BaseAlert
70  {
71  public WaitingAlert()
72  {
73  }
74 
75  public WaitingAlert(TimeSpan timeLimit)
76  {
77  DelayBeforeSms = timeLimit;
78  }
79  }
80 }
BlockAlert(String blockname, String type, double lowlimit, double highlimit, Boolean enabled)
Definition: Alert.cs:57
WaitingAlert(TimeSpan timeLimit)
Definition: Alert.cs:75