public override void Bad(string tagged_text, DebugMode mode) { if (mode <= DebugMode.MINIMAL) { SysConsole.Output(OutputType.WARNING, Syst.TagSystem.ParseTagsFromText(tagged_text, "^r^3", new Dictionary<string, TemplateObject>(), mode, (o) => { throw new Exception(o); }, true)); } }
public UtilityHtmlExtensionsTester() { NothingInQueryString = new DebugMode { QueryString = new NameValueCollection(), Cookies = new HttpCookieCollection(), Expected = false }; BlankInQueryString = new DebugMode { QueryString = new NameValueCollection { { "debug", null } }, Cookies = new HttpCookieCollection(), Expected = false }; ZeroInQueryString = new DebugMode { QueryString = new NameValueCollection { { "debug", "0" } }, Cookies = new HttpCookieCollection(), Expected = false }; OneInQueryString = new DebugMode { QueryString = new NameValueCollection { { "debug", "1" } }, Cookies = new HttpCookieCollection(), Expected = true }; JunkInCookies = new DebugMode { QueryString = new NameValueCollection(), Cookies = new HttpCookieCollection { new HttpCookie("foo") }, Expected = false }; ZeroInCookies = new DebugMode { QueryString = new NameValueCollection(), Cookies = new HttpCookieCollection { new HttpCookie("debug", "0") }, Expected = false }; ExpiredCookieButOne = new DebugMode { QueryString = new NameValueCollection(), Cookies = new HttpCookieCollection { new HttpCookie("debug", "1") { Expires = DateTime.UtcNow.AddDays(-1) } }, Expected = false }; NotExpiredZeroInCookies = new DebugMode { QueryString = new NameValueCollection(), Cookies = new HttpCookieCollection { new HttpCookie("debug", "0") { Expires = DateTime.UtcNow.AddDays(1) } }, Expected = false }; NotExpiredOneInCookies = new DebugMode { QueryString = new NameValueCollection(), Cookies = new HttpCookieCollection { new HttpCookie("debug", "1") { Expires = DateTime.UtcNow.AddDays(1) } }, Expected = true }; }
public void IsInDebugMode_ShouldBeCorrect(DebugMode data) { _mockRequest.Expect(r => r.QueryString).Return(data.QueryString); _mockRequest.Expect(r => r.Cookies).Return(data.Cookies); Assert.AreEqual(data.Expected, _html.IsInDebugMode()); }
public static void WriteNumber(string label, double value, DebugMode Debug) { if (Global.DMode >= Debug) { SmartDashboard.PutNumber(label, value); if (Global.DisplayConsoleOutput) Console.WriteLine(label + " : " + value); } }
public static void WriteBool(string label, bool value, DebugMode Debug) { if(Global.DMode >= Debug) { SmartDashboard.PutBoolean(label, value); if (Global.DisplayConsoleOutput) Console.WriteLine(label + " : " + value); } }
/// <summary> /// Creates a DebugSession against a process, optionally pausing and/or controlling the process for the lifetime of the session. /// </summary> /// <remarks> /// First verifies that the target process's architecture matches this process, throwing a Requires32/64BitEnvironmentException as necessary. /// </remarks> /// <param name="process"></param> /// <param name="mode"></param> /// <returns></returns> public static DebugSession Create(IProcessInfo process, DebugMode mode = DebugMode.Observe) { process.Architecture.AssertMatchesCurrent(); // Create the data target. This tells us the versions of CLR loaded in the target process. var dataTarget = AttachWithMode(process, mode); return(new DebugSession(dataTarget)); }
private void InitializeDebugMode() { var modeArray = new DBGMODE[1]; Marshal.ThrowExceptionForHR(this.Debugger.GetMode(modeArray)); _debugMode = ConvertDebugMode(modeArray[0]); OnDebugModeChanged(); }
internal static void AddDebugMode(string name, string description, bool isEnabled = false) { debugModes[name] = new DebugMode() { Name = name, Description = description, IsEnabled = isEnabled }; }
private static void AddDebugMode(string name, string description) { debugModes[name] = new DebugMode() { Name = name, Description = description, IsEnabled = false }; }
public static IServiceDebugInfoModel CreateServiceDebugInfoModel(IContextualResourceModel resourceModel, string serviceInputData, DebugMode debugSetting) { IServiceDebugInfoModel serviceDebugInfoModel = new ServiceDebugInfoModel(); serviceDebugInfoModel.ResourceModel = resourceModel; serviceDebugInfoModel.DebugModeSetting = debugSetting; serviceDebugInfoModel.ServiceInputData = serviceInputData; serviceDebugInfoModel.RememberInputs = true; return serviceDebugInfoModel; }
public void OnDebugModeChange() { NowDebugMode++; if (DebugMode.Draw < NowDebugMode) { NowDebugMode = DebugMode.Normal; } DebugModeButtonText.GetComponent <Text> ().text = NowDebugModeText(); }
void Start() { debugMode = DebugMode.DBG_NONE; if (isBuilt && Application.isPlaying) { m_indirectCoroutine = StartCoroutine(UpdateIndirectTexture(true)); } }
/// <summary> /// Creates a DebugSession against a process, optionally pausing and/or controlling the process for the lifetime of the session. /// </summary> /// <remarks> /// First verifies that the target process's architecture matches this process, throwing a Requires32/64BitEnvironmentException as necessary. /// </remarks> /// <param name="process"></param> /// <param name="mode"></param> /// <returns></returns> public static DebugSession Create(IProcessInfo process, DebugMode mode = DebugMode.Observe) { process.Architecture.AssertMatchesCurrent(); // Create the data target. This tells us the versions of CLR loaded in the target process. var dataTarget = AttachWithMode(process, mode); return new DebugSession(dataTarget); }
private void tsbStepOut_Click(object sender, EventArgs e) { if (!this.IsRuning) { return; } m_debugMode = DebugMode.StepOut; ExecuteStep(); }
public override int GetHashCode() { var hash = 11; hash = (hash * 7) + InputFile.GetHashCode(); hash = (hash * 7) + Parser.GetHashCode(); hash = (hash * 7) + DebugMode.GetHashCode(); hash = (hash * 7) + CoverallsRepoToken.GetHashCode(); return(hash); }
private void LoadDataFromFile(string path) { if (string.IsNullOrEmpty(path)) { return; } if (File.Exists(path)) { MainForm.targetAVMPath = path; var bytes = File.ReadAllBytes(path); var mapFileName = path.Replace(".avm", ".neomap"); debugMode = DebugMode.Assembly; sourceLanguage = SourceLanguageKind.Other; if (File.Exists(mapFileName)) { map = new NeoMapFile(); map.LoadFromFile(mapFileName); } else { map = null; } this.debugger = new NeoDebugger(bytes); this.avm_asm = NeoDisassembler.Disassemble(bytes); if (map != null && map.Entries.Any()) { var srcFile = map.Entries.FirstOrDefault().url; FileName.Text = srcFile; sourceLanguage = LanguageSupport.DetectLanguage(srcFile); debugMode = DebugMode.Source; debugContent[DebugMode.Source] = File.ReadAllText(srcFile); } debugContent[DebugMode.Assembly] = avm_asm.ToString(); FileName.Text = Path.GetFileName(path); ReloadTextArea(); StorageLoad(); UpdateSourceViewMenus(); shouldReset = true; } }
/// <summary> /// Map the watch identifiers listed in <paramref name="watchElementList"/> to the watch element array monitored by the target hardware. /// </summary> /// <remarks> The number of watch identifiers in the list must not exceed <c>WatchSize</c>.</remarks> /// <param name="watchElementList">The list containing the watch identifiers that are to be mapped to each element of the watch element array. /// </param> /// <exception cref="CommunicationException">Thrown if the error code returned from the call to the PTUDLL32.SetWatchElements() method is not /// CommunicationError.Success.</exception> public void SetWatchElements(List <short> watchElementList) { Debug.Assert(m_SetWatchElements != null, "CommunicationWatch.SetWatchElements() - [m_SetWatchElementDelegates != null]"); Debug.Assert(m_MutexCommuncationInterface != null, "CommunicationWatch.SetWatchElements() - [m_MutexCommuncationInterface != null]"); // Skip, if the parameter isn't defined. if (watchElementList == null) { return; } Debug.Assert(watchElementList.Count <= Parameter.WatchSize, "CommunicationWatch.SetWatchElements - [watchElementList.Count <= Parameter.WatchSize]"); short[] watchElements = new short[Parameter.WatchSize]; Array.Copy(watchElementList.ToArray(), watchElements, watchElementList.Count); // Send the mapping to the target hardware. CommunicationError errorCode = CommunicationError.UnknownError; try { m_MutexCommuncationInterface.WaitOne(DefaultMutexWaitDurationMs, false); errorCode = (CommunicationError)m_SetWatchElements(watchElements); } catch (Exception) { errorCode = CommunicationError.SystemException; throw new CommunicationException(Resources.EMSetWatchElementsFailed, errorCode); } finally { m_MutexCommuncationInterface.ReleaseMutex(); } if (DebugMode.Enabled == true) { DebugMode.SetWatchElements_t setWatchElements = new DebugMode.SetWatchElements_t(watchElements, errorCode); DebugMode.Write(setWatchElements.ToXML()); } if (errorCode != CommunicationError.Success) { throw new CommunicationException(Resources.EMSetWatchElementsFailed, errorCode); } // Keep a record up the new mapping beween the each element index and the watch identifier. for (short elementIndex = 0; elementIndex < Parameter.WatchSize; elementIndex++) { m_WatchElements[elementIndex].WatchIdentifier = watchElements[elementIndex]; // Required to map between the watch identifier and the element index. m_WatchElements[elementIndex].ElementIndex = elementIndex; } }
private void InitializeSingleton() { if (Singleton != null && Singleton != this) { Destroy(this); } else { Singleton = this; } }
public void ToggleDebugMode() { if (_mode == DebugMode.Assembly) { _mode = DebugMode.Source; } else { _mode = DebugMode.Assembly; } }
/*public string getAstErrors(string sourceCode) * { * return new Ast_CSharp(sourceCode).Errors; * }*/ public string createCSharpCodeWith_Class_Method_WithMethodText(string code) { var parsedCode = TextToCodeMappings.tryToFixRawCode(code, tryToCreateCSharpCodeWith_Class_Method_WithMethodText); if (parsedCode == null) { DebugMode.ifError("Ast parsing Failed"); this.invoke(onAstFail); } return(parsedCode); }
public ActionResult Login() { if (User.Identity.IsAuthenticated) { return(RedirectToAction("Index", "Home")); } return(View(DebugMode != null ? new LoginRequest() { UserName = DebugMode.ToString() } : new LoginRequest())); }
public void DebugAlert(DebugMode flag, String msg) { if (!DebugFlag.Contains(flag)) { return; } foreach (InputHandler ih in InputHandlers.Values) { ih.Bridge.DebugAlert(flag.ToString() + ": " + msg); } }
public static void GetScreenShot(Action <Sprite> sprite) { DebugMode.Log(" GetScreenShot"); string path = "file://" + screenshotPath; #if UNITY_EDITOR path = "file:///" + screenshotPath; #endif instance.StartCoroutine(FileExtend.DOLoadSprite(path, sprite)); }
internal HartEnvironment(Architecture architecture, IRegister register, IMemory memory, ICsrRegister csrRegister) { this.architecture = architecture; this.register = register; this.csrRegister = csrRegister; this.memory = memory; debugMode = DebugMode.Disabled; common = new Common(); currentState = State.Init; }
/// <summary>Constructs the tag information container.</summary> /// <param name="_system">The command system to use.</param> /// <param name="_vars">The variable argument pieces.</param> /// <param name="_bits">The tag bits.</param> /// <param name="_basecolor">The default color to use for output.</param> /// <param name="_mode">What debug mode to use.</param> /// <param name="_error">What to invoke if there is an error.</param> /// <param name="fallback">What to fall back to if the tag returns null.</param> /// <param name="_runnable">The relevant command runnable, if any.</param> public TagData(TagHandler _system, Argument[] _vars, TagBit[] _bits, string _basecolor, DebugMode _mode, Action <string> _error, Argument fallback, CompiledCommandRunnable _runnable) { TagSystem = _system; BaseColor = _basecolor ?? TextStyle.Simple; DBMode = _mode; ErrorHandler = _error; Fallback = fallback; Variables = _vars; Bits = _bits; Runnable = _runnable; ErrorAction = ErrorNoReturn; }
static void Main(string[] args) { DebugMode debugMode = DebugMode.CHECK_TCP_IP; byte debugByte; string debugString; Console.WriteLine("myDirection = {0}", debugMode); debugByte = (byte)debugMode; debugString = Convert.ToString(debugMode); Console.WriteLine("byte equivalent = {0}", debugByte); Console.WriteLine("string equivalent = {0}", debugString); }
public Juliet(DebugMode mode) { JulietLogger.DebugMode = mode; JulietLogger.Info(TAG, "Create Juliet API"); // Create instance to use API GameObject api = new GameObject(API_JULIET); api.AddComponent <JulietAPI>(); api.name = API_JULIET; }
public void SetDebugMode( DebugMode mode, float gridSize ) { _jsRuntime.InvokeVoid( _p5InvokeFunction, "debugMode", DebugModeToString(mode), gridSize ); }
/// <summary> /// Initializes a new instance of the <see cref="SkeletalRenderer" /> class. /// </summary> /// <param name="layerType">Type of the layer.</param> /// <param name="samplerMode">The sampler mode.</param> public SkeletalRenderer(Type layerType, AddressMode samplerMode = AddressMode.LinearClamp) : base("SkeletalRenderer" + instances++, layerType) { this.Transform2D = null; this.samplerMode = samplerMode; this.material = new BasicMaterial2D() { LayerType = layerType, SamplerMode = this.samplerMode }; this.position = new Vector2(); this.scale = new Vector2(1); this.ActualDebugMode = DebugMode.Bones; }
public static void Affichage() { foreach (GameObject go in Global.Entities.OrderBy(x => x.Layer)) { CDrawable drawable = go.GetComponent <CDrawable>(); if (drawable != null) { drawable.Draw(); } } DebugMode.Update(); }
private void SetupDebugMode(Material material, DebugMode debugMode) { switch (debugMode) { case DebugMode.None: SetKeyword(material, "MTOON_DEBUG_NORMAL", false); break; case DebugMode.Normal: SetKeyword(material, "MTOON_DEBUG_NORMAL", true); break; } }
public override int GetHashCode() { var hash = 11; foreach (string inputFile in InputFiles) { hash = (hash * 7) + inputFile.GetHashCode(); } hash = (hash * 7) + Parser.GetHashCode(); hash = (hash * 7) + DebugMode.GetHashCode(); hash = (hash * 7) + CoverallsRepoToken.GetHashCode(); return(hash); }
/// <summary> /// Retrieve the watch elements from the target hardware. /// </summary> /// <remarks>The watch elements are the watch values that are being monitored by the target hardware as defined by the /// <c>SetWatchElements()> method.</c></remarks> /// <returns>The retrieved watch element table, if successful; otherwise, null.</returns> /// <exception cref="CommunicationException">Thrown if the error code returned from the call to the VcuCommunication32/VcuCommunication64 /// UpdateElements() method is not CommunicationError.Success.</exception> public WatchElement_t[] UpdateWatchElements(bool forceUpdate) { Debug.Assert(m_UpdateWatchElements != null, "CommunicationWatch.UpdateWatchElements() - [m_UpdateWatchElementsDelegate != null]"); Debug.Assert(m_MutexCommuncationInterface != null, "CommunicationWatch.UpdateWatchElements() - [m_MutexCommuncationInterface != null]"); WatchElement_t[] watchElements = new WatchElement_t[Parameter.WatchSize]; double[] watchValues = new double[Parameter.WatchSize]; short[] watchDataTypes = new short[Parameter.WatchSize]; short forceUpdateAsShort = (forceUpdate == true) ? ForceUpdateTrue : ForceUpdateFalse; CommunicationError errorCode = CommunicationError.UnknownError; try { m_MutexCommuncationInterface.WaitOne(DefaultMutexWaitDurationMs, false); errorCode = (CommunicationError)m_UpdateWatchElements(forceUpdateAsShort, watchValues, watchDataTypes); } catch (Exception) { errorCode = CommunicationError.SystemException; throw new CommunicationException(Resources.EMUpdateWatchElementsFailed, errorCode); } finally { m_MutexCommuncationInterface.ReleaseMutex(); } if (DebugMode.Enabled == true) { DebugMode.UpdateWatchElements_t updateWatchElements = new DebugMode.UpdateWatchElements_t(forceUpdateAsShort, watchValues, watchDataTypes, errorCode); DebugMode.Write(updateWatchElements.ToXML()); } if (errorCode != CommunicationError.Success) { throw new CommunicationException(Resources.EMUpdateWatchElementsFailed, errorCode); } // Map the values retrieved from the target hardware into the watch element table. for (short elementIndex = 0; elementIndex < Parameter.WatchSize; elementIndex++) { watchElements[elementIndex] = new WatchElement_t(); watchElements[elementIndex].Value = watchValues[elementIndex]; watchElements[elementIndex].DataType = watchDataTypes[elementIndex]; watchElements[elementIndex].WatchIdentifier = m_WatchElements[elementIndex].WatchIdentifier; watchElements[elementIndex].ElementIndex = elementIndex; } return(watchElements); }
private void Generate(string projectPath, DebugMode debugMode) { try { //Create the generator var generator = new EmbeddedCodeGenerator(); //Get the project model var project = GetModel(); project.GenerationOptions.DebugMode = debugMode; string documentationFullPath = string.Empty; if (!string.IsNullOrWhiteSpace(GenerationOptions.DocumentationFolder)) { var directory = Path.Combine(projectPath, GenerationOptions.DocumentationFolder ?? string.Empty); Directory.CreateDirectory(directory); documentationFullPath = Path.Combine(directory, DocumentationFileName); new MarkdownGenerator().Generate(project.StateMachines.ToList(), documentationFullPath); } //Massage it real nice like project.Massage(); try { //Generate. Do it now. generator.Generate(project, projectPath); } catch (Exception ex) { string errorMessage = "\nException during code generation: " + ex.Message; if (!string.IsNullOrWhiteSpace(documentationFullPath)) { AppendTextToFile(documentationFullPath, errorMessage); } MessageBox.Show(errorMessage); } } catch (Exception ex) { _messageBoxService.Show(ex); } }
private void toggleDebug() { if (Input.GetKey(KeyCode.D)) { if (deBugMode == DebugMode.on) { deBugMode = DebugMode.off; } else { deBugMode = DebugMode.on; } } }
private static DataTarget AttachWithMode(IProcessInfo process, DebugMode mode) { switch (mode) { case DebugMode.Snapshot: return(DataTarget.AttachToProcess(process.Pid, 0, AttachFlag.NonInvasive)); // This takes some time. Specifying a timeout of 0 appears to always fail. case DebugMode.Control: return(DataTarget.AttachToProcess(process.Pid, 5000, AttachFlag.Invasive)); case DebugMode.Observe: default: return(DataTarget.AttachToProcess(process.Pid, 0, AttachFlag.Passive)); } }
private static DataTarget AttachWithMode(IProcessInfo process, DebugMode mode) { switch(mode) { case DebugMode.Snapshot: return DataTarget.AttachToProcess(process.Pid, 0, AttachFlag.NonInvasive); // This takes some time. Specifying a timeout of 0 appears to always fail. case DebugMode.Control: return DataTarget.AttachToProcess(process.Pid, 5000, AttachFlag.Invasive); case DebugMode.Observe: default: return DataTarget.AttachToProcess(process.Pid, 0, AttachFlag.Passive); } }
public CoresLibOptions(CoresMode mode, string appName, DebugMode defaultDebugMode = DebugMode.Debug, bool defaultPrintStatToConsole = false, bool defaultRecordLeakFullStack = false) { this.DebugMode = defaultDebugMode; this.PrintStatToConsole = defaultPrintStatToConsole; this.RecordLeakFullStack = defaultRecordLeakFullStack; this.Mode = mode; this.AppName = appName._NonNullTrim(); if (this.AppName._IsEmpty()) { throw new ArgumentNullException("AppName"); } }
public void ChangeDebugMode(DebugMode mode) { gm.cm.terrainGenerator.debugHeightmap = false; gm.cm.terrainGenerator.debugRmin = false; gm.cm.terrainGenerator.debugRmax = false; gm.cm.terrainGenerator.debugNoise = false; if(mode == DebugMode.heightmap) gm.cm.terrainGenerator.debugHeightmap = true; else if (mode == DebugMode.rMin) gm.cm.terrainGenerator.debugRmin = true; else if (mode == DebugMode.rMax) gm.cm.terrainGenerator.debugRmax = true; else if (mode == DebugMode.noise) gm.cm.terrainGenerator.debugNoise = true; }
void Awake() { debugMode = DebugMode.DBG_HAIR_NONE; gameObject.layer = sourceRenderer.gameObject.layer; if(sourceRenderer is MeshRenderer) m_sourceMesh = ((MeshRenderer)sourceRenderer).GetComponent<MeshFilter>().sharedMesh; else if(sourceRenderer is SkinnedMeshRenderer) m_sourceMesh = ((SkinnedMeshRenderer)sourceRenderer).sharedMesh; else Debug.LogError("Invalid source renderer type"); CreateMeshData(); CreateMaterials(); UpdateMaterials(); UpdateKeywords(); SelectMesh(); }
public void Setup( Renderer rend ){ debugMode = DebugMode.DBG_HAIR_NONE; sourceRenderer = rend; if(sourceRenderer != null){ gameObject.layer = sourceRenderer.gameObject.layer; if(sourceRenderer is MeshRenderer) m_sourceMesh = ((MeshRenderer)sourceRenderer).GetComponent<MeshFilter>().sharedMesh; else if(sourceRenderer is SkinnedMeshRenderer) m_sourceMesh = ((SkinnedMeshRenderer)sourceRenderer).sharedMesh; else Debug.LogError("Invalid source renderer type"); CreateMeshData(); CreateMaterials(); UpdateMaterials(); UpdateKeywords(); SelectMesh(); hasSetup = true; } }
/// <summary> /// Applies a determination string to the event. /// </summary> /// <param name="determ">What was determined.</param> /// <param name="determLow">A lowercase copy of the determination.</param> /// <param name="mode">What debugmode to use.</param> public virtual void ApplyDetermination(string determ, string determLow, DebugMode mode) { if (Cancellable) { switch (determLow) { case "cancelled:true": case "cancelled": Cancelled = true; break; case "cancelled:false": Cancelled = false; break; default: System.Output.Bad("Unknown determination '<{color.emphasis}>" + TagParser.Escape(determ) + "<{color.base}>'.", mode); break; } } else { System.Output.Bad("Unknown determination '<{color.emphasis}>" + TagParser.Escape(determ) + "<{color.base}>'.", mode); } }
/// <summary> /// Constructs the tag information container. /// </summary> /// <param name="_system">The command system to use.</param> /// <param name="_input">The input tag pieces.</param> /// <param name="_basecolor">The default color to use for output.</param> /// <param name="_vars">Any variables involved in the queue.</param> /// <param name="_mode">What debug mode to use.</param> public TagData(TagParser _system, List<string> _input, string _basecolor, Dictionary<string, TemplateObject> _vars, DebugMode _mode) { TagSystem = _system; Input = _input; BaseColor = _basecolor; Variables = _vars; mode = _mode; Modifiers = new List<string>(); for (int x = 0; x < Input.Count; x++) { Input[x] = Input[x].Replace("&dot", ".").Replace("&", "&"); if (Input[x].Length > 1 && Input[x].Contains('[') && Input[x][Input[x].Length - 1] == ']') { int index = Input[x].IndexOf('['); Modifiers.Add(Input[x].Substring(index + 1, Input[x].Length - (index + 2))); Input[x] = Input[x].Substring(0, index).ToLower(); } else { Input[x] = Input[x].ToLower(); Modifiers.Add(""); } } }
/// <summary> /// 开始调试脚本 /// </summary> private void StartDebug(DebugMode currentDebugMode) { // 检查调试文件是否都已经存在 if (!CheckDebugFileReady()) { MessageBox.Show("请先确定调试文件都已经正确挂接!", "开始调试", MessageBoxButtons.OK, MessageBoxIcon.Information); SettingForm sForm = new SettingForm(); sForm.CurrentUpdateScriptFont = new SettingForm.UpdateScriptFont(UpdateScriptFont); sForm.CurrentUpdateScriptForeColor = new SettingForm.UpdateScriptForeColor(UpdateScriptForeColor); sForm.ShowDialog(); return; } // 检查调试模式是否变更过 if (debugMode != DebugMode.None && debugMode != currentDebugMode) { switch (currentDebugMode) { case DebugMode.Client: { if (Helper.CheckProcessExist("JX3Client", false)) { MessageBox.Show("从服务端脚本切换到客户端脚本调试时,需要修改挂接文件,请先关闭JX3Client.exe!", "开始调试", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } break; } case DebugMode.Server: { if (Helper.CheckProcessExist("SO3GameServer", false)) { MessageBox.Show("从客户端脚本切换到服务端脚本调试时,需要修改挂接文件,请先关闭JX3Client.exe!", "开始调试", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } break; } } } // 挂接调试文件 switch (currentDebugMode) { case DebugMode.Client: { DetachServerDebugFile(); if (!AttachClientDebugFile()) { return; } break; } case DebugMode.Server: { DetachClientDebugFile(); if (!AttachServerDebugFile()) { return; } break; } } debugMode = currentDebugMode; PrintOutputText("开始调试脚本..."); networkManager = NetworkManager.GetNetworkManager(); networkManager.BeginReceiveUdpMessage(); PrintOutputText("开始等待响应调试请求..."); StartDebugWaitTimer(Helper.BreakPointWaitCircle, DebugState.WaitStartDebugActivated); }
protected PhpAssemblyBuilder(PhpAssembly/*!*/ assembly, AssemblyName assemblyName, string moduleName, string directory, string fileName, AssemblyKinds kind, ICollection<ResourceFileReference> resources, DebugMode debug, bool force32bit, bool saveOnlyAssembly, Win32IconResource icon) : base(assembly) { this.kind = kind; this.debuggable = debug; this.Force32Bit = force32bit; this.fileName = fileName; this.directory = directory; this.icon = icon; this.resources = resources; #if SILVERLIGHT AssemblyBuilder assembly_builder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); ModuleBuilder module_builder = (ModuleBuilder)assembly_builder.ManifestModule; // SILVERLIGHT: hack? http://silverlight.org/forums/p/1444/3919.aspx#3919 #else AssemblyBuilder assembly_builder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, saveOnlyAssembly ? AssemblyBuilderAccess.Save : AssemblyBuilderAccess.RunAndSave, directory); ModuleBuilder module_builder = assembly_builder.DefineDynamicModule(moduleName, fileName, debug != DebugMode.None); #endif DefineGlobalType(module_builder); assembly.WriteUp(module_builder, Path.Combine(directory, fileName)); // TODO: Combine can be avoided (pass path instead of directory + fileName) }
/// <summary> /// Creates an instance of of multi-script assembly builder. /// </summary> /// <param name="applicationContext">Application context.</param> /// <param name="assemblyName">Name of the assembly.</param> /// <param name="directory">Directory where assembly will be stored.</param> /// <param name="fileName">Name of the assembly file including an extension.</param> /// <param name="kind">Assembly file kind.</param> /// <param name="debug">Whether to include debug information.</param> /// <param name="force32bit">Whether to force 32bit execution of generated assembly.</param> /// <param name="entryPoint">Entry point.</param> /// <param name="icon">Icon.</param> /// <param name="resources">Resources to embed</param> public MultiScriptAssemblyBuilder(ApplicationContext/*!*/ applicationContext, AssemblyName assemblyName, string directory, string fileName, AssemblyKinds kind, ICollection<ResourceFileReference> resources, DebugMode debug, bool force32bit, Win32IconResource icon, PhpSourceFile entryPoint) : base(new MultiScriptAssembly(applicationContext), assemblyName, directory, fileName, kind, resources, debug, force32bit, false, icon) { this.entryPoint = entryPoint; }
/// <summary> /// Creates an instance of of single-script assembly builder (without resources). /// </summary> /// <param name="applicationContext">Application context.</param> /// <param name="assemblyName">Name of the assembly.</param> /// <param name="directory">Directory where assembly will be stored.</param> /// <param name="fileName">Name of the assembly file including an extension.</param> /// <param name="kind">Assembly kind.</param> /// <param name="debug">Whether to include debug information.</param> /// <param name="force32bit">Whether to force 32bit execution of generated assembly.</param> /// <param name="saveOnlyAssembly">Whether to not load the assembly into memory.</param> /// <param name="icon">Icon resource or a <B>null</B> reference.</param> public SingleScriptAssemblyBuilder(ApplicationContext/*!*/ applicationContext, AssemblyName assemblyName, string directory, string fileName, AssemblyKinds kind, DebugMode debug, bool force32bit, bool saveOnlyAssembly, Win32IconResource icon) : base(new SingleScriptAssembly(applicationContext), assemblyName, directory, fileName, kind, null, debug, force32bit, saveOnlyAssembly, icon) { }
protected ScriptAssemblyBuilder(ScriptAssembly/*!*/ assembly, AssemblyName assemblyName, string directory, string fileName, AssemblyKinds kind, ICollection<ResourceFileReference> resources, DebugMode debug, bool force32bit, bool saveOnlyAssembly, Win32IconResource icon) : base(assembly, assemblyName, ScriptAssembly.RealModuleName, directory, fileName, kind,resources, debug, force32bit, saveOnlyAssembly, icon) { }
/// <summary> /// Main Timer Tick Event Handler. /// It Fires the new firing interval and, it display the connection elapsed time and it checks the connection /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void mainTimer_Tick(object sender, EventArgs e) { long pos; double foo = 0; TimeSpan elapsed = DateTime.Now - T0; // Gets the Telescope/Dome position and plots them try { foo = _dome.Azimuth; pos = Convert.ToInt64(foo); DomePosition.Content = (360 * foo / (int)EncoderRes.Value / (int)GearRatio.Value).ToString("F6"); writeLastDomePosition(pos); } catch (Exception ex) { ErrDlg("Error getting Dome Position", ex); } //if (_dome._telescope.isConnected()) if(_dome._telescope.Connected) { //TelescopePos.Content = _dome._telescope.getAzimut(); TelescopePos.Content = _dome._telescope.Azimuth.ToString("F6"); AngleDiff.Content = (360 * foo / (int)EncoderRes.Value / (int)GearRatio.Value - _dome._telescope.Azimuth).ToString("F6"); if (_dome.Slewing) { SlewingLight.Source = new BitmapImage(new Uri(@"Images/Circle_Green.png", UriKind.Relative)); } else { SlewingLight.Source = new BitmapImage(new Uri(@"Images/Circle_Red.png", UriKind.Relative)); } } // Checks up the AVR connection and plot an error if it is found disconnected if(!_dome.Connected) //if (!((App)(System.Windows.Application.Current))._Dome_uC.GetAck()) { ConnectionStatusLabel.Content = Disconnected_Label; ErrDlg("Error: AVR disconnected", new Exception()); mainTimer.Stop(); } // Check DEBUG mode and update GUI _debugMode = _dome._arduino.get_debug_mode(); switch(_debugMode) { case Arduino.Dome.DebugMode.NO_DEBUG: DebugMode_Combo.SelectedIndex = 0; break; case Arduino.Dome.DebugMode.LIGHT_DEBUG: DebugMode_Combo.SelectedIndex = 2; break; case Arduino.Dome.DebugMode.FULL_DEBUG: DebugMode_Combo.SelectedIndex = 1; break; } // Generate Log information and update log files if(this.LogCheckBox.IsChecked == true) { string addr = "A" + LastLogLine.ToString(); string elapsedStr = string.Format("{0:00}:{1:00}:{2:00}", elapsed.Hours, elapsed.Minutes, elapsed.Seconds); _logWriter.setCell(addr, elapsedStr); // _logWriter.upDateValue(wsName, addr, elapsedStr, 0, false); addr = "B" + LastLogLine.ToString(); // _logWriter.upDateValue(wsName, addr, TelescopePos.Content.ToString(), 0, false); _logWriter.setCell(addr, TelescopePos.Content.ToString()); addr = "C" + LastLogLine.ToString(); _logWriter.setCell(addr, (360 * foo / (int)EncoderRes.Value / (int)GearRatio.Value)); // _logWriter.upDateValue(wsName, addr, Convert.ToString(360 * foo / (int)EncoderRes.Value / (int)GearRatio.Value), 0, false); addr = "D" + LastLogLine.ToString(); _logWriter.setCell(addr, AngleDiff.Content.ToString()); // _logWriter.upDateValue(wsName, addr, AngleDiff.Content.ToString(), 0, false); //int status; //switch (_status) //{ // case Status.TURN_LEFT: status = -1; break; // case Status.TURN_RIGHT: status = 1; break; // default: status = 0; break; //} string status; if (_dome.Slewing) status = "SLEWING"; else status = "STOPPED"; addr = "E" + LastLogLine.ToString(); // _logWriter.upDateValue("Dome LOG", addr, _status.ToString(), 0, false); _logWriter.setCell(addr, status.ToString()); LastLogLine++; long mod; long div = Math.DivRem((long)LastLogLine, (long)10, out mod); if (mod == 0) { try { _logWriter.Save(); } catch { } } } }
public static PhpAssemblyBuilder/*!*/ Create(ApplicationContext/*!*/ applicationContext, AssemblyKinds kind, bool pure, FullPath outPath, FullPath docPath, PhpSourceFile entryPoint, Version version, StrongNameKeyPair key, Win32IconResource icon, ICollection<ResourceFileReference> resources, DebugMode debug, bool force32bit) { string out_dir = Path.GetDirectoryName(outPath); string out_file = Path.GetFileName(outPath); AssemblyName assembly_name = new AssemblyName(); assembly_name.Name = Path.GetFileNameWithoutExtension(outPath); assembly_name.Version = version; assembly_name.KeyPair = key; if (pure) { return new PureAssemblyBuilder(applicationContext, assembly_name, out_dir, out_file, kind, resources, debug, force32bit, icon); } else { return new MultiScriptAssemblyBuilder(applicationContext, assembly_name, out_dir, out_file, kind, resources, debug, force32bit, icon, entryPoint); } }
/// <summary> /// Applies a determination string to the event. /// </summary> /// <param name="determ">What was determined.</param> /// <param name="determLow">A lowercase copy of the determination.</param> /// <param name="mode">What debugmode to use.</param> public override void ApplyDetermination(string determ, string determLow, DebugMode mode) { base.ApplyDetermination(determ, determLow, mode); }
public static bool LoadSettings(bool ErrorWhenNotFound, bool loadFile) { try { bool ReadOnly = false; _Sources.Clear(); _Subfolder = ""; _Path = GlobalData.SystemXMLFile; if (loadFile) { OpenFileDialog FB = new OpenFileDialog(); FB.Title = Translations.Get("SelectDirectoryToBackup"); FB.Filter = "XML Files (*.xml)|*.xml"; FB.FilterIndex = 0; FB.DefaultExt = "xml"; if (FB.ShowDialog() == System.Windows.Forms.DialogResult.OK) { _Path = FB.FileName; } } else { // Get the current configuration associated // with the application. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); System.Configuration.AppSettingsSection appSettings = config.AppSettings; if (appSettings.Settings["SettingsXMLFile"] != null) { _Path = appSettings.Settings["SettingsXMLFile"].Value.ToString(); } } if (System.IO.Directory.Exists(new FileInfo(_Path).DirectoryName)) { try { if (System.IO.File.Exists(_Path + ".test")) File.Delete(_Path + ".test"); using (System.IO.File.Create(_Path + ".test")) { } File.Delete(_Path + ".test"); } catch { ReadOnly = true; } } if (!System.IO.File.Exists(_Path) || ReadOnly) { if (System.IO.File.Exists(_Path)) { GlobalData.SettingsInAppData = true; } else { return false; } } BackupSource BackupSource = new BackupSource(); System.Reflection.PropertyInfo[] Properties = BackupSource.GetType().GetProperties(); try { using (XmlTextReader Rd = HelperFunctions.LoadXMLFile(_Path)) { Rd.WhitespaceHandling = WhitespaceHandling.Significant; String Temp; int TempInt; while (Rd.Read()) { if (Rd.NodeType == XmlNodeType.Element) { if (Rd.Name.StartsWith("Auto") && Rd.Name.Length > 4) { IEnumerable<System.Reflection.PropertyInfo> SelectedProperty = from Property in Properties where Property.Name == Rd.Name.Substring(4) select Property; foreach (System.Reflection.PropertyInfo Property in SelectedProperty) //Sollte nur eine sein { try { if (Property.PropertyType == typeof(List<String>)) Property.SetValue(BackupSource, new List<String>(Rd.ReadString().Split('|')), null); if (Property.PropertyType == typeof(String)) Property.SetValue(BackupSource, Rd.ReadString(), null); if (Property.PropertyType == typeof(int)) Property.SetValue(BackupSource, int.Parse(Rd.ReadString()), null); if (Property.PropertyType == typeof(long)) Property.SetValue(BackupSource, long.Parse(Rd.ReadString()), null); if (Property.PropertyType == typeof(bool)) Property.SetValue(BackupSource, bool.Parse(Rd.ReadString()), null); if (Property.PropertyType == typeof(BackupSource.Attribute)) Property.SetValue(BackupSource, (BackupSource.Attribute)int.Parse(Rd.ReadString()), null); if (Property.PropertyType == typeof(BackupSource.CopyFlag)) Property.SetValue(BackupSource, (BackupSource.CopyFlag)int.Parse(Rd.ReadString()), null); } catch (Exception ex) { HelperFunctions.ShowError(ex); } } } else { switch (Rd.Name.ToLower()) { case "language": _Language = Rd.ReadString().Trim(); break; case "smallestdriveletter": _SmallestDriveLetter = CheckDriveLetter(Rd.ReadString().Trim()); if (_SmallestDriveLetter == null) _SmallestDriveLetter = @"A:\"; break; case "biggestdriveletter": _LargestDriveLetter = CheckDriveLetter(Rd.ReadString().Trim()); if (_LargestDriveLetter == null) _LargestDriveLetter = @"Z:\"; break; case "source": if (BackupSource.SourcePath != "" && BackupSource.Name != "") _Sources.Add(BackupSource); BackupSource = new BackupSource(); break; case "subfolder": Subfolder = Rd.ReadString().Trim(); break; case "networkshare": NetworkShare = Rd.ReadString().Trim(); break; case "retries": if (int.TryParse(Rd.ReadString().Trim(), out TempInt)) _Retries = TempInt; break; case "waitbetweenretries": if (int.TryParse(Rd.ReadString().Trim(), out TempInt)) _WaitBetweenRetries = TempInt; break; case "exitafterbackup": Temp = Rd.ReadString().Trim().ToLower(); if (Temp == "1" || Temp == "true") _AutoExit = true; else _AutoExit = false; break; case "alwaysexitafterbackup": Temp = Rd.ReadString().Trim().ToLower(); if (Temp == "1" || Temp == "true") _AutoExitAlways = true; else _AutoExitAlways = false; break; case "programbeforebackup": ProgramBeforeBackup = Rd.ReadString().Trim(); break; case "argumentsprogrambeforebackup": ArgumentsProgramBeforeBackup = Rd.ReadString().Trim(); break; case "programbeforebackupadmin": Temp = Rd.ReadString().Trim().ToLower(); if (Temp == "1" || Temp == "true") ProgramBeforeBackupAdmin = true; else ProgramBeforeBackupAdmin = false; break; case "programafterbackup": ProgramAfterBackup = Rd.ReadString().Trim(); break; case "argumentsprogramafterbackup": ArgumentsProgramAfterBackup = Rd.ReadString().Trim(); break; case "programafterbackupadmin": Temp = Rd.ReadString().Trim().ToLower(); if (Temp == "1" || Temp == "true") ProgramAfterBackupAdmin = true; else ProgramAfterBackupAdmin = false; break; case "programonerror": ProgramOnError = Rd.ReadString().Trim(); break; case "argumentsprogramonerror": ArgumentsProgramOnError = Rd.ReadString().Trim(); break; case "programonerroradmin": Temp = Rd.ReadString().Trim().ToLower(); if (Temp == "1" || Temp == "true") ProgramOnErrorAdmin = true; else ProgramOnErrorAdmin = false; break; case "startmode": if (Rd.ReadString().Trim().ToLower() == "debug") _StartMode = DebugMode.Debug; break; case "incrementalbackup": Temp = Rd.ReadString().Trim().ToLower(); if (Temp == "1" || Temp == "true") _IncrementalBackup = true; else _IncrementalBackup = false; break; case "deletefilesbeforecopying": Temp = Rd.ReadString().Trim().ToLower(); if (Temp == "1" || Temp == "true") _DeleteFilesBeforeCopying = true; else _DeleteFilesBeforeCopying = false; break; case "silentmode": Temp = Rd.ReadString().Trim().ToLower(); if (Temp == "1" || Temp == "true") _SilentMode = true; else _SilentMode = false; break; } } } } } } catch (Exception ex) { HelperFunctions.ShowError("Please select a valid XML settings file. " + ex.Message); } if (BackupSource.SourcePath != "") { _Sources.Add(BackupSource); } return true; } catch (XmlException ex) { HelperFunctions.ShowError(ex.Message); } catch (Exception ex) { HelperFunctions.ShowError(ex.Message); } GlobalData.SettingsInAppData = false; return false; }
// 初期化. void Start() { // デバッグモード. NowDebugMode = DebugMode.Normal; // 勝利回数. VictoryNum = 0; // 連勝数. WinningStreak = 0; // ゲームテキストの設定. CenterText.SetActive (false); // リトライボタン. RetryButton.SetActive (false); // 勝利回数. VictoryNumPlace.SetActive (false); VictoryNumIndicator(VictoryNum, WinningStreak); // 手を非表示. Gu.GetComponent<SpriteRenderer> ().material.color = new Color (1.0f, 1.0f, 1.0f, 0.0f); Choki.GetComponent<SpriteRenderer> ().material.color = new Color (1.0f, 1.0f, 1.0f, 0.0f); Pa.GetComponent<SpriteRenderer> ().material.color = new Color (1.0f, 1.0f, 1.0f, 0.0f); EnemyGu.GetComponent<SpriteRenderer> ().material.color = new Color (1.0f, 1.0f, 1.0f, 0.0f); EnemyChoki.GetComponent<SpriteRenderer> ().material.color = new Color (1.0f, 1.0f, 1.0f, 0.0f); EnemyPa.GetComponent<SpriteRenderer> ().material.color = new Color (1.0f, 1.0f, 1.0f, 0.0f); }
public override void Good(string tagged_text, DebugMode mode) { string text = TheClient.Commands.CommandSystem.TagSystem.ParseTagsFromText(tagged_text, TextStyle.Color_Outgood, null, mode, (o) => { throw new Exception("Tag exception: " + o); }, true); UIConsole.WriteLine(TextStyle.Color_Outgood + text); }
public void OnDebugModeChange() { NowDebugMode ++; if(DebugMode.Draw < NowDebugMode) { NowDebugMode = DebugMode.Normal; } DebugModeButtonText.GetComponent<Text> ().text = NowDebugModeText (); }
public PureAssemblyBuilder(ApplicationContext/*!*/ applicationContext, AssemblyName assemblyName, string directory, string fileName, AssemblyKinds kind, ICollection<ResourceFileReference> resources, DebugMode debug, bool force32bit, Win32IconResource icon) : base(new PureAssembly(applicationContext), assemblyName, PureAssembly.ModuleName, directory, fileName, kind, resources, debug, force32bit, false, icon) { }
public override void Good(string tagged_text, DebugMode mode) { SysConsole.Output(OutputType.INFO, Syst.TagSystem.ParseTagsFromText(tagged_text, "^r^2", new Dictionary<string, TemplateObject>(), mode, (o) => { throw new Exception(o); }, true)); }
public MainWindow() { //// Force the language to english //CultureInfo culture = new CultureInfo("us-US"); //if (culture != null) //{ // Thread.CurrentThread.CurrentCulture = culture; // Thread.CurrentThread.CurrentUICulture = culture; //} //FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); InitializeComponent(); // Setting default Dome HOME position _HOME = 0.0; // Setting default slewing state _status = Status.NO_TURN; // Setting default debug mode _arduinoDebugMode = false; _debugMode = Arduino.Dome.DebugMode.NO_DEBUG; try { // // Read the Configuration file // configXml = "../../config.xml"; if (File.Exists(configXml)) { // Development Version ReadConfiguration(); } else { configXml = "config.xml"; if (File.Exists(configXml)) { // Released Version ReadConfiguration(); } } configFilename = configXml; // // Using XML for language // // UpdateDialogs(); // // Using Resources for language // UpdateGUI(); } catch (Exception ex) { ErrDlg("Error Reading Configurations\n", ex); } // Arduino COM port GUI update // // If it is AVR Bootloader help to get into the AVR user code via avrdude // if (!isArduinoBootloader) { launchAVRDude(); System.Threading.Thread.Sleep(3000); // Update the GUI for the Arduino bootloader sections ArduinoBootloader_CB.IsChecked = true; BootloaderCOM_Combo.SelectedItem = AVRBootLoader_COM; } // this.Width = 820; // this.Height = 540; //autoGroupBox.IsEnabled = isAuto; //PWM_Value = (int)PWMSlider.Value; //autoGroupBox.Visibility = Visibility.Collapsed; //autoGroupBox.IsEnabled = false; //mainGraph = new ZedGraphControl(); //foreach (string s in System.IO.Ports.SerialPort.GetPortNames()) //{ // //ComPortComboBox.Items.Add(s); // AVRCOMListBox.Items.Add(s); //} mainTimer.Interval = TimeSpan.FromSeconds(TelescopeCheckInterval_s); mainTimer.IsEnabled = true; mainTimer.Tick += mainTimer_Tick; mainTimer.Stop(); StartTime = Environment.TickCount; T0 = DateTime.Now; if (LogCheckBox.IsChecked == true) { StartLog(); _logWriter.setCell("A1", "Elapsed Time"); _logWriter.setCell("B1", "Telescope Position"); _logWriter.setCell("C1", "Dome Position"); _logWriter.setCell("D1", "Angle Diff"); _logWriter.setCell("E1", "Status"); LastLogLine++; } try { ConnectionImage.Source = new BitmapImage(new Uri(@"./images/DisconnectedImg.png", UriKind.Relative)); ConnectionImage.MinHeight = 15; // Connected_Label = Properties.Resources.StatusBar_Disconnected; Connected_Label = Dome_Control.Resources.Strings.StatusBar_Disconnected; ConnectionStatusLabel.Content = Connected_Label; //ConnectioStatusLabel.Content = Disconnected_Label; // SlewingIndicatorLabel.Content = Properties.Resources.SlewingLabel; SlewingIndicatorLabel.Content = Dome_Control.Resources.Strings.SlewingLabel; SlewingLight.Source = new BitmapImage(new Uri(@"images/Circle_Red.png", UriKind.Relative)); } catch { } // Get the Full help file name //bool found = false; //HelpPaths = new string[3] { "/Help/", "Help/", "../../Help/" }; //foreach (string s in HelpPaths) //{ // if (File.Exists(s + DefaultChm)) // { // found = true; // break; // } //} //if (!found) //{ // ErrDlg(Properties.Resources.Error_HelpFileNotFound, (Exception)null); //} }
public static WorkflowInputDataViewModel Create(IContextualResourceModel resourceModel, Guid sessionId, DebugMode debugMode) { VerifyArgument.IsNotNull("resourceModel", resourceModel); var debugInfoModel = ServiceDebugInfoModelFactory.CreateServiceDebugInfoModel(resourceModel, string.Empty, debugMode); var result = new WorkflowInputDataViewModel(debugInfoModel, sessionId); if(resourceModel != null && resourceModel.Environment != null && resourceModel.Environment.AuthorizationService != null) { result.CanDebug = resourceModel.Environment.AuthorizationService.GetResourcePermissions(resourceModel.ID).CanDebug(); } return result; }
public override void Good(string tagged_text, DebugMode mode) { string text = TheServer.Commands.CommandSystem.TagSystem.ParseTagsFromText(tagged_text, TextStyle.Color_Outgood, null, mode, (o) => { throw new Exception("Tag exception: " + o); }, true); SysConsole.Output(OutputType.INFO, TextStyle.Color_Outgood + text); }