예제 #1
0
        public TestSuite(Type type)
        {
            this.name = type.Name;
            this.fullName = type.FullName;

            object[] attrs = type.GetCustomAttributes( typeof(PropertyAttribute), true);
            foreach (PropertyAttribute attr in attrs)
                this.Properties[attr.Name] = attr.Value;

            IgnoreAttribute ignore = (IgnoreAttribute)Reflect.GetAttribute(type, typeof(IgnoreAttribute));
            if (ignore != null)
            {
                this.runState = RunState.Ignored;
                this.ignoreReason = ignore.Reason;
            }

            if ( !InvalidTestSuite(type) )
            {
                foreach (MethodInfo method in type.GetMethods())
                {
                    if (IsTestMethod(method))
                        this.AddTest(HasValidSignature(method)
                            ? Reflect.ConstructTestCase(method)
                            : new InvalidTestCase(method.Name,
                                "Test methods must have signature void MethodName()"));
                }
            }
        }
예제 #2
0
        public TestSuite(Type type)
        {
            this.name = type.Name;
            this.fullName = type.FullName;

            object[] attrs = type.GetCustomAttributes( typeof(PropertyAttribute), true);
            foreach (PropertyAttribute attr in attrs)
                foreach( DictionaryEntry entry in attr.Properties )
                    this.Properties[entry.Key] = entry.Value;

            IgnoreAttribute ignore = (IgnoreAttribute)Reflect.GetAttribute(type, typeof(IgnoreAttribute));
            if (ignore != null)
            {
                this.runState = RunState.Ignored;
                this.ignoreReason = ignore.Reason;
            }

            if ( !InvalidTestSuite(type) )
            {
                foreach (MethodInfo method in type.GetMethods())
                {
                    if (TestCase.IsTestMethod(method))
                        this.AddTest(new TestCase(method));
                    //{
                    //    ITest test = TestCase.HasValidSignature(method)
                    //        ? (ITest)new TestCase(method)
                    //        : (ITest)new InvalidTestCase(method.Name,
                    //            "Test methods must have signature void MethodName()");

                    //    this.AddTest(test);
                    //}
                }
            }
        }
예제 #3
0
        private void Initialize(MethodInfo method, object fixture)
        {
            this.name = method.Name;
            this.method = method;
            this.fullName = method.ReflectedType.FullName + "." + name;
            this.fixture = fixture;
            if ( fixture == null )
                this.fixture = Reflect.Construct(method.ReflectedType, null);

            if (!HasValidSignature(method))
            {
                this.runState = RunState.NotRunnable;
                this.ignoreReason = "Test methods must have signature void MethodName()";
            }
            else
            {
                IgnoreAttribute ignore = (IgnoreAttribute)Reflect.GetAttribute(this.method, typeof(IgnoreAttribute));
                if (ignore != null)
                {
                    this.runState = RunState.Ignored;
                    this.ignoreReason = ignore.Reason;
                }
            }

            foreach (MethodInfo m in method.ReflectedType.GetMethods())
            {
                if (Reflect.HasAttribute(m, typeof(SetUpAttribute)))
                    this.setup = m;

                if (Reflect.HasAttribute(m, typeof(TearDownAttribute)))
                    this.teardown = m;
            }
        }
예제 #4
0
		public void Tests(MethodInfo method, RunState state)
		{
			Test built = _sut.BuildFrom(method);

			Assert.That(built, Is.InstanceOf(typeof(NUnitTestMethod)));
			Assert.That(built.RunState, Is.EqualTo(state));
		}
예제 #5
0
		public void AsyncTests(MethodInfo method, RunState state)
		{
			var built = _sut.BuildFrom(method);

			Assert.That(built, Is.InstanceOf<NUnitAsyncTestMethod>());
			Assert.That(built.RunState, Is.EqualTo(state));
		}
예제 #6
0
 public void TryApplyRunState(RunState state, string reason)
 {
     if (_runStatePriorities[state] < _runStatePriorities[_test.RunState])
     {
         _test.RunState = state;
         _test.IgnoreReason = reason;
     }
 }
 private void OnTestClassStarting(object sender, TestClassStartingEventArgs e)
 {
     if (!IsRunning)
     {
         IsRunning = true;
         runState = new RunState();
     }
 }
예제 #8
0
 public VirtualHardware(int boardLayoutWidth, int boardLayoutHeight, int ledSize, Color ledColor, int dotPitch)
 {
     this.m_display = null;
     this.m_state = RunState.Stopped;
     this.m_boardLayout = new Size(boardLayoutWidth, boardLayoutHeight);
     this.m_ledSize = ledSize;
     this.m_ledColor = ledColor;
     this.m_dotPitch = dotPitch;
 }
예제 #9
0
        public void runCalculation(Object o)
        {
            DataResponse r = (DataResponse)o;
            Thread.Sleep(1000 * 20);
            r.data = MakeArrayetest(r.row, r.col);
            sendRequest(r, null);

            myState = RunState.IDLE;
        }
예제 #10
0
        public void Match_returns_true_if_run_state_is_not_explicit(RunState runState)
        {
            test.Stub(t => t.TestName).Return(testName);
            test.RunState = runState;

            var result = testFilter.Match(test);

            Assert.That(result, Is.True());
        }
예제 #11
0
		private void ChangeState(RunState newState)
		{
			RunState = newState;			
			
			if (RunStateChanged != null)
			{
				RunStateChanged(this, EventArgs.Empty);
			}
		}
예제 #12
0
		/// <summary>
		/// Constructs a test given its name
		/// </summary>
		/// <param name="name">The name of the test</param>
		protected Test( string name )
		{
			this.testName = new TestName();
			this.testName.FullName = name;
			this.testName.Name = name;
			this.testName.TestID = new TestID();

            this.runState = RunState.Runnable;
		}
예제 #13
0
 public VirtualHardware(int boardLayoutWidth, int boardLayoutHeight)
 {
     this.m_display = null;
     this.m_state = RunState.Stopped;
     this.m_boardLayout = new Size(boardLayoutWidth, boardLayoutHeight);
     this.m_ledSize = 3;
     this.m_ledColor = Color.FromArgb(-65536);
     this.m_dotPitch = 9;
 }
예제 #14
0
        /// <summary>
        /// Construct a TestCaseAttribute with a list of arguments.
        /// This constructor is not CLS-Compliant
        /// </summary>
        /// <param name="arguments"></param>
        public TestCaseAttribute(params object[] arguments)
        {
			this.runState = RunState.Runnable;
			
         	if (arguments == null)
         		this.arguments = new object[] { null };
         	else
 	        	this.arguments = arguments;
        }
예제 #15
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            myState = RunState.RUN;
            r = new DataResponse();
            r.row = Int32.Parse( this.txtRow.Text);
            r.col = Int32.Parse(this.txtCol.Text);

            ThreadPool.QueueUserWorkItem(this.runCalculation, r);
            //this.Close();
        }
예제 #16
0
 public ThreadBLL(String connString)
 {
     this._workerThread = null;
     this._connected = false;
     this._task = null;
     this._runState = RunState.idle;
     this._connString = connString;
     this.Connection = new SQLiteConnection();
     this.Adapt = new SQLiteDataAdapter();
 }
예제 #17
0
 public ThreadBLL()
 {
     this._workerThread = null;
     this._connected = false;
     this._task = null;
     this._runState = RunState.idle;
     this._connString = String.Empty;///////////////////////important
     this.Connection = new SQLiteConnection();
     this.Adapt = new SQLiteDataAdapter();
 }
