Ejemplo n.º 1
0
        public override void execute(Tag tag, String devCode, CellTag cellTag,
                                     SystemDateTag systemDateTag, CasicSession session)
        {
            WakeUpTag wakeUpTag = tag as WakeUpTag;

            if (session.devMaps.ContainsKey(devCode))
            {
                CasicSession.DeviceDTO dev = session.devMaps[devCode];

                byte flag = byte.Parse(wakeUpTag.DataValue, System.Globalization.NumberStyles.HexNumber);

                dev.IsWakeUp             = flag == 0?true:false; //上传0代表已经唤醒
                session.devMaps[devCode] = dev;
                session.Logger.Info("设备唤醒" + devCode);

                session.Logger.Info("唤醒TAG:oid:" + wakeUpTag.Oid +
                                    "唤醒状态:" + wakeUpTag.IsWAkeUp);
            }
        }
Ejemplo n.º 2
0
        public static Tag create(String oid, int len, String value)
        {
            Tag tag;

            if (UploadTag.isUploadTag(oid))
            {
                tag = new UploadTag(oid, len, value);
            }
            else if (oid == SystemDateTag.SYSTEM_DATE_OID)
            {
                tag = new SystemDateTag(oid, len, value);
            }
            else if (oid == SystemTimeTag.SYSTEM_TIME_OID)
            {
                tag = new SystemTimeTag(oid, len, value);
            }
            else if (oid == WakeUpTag.WAKEUP_TAG_OID)
            {
                tag = new WakeUpTag(oid, len, value);
            }
            else if (oid == CellTag.CELL_TAG_OID)
            {
                tag = new CellTag(oid, len, value);
            }
            else if (oid == SensorException0Tag.SENSOR_EXCEP0_TAG_OID)
            {
                tag = new SensorException0Tag(oid, len, value);
            }
            else if (oid == SensorException1Tag.SENSOR_EXCEP1_TAG_OID)
            {
                tag = new SensorException1Tag(oid, len, value);
            }
            else
            {
                tag = new NormalTag(oid, len, value);
            }
            return(tag);
        }