iMonitor desktop application using dotnet 4.8
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
4.7 KiB

2 weeks ago
using System;
using iMonitorApp.Classes.DataAccess;
namespace iMonitorApp
{
// Token: 0x02000007 RID: 7
public class DataAlarm
{
// Token: 0x17000009 RID: 9
// (get) Token: 0x06000020 RID: 32 RVA: 0x00002FAD File Offset: 0x000011AD
// (set) Token: 0x06000021 RID: 33 RVA: 0x00002FB5 File Offset: 0x000011B5
public string Instrument { get; set; }
// Token: 0x1700000A RID: 10
// (get) Token: 0x06000022 RID: 34 RVA: 0x00002FBE File Offset: 0x000011BE
// (set) Token: 0x06000023 RID: 35 RVA: 0x00002FC6 File Offset: 0x000011C6
public string Field { get; set; }
// Token: 0x1700000B RID: 11
// (get) Token: 0x06000024 RID: 36 RVA: 0x00002FCF File Offset: 0x000011CF
// (set) Token: 0x06000025 RID: 37 RVA: 0x00002FD7 File Offset: 0x000011D7
public decimal Up { get; set; }
// Token: 0x1700000C RID: 12
// (get) Token: 0x06000026 RID: 38 RVA: 0x00002FE0 File Offset: 0x000011E0
// (set) Token: 0x06000027 RID: 39 RVA: 0x00002FE8 File Offset: 0x000011E8
public decimal Down { get; set; }
// Token: 0x1700000D RID: 13
// (get) Token: 0x06000028 RID: 40 RVA: 0x00002FF1 File Offset: 0x000011F1
// (set) Token: 0x06000029 RID: 41 RVA: 0x00002FF9 File Offset: 0x000011F9
public bool Enabled { get; set; }
// Token: 0x1700000E RID: 14
// (get) Token: 0x0600002A RID: 42 RVA: 0x00003002 File Offset: 0x00001202
// (set) Token: 0x0600002B RID: 43 RVA: 0x0000300A File Offset: 0x0000120A
public int Notification { get; set; }
// Token: 0x1700000F RID: 15
// (get) Token: 0x0600002C RID: 44 RVA: 0x00003013 File Offset: 0x00001213
// (set) Token: 0x0600002D RID: 45 RVA: 0x0000301B File Offset: 0x0000121B
public decimal Value { get; set; }
// Token: 0x17000010 RID: 16
// (get) Token: 0x0600002E RID: 46 RVA: 0x00003024 File Offset: 0x00001224
// (set) Token: 0x0600002F RID: 47 RVA: 0x0000302C File Offset: 0x0000122C
public bool isUpDirty { get; set; }
// Token: 0x17000011 RID: 17
// (get) Token: 0x06000030 RID: 48 RVA: 0x00003035 File Offset: 0x00001235
// (set) Token: 0x06000031 RID: 49 RVA: 0x0000303D File Offset: 0x0000123D
public bool isDownDirty { get; set; }
// Token: 0x17000012 RID: 18
// (get) Token: 0x06000032 RID: 50 RVA: 0x00003046 File Offset: 0x00001246
// (set) Token: 0x06000033 RID: 51 RVA: 0x0000304E File Offset: 0x0000124E
public decimal[] LastFive { get; set; }
// Token: 0x17000013 RID: 19
// (get) Token: 0x06000034 RID: 52 RVA: 0x00003057 File Offset: 0x00001257
// (set) Token: 0x06000035 RID: 53 RVA: 0x0000305F File Offset: 0x0000125F
public bool Phone { get; set; }
// Token: 0x17000014 RID: 20
// (get) Token: 0x06000036 RID: 54 RVA: 0x00003068 File Offset: 0x00001268
// (set) Token: 0x06000037 RID: 55 RVA: 0x00003070 File Offset: 0x00001270
public bool Email { get; set; }
// Token: 0x17000015 RID: 21
// (get) Token: 0x06000038 RID: 56 RVA: 0x00003079 File Offset: 0x00001279
// (set) Token: 0x06000039 RID: 57 RVA: 0x00003081 File Offset: 0x00001281
public bool Sound { get; set; }
// Token: 0x17000016 RID: 22
// (get) Token: 0x0600003A RID: 58 RVA: 0x0000308A File Offset: 0x0000128A
// (set) Token: 0x0600003B RID: 59 RVA: 0x00003092 File Offset: 0x00001292
public string Themes { get; set; }
// Token: 0x0600003C RID: 60 RVA: 0x00002AAD File Offset: 0x00000CAD
public DataAlarm()
{
}
// Token: 0x0600003D RID: 61 RVA: 0x0000309C File Offset: 0x0000129C
public DataAlarm(Alert a)
{
this.Instrument = a.Instrument;
this.Field = a.Field;
this.Up = a.Up;
this.Down = a.Down;
this.Enabled = a.Enabled;
this.Notification = a.Notification.Value;
bool flag = a.Phonecall != null;
if (flag)
{
this.Phone = a.Phonecall.Value;
}
else
{
this.Phone = false;
}
bool flag2 = a.Email != null;
if (flag2)
{
this.Email = a.Email.Value;
}
bool flag3 = a.Sound != null;
if (flag3)
{
this.Sound = a.Sound.Value;
}
this.Themes = a.Themes;
}
// Token: 0x0600003E RID: 62 RVA: 0x00003195 File Offset: 0x00001395
public void SetValue(decimal value)
{
this.Value = value;
this.Check();
}
// Token: 0x0600003F RID: 63 RVA: 0x000031A7 File Offset: 0x000013A7
public void SetValue(double value)
{
this.Value = Math.Round(Convert.ToDecimal(value), 4);
this.Check();
}
// Token: 0x06000040 RID: 64 RVA: 0x000031C4 File Offset: 0x000013C4
public void Check()
{
bool flag = this.Up != 0m;
if (flag)
{
bool flag2 = this.Value >= this.Up;
if (flag2)
{
this.isUpDirty = true;
}
else
{
this.isUpDirty = false;
}
}
bool flag3 = this.Down != 0m;
if (flag3)
{
bool flag4 = this.Value <= this.Down;
if (flag4)
{
this.isDownDirty = true;
}
else
{
this.isDownDirty = false;
}
}
}
}
}