예제 #18
0
		public void TestCases(MethodInfo method, RunState state)
		{
			Test built = _sut.BuildFrom(method);

			NUnitTestMethod testMethod = built.Tests[0] as NUnitTestMethod;

			Assert.IsNotNull(testMethod);

			Assert.That(testMethod.RunState, Is.EqualTo(state));
		}
예제 #19
0
파일: Test.cs 프로젝트: scottwis/eddie
        /// <summary>
        /// Constructs a test given the path through the
        /// test hierarchy to its parent and a name.
        /// </summary>
        /// <param name="pathName">The parent tests full name</param>
        /// <param name="name">The name of the test</param>
        protected Test( string pathName, string name )
        {
            this.testName = new TestName();
            this.testName.FullName = pathName == null || pathName == string.Empty
                ? name : pathName + "." + name;
            this.testName.Name = name;
            this.testName.TestID = new TestID();

            this.runState = RunState.Runnable;
        }
예제 #20
0
파일: Run.cs 프로젝트: ilya11211/nprof
 public Run( Profiler p, ProjectInfo pi )
 {
     _p = p;
     _dtStart = DateTime.Now;
     _dtEnd = DateTime.MaxValue;
     _rs = RunState.Initializing;
     _tic = new ThreadInfoCollection();
     _pi = pi;
     _rmcMessages = new RunMessageCollection();
     _bSuccess = false;
 }
        private void OnTestHarnessCompleted(object sender, TestHarnessCompletedEventArgs e)
        {
            // Setup initial conditions.
            if (!IsRunning) return;

            // Write output to HTML DOM.
            runState.Write();
            runState = null;

            // Finish up.
            IsRunning = false;
        }
예제 #22
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this)
            {
                PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8
            };
            //graphicsDevice = new GraphicsDevice();
            Content.RootDirectory = "Content";

            runState = RunState.MainMenu;

            graphics.IsFullScreen = false;
            graphics.PreferredBackBufferWidth = 1280;
            graphics.PreferredBackBufferHeight = 720;

            loadPercentage = 0;
        }
예제 #23
0
 private void Initialize(string name, object fixture)
 {
     this.name = name;
     this.fixture = fixture;
     this.fullName = this.fixture.GetType().FullName + "." + name;
     this.method = Reflect.GetMethod(this.fixture.GetType(), name);
     if (this.method == null)
         this.runState = RunState.NotRunnable;
     else 
     {
         IgnoreAttribute ignore = (IgnoreAttribute)Reflect.GetAttribute(this.method, typeof(IgnoreAttribute));
         if (ignore != null)
         {
             this.runState = RunState.Ignored;
             this.ignoreReason = ignore.Reason;
         }
     }
 }
예제 #24
0
        public TestSuite(Type type)
        {
            TestObject = Reflect.Construct(type, null);

            this.name = type.Name;
            this.fullName = type.FullName;

            object[] attrs = type.GetCustomAttributes( typeof(PropertyAttribute), true);
            foreach (PropertyAttribute attr in attrs)
            {
                foreach( DictionaryEntry entry in attr.Properties )
                {
                    this.Properties[entry.Key] = entry.Value;
                }
            }

            IgnoreAttribute ignore = (IgnoreAttribute)Reflect.GetAttribute(type, typeof(IgnoreAttribute));
            if (ignore != null)
            {
                this.runState = RunState.Ignored;
                this.ignoreReason = ignore.Reason;
            }

            if ( !InvalidTestSuite(type) )
            {
                foreach (MethodInfo method in type.GetMethods())
                {
                    if (TestCase.IsTestMethod(method))
                    {
                        this.AddTest(new TestCase(method, TestObject));
                    }
                    else if (IsTestFixtureSetup(method))
                    {
                        TestFixtureSetUpMethod = method;

                    }else if (IsTestFixtureTearDownAttribute(method))
                    {
                        TestFixtureTearDownMethod = method;
                    }
                }
            }
        }
예제 #25
0
		/// <summary>
		/// Construct from an ITest
		/// </summary>
		/// <param name="test">Test from which a TestNode is to be constructed</param>
		public TestInfo( ITest test )
		{
			this.testName = (TestName)test.TestName.Clone();
			this.testType = test.TestType;

            this.runState = test.RunState;
			this.ignoreReason = test.IgnoreReason;
			this.description = test.Description;
			this.isSuite = test.IsSuite;

			if (test.Categories != null) 
				this.categories.AddRange(test.Categories);
			if (test.Properties != null)
			{
				this.properties = new ListDictionary();
				foreach( DictionaryEntry entry in test.Properties )
					this.properties.Add( entry.Key, entry.Value );
			}

			this.testCaseCount = test.TestCount;
		}
예제 #26
0
	void InputManagement(){
		if (Input.GetKeyDown(KeyCode.Space)) 
		{
			Debug.Log("Space Pressed");
			//if(rigidbody.useGravity == false){
			//	rigidbody.useGravity = true;
			
			//}
			GetComponent<TetherScript>().isTethered = !GetComponent<TetherScript>().isTethered;
		}
		vertical = Input.GetAxis("Vertical");
		horizontal = Input.GetAxis("Horizontal");
		//rVertical = Input.GetAxis("RVertical");
		rHorizontal = Input.GetAxis("RHorizontal");

		if (Input.GetAxis("LeftTrigger")>0){
			runState = RunState.Sliding;
		}
		else {
			runState = RunState.Walking;
		}
	}
예제 #27
0
파일: Form1.cs 프로젝트: imdmmp/kpgweigher
 private void UpdateRunButton(RunState brunning)
 {
     TabPage tp = tabControl1.TabPages["tabPage3"];
     if (brunning == RunState.IDLE)
     {
         tp.Text = "开始运行";
         tp.BackColor = Color.LawnGreen;
         tp.ImageKey = "run3.png";
         return;
     }
     if (brunning == RunState.STOPPING)
     {
         tp.Text = "正在停止运行...";
         tp.BackColor = Color.YellowGreen;
     }
     if (brunning == RunState.RUNNING)
     {
         tp.Text = "正在运行";
         tp.BackColor = Color.Yellow;
         tp.ImageKey = "stop3.png";
     }
     tp.Refresh();
 }
예제 #28
0
        private void fileTransferComplete()
        {
            debugMsg("fileTransferComplete:Enter state is " + CurrState);
            switch (CurrState)
            {
            case RunState.ReadBootLoader:     // WTF
                break;

            case RunState.ReadBootLoaderComplete:     // WTF
                break;

            case RunState.UpdateSoftwareFlashWriter:
                switch (this.chipType)
                {
                case ChipType.LionsGate:
                    SendXmodem("Firmware", Properties.Resources.firmware_lg);
                    break;

                case ChipType.GoldenEars:
                    if (this.platformId == PlatformId.SpartanProduct)
                    {
                        SendXmodem(
                            "Firmware",
                            this.unitSide == UnitSide.Lex ?
                            Properties.Resources.firmware_ge_spartan_lex :
                            Properties.Resources.firmware_ge_spartan_rex);
                    }
                    else if (this.platformId == PlatformId.AsicProduct ||
                             this.platformId == PlatformId.KintexDevBoard)
                    {
                        SendXmodem(
                            "Firmware",
                            Properties.Resources.firmware_ge);
                    }
                    else
                    {
                        throw new UnsupportedPlatformException(this.platformId, "update firmware");
                    }
                    break;
                }
                CurrState = RunState.UpdateSoftwareFirmware;
                break;

            case RunState.UpdateSoftwareFirmware:
                SetStatusLabelText("Download Complete");
                SetButtonsAvailability(true, false);
                CurrState = RunState.Done;
                break;

            case RunState.LoadFlashBoot:
                CurrState = RunState.ReadSoftwareVersion;
                break;

            case RunState.ReadSoftwareVersion:     // WTF
                break;

            case RunState.Done:     // WTF
                break;
            }
            debugMsg("fileTransferComplete:Leave state is " + CurrState);
        }
