public virtual void judgeState() { if (NowValue != null && !NowValue.Equals("")) { if (float.Parse(NowValue) > Highthreshold) { State = DeviceDataBox_Base.State.H_Alert.ToString(); } else if (float.Parse(NowValue) < Lowthreshold) { State = DeviceDataBox_Base.State.L_Alert.ToString(); } } }
public override string GenerateInsertSql(string tablename) { string[] values = NowValue.Trim().Split(','); return("INSERT INTO " + tablename + "( DD_ID, DEVID, DATATIME, VALUE1, VALUE2, UNITS,SAFESTATE)" + " VALUES(" + tablename + "_sequence" + ".nextval" + ", " + DeviceId + ", " + "'" + DateTime.Now + "'" + ", " + values[0] + ", " + values[1] + ", " + "'" + DataUnit + "'" + ", " + "'" + State + "' )"); }