Example #1
0
        public void AddWares(int pCodeWares, int pCodeUnit = 0, decimal pQuantity = 0m, decimal pPrice = 0m, GW pGV = null)
        {
            if (pGV != null)
            {
                CurW = pGV;
                NameWares.Content = CurW.Name;

                Image im = null;
                foreach (var el in GridWeightWares.Children)
                {
                    im = el as Image;
                    if (im != null)
                    {
                        break;
                    }
                }
                if (im != null)
                {
                    GridWeightWares.Children.Remove(im);
                }
                if (File.Exists(CurW.Pictures))
                {
                    im = new Image
                    {
                        Source            = new BitmapImage(new Uri(CurW.Pictures)),
                        VerticalAlignment = VerticalAlignment.Center
                    };
                    //Grid.SetColumn(Bt, i);
                    Grid.SetRow(im, 1);
                    GridWeightWares.Children.Add(im);
                }

                //GridWeightWares.Children.Clear();

                SetStateView(eStateMainWindows.WaitWeight);
                return;
            }


            if (pCodeWares > 0)
            {
                CurWares = Bl.AddWaresCode(null, pCodeWares, pCodeUnit, pQuantity, pPrice);

                if (CurWares != null)
                {
                    if (CurWares.TypeWares == 1)
                    {
                        SetStateView(eStateMainWindows.WaitExciseStamp);
                        return;
                    }

                    if (CurWares.Price == 0) //Повідомлення Про відсутність ціни
                    {
                    }
                    if (CurWares.Prices != null && pPrice == 0m) //Меню з вибором ціни. Сигарети.
                    {
                        if (CurWares.Prices.Count() > 1)
                        {
                            SetStateView(eStateMainWindows.WaitInputPrice);
                        }
                        else
                        if (CurWares.Prices.Count() == 1)
                        {
                            Bl.AddWaresCode(null, pCodeWares, pCodeUnit, pQuantity, CurWares.Prices.First());
                        }
                    }
                }
            }
        }
Example #2
0
 public static extern IntPtr GetWindow(HandleRef hWnd, GW uCmd);
		/// <summary>
		/// Retrieves the handle to a window that has the specified relationship to the Win32Window.
		/// </summary>
		/// <param name="nCmd">Specifies the relationship between the specified window and the window which is to be retrieved.</param>
		/// <returns></returns>
		public Win32Window GetWindow(GW nCmd)
		{
			IntPtr hWndNext = GetWindow(hWnd, nCmd);
			return new Win32Window(hWndNext);	
		}
Example #4
0
 public static extern IntPtr GetWindow(IntPtr hWnd, GW nCmd);
Example #5
0
 public static extern IntPtr GetWindow(IntPtr hWnd, GW nCmd);
Example #6
0
 public static partial IntPtr GetWindow(IntPtr hWnd, GW uCmd);
 internal static extern IntPtr GetWindow(IntPtr hwnd, GW nCmd);
Example #8
0
 private void loadinfo()
 {
     lbGuildName.Text = GW.GetGuildName(Page);
 }
Example #9
0
 public static extern IntPtr GetWindow(
     HandleRef hWnd,
     GW     uCmd
     );
Example #10
0
 static extern IntPtr GetWindow(IntPtr hWnd, [MarshalAs(UnmanagedType.U4)] GW uCmd);
Example #11
0
 public static extern HWND GetWindow(HWND hwnd, GW uCmd);
Example #12
0
 private void btnStartGame_Click(object sender, RoutedEventArgs e)
 {
     GW.PlayerButtonsPanel.Children.Clear();
     GW.InitiateGame();
     GW.RemainingShipsLabel.Content = "5 of the computer's ships are afloat.";
 }
Example #13
0
 public static LogMsgLevel GetLogMsgLevel(GW.Utils.LogMsgLevel logLevel)
 {
     return (LogMsgLevel)ParseHelper.Parse<int>(logLevel);
 }