예제 #29
0
        public void Initialize()
        {
            if (this.State == RunState.Created || this.State == RunState.FailedInitializing)
            {
                this.State = RunState.Initializing;
                if (ConfigurationManager.Instance.State == RunState.Created)
                {
                    ConfigurationManager.Instance.Bootstrap();
                    ConfigurationManager.Instance.Initialize();
                }
                if (ConfigurationManager.Instance.State == RunState.Initialized)
                {
                    ConfigurationManager.Instance.Start();
                }

                if (ConfigurationManager.Instance.State == Osrs.Runtime.RunState.Running)
                {
                    if (LogManager.Instance.State == RunState.Created)
                    {
                        LogManager.Instance.Bootstrap();
                        LogManager.Instance.Initialize();
                    }
                    if (LogManager.Instance.State == RunState.Initialized)
                    {
                        LogManager.Instance.Start();
                    }

                    if (LogManager.Instance.State == Osrs.Runtime.RunState.Running)
                    {
                        logger = LogManager.Instance.GetProvider(typeof(HostServiceProxy));
                        if (logger == null)
                        {
                            logger = new NullLogger(typeof(HostServiceProxy));
                        }

                        ConfigurationProviderBase cfg = ConfigurationManager.Instance.GetProvider();
                        if (cfg != null)
                        {
                            ConfigurationParameter parm = cfg.Get(typeof(HostServiceProxy), "appListFileName");
                            if (parm != null)
                            {
                                try
                                {
                                    this.fileName = (string)parm.Value;
                                    if (!string.IsNullOrEmpty(this.fileName))
                                    {
                                        if (File.Exists(this.fileName))
                                        {
                                            this.logger.Log(0, "Init(Constructor): Succeeded");
                                            this.State = RunState.Initialized;
                                            return;
                                        }
                                    }
                                }
                                catch
                                { }
                            }
                        }
                    }
                }
            }
        }
예제 #30
0
        /// <summary>
        /// Constructs a test given a TestName object
        /// </summary>
        /// <param name="testName">The TestName for this test</param>
        protected Test(TestName testName)
        {
            this.testName = testName;

            this.runState = RunState.Runnable;
        }
예제 #31
0
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="runState">RunState to copy</param>
 public RunState(RunState runState)
 {
     this.ModelState = new ModelState(runState.ModelState);
     this.Output     = runState.Output;
 }
예제 #32
0
 /// <summary>
 /// Construct an empty parameter set, which
 /// defaults to being Runnable.
 /// </summary>
 public ParameterSet()
 {
     this.runState = RunState.Runnable;
 }
예제 #33
0
 private void UpdateState(RunState state)
 {
     _state = state;
     buttonRun.Invoke((Action)(() => { buttonRun.Text = "HyperNEAT " + _state + "..."; }));
 }
예제 #34
0
 /// <summary>
 /// Set output state for a specfic port.
 /// </summary>
 public void SetOutputState(int port, int power_setpoint, OutputMode mode, RegulationMode regulation_mode, int turn_ratio, RunState run_state, int tacho_limit)
 {
     byte[] message = new byte[12];
     if (!RequestResponse)
     {
         message[0] = 0x80;
     }
     message[1]  = 0x04;
     message[2]  = (byte)port;
     message[3]  = (byte)Convert.ToSByte(power_setpoint);
     message[4]  = (byte)mode;
     message[5]  = (byte)regulation_mode;
     message[6]  = (byte)Convert.ToSByte(turn_ratio);
     message[7]  = (byte)run_state;
     message[8]  = (byte)tacho_limit;
     message[9]  = (byte)(tacho_limit >> 8);
     message[10] = (byte)(tacho_limit >> 16);
     message[11] = (byte)(tacho_limit >> 24);
     robot.Send(message);
 }
예제 #35
0
 // whether this activity is available, given state of run
 public override int CustomAvailability(RunState runState)
 {
     return(runState.emotions.Extremeness(EmotionType.frustration));
 }
예제 #36
0
 /// <summary>Adds a message for the competition.</summary>
 /// <param name="messageSeverity">Severity of the message.</param>
 /// <param name="message">Text of the message.</param>
 /// <param name="hint">Hints for the message.</param>
 public void WriteMessage(MessageSeverity messageSeverity, string message, string hint = null) => RunState.WriteMessage(MessageSource, messageSeverity, message, hint);
예제 #37
0
파일: VixenSystem.cs 프로젝트: komby/vixen
        public static void Start(IApplication clientApplication, bool openExecution = true, bool disableDevices = false,
            string dataRootDirectory = null)
        {
            if (_state == RunState.Stopped) {
                try {
                    _state = RunState.Starting;
                    ApplicationServices.ClientApplication = clientApplication;

                    // A user data file in the binary branch will give any alternate
                    // data branch to use.
                    Paths.DataRootPath = dataRootDirectory ?? _GetUserDataPath();

                    Logging.Info("Vixen System starting up...");

                    Instrumentation = new Instrumentation.Instrumentation();

                    ModuleImplementation[] moduleImplementations = Modules.GetImplementations();

                    // Build branches for each module type.
                    foreach (ModuleImplementation moduleImplementation in moduleImplementations) {
                        Helper.EnsureDirectory(Path.Combine(Modules.Directory, moduleImplementation.TypeOfModule));
                    }
                    // There is going to be a "Common" directory for non-module DLLs.
                    // This will give them a place to be other than the module directories.
                    // If they're in a module directory, the system will try to load them and
                    // it will result in an unnecessary log notification for the user.
                    // All other binary directories (module directories) have something driving
                    // their presence, but this doesn't.  So it's going to be a blatantly
                    // ugly statement for now.
                    Helper.EnsureDirectory(Path.Combine(Paths.BinaryRootPath, "Common"));

                    // Load all module descriptors.
                    Modules.LoadAllModules();

                    LoadSystemConfig();

                    // Add modules to repositories.
                    Modules.PopulateRepositories();

                    if (disableDevices) {
                        SystemConfig.DisabledDevices = OutputDeviceManagement.Devices;
                    }
                    if (openExecution) {
                        Execution.OpenExecution();
                    }

                    _state = RunState.Started;
                    Logging.Info("Vixen System successfully started.");
                }
                catch (Exception ex) {
                    // The client is expected to have subscribed to the logging event
                    // so that it knows that an exception occurred during loading.
                    Logging.ErrorException("Error during system startup; the system has been stopped.", ex);
                    Stop();
                }
            }
        }
    // Update is called once per frame
    void Update()
    {
        RunState     runState = runManager.runState;
        EmotionState e        = runState.emotions;
        // change the static background based on the time of day
        Sprite newStaticBG = morning;

        if (runState.timeSteps > 2)
        {
            newStaticBG = midday;
        }
        if (runState.timeSteps > 4)
        {
            newStaticBG = sunset;
        }
        if (runState.timeSteps > 6)
        {
            newStaticBG = night;
        }
        TransitionStaticBG(staticBase.GetComponent <Image>(), newStaticBG);

        // rain if sad
        if (e.despair >= 10 && !runState.IsSuppressed(EmotionType.despair))
        {
            tileRain.SetActive(true);
            rainAudio.volume += Time.deltaTime / fadeOutDuration;
            rainAudio.volume  = Mathf.Min(rainAudio.volume, maxVolumeFactor * e.despair);
        }
        else
        {
            tileRain.SetActive(false);
            rainAudio.volume -= Time.deltaTime / fadeOutDuration;
        }
        Color transparent = new Color(1, 1, 1, (float)e.despair / 20f);

        tileRain.GetComponent <SpriteRenderer>().color = transparent;
        // lightning if anxious
        if (e.anxiety >= 10 && !runState.IsSuppressed(EmotionType.anxiety))
        {
            FlashLightning(.5f, Mathf.Min(0, (20f - e.anxiety) / 5f));
            thunderAudio.volume += Time.deltaTime / fadeInDuration;
            thunderAudio.volume  = Mathf.Min(thunderAudio.volume, maxVolumeFactor * e.anxiety);
        }
        else
        {
            thunderAudio.volume -= Time.deltaTime / fadeOutDuration;
        }
        // fire if frustrated
        if (e.frustration >= 10 && !runState.IsSuppressed(EmotionType.frustration))
        {
            int maxPlumes = e.frustration / 4;
            SpawnFire(runState.CurrentActivityPlatform(), maxPlumes);
            fireAudio.volume += Time.deltaTime / fadeInDuration;
            fireAudio.volume  = Mathf.Min(fireAudio.volume, maxVolumeFactor * e.frustration);
        }
        else
        {
            fireAudio.volume -= Time.deltaTime / fadeOutDuration;
        }
        // change fogginess based on total emotion level
        int s = e.GetSum();
        int i = fogLevels.Count - 1;

        while (i > 0 && s < fogLevels[i])
        {
            i--;
        }
        if (!isFogFading)
        {
            TransitionFog(tileBase.GetComponent <SpriteRenderer>(), fogSprites[i]);
        }
    }
