Beispiel #1
0
        public AndroidDevice(string filePath)
        {
            InifileUtils ini = new InifileUtils(filePath);

            // Area
            // Check In button area
            CheckInAreaXStart = ini.getValueInt("Area", "CheckInAreaXStart");
            CheckInAreaYStart = ini.getValueInt("Area", "CheckInAreaYStart");
            CheckInAreaXEnd   = ini.getValueInt("Area", "CheckInAreaXEnd");
            CheckInAreaYEnd   = ini.getValueInt("Area", "CheckInAreaYEnd");

            // Link button area
            LinkAreaXStart = ini.getValueInt("Area", "LinkAreaXStart");
            LinkAreaYStart = ini.getValueInt("Area", "LinkAreaYStart");
            LinkAreaXEnd   = ini.getValueInt("Area", "LinkAreaXEnd");
            LinkAreaYEnd   = ini.getValueInt("Area", "LinkAreaYEnd");

            // Window Close area
            WindowCloseAreaXStart = ini.getValueInt("Area", "WindowCloseAreaXStart");
            WindowCloseAreaYStart = ini.getValueInt("Area", "WindowCloseAreaYStart");
            WindowCloseAreaXEnd   = ini.getValueInt("Area", "WindowCloseAreaXEnd");
            WindowCloseAreaYEnd   = ini.getValueInt("Area", "WindowCloseAreaYEnd");

            // Bag Button area
            BagButtonAreaXStart = ini.getValueInt("Area", "BagButtonAreaXStart");
            BagButtonAreaYStart = ini.getValueInt("Area", "BagButtonAreaYStart");
            BagButtonAreaXEnd   = ini.getValueInt("Area", "BagButtonAreaXEnd");
            BagButtonAreaYEnd   = ini.getValueInt("Area", "BagButtonAreaYEnd");

            // Battery Button area
            BatteryButtonAreaXStart = ini.getValueInt("Area", "BatteryButtonAreaXStart");
            BatteryButtonAreaYStart = ini.getValueInt("Area", "BatteryButtonAreaYStart");
            BatteryButtonAreaXEnd   = ini.getValueInt("Area", "BatteryButtonAreaXEnd");
            BatteryButtonAreaYEnd   = ini.getValueInt("Area", "BatteryButtonAreaYEnd");

            // Charge 50 Button area
            Charge50ButtonAreaXStart = ini.getValueInt("Area", "Charge50ButtonAreaXStart");
            Charge50ButtonAreaYStart = ini.getValueInt("Area", "Charge50ButtonAreaYStart");
            Charge50ButtonAreaXEnd   = ini.getValueInt("Area", "Charge50ButtonAreaXEnd");
            Charge50ButtonAreaYEnd   = ini.getValueInt("Area", "Charge50ButtonAreaYEnd");

            // Charge 150 Button area
            Charge150ButtonAreaXStart = ini.getValueInt("Area", "Charge150ButtonAreaXStart");
            Charge150ButtonAreaYStart = ini.getValueInt("Area", "Charge150ButtonAreaYStart");
            Charge150ButtonAreaXEnd   = ini.getValueInt("Area", "Charge150ButtonAreaXEnd");
            Charge150ButtonAreaYEnd   = ini.getValueInt("Area", "Charge150ButtonAreaYEnd");

            // Charge 300 Button area
            Charge300ButtonAreaXStart = ini.getValueInt("Area", "Charge300ButtonAreaXStart");
            Charge300ButtonAreaYStart = ini.getValueInt("Area", "Charge300ButtonAreaYStart");
            Charge300ButtonAreaXEnd   = ini.getValueInt("Area", "Charge300ButtonAreaXEnd");
            Charge300ButtonAreaYEnd   = ini.getValueInt("Area", "Charge300ButtonAreaYEnd");

            // Close Button area
            CloseButtonAreaXStart = ini.getValueInt("Area", "CloseButtonAreaXStart");
            CloseButtonAreaYStart = ini.getValueInt("Area", "CloseButtonAreaYStart");
            CloseButtonAreaXEnd   = ini.getValueInt("Area", "CloseButtonAreaXEnd");
            CloseButtonAreaYEnd   = ini.getValueInt("Area", "CloseButtonAreaYEnd");

            // Error Button area
            ErrorButtonAreaXStart = ini.getValueInt("Area", "ErrorButtonAreaXStart");
            ErrorButtonAreaYStart = ini.getValueInt("Area", "ErrorButtonAreaYStart");
            ErrorButtonAreaXEnd   = ini.getValueInt("Area", "ErrorButtonAreaXEnd");
            ErrorButtonAreaYEnd   = ini.getValueInt("Area", "ErrorButtonAreaYEnd");

            // Radar Button area
            RadarButtonAreaXStart = ini.getValueInt("Area", "RadarButtonAreaXStart");
            RadarButtonAreaYStart = ini.getValueInt("Area", "RadarButtonAreaYStart");
            RadarButtonAreaXEnd   = ini.getValueInt("Area", "RadarButtonAreaXEnd");
            RadarButtonAreaYEnd   = ini.getValueInt("Area", "RadarButtonAreaYEnd");

            // Radar 1 Button area
            Radar1ButtonAreaXStart = ini.getValueInt("Area", "Radar1ButtonAreaXStart");
            Radar1ButtonAreaYStart = ini.getValueInt("Area", "Radar1ButtonAreaYStart");
            Radar1ButtonAreaXEnd   = ini.getValueInt("Area", "Radar1ButtonAreaXEnd");
            Radar1ButtonAreaYEnd   = ini.getValueInt("Area", "Radar1ButtonAreaYEnd");
            RadarButtonsOffsetY    = ini.getValueInt("Area", "RadarButtonsOffsetY");

            // Radar Close Button area
            RadarCloseButtonAreaXStart = ini.getValueInt("Area", "RadarCloseButtonAreaXStart");
            RadarCloseButtonAreaYStart = ini.getValueInt("Area", "RadarCloseButtonAreaYStart");
            RadarCloseButtonAreaXEnd   = ini.getValueInt("Area", "RadarCloseButtonAreaXEnd");
            RadarCloseButtonAreaYEnd   = ini.getValueInt("Area", "RadarCloseButtonAreaYEnd");

            // Radar Close Button area
            ReturnMaintenanceButtonAreaXStart = ini.getValueInt("Area", "ReturnMaintenanceButtonAreaXStart");
            ReturnMaintenanceButtonAreaYStart = ini.getValueInt("Area", "ReturnMaintenanceButtonAreaYStart");
            ReturnMaintenanceButtonAreaXEnd   = ini.getValueInt("Area", "ReturnMaintenanceButtonAreaXEnd");
            ReturnMaintenanceButtonAreaYEnd   = ini.getValueInt("Area", "ReturnMaintenanceButtonAreaYEnd");

            // Interval
            // Window Close interval
            WindowOpenInterval         = ini.getValueInt("Interval", "WindowOpenInterval");
            WindowCloseInterval        = ini.getValueInt("Interval", "WindowCloseInterval");
            WindowCloseAnotherInterval = ini.getValueInt("Interval", "WindowCloseAnotherInterval");

            // Next Check In interval
            CheckInIntervalMin = ini.getValueInt("Interval", "CheckInIntervalMin");
            CheckInIntervalMax = ini.getValueInt("Interval", "CheckInIntervalMax");

            // Maintain Link interval
            MaintainLinkIntervalMin = ini.getValueInt("Interval", "MaintainLinkIntervalMin");
            MaintainLinkIntervalMax = ini.getValueInt("Interval", "MaintainLinkIntervalMax");

            // Charge Battely interval
            ChargeBattelyInterval = ini.getValueInt("Interval", "ChargeBattelyInterval");

            // Unlock Interval
            UnlockPowerInterval = ini.getValueInt("Interval", "UnlockPowerInterval");
            UnlockSwipeInterval = ini.getValueInt("Interval", "UnlockSwipeInterval");
            UnlockInputInterval = ini.getValueInt("Interval", "UnlockInputInterval");

            // Wakeup Interval
            WakeupInterval = ini.getValueInt("Interval", "WakeupInterval");

            // Close Button Interval
            CloseButtonInterval = ini.getValueInt("Interval", "CloseButtonInterval");

            // Error Button Interval
            ErrorButtonInterval = ini.getValueInt("Interval", "ErrorButtonInterval");

            // Charge Button Interval
            ChargeButtonInterval = ini.getValueInt("Interval", "ChargeButtonInterval");

            // Battry Button Interval
            BattryButtonInterval = ini.getValueInt("Interval", "BattryButtonInterval");

            // Bag Button Interval
            BagButtonInterval = ini.getValueInt("Interval", "BagButtonInterval");

            // CheckIn flow Interval
            DoCheckInInterval    = ini.getValueInt("Interval", "DoCheckInInterval");
            CloseCheckInInterval = ini.getValueInt("Interval", "CloseCheckInInterval");

            // ScreenShot Interval
            TakeScreenShotInterval = ini.getValueInt("Interval", "TakeScreenShotInterval");
            PullFileInterval       = ini.getValueInt("Interval", "PullFileInterval");
            RemoveFileInterval     = ini.getValueInt("Interval", "RemoveFileInterval");

            // Radar Button Interval
            RadarButtonInterval = ini.getValueInt("Interval", "RadarButtonInterval");

            // Radar Check in Interval
            RadarCheckInInterval = ini.getValueInt("Interval", "RadarCheckInInterval");

            // Radar Close Button Interval
            RadarCloseButtonInterval = ini.getValueInt("Interval", "RadarCloseButtonInterval");

            // Radar Check in try
            RadarCheckInTryNum         = ini.getValueInt("Interval", "RadarCheckInTryNum");
            RadarCheckInTryTime        = ini.getValueInt("Interval", "RadarCheckInTryTime");
            RadarCheckInTryIntervalMin = ini.getValueInt("Interval", "RadarCheckInTryIntervalMin");
            RadarCheckInTryIntervalMax = ini.getValueInt("Interval", "RadarCheckInTryIntervalMax");

            // Radar Useable num
            RadarUseableNum = ini.getValueInt("Interval", "RadarUseableNum");

            // Tough Recovery Time
            ToughRecoveryTimeMin = ini.getValueInt("Interval", "ToughRecoveryTimeMin");
            ToughRecoveryTimeMax = ini.getValueInt("Interval", "ToughRecoveryTimeMax");

            // Smart Check Alive Interval
            ToughCheckAliveIntervalMin = ini.getValueInt("Interval", "ToughCheckAliveIntervalMin");
            ToughCheckAliveIntervalMax = ini.getValueInt("Interval", "ToughCheckAliveIntervalMax");

            // Image
            // ScreenShot Info
            ScreenShotTrimX      = ini.getValueInt("Image", "ScreenShotTrimX");
            ScreenShotTrimY      = ini.getValueInt("Image", "ScreenShotTrimY");
            ScreenShotTrimWidth  = ini.getValueInt("Image", "ScreenShotTrimWidth");
            ScreenShotTrimHeight = ini.getValueInt("Image", "ScreenShotTrimHeight");

            // ScreenShot Path
            ScreenShotRemotePath = ini.getValueString("Image", "ScreenShotRemotePath");
            ScreenShotLocalPath  = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\LWR\AutoTap\" + ini.getValueString("Image", "ScreenShotLocalPath");

            // OCR Info
            TrimImageLocalPath = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\LWR\AutoTap\" + ini.getValueString("Image", "TrimImageLocalPath");
            OcrTextLocalPath   = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\LWR\AutoTap\" + ini.getValueString("Image", "OcrTextLocalPath");

            // Compared Image Path
            ComparedLinkImagePath        = ini.getValueString("Image", "ComparedLinkImagePath");
            ComparedErrorImagePath       = ini.getValueString("Image", "ComparedErrorImagePath");
            ComparedGreetingImagePath    = ini.getValueString("Image", "ComparedGreetingImagePath");
            ComparedLoadingImagePathA    = ini.getValueString("Image", "ComparedLoadingImagePathA");
            ComparedLoadingImagePathB    = ini.getValueString("Image", "ComparedLoadingImagePathB");
            ComparedMaintenanceImagePath = ini.getValueString("Image", "ComparedMaintenanceImagePath");
            ComparedOpeningImagePath     = ini.getValueString("Image", "ComparedOpeningImagePath");
            ComparedTitleImagePath       = ini.getValueString("Image", "ComparedTitleImagePath");
            ComparedTimelineImagePath    = ini.getValueString("Image", "ComparedTimelineImagePath");

            // Threshold
            // Pattern matching threshold
            PatternMatchingThreshold = double.Parse(ini.getValueString("Threshold", "PatternMatchingThreshold"));

            // Battely threshold
            BatteryEnoughThreshold = ini.getValueInt("Threshold", "BatteryEnoughThreshold");
            BatteryMaxThreshold    = ini.getValueInt("Threshold", "BatteryMaxThreshold");

            // No Recover threshold
            NoRecoverThreshold = ini.getValueInt("Threshold", "NoRecoverThreshold");

            // Unlock
            // Unlock
            switch (ini.getValueString("Unlock", "UnlockType").ToUpper())
            {
            case "PIN":
                UnlockType = UnlockTypeEnum.Pin;
                break;

            case "PASSWORD":
                UnlockType = UnlockTypeEnum.Passowrd;
                break;

            case "NONE":
                UnlockType = UnlockTypeEnum.None;
                break;

            case "PINWITHOUTENTER":
                UnlockType = UnlockTypeEnum.PinWithoutEnter;
                break;

            default:
                UnlockType = UnlockTypeEnum.None;
                break;
            }

            UnlockPassword = ini.getValueString("Unlock", "UnlockPassword");
            UnlockXStart   = ini.getValueInt("Unlock", "UnlockXStart");
            UnlockYStart   = ini.getValueInt("Unlock", "UnlockYStart");
            UnlockXEnd     = ini.getValueInt("Unlock", "UnlockXEnd");
            UnlockYEnd     = ini.getValueInt("Unlock", "UnlockYEnd");
            UnlockDuration = ini.getValueInt("Unlock", "UnlockDuration");
        }
