示例#1
0
        public bool LoadXml(string aXmlPath)
        {
            if (!File.Exists(aXmlPath))
            {
                MController.Status(this, "config xml not found:{0}", aXmlPath);
                return(false);
            }

            _listItems = ImageItem.Load(aXmlPath);

            if (_listItems == null)
            {
                MController.Status(this, "config xml Loading failed:{0}", aXmlPath);
                return(false);
            }

            foreach (var item in _listItems)
            {
                item.IsExist = File.Exists(Path.Combine(ImageItem.Dir, item.FileName));
                item.Erase   = item.Use;
                Log.v("Partition ID={0} Name={1}, FileName={2}, Use={3}", item.Id, item.Name,
                      item.Use ? item.FileName : "(not exist!)", item.Use);
            }

            this.ConfigPath = aXmlPath;


            return(true);
        }
示例#2
0
 private void Awake()
 {
     mController    = new MController(GetComponent <Rigidbody2D>(), true);
     floorDetection = new ColliderDetection2D(detectionPoint, radius, detectionLayer);
     enemyDetection = new ColliderDetection2D(gameObject.transform, attack.radius, attack.targetLayer);
     dashCDCounter  = new CooldownCounter(dashCoolDown, Timer.Timing.unscaledTime); // can be adjustable
     attacker       = new MeleeCircAtk(attack, gameObject);
 }
        public void EnterItem(KeyInputCode[] keyInputCodes)
        {
            MController.SetToPoint(SearchBar);
            MController.ClickLeftButton();

            foreach (KeyInputCode kIC in keyInputCodes)
            {
                KController.PressKey(kIC);
            }
        }
示例#4
0
        private void ExecuteDownload(object arg)
        {
            try
            {
                if (this.TargetItems.Count == 0)
                {
                    return;
                }

                if (!File.Exists(Helper.TempConfigFile(this)))
                {
                    Log.MsgBox("First select a valid configuration file.");
                    return;
                }
                if (this.GMSignedMulti == true && ImageItem.SelFirehose == 0)
                {
                    //Log.MsgBox("This is a GM signed image. Please check the firehose file.");
                    //return;
                }
                if (this.GMSignedMulti == false && ImageItem.SelFirehose == 1)
                {
                    //if(ImageItem.Dir.Contains("s.lge"))
                    //    Log.MsgBox("This is a lge signed image. Please check the firehose file.");
                    //else
                    //    Log.MsgBox("This is a non signed image. Please check the firehose file.");
                    //return;
                }

                FbMode = FBMode.Download;
                this.DownloadCommand.RaiseCanExecuteChanged();

                // 전체 정보 출력 및 각 아이템 실행.
                Log.i("*********************** START  Multi download ***********************");
                Log.i("------------------- Prepare : options list -------------------");
                Log.i("Total Download target count:{0}", this.TargetItems.Count);
                Log.i("[Option-1] AllErase:{0}, Reboot:{1}, LogLevel:{2}", ImageItem.AllErase, ImageItem.Reset, Log.LogLevel);
                Log.i("[Option-2] Erase except EFS & Backup:{0}, Use Micom Update:{1}", ImageItem.SkipEraseEfs, this.UseMicomUpdate);

                ImageItem.Save(Helper.TempConfigFile(this), this.Items);

                foreach (var titem in this.TargetItems)
                {
                    // 실행.
                    MController.Run(titem);
                }
            }
            catch (Exception e)
            {
                Log.e("Command (Download) invoke Error, Exception: {1}", e);
            }
        }