Example #14
0
 private void Close(int pCodeWares, int pCodeUnit = 0, decimal pQuantity = 0m, GW pGW = null)
 {
     MW?.AddWares(pCodeWares, pCodeUnit, pQuantity, 0m, pGW);
     Close();
 }
Example #15
0
 public static extern HWND GetWindow(HWND hwnd, GW uCmd);
        public override void Execute()
        {
            //Get Values From ini File
            FTA_1st_Mux_1 = CL.EA.GetValue("FTA_1st_Mux_1");
            CL.LogComment("Retrieved Value From ini File: FTA_1st_Mux_1 = " + FTA_1st_Mux_1);

            //Get the Default Item attribute from the ini file

            First_Item_Focus = CL.EA.GetValueFromINI(EnumINIFile.Project, "PROJATTRIB", "MAIN_MENU_FIRST_FOCUSSED_ITEM");

            if (First_Item_Focus.Equals(""))
            {
                CL.FailStep("Failed to fetch Main Menu items from the Project attributes file!");
            }


            if (multiBoxTest)
            {
                GW.StartStep(this);
                CL.StartStep(this);

                bool MountPassed = Env.MountGroup(Platfroms, testDuration);
                if (MountPassed == false)
                {
                    GW.FailStep("Failed To Mount Gateway", false);
                    CL.FailStep("Failed To Mount Client(s)");
                }
                GW.PassStep();
            }
            else
            {
                CL.StartStep(this);

                res = Env.MountSingle(CL, testDuration);
                if (!res.CommandSucceeded)
                {
                    CL.FailStep(res);
                }
            }

            res = CL.EA.StandBy(false);
            if (!res.CommandSucceeded)
            {
                CL.FailStep(res, "Failed to put Box in Standby");
            }

            res = CL.EA.CheckForVideo(false, false, 15);
            if (!res.CommandSucceeded)
            {
                CL.FailStep(res, "Failed: Video is Present After entering Standby");
            }

            res = CL.EA.StandBy(true);
            if (!res.CommandSucceeded)
            {
                CL.FailStep(res, "Failed Exiting Standby");
            }
            res = CL.EA.CheckForVideo(true, false, 60);
            if (!res.CommandSucceeded)
            {
                CL.FailStep(res, "Failed: Video is not recovered  on Exit From Standby");
            }

            CL.PassStep();
        }
Example #17
0
    void OnCollisionEnter(Collision other)
    {
        if (other.gameObject.tag == "Stone")
        {
            posX = camSet.transform.position.x / 10;
            posZ = camSet.transform.position.z / 10;
            pXi  = (int)posX;
            pZi  = (int)posZ;
            if (posX > 0)
            {
                posX = (float)pXi * 10 + 5;
            }
            else if (posX < 0)
            {
                posX = (float)pXi * 10 - 5;
            }
            if (posZ > 0)
            {
                posZ = (float)pZi * 10 + 5;
            }
            else if (posZ < 0)
            {
                posZ = (float)pZi * 10 - 5;
            }
            camSet.transform.position = new Vector3(posX, 0, posZ);
            moveX   = 0;
            moveZ   = 0;
            canMove = true;
        }

        if (other.gameObject.tag == "Poison")
        {
            poison = true;
            camSet.transform.position = new Vector3(-15, 0, -55);
            moveX = 0;
            moveZ = 0;
            goal  = false; goal1 = false; goal2 = false;
            goalSet.SetActive(true); goal1Set.SetActive(true); goal2Set.SetActive(true);
            poisonTag.SetActive(true);
            getTag.SetActive(false); get1Tag.SetActive(false); get2Tag.SetActive(false);
            exitSet.SetActive(false);
            gwY.SetActive(true); gwB.SetActive(true); gwR.SetActive(true);
            GW.SetActive(true);
            canMove = true;
        }

        if (other.gameObject.tag == "Goal")
        {
            goal = true;
            getTag.SetActive(true);
            goalSet.SetActive(false);
            gwY.SetActive(false);
            if (goal1 == true && goal2 == true)
            {
                exitSet.SetActive(true);
                GW.SetActive(false);
            }
        }

        if (other.gameObject.tag == "Goal1")
        {
            goal1 = true;
            get1Tag.SetActive(true);
            goal1Set.SetActive(false);
            gwB.SetActive(false);
            if (goal == true && goal2 == true)
            {
                exitSet.SetActive(true);
                GW.SetActive(false);
            }
        }

        if (other.gameObject.tag == "Goal2")
        {
            goal2 = true;
            get2Tag.SetActive(true);
            goal2Set.SetActive(false);
            gwR.SetActive(false);
            if (goal1 == true && goal == true)
            {
                exitSet.SetActive(true);
                GW.SetActive(false);
            }
        }

        if (other.gameObject.tag == "Exit")
        {
            SceneManager.LoadScene("IceFloorGoal");
        }
    }