Beispiel #2
0
        /// <summary>
        /// プリセット一覧をConfig画面に展開する
        /// </summary>
        /// <param name="presetFileName"></param>
        private void ExtractPreset(string presetFileName)
        {
            InifileUtils ini = new InifileUtils(presetPath + presetFileName);

            // Area
            // Check In button area
            CheckInAreaXStart.Text = ini.getValueString("Area", "CheckInAreaXStart");
            CheckInAreaYStart.Text = ini.getValueString("Area", "CheckInAreaYStart");
            CheckInAreaXEnd.Text   = ini.getValueString("Area", "CheckInAreaXEnd");
            CheckInAreaYEnd.Text   = ini.getValueString("Area", "CheckInAreaYEnd");

            // Link button area
            LinkAreaXStart.Text = ini.getValueString("Area", "LinkAreaXStart");
            LinkAreaYStart.Text = ini.getValueString("Area", "LinkAreaYStart");
            LinkAreaXEnd.Text   = ini.getValueString("Area", "LinkAreaXEnd");
            LinkAreaYEnd.Text   = ini.getValueString("Area", "LinkAreaYEnd");

            // Window Close area
            WindowCloseAreaXStart.Text = ini.getValueString("Area", "WindowCloseAreaXStart");
            WindowCloseAreaYStart.Text = ini.getValueString("Area", "WindowCloseAreaYStart");
            WindowCloseAreaXEnd.Text   = ini.getValueString("Area", "WindowCloseAreaXEnd");
            WindowCloseAreaYEnd.Text   = ini.getValueString("Area", "WindowCloseAreaYEnd");

            // Bag Button area
            BagButtonAreaXStart.Text = ini.getValueString("Area", "BagButtonAreaXStart");
            BagButtonAreaYStart.Text = ini.getValueString("Area", "BagButtonAreaYStart");
            BagButtonAreaXEnd.Text   = ini.getValueString("Area", "BagButtonAreaXEnd");
            BagButtonAreaYEnd.Text   = ini.getValueString("Area", "BagButtonAreaYEnd");

            // Battery Button area
            BatteryButtonAreaXStart.Text = ini.getValueString("Area", "BatteryButtonAreaXStart");
            BatteryButtonAreaYStart.Text = ini.getValueString("Area", "BatteryButtonAreaYStart");
            BatteryButtonAreaXEnd.Text   = ini.getValueString("Area", "BatteryButtonAreaXEnd");
            BatteryButtonAreaYEnd.Text   = ini.getValueString("Area", "BatteryButtonAreaYEnd");

            // Charge Button area
            Charge50ButtonAreaXStart.Text = ini.getValueString("Area", "Charge50ButtonAreaXStart");
            Charge50ButtonAreaYStart.Text = ini.getValueString("Area", "Charge50ButtonAreaYStart");
            Charge50ButtonAreaXEnd.Text   = ini.getValueString("Area", "Charge50ButtonAreaXEnd");
            Charge50ButtonAreaYEnd.Text   = ini.getValueString("Area", "Charge50ButtonAreaYEnd");

            // Charge Button area
            Charge150ButtonAreaXStart.Text = ini.getValueString("Area", "Charge150ButtonAreaXStart");
            Charge150ButtonAreaYStart.Text = ini.getValueString("Area", "Charge150ButtonAreaYStart");
            Charge150ButtonAreaXEnd.Text   = ini.getValueString("Area", "Charge150ButtonAreaXEnd");
            Charge150ButtonAreaYEnd.Text   = ini.getValueString("Area", "Charge150ButtonAreaYEnd");

            // Charge Button area
            Charge300ButtonAreaXStart.Text = ini.getValueString("Area", "Charge300ButtonAreaXStart");
            Charge300ButtonAreaYStart.Text = ini.getValueString("Area", "Charge300ButtonAreaYStart");
            Charge300ButtonAreaXEnd.Text   = ini.getValueString("Area", "Charge300ButtonAreaXEnd");
            Charge300ButtonAreaYEnd.Text   = ini.getValueString("Area", "Charge300ButtonAreaYEnd");

            // Close Button area
            CloseButtonAreaXStart.Text = ini.getValueString("Area", "CloseButtonAreaXStart");
            CloseButtonAreaYStart.Text = ini.getValueString("Area", "CloseButtonAreaYStart");
            CloseButtonAreaXEnd.Text   = ini.getValueString("Area", "CloseButtonAreaXEnd");
            CloseButtonAreaYEnd.Text   = ini.getValueString("Area", "CloseButtonAreaYEnd");

            // Error Button area
            ErrorButtonAreaXStart.Text = ini.getValueString("Area", "ErrorButtonAreaXStart");
            ErrorButtonAreaYStart.Text = ini.getValueString("Area", "ErrorButtonAreaYStart");
            ErrorButtonAreaXEnd.Text   = ini.getValueString("Area", "ErrorButtonAreaXEnd");
            ErrorButtonAreaYEnd.Text   = ini.getValueString("Area", "ErrorButtonAreaYEnd");

            // Radar Button area
            RadarButtonAreaXStart.Text = ini.getValueString("Area", "RadarButtonAreaXStart");
            RadarButtonAreaYStart.Text = ini.getValueString("Area", "RadarButtonAreaYStart");
            RadarButtonAreaXEnd.Text   = ini.getValueString("Area", "RadarButtonAreaXEnd");
            RadarButtonAreaYEnd.Text   = ini.getValueString("Area", "RadarButtonAreaYEnd");

            // Radar Button area
            Radar1ButtonAreaXStart.Text = ini.getValueString("Area", "Radar1ButtonAreaXStart");
            Radar1ButtonAreaYStart.Text = ini.getValueString("Area", "Radar1ButtonAreaYStart");
            Radar1ButtonAreaXEnd.Text   = ini.getValueString("Area", "Radar1ButtonAreaXEnd");
            Radar1ButtonAreaYEnd.Text   = ini.getValueString("Area", "Radar1ButtonAreaYEnd");
            RadarButtonsOffsetY.Text    = ini.getValueString("Area", "RadarButtonsOffsetY");

            // Radar Close Button area
            RadarCloseButtonAreaXStart.Text = ini.getValueString("Area", "RadarCloseButtonAreaXStart");
            RadarCloseButtonAreaYStart.Text = ini.getValueString("Area", "RadarCloseButtonAreaYStart");
            RadarCloseButtonAreaXEnd.Text   = ini.getValueString("Area", "RadarCloseButtonAreaXEnd");
            RadarCloseButtonAreaYEnd.Text   = ini.getValueString("Area", "RadarCloseButtonAreaYEnd");

            //;Return Maintenance Button area
            ReturnMaintenanceButtonAreaXStart.Text = ini.getValueString("Area", "ReturnMaintenanceButtonAreaXStart");
            ReturnMaintenanceButtonAreaYStart.Text = ini.getValueString("Area", "ReturnMaintenanceButtonAreaYStart");
            ReturnMaintenanceButtonAreaXEnd.Text   = ini.getValueString("Area", "ReturnMaintenanceButtonAreaXEnd");
            ReturnMaintenanceButtonAreaYEnd.Text   = ini.getValueString("Area", "ReturnMaintenanceButtonAreaYEnd");

            // Interval
            // Window Close interval
            WindowOpenInterval.Text         = ini.getValueString("Interval", "WindowOpenInterval");
            WindowCloseInterval.Text        = ini.getValueString("Interval", "WindowCloseInterval");
            WindowCloseAnotherInterval.Text = ini.getValueString("Interval", "WindowCloseAnotherInterval");

            // Next Check In interval
            CheckInIntervalMin.Text = ini.getValueString("Interval", "CheckInIntervalMin");
            CheckInIntervalMax.Text = ini.getValueString("Interval", "CheckInIntervalMax");

            // Maintain Link interval
            MaintainLinkIntervalMin.Text = ini.getValueString("Interval", "MaintainLinkIntervalMin");
            MaintainLinkIntervalMax.Text = ini.getValueString("Interval", "MaintainLinkIntervalMax");

            // Charge Battely interval
            ChargeBattelyInterval.Text = ini.getValueString("Interval", "ChargeBattelyInterval");

            // Unlock Interval
            UnlockPowerInterval.Text = ini.getValueString("Interval", "UnlockPowerInterval");
            UnlockSwipeInterval.Text = ini.getValueString("Interval", "UnlockSwipeInterval");
            UnlockInputInterval.Text = ini.getValueString("Interval", "UnlockInputInterval");

            // Wakeup Interval
            WakeupInterval.Text = ini.getValueString("Interval", "WakeupInterval");

            // Close Button Interval
            CloseButtonInterval.Text = ini.getValueString("Interval", "CloseButtonInterval");

            // Error Button Interval
            ErrorButtonInterval.Text = ini.getValueString("Interval", "ErrorButtonInterval");

            // Charge Button Interval
            ChargeButtonInterval.Text = ini.getValueString("Interval", "ChargeButtonInterval");

            // Battry Button Interval
            BattryButtonInterval.Text = ini.getValueString("Interval", "BattryButtonInterval");

            // Bag Button Interval
            BagButtonInterval.Text = ini.getValueString("Interval", "BagButtonInterval");

            // CheckIn flow Interval
            DoCheckInInterval.Text    = ini.getValueString("Interval", "DoCheckInInterval");
            CloseCheckInInterval.Text = ini.getValueString("Interval", "CloseCheckInInterval");

            // ScreenShot Interval
            TakeScreenShotInterval.Text = ini.getValueString("Interval", "TakeScreenShotInterval");
            PullFileInterval.Text       = ini.getValueString("Interval", "PullFileInterval");
            RemoveFileInterval.Text     = ini.getValueString("Interval", "RemoveFileInterval");

            // Radar Button Interval
            RadarButtonInterval.Text = ini.getValueString("Interval", "RadarButtonInterval");

            // Radar Check in Interval
            RadarCheckInInterval.Text = ini.getValueString("Interval", "RadarCheckInInterval");

            // Radar Close Button Interval
            RadarCloseButtonInterval.Text = ini.getValueString("Interval", "RadarCloseButtonInterval");

            // Radar Check in try
            RadarCheckInTryNum.Text         = ini.getValueString("Interval", "RadarCheckInTryNum");
            RadarCheckInTryTime.Text        = ini.getValueString("Interval", "RadarCheckInTryTime");
            RadarCheckInTryIntervalMin.Text = ini.getValueString("Interval", "RadarCheckInTryIntervalMin");
            RadarCheckInTryIntervalMax.Text = ini.getValueString("Interval", "RadarCheckInTryIntervalMax");

            // Radar Useable num
            RadarUseableNum.Text = ini.getValueString("Interval", "RadarUseableNum");

            // Tough Recovery Time
            ToughRecoveryTimeMin.Text = ini.getValueString("Interval", "ToughRecoveryTimeMin");
            ToughRecoveryTimeMax.Text = ini.getValueString("Interval", "ToughRecoveryTimeMax");

            // Tough Check Alive Interval
            ToughCheckAliveIntervalMin.Text = ini.getValueString("Interval", "ToughCheckAliveIntervalMin");
            ToughCheckAliveIntervalMax.Text = ini.getValueString("Interval", "ToughCheckAliveIntervalMax");

            // Image
            // ScreenShot Info
            ScreenShotTrimX.Text      = ini.getValueString("Image", "ScreenShotTrimX");
            ScreenShotTrimY.Text      = ini.getValueString("Image", "ScreenShotTrimY");
            ScreenShotTrimWidth.Text  = ini.getValueString("Image", "ScreenShotTrimWidth");
            ScreenShotTrimHeight.Text = ini.getValueString("Image", "ScreenShotTrimHeight");

            // ScreenShot Path
            ScreenShotRemotePath.Text = ini.getValueString("Image", "ScreenShotRemotePath");
            ScreenShotLocalPath.Text  = ini.getValueString("Image", "ScreenShotLocalPath");

            // OCR Info
            TrimImageLocalPath.Text = ini.getValueString("Image", "TrimImageLocalPath");
            OcrTextLocalPath.Text   = ini.getValueString("Image", "OcrTextLocalPath");

            // Compared Image Path
            ComparedLinkImagePath.Text        = ini.getValueString("Image", "ComparedLinkImagePath");
            ComparedErrorImagePath.Text       = ini.getValueString("Image", "ComparedErrorImagePath");
            ComparedGreetingImagePath.Text    = ini.getValueString("Image", "ComparedGreetingImagePath");
            ComparedLoadingImagePathA.Text    = ini.getValueString("Image", "ComparedLoadingImagePathA");
            ComparedLoadingImagePathB.Text    = ini.getValueString("Image", "ComparedLoadingImagePathB");
            ComparedMaintenanceImagePath.Text = ini.getValueString("Image", "ComparedMaintenanceImagePath");
            ComparedOpeningImagePath.Text     = ini.getValueString("Image", "ComparedOpeningImagePath");
            ComparedTitleImagePath.Text       = ini.getValueString("Image", "ComparedTitleImagePath");
            ComparedTimelineImagePath.Text    = ini.getValueString("Image", "ComparedTimelineImagePath");

            // Threshold
            // Pattern matching threshold
            PatternMatchingThreshold.Text = ini.getValueString("Threshold", "PatternMatchingThreshold");

            // Battely threshold
            BatteryEnoughThreshold.Text = ini.getValueString("Threshold", "BatteryEnoughThreshold");
            BatteryMaxThreshold.Text    = ini.getValueString("Threshold", "BatteryMaxThreshold");

            // No Recover threshold
            NoRecoverThreshold.Text = ini.getValueString("Threshold", "NoRecoverThreshold");

            // Unlock
            // Unlock
            UnlockType.Text = ini.getValueString("Unlock", "UnlockType");

            UnlockPassword.Password = ini.getValueString("Unlock", "UnlockPassword");
            UnlockXStart.Text       = ini.getValueString("Unlock", "UnlockXStart");
            UnlockYStart.Text       = ini.getValueString("Unlock", "UnlockYStart");
            UnlockXEnd.Text         = ini.getValueString("Unlock", "UnlockXEnd");
            UnlockYEnd.Text         = ini.getValueString("Unlock", "UnlockYEnd");
            UnlockDuration.Text     = ini.getValueString("Unlock", "UnlockDuration");
        }
