示例#1
0
        public bool Execute()
        {
            try
            {
                if (RepeatData.IsRepeatData(RepeatStr()))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }


                CZW_61506_0411_195_Mod Cm = CZW_61506_0411_195_Dal.GetMod(this._content);
                Cm.基站编号 = (uint)StationId;
                Cm.平台时间 = this.PlatformTime;

                Pro_IndataBase_ZNMP_Mod info = CZW_61506_0411_195_Dal.Get_Pro_Mod(Cm);


                Pro_IndataBase_ZNMP_Bll c = new Pro_IndataBase_ZNMP_Bll(info);
                string Result             = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(NAME + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
        public bool Execute()
        {
            try
            {
                if (RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }


                Pro_IndateBase_Sec_Mod info = new Pro_IndateBase_Sec_Mod();
                info.pi_bigtype      = "4";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);
                info.pi_devicetype   = ConverUtil.ByteToStr_2(_content, 7);
                info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 9);
                info.pi_protocoltype = _content[13].ToString();
                info.pi_param1       = ConverUtil.ByteToStr_2(_content, 14); //功率过大阀值
                info.pi_stationno    = StationId.ToString();
                info.pi_servicetime  = PlatformTime;
                Other.ChuZuWu.Pro_IndateBase_Sec_Bll c = new Other.ChuZuWu.Pro_IndateBase_Sec_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
示例#3
0
    private void CollectRepeatAssets()
    {
        abAssetDict = new Dictionary <string, HashSet <Object> >();

        //获得ab依赖的所有资源
        string[] abNames = AssetDatabase.GetAllAssetBundleNames();
        foreach (string abName in abNames)
        {
            string[]      assetPaths = AssetDatabase.GetAssetPathsFromAssetBundle(abName);
            List <Object> objects    = new List <Object>();
            foreach (string assetPath in assetPaths)
            {
                objects.AddRange(AssetDatabase.LoadAllAssetsAtPath(assetPath));
            }
            HashSet <Object> abAssets = new HashSet <Object>(EditorUtility.CollectDependencies(objects.ToArray()));
            abAssetDict.Add(abName, abAssets);
        }
        //移除ab间依赖
        foreach (var pair in abAssetDict)
        {
            string[] dependAbs = AssetDatabase.GetAssetBundleDependencies(pair.Key, true);
            foreach (string depend in dependAbs)
            {
                foreach (Object obj in abAssetDict[depend])
                {
                    pair.Value.Remove(obj);
                }
            }
        }
        //统计
        repeatCount = new Dictionary <Object, List <RepeatData> >();
        foreach (var pair in abAssetDict)
        {
            foreach (Object obj in pair.Value)
            {
                if (obj is MonoScript)
                {
                    continue;
                }

                RepeatData repeatData = new RepeatData();
                repeatData.abName = pair.Key;
                if (!repeatCount.ContainsKey(obj))
                {
                    repeatCount.Add(obj, new List <RepeatData>()
                    {
                        repeatData
                    });
                }
                else
                {
                    repeatCount[obj].Add(repeatData);
                }
            }
        }
    }
示例#4
0
文件: UpdateMgr.cs 项目: hjj0416/Demo
    public int Repeat(float interval, Action cb)
    {
        handleID++;
        if (handleID == int.MaxValue)
        {
            handleID = 1;
        }
        RepeatData data = new RepeatData(handleID, interval, cb);

        repeatDic.Add(handleID, data);
        return(handleID);
    }
        public bool Execute()
        {

            try
            {

                if (RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return true;
                }


                Pro_IndateBase_ZHMJ_Mod info = new Pro_IndateBase_ZHMJ_Mod();
                info.pi_bigtype = "2";
                info.pi_devicetime = ConverUtil.Time(_content, 0);
                info.pi_devicetype = ConverUtil.ByteToStr_2(_content, 7);
                info.pi_devicecode = ConverUtil.ByteToStr_4(_content, 9);
                info.pi_protocoltype = _content[13].ToString();
                info.pi_stationno = StationId.ToString();
                info.pi_servicetime = PlatformTime;
                info.pi_param1 = _content[14].ToString();       //每天开门次数
                string[] DataArray = DoorInfo(_content[15]);   //门状态及数据标志
                info.pi_param2 = DataArray[0];                 //门状态
                info.pi_param3 = DataArray[1];                //数据标志
                info.pi_param4 = _content[16].ToString();     //开门动作时间
                info.pi_param5 = _content[17].ToString();     //开门最大角度

                byte[] Data = new byte[6];
                Array.Copy(_content, 18, Data, 0, 6);
     
                info.pi_param6 = stttt(Data);                //三个加速度。
                info.pi_param7 = _content[24].ToString();    //开盖报警等
                info.pi_version = _content[26].ToString();  //版本号

                Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll c = new Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }

            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return true;
        }
示例#6
0
    void Update()
    {
        while (releasing.Count > 0)
        {
            FluidInputSustainer releasee = releasing[0];
            releasee.Release();
            if (repeats.ContainsKey(releasee))
            {
                RepeatData repeat = repeats[releasee];
                releasee.dampening += repeat.dampening;
                if (releasee.dampening >= 1)
                {
                    repeats.Remove(releasee);
                }
                else if (repeat.waitRemaining > 0)
                {
                    repeat.waitRemaining = repeat.delay;
                    waiting.Add(releasee);
                }
            }
            releasing.RemoveAt(0);
        }

        for (int i = 0; i < decaying.Count; i++)
        {
            bool continueDecay = decaying[i].Decay();
            if (!continueDecay)
            {
                releasing.Add(decaying[i]);
                decaying.RemoveAt(i);
            }
        }

        for (int i = 0; i < sustaining.Count; i++)
        {
            bool continueSustain = sustaining[i].Sustain();
            if (!continueSustain)
            {
                decaying.Add(sustaining[i]);
                sustaining.RemoveAt(i);
            }
        }

        while (attacking.Count > 0)
        {
            attacking[0].Attack();
            attacking.RemoveAt(0);
        }
    }
示例#7
0
        public bool Execute()
        {
            try
            {
                if (RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }

                Pro_IndataBase_ZNMP_Mod info = new Pro_IndataBase_ZNMP_Mod();
                info.PI_DEVICETIME   = ConverUtil.Time(_content, 0);
                info.PI_RELAYNO      = _content[6].ToString();
                info.PI_DEVICETYPE   = ConverUtil.ByteToStr_2(_content, 7);
                info.PI_DEVID        = ConverUtil.ByteToStr_4(_content, 9);
                info.PI_PROTOCOLTYPE = _content[13].ToString();
                info.PI_STATIONNO    = StationId.ToString();
                info.PI_SERVICETIME  = PlatformTime;
                info.PI_PARAM1       = _content[14].ToString();                         //环境状态
                info.PI_PARAM2       = _content[15].ToString();                         //对人校准身高
                info.PI_PARAM3       = _content[16].ToString();                         //对地校准值
                info.PI_PARAM4       = _content[17].ToString();                         //工作状态
                info.PI_PARAM5       = ConverUtil.ZF_Value(_content[18]);               //当前环境温度
                info.PI_PARAM6       = ConverUtil.GetBin(_content[19], 1);              //防拆
                info.PI_PARAM7       = (Convert.ToInt32(_content[20]) * 20).ToString(); //电池电压
                info.PI_PARAM8       = _content[21].ToString();                         //热视电触发次数(从上次心跳到这次心跳之间)
                info.PI_PARAM9       = ConverUtil.ByteToStr_2(_content, 22);            //超声波总工作时间
                info.PI_PARAM10      = ConverUtil.ByteToStr_2(_content, 24);            //热释电总触发次数
                info.PI_PARAM11      = ConverUtil.ByteToStr_2(_content, 26);            //总震动次数
                info.PI_PARAM12      = _content[28].ToString();                         //每月按键触发次数
                info.PI_PARAM13      = ConverUtil.GetBin(_content[29], 1);              //设备状态_超声波故障
                info.PI_PARAM14      = ConverUtil.GetBin(_content[29], 2);              //设备状态_热释电故障
                info.PI_VERSION      = _content[34].ToString();                         //版本号
                Other.LvYe.Pro_IndataBase_ZNMP_Bll c = new Other.LvYe.Pro_IndataBase_ZNMP_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(NAME + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "错误:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
示例#8
0
        public bool Execute()
        {
            try
            {
                if (RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }


                Pro_IndateBase_ZHMJ_Mod info = new Pro_IndateBase_ZHMJ_Mod();
                info.pi_bigtype      = "2";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);
                info.pi_devicetype   = ConverUtil.ByteToStr_2(_content, 7);
                info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 9);
                info.pi_protocoltype = _content[13].ToString();
                info.pi_stationno    = StationId.ToString();
                info.pi_servicetime  = PlatformTime;
                info.pi_param1       = _content[14].ToString();               //变化方向
                info.pi_param2       = _content[15].ToString();               //房间内人数
                info.pi_param3       = _content[16].ToString();               //每天开门次数
                info.pi_param4       = _content[17].ToString();               //门状态
                info.pi_param5       = _content[18].ToString();               //自动撤布防。
                info.pi_param6       = _content[19].ToString();               //布防报警。
                info.pi_param7       = ((_content[20] >> 7) & 01).ToString(); //开门超过十分钟。
                info.pi_param10      = ((_content[20] >> 6) & 01).ToString(); //表示开盖报警。
                info.pi_param9       = _content[21].ToString();               //打开门的角度
                info.pi_version      = _content[26].ToString();


                Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll c = new Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return(true);
        }
示例#9
0
        public bool Execute()
        {
            try
            {
                if (RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }


                Pro_IndateBase_ZHMJ_Mod info = new Pro_IndateBase_ZHMJ_Mod();
                info.pi_bigtype      = "1";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);
                info.pi_devicetype   = ConverUtil.ByteToStr_2(_content, 7);
                info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 9);
                info.pi_protocoltype = _content[13].ToString();
                info.pi_cardtype     = _content[14].ToString(); //卡类型
                info.pi_cardid       = info.pi_cardtype == "0" ? ConverUtil.ByteToStr_Q(_content, 15, 8) : ConverUtil.ByteToStr_4(_content, 19);;
                info.pi_HEADCOUNT    = _content[23].ToString(); //房间内人数
                info.pi_OPENTIMES    = _content[24].ToString(); //每天开门次数
                info.pi_version      = _content[26].ToString();
                info.pi_stationno    = StationId.ToString();
                info.pi_servicetime  = PlatformTime;

                Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll c = new Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return(true);
        }
        public bool Execute()
        {
            try
            {
                if (RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }


                LV_61506_0419_199_Mod Cm = LV_61506_0419_199_Dal.GetMod(this._content);
                Cm.基站编号 = (uint)StationId;
                Cm.平台时间 = this.PlatformTime;

                Pro_IndataBase_ZNMP_Mod info = LV_61506_0419_199_Dal.Get_Pro_Mod(Cm);

                List <Pro_IndataBase_ZNMP_Mod> list = GetList(info);


                Pro_IndataBase_ZNMP_Bll c;
                string Result = "";
                foreach (var v in list)
                {
                    c      = new Pro_IndataBase_ZNMP_Bll(v);
                    Result = c.Exec();
                    if (Result != "0")
                    {
                        MyLibrary.Log.Debug(NAME + "出错:" + Result + " 原始代码:" + OriginalCode);
                    }
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
示例#11
0
        public bool Execute()
        {
            try
            {
                if (this.Content.Length != 189)
                {
                    MyLibrary.Log.Debug(NAME + "出错:正确长度189,目前长度" + Content.Length.ToString() + " 原始代码:" + OriginalCode);
                }


                if (RepeatData.IsRepeatData(Content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }

                CZW_2_Mod Cm = CZW_2_Dal.GetMod(this.Content);
                Cm.设备编号 = (uint)StationId;
                Tb_EIdentitycardBung_Dal dal = CZW_2_Dal.TableMod(Cm);

                bool IsOk = dal.Select_IdCard(Cm.身份证id);
                if (IsOk)
                {
                    dal.Update();
                }
                else
                {
                    dal.Insert();
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
示例#12
0
    private void CollectRepeatDependencies(RepeatData repeatData, Object target)
    {
        Dictionary <Object, Object[]> repeatDataDepends = new Dictionary <Object, Object[]>();
        HashSet <Object> result = new HashSet <Object>();

        foreach (Object obj in abAssetDict[repeatData.abName])
        {
            if (obj == target)
            {
                continue;
            }

            Object[] depends = EditorUtility.CollectDependencies(new Object[] { obj });
            if (System.Array.IndexOf <Object>(depends, target) >= 0)
            {
                result.Add(obj);
                repeatDataDepends.Add(obj, depends);
            }
        }

        foreach (var pair in repeatDataDepends)
        {
            if (result.Contains(pair.Key))
            {
                foreach (var depend in pair.Value)
                {
                    if (depend != pair.Key && result.Contains(depend))
                    {
                        result.Remove(pair.Key);
                        break;
                    }
                }
            }
        }
        repeatData.objects = new List <Object>(result);
    }
示例#13
0
        private void CollectAssets()
        {
            Dictionary <string, HashSet <Object> > abAssetDict = new Dictionary <string, HashSet <Object> >();

            //获得ab依赖的所有资源
            string[] abNames = AssetDatabase.GetAllAssetBundleNames();
            foreach (string abName in abNames)
            {
                string[]      assetPaths = AssetDatabase.GetAssetPathsFromAssetBundle(abName);
                List <Object> objects    = new List <Object>();
                foreach (string assetPath in assetPaths)
                {
                    if (assetPath.EndsWith(".unity"))
                    {
                        objects.Add(AssetDatabase.LoadMainAssetAtPath(assetPath));
                    }
                    else
                    {
                        objects.AddRange(AssetDatabase.LoadAllAssetsAtPath(assetPath));
                    }
                }
                HashSet <Object> abAssets = new HashSet <Object>(EditorUtility.CollectDependencies(objects.ToArray()).Where(x => !(x is MonoScript)));
                abAssetDict.Add(abName, abAssets);
            }
            //移除ab间依赖
            foreach (var pair in abAssetDict)
            {
                string[] dependAbs = AssetDatabase.GetAssetBundleDependencies(pair.Key, true);
                foreach (string depend in dependAbs)
                {
                    foreach (Object obj in abAssetDict[depend])
                    {
                        pair.Value.Remove(obj);
                    }
                }
            }
            //排序
            abAssets = new Dictionary <string, List <Object> >();
            foreach (var pair in abAssetDict)
            {
                List <Object> list = pair.Value
                                     .OrderBy(x => AssetDatabase.GetAssetPath(x))
                                     .ThenByDescending(x => AssetDatabase.IsMainAsset(x))
                                     .ToList();
                abAssets.Add(pair.Key, list);
            }
            //统计
            assetDenpendGroups = new Dictionary <Object, List <RepeatData> >();
            foreach (var pair in abAssetDict)
            {
                foreach (Object obj in pair.Value)
                {
                    RepeatData repeatData = new RepeatData();
                    repeatData.abName = pair.Key;
                    if (!assetDenpendGroups.ContainsKey(obj))
                    {
                        assetDenpendGroups.Add(obj, new List <RepeatData>()
                        {
                            repeatData
                        });
                    }
                    else
                    {
                        assetDenpendGroups[obj].Add(repeatData);
                    }
                }
            }
            //分类
            repeatAssets  = new Dictionary <Object, List <RepeatData> >();
            buildInAssets = new Dictionary <Object, List <RepeatData> >();
            foreach (var pair in assetDenpendGroups)
            {
                if (pair.Value.Count > 1)
                {
                    repeatAssets.Add(pair.Key, pair.Value);
                }
                if (IsBuildIn(AssetDatabase.GetAssetPath(pair.Key)))
                {
                    //foreach (var repeatData in pair.Value)
                    //{
                    //    CollectRepeatDependencies(repeatData, pair.Key);
                    //}
                    buildInAssets.Add(pair.Key, pair.Value);
                }
            }
        }