Example #18
0
 public static IntPtr GetNextWindow(IntPtr hWnd, GW wCmd)
 {
     return GetWindow(hWnd, wCmd);
 }
Example #19
0
    public void HandleInput(GameTime gameTime)
    {
        //KeyboardState kbs = Keyboard.GetState();
        inputHelper.Update(gameTime);
        //Debug.WriteLine("test2");
        List <Keys> keys = inputHelper.GetPressedKeys();

        if (keys != null)
        {
            //Debug.WriteLine(keys.Count);
            foreach (Keys key in keys)
            {
                switch (key)
                {
                case Keys.Space:
                    //Debug.WriteLine("test325");
                    if (gameState != GameState.Playing)
                    {
                        gameState = GameState.Playing;
                        foreach (GameWorld GW in gameWorlds)
                        {
                            GW.Reset(gameTime);
                        }
                    }
                    break;

                case Keys.D1:
                    //Debug.WriteLine("test2");
                    if (gameState == GameState.NotStarted)
                    //maxLevel = normalModeMaxLevel;
                    {
                        gameState = GameState.Playing;
                        foreach (GameWorld GW in gameWorlds)
                        {
                            GW.Reset(gameTime);
                        }
                    }
                    break;

                case Keys.D2:
                    if (gameState == GameState.NotStarted)
                    {
                        //maxLevel = hardModeMaxLevel;
                        gameWorld2 = new GameWorld(emptyCell, font, new Vector2(25, -3), gridHeight, gridWidth, p2KeySet);
                        gameWorlds.Add(gameWorld2);
                        multiplayer = true;
                        gameState   = GameState.Playing;
                        foreach (GameWorld GW in gameWorlds)
                        {
                            GW.Reset(gameTime);
                        }
                    }
                    break;

                case Keys.Escape:
                    Exit();
                    break;
                }
            }
        }
    }
Example #20
0
 public static IntPtr GetWindow(IntPtr hWnd, GW wCmd)
 {
     return GetWindow(hWnd, (uint)wCmd);
 }