Beispiel #3
0
        /// <summary>
        /// Preset一覧をファイルに保存する
        /// </summary>
        /// <param name="presetFileName"></param>
        private void SavePreset(string presetFileName)
        {
            InifileUtils ini = new InifileUtils(presetPath + presetFileName);

            // Area
            // Check In button area
            ini.setValue("Area", "CheckInAreaXStart", CheckInAreaXStart.Text);
            ini.setValue("Area", "CheckInAreaYStart", CheckInAreaYStart.Text);
            ini.setValue("Area", "CheckInAreaXEnd", CheckInAreaXEnd.Text);
            ini.setValue("Area", "CheckInAreaYEnd", CheckInAreaYEnd.Text);

            // Link button area
            ini.setValue("Area", "LinkAreaXStart", LinkAreaXStart.Text);
            ini.setValue("Area", "LinkAreaYStart", LinkAreaYStart.Text);
            ini.setValue("Area", "LinkAreaXEnd", LinkAreaXEnd.Text);
            ini.setValue("Area", "LinkAreaYEnd", LinkAreaYEnd.Text);

            // Window Close area
            ini.setValue("Area", "WindowCloseAreaXStart", WindowCloseAreaXStart.Text);
            ini.setValue("Area", "WindowCloseAreaYStart", WindowCloseAreaYStart.Text);
            ini.setValue("Area", "WindowCloseAreaXEnd", WindowCloseAreaXEnd.Text);
            ini.setValue("Area", "WindowCloseAreaYEnd", WindowCloseAreaYEnd.Text);

            // Bag Button area
            ini.setValue("Area", "BagButtonAreaXStart", BagButtonAreaXStart.Text);
            ini.setValue("Area", "BagButtonAreaYStart", BagButtonAreaYStart.Text);
            ini.setValue("Area", "BagButtonAreaXEnd", BagButtonAreaXEnd.Text);
            ini.setValue("Area", "BagButtonAreaYEnd", BagButtonAreaYEnd.Text);

            // Battery Button area
            ini.setValue("Area", "BatteryButtonAreaXStart", BatteryButtonAreaXStart.Text);
            ini.setValue("Area", "BatteryButtonAreaYStart", BatteryButtonAreaYStart.Text);
            ini.setValue("Area", "BatteryButtonAreaXEnd", BatteryButtonAreaXEnd.Text);
            ini.setValue("Area", "BatteryButtonAreaYEnd", BatteryButtonAreaYEnd.Text);

            // Charge Button area
            ini.setValue("Area", "Charge50ButtonAreaXStart", Charge50ButtonAreaXStart.Text);
            ini.setValue("Area", "Charge50ButtonAreaYStart", Charge50ButtonAreaYStart.Text);
            ini.setValue("Area", "Charge50ButtonAreaXEnd", Charge50ButtonAreaXEnd.Text);
            ini.setValue("Area", "Charge50ButtonAreaYEnd", Charge50ButtonAreaYEnd.Text);

            // Charge Button area
            ini.setValue("Area", "Charge150ButtonAreaXStart", Charge150ButtonAreaXStart.Text);
            ini.setValue("Area", "Charge150ButtonAreaYStart", Charge150ButtonAreaYStart.Text);
            ini.setValue("Area", "Charge150ButtonAreaXEnd", Charge150ButtonAreaXEnd.Text);
            ini.setValue("Area", "Charge150ButtonAreaYEnd", Charge150ButtonAreaYEnd.Text);

            // Charge Button area
            ini.setValue("Area", "Charge300ButtonAreaXStart", Charge300ButtonAreaXStart.Text);
            ini.setValue("Area", "Charge300ButtonAreaYStart", Charge300ButtonAreaYStart.Text);
            ini.setValue("Area", "Charge300ButtonAreaXEnd", Charge300ButtonAreaXEnd.Text);
            ini.setValue("Area", "Charge300ButtonAreaYEnd", Charge300ButtonAreaYEnd.Text);

            // Close Button area
            ini.setValue("Area", "CloseButtonAreaXStart", CloseButtonAreaXStart.Text);
            ini.setValue("Area", "CloseButtonAreaYStart", CloseButtonAreaYStart.Text);
            ini.setValue("Area", "CloseButtonAreaXEnd", CloseButtonAreaXEnd.Text);
            ini.setValue("Area", "CloseButtonAreaYEnd", CloseButtonAreaYEnd.Text);

            // Error Button area
            ini.setValue("Area", "ErrorButtonAreaXStart", ErrorButtonAreaXStart.Text);
            ini.setValue("Area", "ErrorButtonAreaYStart", ErrorButtonAreaYStart.Text);
            ini.setValue("Area", "ErrorButtonAreaXEnd", ErrorButtonAreaXEnd.Text);
            ini.setValue("Area", "ErrorButtonAreaYEnd", ErrorButtonAreaYEnd.Text);

            // Radar Button area
            ini.setValue("Area", "RadarButtonAreaXStart", RadarButtonAreaXStart.Text);
            ini.setValue("Area", "RadarButtonAreaYStart", RadarButtonAreaYStart.Text);
            ini.setValue("Area", "RadarButtonAreaXEnd", RadarButtonAreaXEnd.Text);
            ini.setValue("Area", "RadarButtonAreaYEnd", RadarButtonAreaYEnd.Text);

            // Radar Button area
            ini.setValue("Area", "Radar1ButtonAreaXStart", Radar1ButtonAreaXStart.Text);
            ini.setValue("Area", "Radar1ButtonAreaYStart", Radar1ButtonAreaYStart.Text);
            ini.setValue("Area", "Radar1ButtonAreaXEnd", Radar1ButtonAreaXEnd.Text);
            ini.setValue("Area", "Radar1ButtonAreaYEnd", Radar1ButtonAreaYEnd.Text);
            ini.setValue("Area", "RadarButtonsOffsetY", RadarButtonsOffsetY.Text);

            // Radar Close Button area
            ini.setValue("Area", "RadarCloseButtonAreaXStart", RadarCloseButtonAreaXStart.Text);
            ini.setValue("Area", "RadarCloseButtonAreaYStart", RadarCloseButtonAreaYStart.Text);
            ini.setValue("Area", "RadarCloseButtonAreaXEnd", RadarCloseButtonAreaXEnd.Text);
            ini.setValue("Area", "RadarCloseButtonAreaYEnd", RadarCloseButtonAreaYEnd.Text);

            // Return Maintenance Button area
            ini.setValue("Area", "ReturnMaintenanceButtonAreaXStart", ReturnMaintenanceButtonAreaXStart.Text);
            ini.setValue("Area", "ReturnMaintenanceButtonAreaYStart", ReturnMaintenanceButtonAreaYStart.Text);
            ini.setValue("Area", "ReturnMaintenanceButtonAreaXEnd", ReturnMaintenanceButtonAreaXEnd.Text);
            ini.setValue("Area", "ReturnMaintenanceButtonAreaYEnd", ReturnMaintenanceButtonAreaYEnd.Text);

            // Interval
            // Window Close interval
            ini.setValue("Interval", "WindowOpenInterval", WindowOpenInterval.Text);
            ini.setValue("Interval", "WindowCloseInterval", WindowCloseInterval.Text);
            ini.setValue("Interval", "WindowCloseAnotherInterval", WindowCloseAnotherInterval.Text);

            // Next Check In interval
            ini.setValue("Interval", "CheckInIntervalMin", CheckInIntervalMin.Text);
            ini.setValue("Interval", "CheckInIntervalMax", CheckInIntervalMax.Text);

            // Maintain Link interval
            ini.setValue("Interval", "MaintainLinkIntervalMin", MaintainLinkIntervalMin.Text);
            ini.setValue("Interval", "MaintainLinkIntervalMax", MaintainLinkIntervalMax.Text);

            // Charge Battely interval
            ini.setValue("Interval", "ChargeBattelyInterval", ChargeBattelyInterval.Text);

            // Unlock Interval
            ini.setValue("Interval", "UnlockPowerInterval", UnlockPowerInterval.Text);
            ini.setValue("Interval", "UnlockSwipeInterval", UnlockSwipeInterval.Text);
            ini.setValue("Interval", "UnlockInputInterval", UnlockInputInterval.Text);

            // Wakeup Interval
            ini.setValue("Interval", "WakeupInterval", WakeupInterval.Text);

            // Close Button Interval
            ini.setValue("Interval", "CloseButtonInterval", CloseButtonInterval.Text);

            // Error Button Interval
            ini.setValue("Interval", "ErrorButtonInterval", ErrorButtonInterval.Text);

            // Charge Button Interval
            ini.setValue("Interval", "ChargeButtonInterval", ChargeButtonInterval.Text);

            // Battry Button Interval
            ini.setValue("Interval", "BattryButtonInterval", BattryButtonInterval.Text);

            // Bag Button Interval
            ini.setValue("Interval", "BagButtonInterval", BagButtonInterval.Text);

            // CheckIn flow Interval
            ini.setValue("Interval", "DoCheckInInterval", DoCheckInInterval.Text);
            ini.setValue("Interval", "CloseCheckInInterval", CloseCheckInInterval.Text);

            // ScreenShot Interval
            ini.setValue("Interval", "TakeScreenShotInterval", TakeScreenShotInterval.Text);
            ini.setValue("Interval", "PullFileInterval", PullFileInterval.Text);
            ini.setValue("Interval", "RemoveFileInterval", RemoveFileInterval.Text);

            // Radar Button Interval
            ini.setValue("Interval", "RadarButtonInterval", RadarButtonInterval.Text);

            // Radar Check in Interval
            ini.setValue("Interval", "RadarCheckInInterval", RadarCheckInInterval.Text);

            // Radar Close Button Interval
            ini.setValue("Interval", "RadarCloseButtonInterval", RadarCloseButtonInterval.Text);

            // Radar Check in try
            ini.setValue("Interval", "RadarCheckInTryNum", RadarCheckInTryNum.Text);
            ini.setValue("Interval", "RadarCheckInTryTime", RadarCheckInTryTime.Text);
            ini.setValue("Interval", "RadarCheckInTryIntervalMin", RadarCheckInTryIntervalMin.Text);
            ini.setValue("Interval", "RadarCheckInTryIntervalMax", RadarCheckInTryIntervalMax.Text);

            // Radar Useable num
            ini.setValue("Interval", "RadarUseableNum", RadarUseableNum.Text);

            // Smart Recovery Time
            ini.setValue("Interval", "ToughRecoveryTimeMin", ToughRecoveryTimeMin.Text);
            ini.setValue("Interval", "ToughRecoveryTimeMax", ToughRecoveryTimeMax.Text);

            // Smart Check Alive Interval
            ini.setValue("Interval", "ToughCheckAliveIntervalMin", ToughCheckAliveIntervalMin.Text);
            ini.setValue("Interval", "ToughCheckAliveIntervalMax", ToughCheckAliveIntervalMax.Text);

            // Image
            // ScreenShot Info
            ini.setValue("Image", "ScreenShotTrimX", ScreenShotTrimX.Text);
            ini.setValue("Image", "ScreenShotTrimY", ScreenShotTrimY.Text);
            ini.setValue("Image", "ScreenShotTrimWidth", ScreenShotTrimWidth.Text);
            ini.setValue("Image", "ScreenShotTrimHeight", ScreenShotTrimHeight.Text);

            // ScreenShot Path
            ini.setValue("Image", "ScreenShotRemotePath", ScreenShotRemotePath.Text);
            ini.setValue("Image", "ScreenShotLocalPath", ScreenShotLocalPath.Text);

            // OCR Info
            ini.setValue("Image", "TrimImageLocalPath", TrimImageLocalPath.Text);
            ini.setValue("Image", "OcrTextLocalPath", OcrTextLocalPath.Text);

            // Compared Image Path
            ini.setValue("Image", "ComparedLinkImagePath", ComparedLinkImagePath.Text);
            ini.setValue("Image", "ComparedErrorImagePath", ComparedErrorImagePath.Text);
            ini.setValue("Image", "ComparedGreetingImagePath", ComparedGreetingImagePath.Text);
            ini.setValue("Image", "ComparedLoadingImagePathA", ComparedLoadingImagePathA.Text);
            ini.setValue("Image", "ComparedLoadingImagePathB", ComparedLoadingImagePathB.Text);
            ini.setValue("Image", "ComparedMaintenanceImagePath", ComparedMaintenanceImagePath.Text);
            ini.setValue("Image", "ComparedOpeningImagePath", ComparedOpeningImagePath.Text);
            ini.setValue("Image", "ComparedTitleImagePath", ComparedTitleImagePath.Text);
            ini.setValue("Image", "ComparedTimelineImagePath", ComparedTimelineImagePath.Text);

            // Threshold
            // Pattern matching threshold
            ini.setValue("Threshold", "PatternMatchingThreshold", PatternMatchingThreshold.Text);

            // Battely threshold
            ini.setValue("Threshold", "BatteryEnoughThreshold", BatteryEnoughThreshold.Text);
            ini.setValue("Threshold", "BatteryMaxThreshold", BatteryMaxThreshold.Text);

            // No Recover threshold
            ini.setValue("Threshold", "NoRecoverThreshold", NoRecoverThreshold.Text);

            // Unlock
            // Unlock
            ini.setValue("Unlock", "UnlockType", UnlockType.Text);

            ini.setValue("Unlock", "UnlockPassword", UnlockPassword.Password);
            ini.setValue("Unlock", "UnlockXStart", UnlockXStart.Text);
            ini.setValue("Unlock", "UnlockYStart", UnlockYStart.Text);
            ini.setValue("Unlock", "UnlockXEnd", UnlockXEnd.Text);
            ini.setValue("Unlock", "UnlockYEnd", UnlockYEnd.Text);
            ini.setValue("Unlock", "UnlockDuration", UnlockDuration.Text);
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                return;
            }
            AppPath = Assembly.GetEntryAssembly().Location;
            //ディレクトリ
            AppDir = Path.GetDirectoryName(AppPath);
            //ファイル名
            AppName = Path.GetFileName(AppPath);
            //ファイル名(拡張子含まず)
            AppNameWoExt = System.IO.Path.ChangeExtension(AppName, null);
            Ini          = new InifileUtils(Path.Combine(AppDir, AppNameWoExt + ".ini"));
            Clientlist   = new List <Client>();

            Client Clientl;
            int    i = 0;

            while (true)
            {
                Clientl = new Client
                {
                    Str = Ini.GetValueString("Default", "str" + i),
                    Exe = Ini.GetValueString("Default", "exe" + i),
                    Env = Ini.GetValueString("Default", "env" + i),
                    Del = Ini.GetValueString("Default", "Del" + i) != ""
                };
                Clientl.Chkexe();
                Clientl.Chkenv();
                //Clientl.Addexe(Ini.GetValueString("Default", "exe"+i));
                //Ini.SetValue("Default", "str" + i, Clientl.Str);

                if (Clientl.Str == "")
                {
                    if (i == 0)
                    {
                        return;
                    }
                    break;
                }
                Clientlist.Add(Clientl);
                i++;
            }
            Directory.SetCurrentDirectory(AppDir);
            string url;
            int    s = Clientlist.Count;

            //if (s <= 1) return;
            for (i = 1; i < s; i++)
            {
                Clientl     = Clientlist[i];
                url         = Clientl.StartsWith(args[0]);
                Clientl.Exe = Clientl.Exe == "" ? Clientlist[0].Exe : Clientl.Exe;
                if (url != "" && Clientl.Exe != "")
                {
                    Clientl.Startexe(Clientl.Del ? url : args[0]);
                    break;
                }
            }
        }