예제 #39
0
 public static void SetRunState(RunState newRunState)
 {
 }
예제 #40
0
        public void RunThreaded()
        {
            WinDebug.DEBUG_EVENT DbgEvt = new WinDebug.DEBUG_EVENT();
            ContinueStatus = WinDebug.CONTINUE_STATUS.DBG_CONTINUE;

            foreach (IDebuggerGeneralEvents Event in GeneralEvents)
            {
                Event.OnDebugStart();
            }

            // Loop until told to stop
            while (bContinue == true)
            {
                // Pause until a debug event notification happens
                bContinue = WinDebug.NativeMethods.WaitForDebugEvent(out DbgEvt, VsChromium.Core.Win32.Constants.INFINITE);

                switch (DbgEvt.dwDebugEventCode)
                {
                case WinDebug.DEBUG_EVENT_CODE.EXCEPTION_DEBUG_EVENT:
                    HandleException(DbgEvt);
                    break;

                case WinDebug.DEBUG_EVENT_CODE.CREATE_THREAD_DEBUG_EVENT:
                    HandleCreateThread(DbgEvt);
                    break;

                case WinDebug.DEBUG_EVENT_CODE.CREATE_PROCESS_DEBUG_EVENT:
                    HandleCreateProcess(DbgEvt);
                    break;

                case WinDebug.DEBUG_EVENT_CODE.EXIT_THREAD_DEBUG_EVENT:
                    HandleExitThread(DbgEvt);
                    break;

                case WinDebug.DEBUG_EVENT_CODE.EXIT_PROCESS_DEBUG_EVENT:
                    HandleExitProcess(DbgEvt);

                    // XX Temporary
                    bContinue = false;
                    break;

                case WinDebug.DEBUG_EVENT_CODE.LOAD_DLL_DEBUG_EVENT:
                    HandleLoadDll(DbgEvt);
                    break;

                case WinDebug.DEBUG_EVENT_CODE.UNLOAD_DLL_DEBUG_EVENT:
                    HandleUnloadDll(DbgEvt);
                    break;

                case WinDebug.DEBUG_EVENT_CODE.OUTPUT_DEBUG_STRING_EVENT:
                    HandleOutputDebugString(DbgEvt);
                    break;

                case WinDebug.DEBUG_EVENT_CODE.RIP_EVENT:
                    // TODO: Handle
                    break;
                }

                // TODO: At the moment we suspend the app to skip over this
                // INSTEAD we need to not call ContinueDebugEvent until we are done processing commands

                // TODO: Stop doing this once we raise an exception
                WinDebug.NativeMethods.ContinueDebugEvent(DbgEvt.dwProcessId, DbgEvt.dwThreadId, ContinueStatus);
                ContinueStatus = WinDebug.CONTINUE_STATUS.DBG_CONTINUE;
            }

            State = RunState.Ended;

            foreach (IDebuggerGeneralEvents Event in GeneralEvents)
            {
                Event.OnDebugEnd();
            }
        }
예제 #41
0
 public void Stop()
 {
     State = RunState.Disabled;
     Thread.GetTable("keepalives")[Thread] = null;
     Thread = null;
 }
예제 #42
0
 public static bool Resumable(RunState state, bool allowFailed)
 {
     return(state == RunState.Paused ||
            (allowFailed ? (state == RunState.FailedStarting || state == RunState.FailedRunning) : false));
 }
예제 #43
0
 public SequenceItemLoad(RunState state, SequenceItem sequenceItem, object model, IEnumerable <SequenceItem> nextSequenceItems)
     : base(state, sequenceItem, model, nextSequenceItems)
 {
 }
예제 #44
0
 public static bool Bootstrappable(RunState state)
 {
     return(Bootstrappable(state, false));
 }
예제 #45
0
 public void PauseStory()
 {
     _textManagerState = RunState.Pause;
 }
예제 #46
0
        public static void Start(IApplication clientApplication, bool openExecution = true, bool disableDevices = false,
                                 string dataRootDirectory = null)
        {
            if (_state == RunState.Stopped)
            {
                try {
                    _state = RunState.Starting;
                    ApplicationServices.ClientApplication = clientApplication;

                    // A user data file in the binary branch will give any alternate
                    // data branch to use.
                    Paths.DataRootPath = dataRootDirectory ?? _GetUserDataPath();


                    Logging.Info("Vixen System starting up...");

                    Instrumentation = new Instrumentation.Instrumentation();

                    ModuleImplementation[] moduleImplementations = Modules.GetImplementations();

                    // Build branches for each module type.
                    foreach (ModuleImplementation moduleImplementation in moduleImplementations)
                    {
                        Helper.EnsureDirectory(Path.Combine(Modules.Directory, moduleImplementation.TypeOfModule));
                    }
                    // There is going to be a "Common" directory for non-module DLLs.
                    // This will give them a place to be other than the module directories.
                    // If they're in a module directory, the system will try to load them and
                    // it will result in an unnecessary log notification for the user.
                    // All other binary directories (module directories) have something driving
                    // their presence, but this doesn't.  So it's going to be a blatantly
                    // ugly statement for now.
                    Helper.EnsureDirectory(Path.Combine(Paths.BinaryRootPath, "Common"));

                    // Load all module descriptors.
                    Modules.LoadAllModules();

                    LoadSystemConfig();

                    DefaultUpdateTimeSpan = TimeSpan.FromMilliseconds(SystemConfig.DefaultUpdateInterval);

                    // Add modules to repositories.
                    Modules.PopulateRepositories();

                    if (disableDevices)
                    {
                        SystemConfig.DisabledDevices = OutputDeviceManagement.Devices;
                    }
                    if (openExecution)
                    {
                        Execution.OpenExecution();
                    }

                    //var temp = Modules.ModuleManagement.GetEffect(new Guid("{32cff8e0-5b10-4466-a093-0d232c55aac0}"));
                    //if (temp == null)
                    //{
                    //	Logging.Error("Module Management init error!");
                    //}

                    _state = RunState.Started;
                    Logging.Info("Vixen System successfully started.");
                }
                catch (Exception ex) {
                    // The client is expected to have subscribed to the logging event
                    // so that it knows that an exception occurred during loading.
                    Logging.Error("Error during system startup; the system has been stopped.", ex);
                    Stop();
                }
            }
        }