Example #21
0
        //****************************************************************************************************
        //****************************************************************************************************
        //****************************************************************************************************
        bool RunAll(testinginfo _testtemp, bosainfo _bosainfo, variables _vari)
        {
            System.Diagnostics.Stopwatch pt = new System.Diagnostics.Stopwatch();
            pt.Start();
            string _apdTime = "", _pwTime = "", _erTime = "", _ddmiTime = "";


            if (!(GlobalData.initSetting.ONTTYPE == "GW020BoB" && GlobalData.initSetting.ONTAPD == "Only Write APD LUT"))
            {
                //Kiem tra ket noi toi may do Power
                _testtemp.SYSTEMLOG += string.Format("Kiểm tra kết nối tới máy đo EXFO IQS610P {0}...\r\n", GlobalData.initSetting.EXFOIP);
                if (Network.PingNetwork(GlobalData.initSetting.EXFOIP) == false)
                {
                    _testtemp.SYSTEMLOG += "...Kết quả = FAIL\r\n";
                    GlobalData.connectionManagement.IQS1700STATUS  = false;
                    GlobalData.connectionManagement.IQS9100BSTATUS = false;
                    return(false);
                }
                _testtemp.SYSTEMLOG += "...Kết quả = PASS\r\n";
            }


            //login to ONT
            bool _result   = false;
            GW   ontDevice = null;

            switch (GlobalData.initSetting.ONTTYPE)
            {
            case "GW040H": {
                ontDevice = new GW040H(_testtemp.COMPORT);
                break;
            }

            case "GW020BoB": {
                ontDevice = new GW020BoB(_testtemp.COMPORT);
                break;
            }

            default: return(false);
            }
            if (ontDevice.loginToONT(_testtemp) == false)
            {
                goto END;
            }


            //Get MAC Address
            if (!GlobalData.initSetting.ENABLEWRITEMAC)
            {
                _testtemp.MACADDRESS = ontDevice.getMACAddress(_testtemp);
                if (_testtemp.MACADDRESS == string.Empty)
                {
                    _testtemp.ERRORCODE = "(Mã Lỗi: COT-GM-0001)"; goto END;
                }
            }

            //Write APD LUT
            if (GlobalData.initSetting.ENABLEWRITEAPD == true)
            {
                if (ontDevice.writeAPD(_bosainfo, _testtemp) == false)
                {
                    goto END;
                }
            }
            pt.Stop();
            _apdTime = string.Format("PW time = {0} ms\r\n", pt.ElapsedMilliseconds);
            pt.Reset(); pt.Restart();

            //Calib Power
            if (GlobalData.initSetting.ENABLETUNINGPOWER)
            {
                if (ontDevice.calibPower(int.Parse(_testtemp.ONTINDEX), _bosainfo, _testtemp, _vari) == false)
                {
                    goto END;
                }
            }

            pt.Stop();
            _pwTime = string.Format("PW time = {0} ms\r\n", pt.ElapsedMilliseconds);

            //Calib ER
            if (GlobalData.initSetting.ENABLETUNINGER || GlobalData.initSetting.ENABLETUNINGCROSSING)
            {
                pt.Reset();
                pt.Restart();

                //Đăng kí thứ tự Calib ER
                if (this._addToListSequenceTestER(_testtemp) == false)
                {
                    goto END;
                }

                //Chờ đến lượt timeout 90s
                if (this._waitForTurn(_testtemp) == false)
                {
                    goto END;
                }

                //Kiem tra ket noi toi may do DCA
                _testtemp.SYSTEMLOG += string.Format("Kiểm tra kết nối tới máy đo DCA X86100D {0}...\r\n", GlobalData.initSetting.ERINSTRGPIB);
                if (GlobalData.erDevice.isConnected() == false)
                {
                    _testtemp.SYSTEMLOG += "...Kết quả = FAIL\r\n";
                    GlobalData.connectionManagement.DCAX86100DSTATUS = false;
                    return(false);
                }
                _testtemp.SYSTEMLOG += "...Kết quả = PASS\r\n";

                //Calib Dark level
                _testtemp.SYSTEMLOG += string.Format("Switching port...{0} OFF\r\n", _testtemp.ONTINDEX);
                GlobalData.switchDevice.switchOff();
                Thread.Sleep(500);
                GlobalData.erDevice.Calibrate();
                Thread.Sleep(500);

                //Switch Port check ER
                _testtemp.SYSTEMLOG += string.Format("Switching port...{0} ON\r\n", _testtemp.ONTINDEX);
                if (GlobalData.switchDevice.switchToPort(int.Parse(_testtemp.ONTINDEX)) == false)
                {
                    goto END;
                }

                //Calib ER
                if (GlobalData.initSetting.ENABLETUNINGER)
                {
                    if (ontDevice.calibER(int.Parse(_testtemp.ONTINDEX), _bosainfo, _testtemp, _vari) == false)
                    {
                        goto END;
                    }
                }

                //Calib Crossing
                if (GlobalData.initSetting.ENABLETUNINGCROSSING && GlobalData.initSetting.ONTTYPE == "GW020BoB")
                {
                    if (ontDevice.calibCrossing(int.Parse(_testtemp.ONTINDEX), _bosainfo, _testtemp, _vari) == false)
                    {
                        goto END;
                    }
                }

                //Xóa thứ tự đăng kí Calib ER (để Thread # có thể sử dụng)
                this._removeFromListSequenceTestER(_testtemp);

                pt.Stop();
                _erTime = string.Format("ER time = {0} ms\r\n", pt.ElapsedMilliseconds);
            }

            //TX DDMI
            pt.Reset(); pt.Restart();
            if (GlobalData.initSetting.ENABLETXDDMI)
            {
                if (ontDevice.txDDMI(int.Parse(_testtemp.ONTINDEX), _bosainfo, _testtemp, _vari) == false)
                {
                    goto END;
                }
            }

            //Signal Off
            if (GlobalData.initSetting.ENABLESIGNALOFF && GlobalData.initSetting.ONTTYPE == "GW040H")
            {
                if (ontDevice.signalOff(int.Parse(_testtemp.ONTINDEX), _bosainfo, _testtemp, _vari) == false)
                {
                    goto END;
                }
            }

            //Write flash
            if (GlobalData.initSetting.ENABLEWRITEFLASH && GlobalData.initSetting.ONTTYPE == "GW040H")
            {
                if (ontDevice.writeFlash(_bosainfo, _testtemp) == false)
                {
                    goto END;
                }
            }

            //Verify Signal
            if (GlobalData.initSetting.ENABLEVERIFYSIGNAL && GlobalData.initSetting.ONTTYPE == "GW040H")
            {
                if (ontDevice.verifySignal(int.Parse(_testtemp.ONTINDEX), _bosainfo, _testtemp, _vari) == false)
                {
                    goto END;
                }
            }

            //Write MAC
            if (GlobalData.initSetting.ENABLEWRITEMAC)
            {
                if (ontDevice.writeMAC(_testtemp) == false)
                {
                    goto END;
                }
            }

            pt.Stop();
            _ddmiTime = string.Format("DDMI,SIGOFF,WRITE FLASH time = {0} ms\r\n", pt.ElapsedMilliseconds);

            _result = true;

END:
            _testtemp.SYSTEMLOG += _pwTime;
            _testtemp.SYSTEMLOG += _erTime;
            _testtemp.SYSTEMLOG += _ddmiTime;
            this._removeFromListSequenceTestER(_testtemp);
            try { ontDevice.Close(); } catch { }
            return(_result);
        }