示例#5
0
        private void Tif_AppProgressEvent(ProgressArgs arg)
        {
            int idx = _listItems.FindIndex(x => x.Id == arg.ImageID && (int)x.Protocol == arg.ExtraInfo);

            if (idx >= 0 && arg.TotalBytes > 0) // 유효한 파일 다운로드 중..
            {
                var item     = _listItems[idx];
                int progress = (int)(arg.SentBytes * 100 / arg.TotalBytes);

                if (item.Progress == progress)
                {
                    return;
                }

                item.Progress = progress;

                int count = 0;
                int total = 0;
                foreach (var m in _listItems)
                {
                    if (m.Use)
                    {
                        total += m.Progress;
                        count++;
                    }
                }

                this.FileProgress  = progress;
                this.TotalProgress = count > 0 ? total / count : 0;
                if (_lastName != item.Name)
                {
                    _lastName = item.Name;
                    MController.Status(this, "{0}/{1}", item.Name, item.FileName);
                }
            }
            else if (arg.ExtraInfo == (int)QProtocol.All)
            {
                this.TotalProgress = 100;

                Print(LogLevels.Info, "====== Downloaded Images  ======");
                foreach (var m in _listItems)
                {
                    if (m.Use)
                    {
                        Print(LogLevels.Info, "Name:{0} File:{1}", m.Name, m.FileName);
                    }
                }
                _lastName = "";
            }
        }
示例#6
0
        public bool PrepareTargetWrapper(string aDllPath)
        {
            if (_tif != null)
            {
                _tif.Dispose();
                _tif = null;
            }

            _tif = new TargetWrapper();
            if (!_tif.Load(aDllPath))
            {
                MController.Status(this, "Load Protocol library failed :{0}", aDllPath);
                return(false);
            }

            _tif.AppLogEvent += _tif_AppLogEvent;

            return(true);
        }
 public void GoToNextPage()
 {
     MController.SetToPoint(NextPage);
     MController.ClickLeftButton();
 }
 public void SearchItem()
 {
     MController.SetToPoint(Search);
     MController.ClickLeftButton();
 }
 public void ClearItem()
 {
     MController.SetToPoint(ClearSearchBar);
     MController.ClickLeftButton();
 }
示例#10
0
        private void ExecuteDownload(object arg)
        {
            Log.i("------------------- Run Download -------------------");
            if (this.GMSignedEmer == true && ImageItem.SelFirehose == 0)
            {
                //Log.MsgBox("This is a GM signed image. Please check the firehose file.");
                //return;
            }
            if (this.GMSignedEmer == false && ImageItem.SelFirehose == 1)
            {
                //if (ImageItem.Dir.Contains("s.lge"))
                //    Log.MsgBox("This is a lge signed image. Please check the firehose file.");
                //else
                //    Log.MsgBox("This is a non signed image. Please check the firehose file.");
                //return;
            }
            try
            {
                this.TotalProgress = 0;
                this.FileProgress  = 0;
                this.TotalStatus   = "";

                string BaudrateInfo    = "\nEmergency Download나 Image Dump를 수행할 때에는\n다음과 같이 Baudrate을 설정해야 합니다.\n1. Gen11 TCP19 GA Release Version : 115,200 bps\n2. Others : 921,600 bps\n\nYou must set the baudrate as following\nif you are going to do \"Emergency Download\" or \"Image Dump\"\n1. Gen11 TCP19 GA Release Version : 115,200 bps\n2. Others : 921,600 bps\n";
                string BaudrateCaption = "Baudrate Info";
                MController.InfoPopup(BaudrateInfo, BaudrateCaption); // jwoh Baudrate Info popup

                // dispse target wrapper
                if (_targetIf != null)
                {
                    _targetIf.Dispose();
                    _targetIf = null;
                }

                // reset progress value
                int useCount = 0;
                _listItems.ForEach(x => {
                    x.Progress = 0;    if (x.Use)
                    {
                        useCount++;
                    }
                });

                if (useCount == 0)
                {
                    Log.MsgBox("No images will be downloading.");
                    return;
                }
                // save configuration xml for library
                // set fota erase option
                var fxitem = _listItems.SingleOrDefault(fx => fx.Name == "FOTA_SELFTEST");
                if (fxitem != null)
                {
                    fxitem.Erase = this.FotaErase;
                }
                if (!ImageItem.Save(Helper.TempConfigFile(this), _listItems))
                {
                    Log.MsgBox("Error: saving configuration.xml");
                    return;
                }
                // initialize target wrapper
                _targetIf              = new TargetWrapper();
                _targetIf.AppLogEvent += _targetIf_AppLogEvent;
                if (!_targetIf.Load(Helper.ProtocolDllPath))
                {
                    Log.MsgBox("Error: loading protocol library");
                    return;
                }
                _targetIf.AppProgressEvent += TargetIf_AppProgressEvent;
                // wait qdloader mode
                if (Pages.WaitPortBox.Wait(Models.TabType.Emergency, this) == false)
                {
                    return;
                }
                // start download
                FbMode = FBMode.Download;
                this.DownloadCommand.RaiseCanExecuteChanged();

                // Print Download option to log
                Log.i("------------------- Prepare : options list -------------------");
                Log.i("[Option-1] All Erase:{0}, Reboot:{1}, LogLevel:{2}", ImageItem.AllErase, ImageItem.Reset, Log.LogLevel);
                Log.i("[Option-2] Erase except EFS:{0}", ImageItem.SkipEraseEfs);

                System.Threading.Thread.Sleep(3 * 1000); // for micom usb stable control.
                _targetIf.RundDownload(this.CurrentPort.Name, Helper.TempConfigFile(this));
            }
            catch (Exception e)
            {
                Log.e("Command (Download) invoke Error, Exception: {1}", e);
            }
        }