예제 #47
0
 /// <summary>
 /// Construct a non-runnable ParameterSet, specifying
 /// the provider excetpion that made it invalid.
 /// </summary>
 public ParameterSet(Exception exception)
 {
     this.runState          = RunState.NotRunnable;
     this.providerException = exception;
 }
예제 #48
0
        public void AsyncTests(string methodName, RunState expectedState)
        {
            var test = TestBuilder.MakeTestCase(fixtureType, methodName);

            Assert.That(test.RunState, Is.EqualTo(expectedState));
        }
예제 #49
0
 public ProgramExecutor()
 {
     _state = RunState.Stopped;
 }
예제 #50
0
 public void OnRunStateChanged(object _, RunState rs)
 {
     IconHost.RunState = rs;
 }
예제 #51
0
        public void Start()
        {
            if (this.State == RunState.Initialized || this.State == RunState.Stopped)
            {
                this.State = RunState.Starting;
                if (ConfigurationManager.Instance.State == RunState.Running)
                {
                    if (LogManager.Instance.State == RunState.Running)
                    {
                        this.logger.Log(0, "Start: Called");
                        ServiceListFile fil = ServiceListFile.Open(this.fileName);
                        if (fil != null)
                        {
                            string tmpName;
                            foreach (string name in fil)
                            {
                                tmpName = Path.Combine(name, "AppHost.exe");
                                if (File.Exists(tmpName))
                                {
                                    if (!processNames.Contains(tmpName)) //new for this startup
                                    {
                                        try
                                        {
                                            Process p = this.CreateProcess(tmpName);
                                            if (p.Start())
                                            {
                                                HostCommunication comm = new HostCommunication(p.StandardOutput, p.StandardInput);
                                                //we need to also init this thing
                                                HostMessage response = this.SendMessage(p, comm, HostCommand.Init, null);
                                                if (response != null && response.Command == HostCommand.Init)
                                                {
                                                    if (response.Message.StartsWith("success"))
                                                    {
                                                        this.logger.Log(0, "Start: initialized " + tmpName);
                                                        this.comms[tmpName] = comm;
                                                        this.procs[tmpName] = p;
                                                        this.processNames.Add(tmpName);
                                                    }
                                                }
                                                else
                                                {
                                                    p.Kill();
                                                }
                                            }
                                            else
                                            {
                                                p.Kill();
                                            }
                                        }
                                        catch
                                        { }
                                    }

                                    if (processNames.Contains(tmpName))
                                    {
                                        HostCommunication comm     = this.comms[tmpName];
                                        HostMessage       response = this.SendMessage(this.procs[tmpName], comm, HostCommand.Start, null);
                                        if (response != null && response.Command == HostCommand.Start)
                                        {
                                            if (response.Message.StartsWith("success"))
                                            {
                                                this.logger.Log(0, "Start: started " + tmpName);
                                            }
                                            else
                                            {
                                                this.logger.Log(100, "Start: failed starting " + tmpName);
                                            }
                                        }
                                    }
                                    else
                                    {
                                        this.logger.Log(0, "Start: no process " + tmpName);
                                    }
                                }
                                else
                                {
                                    this.logger.Log(0, "Start: failed to find " + tmpName);
                                }
                            }
                            //we've started what we can, now we start monitoring
                            this.logger.Log(0, "Start: Succeeded, starting monitoring");
                            Task t = new Task(this.MonitorServices);
                            t.Start();
                            this.State = RunState.Running;
                        }
                        else
                        {
                            this.State = RunState.FailedStarting;
                            this.logger.Log(0, "Start: Failed: no processFiles");
                        }
                    }
                    else
                    {
                        this.State = RunState.FailedStarting;
                        this.logger.Log(0, "Start: Failed: Logging didn't start");
                    }
                }
            }
        }
예제 #52
0
        static void Init()
        {
            lock (syncRoot)
            {
                HostMessage m = new HostMessage();
                m.Command = HostCommand.Init;

                if (state == RunState.Created)
                {
                    IEnumerable <TypeNameReference> names = null;
                    m.Message = "";

                    LogProviderBase log = null;
                    try
                    {
                        ConfigurationManager.Instance.Bootstrap();
                        ConfigurationManager.Instance.Initialize();
                        ConfigurationManager.Instance.Start();
                        if (ConfigurationManager.Instance.State == RunState.Running)
                        {
                            LogManager.Instance.Bootstrap();
                            LogManager.Instance.Initialize();
                            LogManager.Instance.Start();
                            if (LogManager.Instance.State == RunState.Running)
                            {
                                log = LogManager.Instance.GetProvider(typeof(Program));
                            }
                            if (log == null)
                            {
                                log = new NullLogger(typeof(Program));
                            }

                            ConfigurationProviderBase prov = ConfigurationManager.Instance.GetProvider();
                            if (prov != null)
                            {
                                ConfigurationParameter param = prov.Get(typeof(Program), "hostList");
                                if (param != null)
                                {
                                    string[] values = param.Value as string[];
                                    if (values != null && values.Length > 0)
                                    {
                                        HashSet <TypeNameReference> tps = new HashSet <TypeNameReference>();
                                        foreach (string s in values)
                                        {
                                            TypeNameReference cur = TypeNameReference.Parse(s);
                                            if (cur != null)
                                            {
                                                tps.Add(cur);
                                            }
                                            else
                                            {
                                                log.Log(5, "Failed to parse TypeName for: " + s);
                                            }
                                        }
                                        if (tps.Count > 0)
                                        {
                                            names = tps;
                                        }
                                    }
                                    else
                                    {
                                        m.Message = "Failed to get configuration value";
                                        log.Log(1000, m.Message);
                                    }
                                }
                                else
                                {
                                    m.Message = "Failed to get configuration parameter: hostList";
                                    log.Log(1000, m.Message);
                                }
                            }
                            else
                            {
                                m.Message = "Failed to get configuration provider";
                                log.Log(1000, m.Message);
                            }
                        }
                        else
                        {
                            m.Message = "Failed to initialize using local file, quitting (" + AppContext.BaseDirectory + ")";
                            if (log != null)
                            {
                                log.Log(1000, m.Message);
                            }
                        }
                    }
                    catch
                    {
                        m.Message = "Failed to initialize using config, falling back to local file";
                        if (log != null)
                        {
                            log.Log(1000, m.Message);
                        }
                    }

                    if (names != null)
                    {
                        HostingManager.Instance.Initialize(names);
                        state = HostingManager.Instance.State;
                        if (state == RunState.Initialized)
                        {
                            m.Message = "success " + m.Message;
                            if (log != null)
                            {
                                log.Log(0, m.Message);
                            }
                        }
                        else
                        {
                            m.Message = "failed " + m.Message;
                            if (log != null)
                            {
                                log.Log(1000, m.Message);
                            }
                        }
                    }
                    else
                    {
                        state     = HostingManager.Instance.State;
                        m.Message = "failed " + m.Message;
                        if (log != null)
                        {
                            log.Log(1000, m.Message);
                        }
                    }
                }
                else
                {
                    state     = HostingManager.Instance.State;
                    m.Message = "ignored";
                }

                comms.Send(m);
            }
        }