Example #22
0
 internal static extern IntPtr GetWindow(IntPtr hwnd, GW nCmd);
        //----RUN ALL
        //****************************************************************************************************
        //****************************************************************************************************
        //****************************************************************************************************
        bool RunAll(testinginfo _testtemp, bosainfo _bosainfo, variables _vari)
        {
            System.Diagnostics.Stopwatch pt = new System.Diagnostics.Stopwatch();
            pt.Start();
            bool   _result  = false;
            string _message = "";

            GW      ontDevice  = null;
            FVA3150 instrument = null;

            switch (globalData.initSetting.ONTTYPE)
            {
            case "GW040H": {
                ontDevice = new GW040H(_testtemp.COMPORT);
                break;
            }

            case "GW020BoB": {
                ontDevice = new GW020BoB(_testtemp.COMPORT);
                break;
            }

            default: return(false);
            }

            //Connect to Instrument
            _testtemp.SYSTEMLOG += string.Format("Connect to FVA3150 {0}...\r\n", _testtemp.GPIB);
            instrument           = new FVA3150(_testtemp.GPIB);
            if (instrument.Open(out _message) == false)
            {
                _testtemp.SYSTEMLOG += "...FAIL" + "\r\n";
                _testtemp.SYSTEMLOG += _message + "\r\n";
                goto END;
            }
            _testtemp.SYSTEMLOG += "...PASS" + "\r\n";

            //login to ONT
            if (ontDevice.loginToONT(_testtemp) == false)
            {
                goto END;
            }


            //Get MAC Address
            _testtemp.MACADDRESS = ontDevice.getMACAddress(_testtemp);
            if (_testtemp.MACADDRESS == string.Empty)
            {
                _testtemp.ERRORCODE = "(Mã Lỗi: COT-GM-0001)"; goto END;
            }


            //Set Vapd + Slope
            if (globalData.initSetting.ONTTYPE == "GW040H")
            {
                if (ontDevice.setVapdAndSlope(_bosainfo, _testtemp, instrument, _vari) == false)
                {
                    goto END;
                }
                pt.Stop();
                _testtemp.SYSTEMLOG += string.Format("Set Vadp + Slope time = {0} ms\r\n", pt.ElapsedMilliseconds);
            }


            //Overload + Sensitivity
            if (globalData.initSetting.ONTTYPE == "GW040H")
            {
                if (ontDevice.overloadSensitivity(_bosainfo, _testtemp, instrument, _vari) == false)
                {
                    goto END;
                }
                pt.Stop();
                _testtemp.SYSTEMLOG += string.Format("Overload + Sensitivity time = {0} ms\r\n", pt.ElapsedMilliseconds);
            }


            //RX DDMI Calibration
            if (ontDevice.calibDDMI(_bosainfo, _testtemp, instrument, _vari) == false)
            {
                goto END;
            }
            pt.Stop();
            _testtemp.SYSTEMLOG += string.Format("RX DDMI Calibration time = {0} ms\r\n", pt.ElapsedMilliseconds);

            //RX DDMI Curve
            if (globalData.initSetting.ONTTYPE == "GW040H")
            {
                if (ontDevice.curveDDMI(_bosainfo, _testtemp, instrument, _vari) == false)
                {
                    goto END;
                }
                pt.Stop();
                _testtemp.SYSTEMLOG += string.Format("RX DDMI Curve time = {0} ms\r\n", pt.ElapsedMilliseconds);
            }

            //LOS Calibration
            bool _flag = false;

            if (ontDevice.calibLOS(_bosainfo, _testtemp, instrument, _vari, ref _flag) == false)
            {
                goto END;
            }
            pt.Stop();
            _testtemp.SYSTEMLOG += string.Format("LOS Calibration time = {0} ms\r\n", pt.ElapsedMilliseconds);

            //LOS Check
            if (globalData.initSetting.ONTTYPE == "GW040H")
            {
                if (ontDevice.checkLOS(_flag, _bosainfo, _testtemp, instrument, _vari) == false)
                {
                    goto END;
                }
                pt.Stop();
                _testtemp.SYSTEMLOG += string.Format("LOS check time = {0} ms\r\n", pt.ElapsedMilliseconds);
            }

            //Write Flash
            if (globalData.initSetting.ONTTYPE == "GW040H")
            {
                if (ontDevice.writeFlash(_bosainfo, _testtemp) == false)
                {
                    goto END;
                }
                pt.Stop();
                _testtemp.SYSTEMLOG += string.Format("Write flash time = {0} ms\r\n", pt.ElapsedMilliseconds);
            }

            _result = true;

END:
            try { ontDevice.Close(); } catch { }
            return(_result);
        }
 public static IntPtr GetWindow(IntPtr parentHWnd, GW uCmd)
 {
     return(SafeNativeMethods.GetWindow(parentHWnd, uCmd));
 }
 static extern IntPtr GetWindow(IntPtr hWnd, GW uCmd);
 public static extern IntPtr GetWindow(IntPtr parentHWnd, GW uCmd);
Example #27
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="hwnd"></param>
 /// <param name="nCmd"></param>
 /// <returns></returns>
 public static IntPtr GetWindow(IntPtr hwnd, GW nCmd)
 {
     return NativeMethods.GetWindow(hwnd, nCmd);
 }
Example #28
0
 /// <summary>指定されたウィンドウと指定された関係(またはオーナー)にあるウィンドウのハンドルを返す</summary>
 /// <param name="hWnd">指定ウィンドウ</param>
 /// <param name="cmd">指定ウィンドウとの関係</param>
 /// <returns>ウィンドウのハンドル</returns>
 public static IntPtr GetWindow(IntPtr hWnd, GW cmd)
 {
     return GetWindow(hWnd, (uint)cmd);
 }