123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- using System;
- using System.ComponentModel;
- using System.ComponentModel.DataAnnotations.Schema;
- using System.Drawing;
- using System.Runtime.CompilerServices;
- using System.Runtime.Serialization;
- namespace GDNXFD.Data
- {
- // CREATE TABLE "SA"."ALERTSNAP"
- // ( "ID" VARCHAR2(50) NOT NULL ENABLE,
- //"STATIONID" VARCHAR2(50) NOT NULL ENABLE,
- //"PROJECTID" VARCHAR2(50),
- //"LINEID" VARCHAR2(50),
- //"WINDTURBINEID" VARCHAR2(50),
- //"ALERTVALUE" NUMBER NOT NULL ENABLE,
- //"CATEGORY1" VARCHAR2(50) NOT NULL ENABLE,
- //"CATEGORY2" VARCHAR2(50),
- //"CATEGORY3" VARCHAR2(50),
- //"RANK" VARCHAR2(50) DEFAULT 1 NOT NULL ENABLE,
- //"ISOPENED" NUMBER(1,0) DEFAULT 0 NOT NULL ENABLE,
- //"ISCONFIRMED" NUMBER(1,0) DEFAULT 0 NOT NULL ENABLE,
- //"CONFIRMTIME" DATE,
- //"CONFIRMPERSON" VARCHAR2(50),
- //"LASTUPDATETIME" DATE,
- //"LASTUPDATEPERSON" VARCHAR2(50),
- //"STATIONNAME" VARCHAR2(50),
- //"PROJECTNAME" VARCHAR2(50),
- //"LINENAME" VARCHAR2(50),
- //"WINDTURBINENAME" VARCHAR2(50),
- //"ALERTTEXT" VARCHAR2(400),
- //"MODELID" VARCHAR2(50)
- // ) SEGMENT CREATION IMMEDIATE
- // PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
- // STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
- // PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
- // TABLESPACE "USERS" ;
- // ALTER TABLE "SA"."ALERTSNAP" MODIFY("ISCONFIRMED" NOT NULL ENABLE);
- // ALTER TABLE "SA"."ALERTSNAP" MODIFY("ISOPENED" NOT NULL ENABLE);
- // ALTER TABLE "SA"."ALERTSNAP" MODIFY("RANK" NOT NULL ENABLE);
- // ALTER TABLE "SA"."ALERTSNAP" MODIFY("CATEGORY1" NOT NULL ENABLE);
- // ALTER TABLE "SA"."ALERTSNAP" MODIFY("ALERTVALUE" NOT NULL ENABLE);
- // ALTER TABLE "SA"."ALERTSNAP" MODIFY("STATIONID" NOT NULL ENABLE);
- // ALTER TABLE "SA"."ALERTSNAP" MODIFY("ID" NOT NULL ENABLE);
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."STATIONID" IS '场站ID';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."PROJECTID" IS '工程ID';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."LINEID" IS '线路ID';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."WINDTURBINEID" IS '风机/逆变器ID';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."ALERTVALUE" IS '报警值,对应EDNAVALUE';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."CATEGORY1" IS '分类,对应warningclassfy表,追加自定义报警、电气报警';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."CATEGORY2" IS '分类2、对应自定义报警的分类';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."CATEGORY3" IS '分类3、冗余备用';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."RANK" IS '报警级别';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."ISOPENED" IS '状态:0-关闭;1-打开';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."ISCONFIRMED" IS '确认状态:0-未确认;1-已确认';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."CONFIRMTIME" IS '确认时间';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."CONFIRMPERSON" IS '确认人';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."LASTUPDATETIME" IS '最后更新时间';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."LASTUPDATEPERSON" IS '最后更新人';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."STATIONNAME" IS '场站名称';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."PROJECTNAME" IS '工程名称';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."LINENAME" IS '线路名称';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."WINDTURBINENAME" IS '风机名称';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."ALERTTEXT" IS '报警内容文本';
- // COMMENT ON COLUMN "SA"."ALERTSNAP"."MODELID" IS '风机类型ID';
- [DataContract]
- [Table("ALARMSNAP")]
- public class AlertSnap : INotifyPropertyChanged
- {
- [DataMember]
- [Column("ID")]
- public long Id { get; set; }
- [DataMember]
- [Column("STATIONID")]
- public string StationId { get; set; }
- [DataMember]
- [Column("PROJECTID")]
- public string ProjectId { get; set; }
- [DataMember]
- [Column("LINEID")]
- public string LineId { get; set; }
- [DataMember]
- [Column("WINDTURBINEID")]
- public string WindturbineId { get; set; }
- [DataMember]
- [Column("ALERTVALUE")] //报警对应故障编码
- public long AlertValue { get; set; }
- [DataMember]
- [Column("RANK")] //报警级别
- public string Rank { get; set; }
- [DataMember]
- [Column("CATEGORY1")]
- public string Category1 { get; set; }
- [DataMember]
- [Column("CATEGORY2")]
- public string Category2 { get; set; }
- [DataMember]
- [Column("CATEGORY3")]
- public string Category3 { get; set; }
- [DataMember]
- [Column("ISOPENED")]
- public bool IsOpened { get; set; }
- [DataMember]
- [Column("ISCONFIRMED")]
- public bool IsConfirmed { get; set; }
- [DataMember]
- [Column("CONFIRMTIME")]
- public DateTime? ConfirmTime { get; set; }
- [DataMember]
- [Column("CONFIRMPERSON")]
- public string ConfirmPerson { get; set; }
- [DataMember]
- [Column("LASTUPDATETIME")]
- public DateTime? LastUpdateTime { get; set; }
- [DataMember]
- [Column("LASTUPDATEPERSON")]
- public string LastUpdatePerson { get; set; }
- [DataMember]
- [Column("LASTCLOSETIME")]
- public DateTime? LastCloseTime { get; set; }
- [DataMember]
- [Column("LASTCLOSEPERSON")]
- public string LastClosePerson { get; set; }
- [DataMember]
- [Column("STATIONNAME")]
- public string StationName { get; set; }
- [DataMember]
- [Column("PROJECTNAME")]
- public string ProjectName { get; set; }
- [DataMember]
- [Column("LINENAME")]
- public string LineName { get; set; }
- [DataMember]
- [Column("WINDTURBINENAME")]
- public string WindturbineName { get; set; }
- [DataMember]
- [Column("ALERTTEXT")]
- public string AlertText { get; set; }
- [DataMember]
- [Column("MODELID")]
- public string ModelId { get; set; }
- [DataMember]
- [Column("TESTINGPOINTKEY")]
- public string TestingPointKey { get; set; }
- [DataMember]
- [Column("IFIXPICTURE")]
- public string IFixPicture { get; set; }
- [DataMember]
- [Column("IFIXTAG")]
- public string IFixTag { get; set; }
- [DataMember]
- [Column("DATAINFO")]
- public string DataInfo { get; set; }
-
- /// <summary>
- /// Property changed event
- /// </summary>
- public event PropertyChangedEventHandler PropertyChanged;
- private void RaisePropertyChanged([CallerMemberName] string caller = "")
- {
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(caller));
- }
- }
- public string ObjectName
- {
- get
- {
- if (Category1 == "custom")
- {
- switch (Category2)
- {
- case "1":
- return WindturbineName;
- case "2":
- return StationName;
- case "3":
- return ProjectName;
- case "4":
- return LineName;
- case "5":
- return StationName;
- default:
- return "未知";
- }
- }
- else if (Category1 == "windturbine")
- return WindturbineName;
- else
- return StationName;
- }
- }
- public string ObjectId
- {
- get
- {
- if (Category1 == "custom")
- {
- switch (Category2)
- {
- case "1":
- return WindturbineId;
- case "2":
- return StationId;
- case "3":
- return ProjectId;
- case "4":
- return LineId;
- case "5":
- return StationId;
- default:
- return "";
- }
- }
- else if (Category1 == "windturbine")
- return WindturbineId;
- else
- return StationId;
- }
- }
- public string RankName
- {
- get
- {
- switch(Rank)
- {
- case "1":
- return "低";
- case "2":
- return "中低";
- case "3":
- return "中";
- case "4":
- return "中高";
- case "5":
- return "高";
- default:
- return "低";
- }
- }
- }
- public string CategoryName
- {
- get
- {
- switch (Category1)
- {
- case "custom":
- return "自定义";
- case "windturbine":
- return "风机";
- case "SYZ":
- return "升压站";
- case "GF":
- return "光伏";
- default:
- return "未知";
- }
- }
- }
- public string BackColor
- {
- get
- {
- if (IsOpened == true && IsConfirmed == false)
- {
- if (Rank == "4")
- return "#FFFF00";
- else if (Rank == "5")
- return "#FF0000";
- else
- return null;
- }
- else
- return null;
- }
- }
- public Color getBackGroundColor()
- {
- if (IsOpened == true && IsConfirmed == false)
- {
- if (Rank == "5")
- return Color.Red;
- else
- return Color.FromArgb(0xff7e66);
- }
- else
- return Color.FromArgb(0xff7e66);
- }
- public string ControlName {
- get
- {
- if (CategoryName == "自定义")
- return "停机";
- else if (CategoryName == "风机")
- return "复位";
- else
- return "";
- }
- }
- public string ConfirmName {
-
- get { return "确认"; }
- }
- }
- }
|