예제 #53
0
        public void Start(EventLog logger)
        {
            this.logger = logger;
            if (this.State == RunState.Created || this.State == RunState.FailedInitializing)
            {
                this.Init();
            }

            if (this.State == RunState.Initialized || this.State == RunState.Stopped)
            {
                this.State = RunState.Starting;
                this.logger.WriteEntry("Start: Called");
                if (File.Exists(this.fileName))
                {
                    if (this.procs == null) //new for this startup
                    {
                        try
                        {
                            Process p = this.CreateProcess(this.fileName);
                            if (p.Start())
                            {
                                HostCommunication comm = new HostCommunication(p.StandardOutput, p.StandardInput);
                                //we need to also init this thing
                                HostMessage response = this.SendMessage(p, comm, HostCommand.Init, null);
                                if (response != null && response.Command == HostCommand.Init)
                                {
                                    if (response.Message.StartsWith("success"))
                                    {
                                        this.logger.WriteEntry("Start: initialized");
                                        this.comms = comm;
                                        this.procs = p;
                                    }
                                }
                                else
                                {
                                    p.Kill();
                                }
                            }
                            else
                            {
                                p.Kill();
                            }
                        }
                        catch
                        { }
                    }

                    if (this.procs != null)
                    {
                        HostCommunication comm     = this.comms;
                        HostMessage       response = this.SendMessage(this.procs, comm, HostCommand.Start, null);
                        if (response != null && response.Command == HostCommand.Start)
                        {
                            if (response.Message.StartsWith("success"))
                            {
                                this.logger.WriteEntry("Start: started");
                            }
                            else
                            {
                                this.logger.WriteEntry("Start: failed starting", EventLogEntryType.Warning);
                            }
                        }
                    }
                    else
                    {
                        this.logger.WriteEntry("Start: no process", EventLogEntryType.Warning);
                        this.State = RunState.FailedStarting;
                        return;
                    }
                }
                else
                {
                    this.logger.WriteEntry("Start: failed to find", EventLogEntryType.Warning);
                    this.State = RunState.FailedStarting;
                    return;
                }

                //we've started
                this.logger.WriteEntry("Start: Succeeded, starting monitoring");
                Task t = new Task(this.MonitorServices);
                t.Start();
                this.State = RunState.Running;
            }
        }
예제 #54
0
        private void processReceivedByte(byte ReceivedByte)
        {
            debugMsg("processReceivedByte(" + ReceivedByte + ")");

            uartTimer.Stop();
            uartTimer.Start();

            if (this.CurrState == RunState.ReadBootLoader ||
                this.CurrState == RunState.ReadBootLoaderComplete ||
                this.CurrState == RunState.Done)
            {
                if (ReceivedByte == (byte)'\n' || ReceivedByte > 127)
                {
                    // Reset the line because of a newline or non-ascii character
                    this.currentUartInput = "";
                }
                else
                {
                    this.currentUartInput = this.currentUartInput + (char)ReceivedByte;
                    // 1.3 is hardcoded because there is only one version of the LG bootloader
                    if (Regex.Match(this.currentUartInput, @"BtLdr: v1.3").Success)
                    {
                        this.chipType         = ChipType.LionsGate;
                        this.currentUartInput = "";
                        SetStatusLabelText("LionsGate Bootloader Version 1.3 Detected");
                        buttonUpdateSoftware.Enabled = true;
                        buttonReadSoftware.Enabled   = true;
                        this.CurrState = RunState.ReadBootLoaderComplete;
                    }
                    else
                    {
                        Match match = Regex.Match(
                            this.currentUartInput,
                            @"Goldenears (?<fpgaVersion>[0-9A-F]+\.[0-9A-F]+\.[0-9A-F]+) Bootloader version (?<btldrVersion>\d+\.\d+)");
                        if (match.Success)
                        {
                            this.chipType          = ChipType.GoldenEars;
                            this.currentUartInput  = "";
                            this.fpgaVersion       = match.Groups["fpgaVersion"].Value;
                            this.bootloaderVersion = match.Groups["btldrVersion"].Value;
                            this.CurrState         = RunState.ReadBootLoaderGE;
                        }
                    }
                }
            }
            else if (this.CurrState == RunState.ReadBootLoaderGE)
            {
                if (ReceivedByte > 127)
                {
                    this.currentUartInput = "";
                    this.CurrState        = RunState.ReadBootLoaderComplete;
                }
                else
                {
                    this.currentUartInput = this.currentUartInput + (char)ReceivedByte;
                    Match match = Regex.Match(
                        this.currentUartInput,
                        @"(?<unitSide>[LR]ex) PlatformID 0x(?<platformId>[0-9a-fA-F][0-9a-fA-F])");
                    if (match.Success)
                    {
                        debugMsg("Success platformID is 0x" + match.Groups["platformId"].Value);
                        this.unitSide         = match.Groups["unitSide"].Value == "Lex" ? UnitSide.Lex : UnitSide.Rex;
                        this.platformId       = (PlatformId)Convert.ToUInt32(match.Groups["platformId"].Value, 16);
                        this.currentUartInput = "";
                        SetStatusLabelText(String.Format(
                                               "GoldenEars Bootloader {0}, FPGA {1}, {2} PlatformID {3} Detected",
                                               this.bootloaderVersion,
                                               this.fpgaVersion,
                                               this.unitSide,
                                               this.platformId));
                        buttonUpdateSoftware.Enabled = true;
                        buttonReadSoftware.Enabled   = true;
                        this.CurrState = RunState.ReadBootLoaderComplete;
                    }
                    else if (this.currentUartInput.Length > 25)
                    {
                        this.currentUartInput = "";
                        // The message we are searching for should come directly after the string
                        // that got us into this state, so if we haven't seen it by 25 characters,
                        // we know that something has gone wrong.  25 is somewhat arbitrary, but
                        // it's long enough.
                        this.CurrState = RunState.ReadBootLoaderComplete;
                    }
                }
            }
            else if (CurrState == RunState.UpdateSoftwareFlashWriter ||
                     CurrState == RunState.UpdateSoftwareFirmware ||
                     CurrState == RunState.LoadFlashBoot)
            {
                debugMsg("In readCOMByte(), CurrState = " + CurrState + " read byte: 0x" + ReceivedByte.ToString("x"));
                myFileSender.SignalRecievedChar(ReceivedByte);
            }
            else if (CurrState == RunState.ReadSoftwareVersion)
            {
                byte[] buf2 = new byte[1];
                buf2[0] = ReceivedByte;
                string asciiByte = System.Text.Encoding.UTF8.GetString(buf2);
                this.loadFlashBootCaptureString.Append(asciiByte);
                this.loadFlashBootCaptureBytes.WriteByte(ReceivedByte);
                string versionText = "";
                Dictionary <string, string> versionLookup = null;
                if (this.chipType == ChipType.LionsGate)
                {
                    versionLookup = this.lgVersions;
                    if (this.loadFlashBootCaptureBytes.Length > ExpressLink.R03_or_greater_BootMsgPreamble)
                    {
                        byte[] bytesReceived = this.loadFlashBootCaptureBytes.ToArray();

                        const byte lgLinkmgrComponentIndex = 0x0f;
                        const byte lgLocalSwVersionIndex   = 0x2a;
                        const uint numParams  = 3;
                        int        matchIndex = this.searchForILog(
                            bytesReceived, lgLinkmgrComponentIndex, lgLocalSwVersionIndex, numParams);
                        if (matchIndex != -1)
                        {
                            versionText = String.Format(
                                "{0}.{1}.{2}",
                                bytesReceived[matchIndex + 7],
                                bytesReceived[matchIndex + 11],
                                bytesReceived[matchIndex + 15]);
                        }
                    }
                    // Haven't matched yet so start checking for old ascii based messages
                    if (versionText.Length == 0 &&
                        this.loadFlashBootCaptureString.Length > ExpressLink.R01_or_R02_BootMsgPreamble)
                    {
                        string bootString = this.loadFlashBootCaptureString.ToString();
                        Match  match      = Regex.Match(bootString, @"LGSW_v(?<major>\d{2})_(?<minor>\d{2})_(?<revision>\d{2})");
                        if (match.Success)
                        {
                            versionText = match.Groups["major"] + "." + match.Groups["minor"] + "." + match.Groups["revision"];
                        }
                    }
                }
                else if (this.chipType == ChipType.GoldenEars &&
                         this.loadFlashBootCaptureBytes.Length > ExpressLink.GE_BootMsgPreambleMinLen)
                {
                    versionLookup = this.geVersions;
                    byte[] bytesReceived = this.loadFlashBootCaptureBytes.ToArray();

                    const byte geToplevelComponentIndex = 0;
                    const byte geSoftwareVersionIndex   = 0;
                    const byte numParams  = 3;
                    int        matchIndex = this.searchForILog(
                        bytesReceived, geToplevelComponentIndex, geSoftwareVersionIndex, numParams);
                    if (matchIndex != -1)
                    {
                        versionText = String.Format(
                            "{0}.{1}.{2}",
                            bytesReceived[matchIndex + 7],
                            bytesReceived[matchIndex + 11],
                            bytesReceived[matchIndex + 15]);
                    }
                }

                // Try to lookup the external release name
                if (versionText.Length != 0)
                {
                    versionText = versionLookup.ContainsKey(versionText) ?
                                  versionLookup[versionText] : ("Engineering version " + versionText);
                }
                // If there is still no match and we should have had a release by now
                else if (
                    (this.chipType == ChipType.LionsGate &&
                     this.loadFlashBootCaptureBytes.Length > ExpressLink.R03_or_greater_BootMsgPreamble &&
                     this.loadFlashBootCaptureString.Length > ExpressLink.R01_or_R02_BootMsgPreamble) ||
                    (this.chipType == ChipType.GoldenEars &&
                     this.loadFlashBootCaptureBytes.Length > ExpressLink.GE_BootMsgPreambleMaxLen))
                {
                    versionText = "Could not detect version";
                }

                if (versionText.Length != 0)
                {
                    SetStatusLabelText("Software Version Detected: " + versionText);
                    CurrState = RunState.Done;
                    SetButtonsAvailability(true, false);
                }
            }
        }
