예제 #1
0
        public WarpAdbManager(DeviceManager manager)
        {
            DeviceManager = manager;

            AdbServerStatus status = AdbServer.Instance.GetStatus();

            if (!status.IsRunning)
            {
                SystemLog.E(TAG, "ADB 没有运行! 重新启动ADB...");
                AdbServer.Instance.StartServer(adbpath, true);
            }
            status = AdbServer.Instance.GetStatus();
            if (status.IsRunning)
            {
                InitAdbSocket();
                Moniter();

                //不必要要此处初始化,一直连着电脑里,也会被MOniter到.
                //try
                //{
                //    CurrentDeviceData = AdbClient.Instance.GetDevices().First();
                //    SystemLog.I(TAG, "初始获得设备连接:" + CurrentDeviceData.Name);
                //}
                //catch
                //{
                //    SystemLog.E(TAG, "初始获得设备连接错误:");
                //}
            }
            ProgLog.D(TAG, "" + status.Version + ".." + status.IsRunning);
        }
예제 #2
0
        public DataBaseManager(DeviceManager manager)
        {
            _DeviceManager = manager;

            if (File.Exists(ProgramInfo.DBFILE))
            {
                var connect = "Data Source=" + ProgramInfo.DBFILE + "; Version=3;";
                _dbConnection = new SQLiteConnection(connect);
                _dbConnection.Open();
                SystemLog.I(TAG, " database " + ProgramInfo.DBFILE + ".opened");
            }
            else
            {
                SystemLog.E(TAG, " database " + ProgramInfo.DBFILE + ".not found");
            }
            //  test();
        }
예제 #3
0
        static void Main()
        {
            if (!EnSureOnlyOneInstance())
            {
                SystemLog.E("程序", "已有程序在运行,本次启动失败");
                return;
            }

            SystemLog.I("程序", "信息准备初始化");
            DeviceManager.Instance.Init();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainWindow());
            var endpropt = "\n***************************************************\n" +
                           "***************************************************\n" +
                           "***************************************************\n";

            SystemLog.I("程序", "主程序退出");
            SystemLog.I("程序", endpropt);
        }
예제 #4
0
        private void InitDBmodul()
        {
            var sql  = "select * from " + ChipInfo.TYPE_TABLE_NAME_CHIPINFO + ";";
            var read = _DeviceManager.DataBaseManager.ExeGetReader(sql);

            if (read == null || !read.HasRows)
            {
                return;
            }
            _venderseriesDictionary.Clear();
            _allchipvendorlistDic.Clear();
            _allChipInfo.Clear();

            while (read.Read())
            {
                try
                {
                    var chipinfo           = new ChipInfo();
                    NameValueCollection nv = read.GetValues();
                    chipinfo.vendor = "" + nv.Get(ChipInfo.TYPE_COLUMN_VENDOR);
                    var series = nv.Get(ChipInfo.TYPE_COLUMN_SERIES);

                    chipinfo.series  = "" + nv.Get(ChipInfo.TYPE_COLUMN_SERIES);
                    chipinfo.name    = nv.Get(ChipInfo.TYPE_COLUMN_NAME);
                    chipinfo.type    = nv.Get(ChipInfo.TYPE_COLUMN_TYPE);
                    chipinfo.package = nv.Get(ChipInfo.TYPE_COLUMN_PACKAGE);
                    chipinfo.burner  = nv.Get(ChipInfo.TYPE_COLUMN_BURNER);
                    chipinfo.note    = nv.Get(ChipInfo.TYPE_COLUMN_NOTE);

                    _allChipInfo.Add(chipinfo);

                    ProgLog.D(TAG, chipinfo.ToString());
                }
                catch (Exception e)
                {
                    SystemLog.E(TAG, " get chipinfo error " + e.ToString());
                }
            }
            read.Close();
        }