示例#11
0
        private void ExecuteDump(object arg)
        {
            Log.i("------------------- Run Dump -------------------");
            string downDir = ImageItem.Dir;

            try
            {
                this.TotalProgress = 0;
                this.FileProgress  = 0;
                this.TotalStatus   = "";

                string BaudrateInfo    = "\nEmergency Download나 Image Dump를 수행할 때에는\n다음과 같이 Baudrate을 설정해야 합니다.\n1. Gen11 TCP19 GA Release Version : 115,200 bps\n2. Others : 921,600 bps\n\nYou must set the baudrate as following\nif you are going to do \"Emergency Download\" or \"Image Dump\"\n1. Gen11 TCP19 GA Release Version : 115,200 bps\n2. Others : 921,600 bps\n";
                string BaudrateCaption = "Baudrate Info";
                MController.InfoPopup(BaudrateInfo, BaudrateCaption); // jwoh Baudrate Info popup

                // dispse target wrapper
                if (_targetIf != null)
                {
                    _targetIf.Dispose();
                    _targetIf = null;
                }

                // reset progress value
                _listItems.ForEach(x => {
                    x.Progress = 0;
                    x.Dump     = true;
                });

                // input save dir
                var fdlg = new System.Windows.Forms.FolderBrowserDialog()
                {
                    SelectedPath        = Properties.Settings.Default.saveDir,
                    ShowNewFolderButton = true,
                };
                if (fdlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
                {
                    return;
                }


                Properties.Settings.Default.saveDir = fdlg.SelectedPath;
                ImageItem.Dir = fdlg.SelectedPath;

                // save configuration xml for library
                if (!ImageItem.Save(Helper.TempConfigFile(this), _listItems))
                {
                    Log.MsgBox("Error: saving configuration.xml");
                    return;
                }

                // initialize target wrapper
                _targetIf              = new TargetWrapper();
                _targetIf.AppLogEvent += _targetIf_AppLogEvent;
                if (!_targetIf.Load(Helper.ProtocolDllPath))
                {
                    Log.MsgBox("Error: loading protocol library");
                    return;
                }
                _targetIf.AppProgressEvent += TargetIf_AppProgressEvent;
                // wait qdloader mode
                if (Pages.WaitPortBox.Wait(Models.TabType.Dump, this) == false)
                {
                    return;
                }
                // start download
                FbMode = FBMode.Dump;
                this.DumpCommand.RaiseCanExecuteChanged();

                _targetIf.RundReadback(this.CurrentPort.Name, Helper.TempConfigFile(this));
            }
            catch (Exception e)
            {
                Log.e("Command (Dump) invoke Error, Exception: {1}", e);
            }
            finally
            {
                ImageItem.Dir = downDir;
            }
        }
 private void Start()
 {
     //has to be in Start, not Awake
     if (_controller == null) _controller = transform.GetComponentInParentRecursively<MController>();
 }