예제 #55
0
    public static void InitStaticData()
    {
        if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.PPTPlayer || PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.pc)
        {
            int_load_AB_nums = 100;
        }
        else
        {
            int_load_AB_nums = 0;
        }

        int mem = SystemInfo.systemMemorySize;

#if UNITY_EDITOR
        //QualitySettings.currentLevel = QualityLevel.Fastest;
        //Quality = Run_Quality.POOL;
        QualitySettings.currentLevel = QualityLevel.Good;
        Quality = Run_Quality.GOOD;
#elif UNITY_STANDALONE_WIN
        if (mem <= 4400)
        {
            QualitySettings.currentLevel = QualityLevel.Fastest;
            Quality = Run_Quality.POOL;
        }
        else
        {
            QualitySettings.currentLevel = QualityLevel.Good;
            Quality = Run_Quality.GOOD;
        }
#elif UNITY_IOS
        if (mem <= 1100)
        {
            QualitySettings.currentLevel = QualityLevel.Fastest;
            Quality = Run_Quality.POOL;
        }
        else
        {
            QualitySettings.currentLevel = QualityLevel.Good;
            Quality = Run_Quality.GOOD;
        }
#elif UNITY_ANDROID
        if (mem <= 3300)
        {
            QualitySettings.currentLevel = QualityLevel.Fastest;
            Quality = Run_Quality.POOL;
        }
        else
        {
            QualitySettings.currentLevel = QualityLevel.Good;
            Quality = Run_Quality.GOOD;
        }
#else
#endif
        Debug.Log("Quality :" + Quality);
        cameraBackAxisPosition = Vector3.zero;
        cameraBackAxisRotation = Vector3.zero;
        currentState           = RunState.Loading;
        currentModle           = ModleChoose.MainModel;
        Difficult_Index        = 0;
        data_list_count        = 0;
        tableCount             = 15;
        //        app_json_str = "";

        filePath = Application.persistentDataPath + "/";
#if UNITY_EDITOR
        if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.PPTPlayer || PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.WeiKePlayer)
        {
            platform = asset_platform.pc;
            fileLocalStreamingPath = "file://" + Application.streamingAssetsPath + "/";
            filePath = Application.streamingAssetsPath + "/";
        }
        else if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.demo_pc || PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.pc)
        {
            platform = asset_platform.pc;
            fileLocalStreamingPath = Application.streamingAssetsPath + "/";
            filePath = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal_unity_PC/";
        }
        else if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.plugin)
        {
            platform = asset_platform.pc;
            fileLocalStreamingPath = "file://" + Application.streamingAssetsPath + "/";
            filePath = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal/";
        }
        else
        {
            platform = asset_platform.android;
            fileLocalStreamingPath = "file://" + Application.streamingAssetsPath + "/";
        }
#elif UNITY_IOS
        platform = asset_platform.ios;
        fileLocalStreamingPath = "file://" + Application.dataPath + "/Raw/";
#elif UNITY_ANDROID
        platform = asset_platform.android;
        fileLocalStreamingPath = "jar:file://" + Application.dataPath + "!/assets/";
#elif UNITY_STANDALONE_WIN
        platform = asset_platform.pc;
        fileLocalStreamingPath = Application.streamingAssetsPath + "/";
        //filePath = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal_unity_PC/";
        if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.PPTPlayer || PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.WeiKePlayer)
        {
            filePath = Vesal_DirFiles.get_dir_from_full_path(Application.dataPath) + "PptPlayer_Data/StreamingAssets/";
        }
        else
        {
            filePath = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal_unity_PC/";
        }
        Debug.Log("UNITY_STANDALONE_WIN filePath:" + filePath);
#endif

        tempPath = filePath + "temp/";

        Vesal_DirFiles.DelFile(tempPath + "temp.dat");

        vesal_db_path     = filePath + "db/";
        sign_texture_path = filePath + "sign_texture/";
        UpdatePath        = filePath + "Update/";
        SignPath          = filePath + "Android_sign/";
        ModelPath         = filePath + "model/";
        MedicalPath       = filePath + "Mediacl/";
        xluaPath          = filePath + "Lua-HotFix/";
        TimelineFilePath  = filePath + "Anim_Timeline/";
        WeiKePlayer_path  = filePath + "microlesson/";
        Video_path        = filePath + "acu_vdo/";
        Anim_TimelinePath = filePath + "Anim_Timeline/";
        BookMarkPath      = filePath + "BookmarkFile/";
        if (Quality == Run_Quality.GOOD)
        {
            MAX_Ab_num = 15;
        }
        else
        {
            MAX_Ab_num = 10;
        }

#if UNITY_DEBUG
        // get_server_interface = "http://api.vesal.cn:8000/vesal-jiepao-prod/server?type=0";
        get_server_interface = "http://118.24.119.234:8083/vesal-jiepao-test/server?type=0";
#else
        //get_server_interface = "http://api.vesal.cn:8000/vesal-jiepao-prod/server?type=0";//正式服
        get_server_interface = "http://114.115.210.145:8083/vesal-jiepao-test/server?type=0";//测试服
#endif
        fix_server_interface = "v1/app/member/getCode";

        //server_ip = vesal_network.Vesal_Network.get_ipfromlist(get_server_interface);
        //server_test_url = server_ip + fix_server_interface;

        online_mode             = true;
        is_enter_server_control = false;
        //        isLanScaple = true;
        //        isLanScaple = true;
        DataManagerStatus = DataIntState.Null;
        is_has_app_buff   = false;
        isRotateScreen    = false;
        DebugLog.DebugLogInfo("---------------设备内存-------------------" + mem);
    }
예제 #56
0
 /// <summary>
 /// Construct a TestCaseAttribute with a three arguments
 /// </summary>
 /// <param name="arg1"></param>
 /// <param name="arg2"></param>
 /// <param name="arg3"></param>
 public TestCaseAttribute(object arg1, object arg2, object arg3)
 {
     this.runState  = RunState.Runnable;
     this.arguments = new object[] { arg1, arg2, arg3 };
 }
예제 #57
0
 public void ParametrizedTestCaseTests(string methodName, RunState expectedState)
 {
     var suite = TestBuilder.MakeParameterizedMethodSuite(optionalTestParametersFixtureType, methodName);
     var testCase = (Test)suite.Tests[0];
     Assert.That(testCase.RunState, Is.EqualTo(expectedState));
 }
예제 #58
0
파일: GameApp.cs 프로젝트: AlkanV/OpenMB
 void OnAppStateManagerStarted()
 {
     state = RunState.Running;
 }
예제 #59
0
파일: VixenSystem.cs 프로젝트: komby/vixen
 public static void Stop()
 {
     if (_state == RunState.Starting || _state == RunState.Started) {
         _state = RunState.Stopping;
         Logging.Info("Vixen System stopping...");
         ApplicationServices.ClientApplication = null;
         // Need to get the disabled devices before stopping them all.
         SaveDisabledDevices();
         Execution.CloseExecution();
         Modules.ClearRepositories();
         Queue<Task> queue = SaveSystemConfig();
         Task.WaitAll(queue.ToArray());
         _state = RunState.Stopped;
         Logging.Info("Vixen System successfully stopped.");
     }
 }
예제 #60
0
        static void Main()
        {
            using (var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole().SetMinimumLevel(LogLevel.Trace)))
            {
                var logger = loggerFactory.CreateLogger <Program>();

                var outputPath = @"../../../../../output/";
                outputPath = Path.GetFullPath(outputPath);

                var context = new MigrationContext()
                {
                    WorkingFolder = outputPath
                };

                // Paths to the MSI test files
                var msiPaths = new string[]
                {
                    @"../../../../../tests/BTS2010FlatFilePipelineSample.msi",
                    @"../../../../../tests/BTS2020SimpleMessagingApplication.msi",
                    @"../../../../../tests/BTS2020SimpleReferencedApplication.msi",
                    @"../../../../../tests/BTS2020SimplePipelineDataApplication.msi",

                    // Path to scenarios MSI
                    @"../../../../../scenarios/001-FtpPassthru/msi/Aim.FtpPassthru.msi",
                    @"../../../../../scenarios/002-XmlMapping/msi/XmlMapping.msi",
                    @"../../../../../scenarios/003-SimpleOrchestration/msi/Aim.SimpleOrchestration.msi",
                    @"../../../../../scenarios/004-HttpJsonOrch/msi/Aim.HttpJsonOrch.msi",
                };

                // New application model
                var model = new AzureIntegrationServicesModel();

                // New run state
                var state = new RunState(new RunnerConfiguration(), model);

                // Create the input criteria (paths to the MSIs)
                foreach (var path in msiPaths)
                {
                    var pathInfo = new FileInfo(path);
                    model.MigrationSource.ResourceContainers.Add(new ResourceContainer()
                    {
                        Key = pathInfo.Name, Name = pathInfo.Name, Type = ModelConstants.ResourceContainerMsi, ContainerLocation = pathInfo.FullName
                    });
                }

                // Setup the discoverers.
                var discoverers = new IBizTalkDiscoverer[]
                {
                    new MsiDiscoverer(new FileRepository(), model, context, logger),
                    new AssemblyDiscoverer(model, context, logger)
                };

                logger.LogInformation(InformationMessages.DiscoveringStarted);

                // Run the discoverers.
                foreach (var discoverer in discoverers)
                {
                    discoverer.Discover();
                }

                logger.LogInformation(InformationMessages.DiscoveringComplete);

                // Setup the parsers
                var parsers = new IBizTalkParser[]
                {
                    // Parse the application definition file
                    new ApplicationDefinitionParser(model, context, logger),
                    // Parse the application name
                    new BizTalkApplicationParser(model, context, logger),
                    // Parse the module Refs
                    new BindingFileParser(model, context, logger),
                    // Parse the send port
                    new SendPortParser(model, context, logger),
                    // Parse the Orchestration Odx contents.
                    new BizTalkOrchestrationParser(model, context, logger),
                    // Parse the send port group filters
                    new DistributionListParser(model, context, logger),
                    // Parse the pipelines
                    new BizTalkPipelineParser(model, context, logger),
                    // Parse the property schemas
                    new PropertySchemaPropertyParser(model, context, logger),
                    // Parse the document schemas
                    new DocumentSchemaParser(model, context, logger),
                    // Parse the send pipeline data
                    new SendPortPipelineDataParser(model, context, logger),
                    // Parse the receive pipeline data
                    new ReceivePortPipelineDataParser(model, context, logger),
                    // Parse the receive port
                    new ReceivePortParser(model, context, logger),
                    // Parse the transforms
                    new TransformParser(model, context, logger),
                    // Parse the pipeline components
                    new PipelineComponentParser(model, context, logger),
                    // Parse the orchestration correlation types
                    new OrchestrationCorrelationTypeParser(model, context, logger),
                    // Parse the orchestration port types
                    new OrchestrationPortTypeParser(model, context, logger),
                    // Parse the orchestration multi part message types
                    new OrchestrationMultiPartMessageTypeParser(model, context, logger),
                    // Parse the orchestration service declarations
                    new OrchestrationServiceDeclarationParser(model, context, logger)
                };

                logger.LogInformation(InformationMessages.ParsingStarted);

                foreach (var parser in parsers)
                {
                    parser.Parse();
                }

                logger.LogInformation(InformationMessages.ParsingComplete);

                var analyzers = new IBizTalkAnalyzer[]
                {
                    new DP001SchemaDependencyAnalyzer(model, context, logger),
                    new DP002TransformDependencyAnalyzer(model, context, logger),
                    new DP003OrchestrationDependencyAnalyzer(model, context, logger),
                    new DP004ApplicationDependencyAnalyzer(model, context, logger),
                    new DP005DistributionListDependencyAnalyzer(model, context, logger),
                    new DP006ParentChildDependencyAnalyzer(model, context, logger),
                    new MB001MessageBusAnalyzer(model, context, logger),
                    new AP001ApplicationAnalyzer(model, context, logger),
                    new AP002SystemApplicationAnalyzer(model, context, logger),
                    new MB002MessageBoxAnalyzer(model, context, logger),
                    new SC001SchemaAnalyzer(model, context, logger),
                    new SC002PropertySchemaAnalyzer(model, context, logger)
                };

                logger.LogInformation(InformationMessages.AnalysisStarted);

                foreach (var analyzer in analyzers)
                {
                    var task = analyzer.AnalyzeAsync(CancellationToken.None);
                    task.Wait();
                }

                logger.LogInformation(InformationMessages.AnalysisComplete);

                logger.LogInformation(InformationMessages.ReportingStarting);

                var reportWriter = new FileReportWriter();
                context.ReportFilePath = Path.Combine(context.WorkingFolder, "BizTalkMigrationReport.html");
                var reporters = new IBizTalkReporter[]
                {
                    new HtmlReportFormatter(model, context, state, reportWriter, logger)
                };

                foreach (var reporter in reporters)
                {
                    reporter.Report();
                }

                logger.LogInformation(InformationMessages.ReportingComplete);

                // Output the results
                var serializer = new JsonSerializer();
                using var writer = new StringWriter();
                serializer.Serialize(writer, model);
                File.WriteAllText(Path.Combine(context.WorkingFolder, "model.json"), writer.ToString());
            }
        }