protected string ToDebuggerDisplayString() { var text = CaptureDeviceName; if (text.Length > 0) { text += "/"; } text += CaptureTime.ToString(); text += "/"; if (Content is PTRBMP ptrBmp) { text += ptrBmp.Info.ToDebuggerDisplayString(); } else if (Content is BitmapInfo.ISource bmpNfo) { text += bmpNfo.Info.ToDebuggerDisplayString(); } else { text += Content?.ToString() ?? "<NULL>"; } return(text); }
void IGXDLMSBase.Save(GXXmlWriter writer) { if (ChangedParameter != null && ChangedParameter.Target != null) { writer.WriteStartElement("ChangedParameter"); writer.WriteElementString("Type", (int)ChangedParameter.Target.ObjectType); writer.WriteElementString("LN", ChangedParameter.Target.LogicalName); writer.WriteElementString("Index", ChangedParameter.AttributeIndex); writer.WriteElementObject("Value", ChangedParameter.Value); writer.WriteEndElement(); } if (CaptureTime != null && CaptureTime != DateTime.MinValue) { writer.WriteElementString("Time", CaptureTime.ToString(CultureInfo.InvariantCulture)); } if (Parameters != null && Parameters.Count != 0) { writer.WriteStartElement("Parameters"); foreach (GXDLMSTarget it in Parameters) { writer.WriteStartElement("Item"); writer.WriteElementString("Type", (int)it.Target.ObjectType); writer.WriteElementString("LN", it.Target.LogicalName); writer.WriteElementString("Index", it.AttributeIndex); writer.WriteEndElement(); } writer.WriteEndElement(); } }
/// <summary> /// This will start the thread from running. /// </summary> public void Start() { _pauseEvent = new ManualResetEvent(true); _shutdownEvent = new ManualResetEvent(false); Started = true; Capturing = true; CaptureTime.Restart(); _thread = new Thread(DoCapture); _thread.Start(); frames = 0; }
/// <summary> /// This will completely stop the running thread. It will allow for the currently paused /// thread to resume again. It will allow the current thread to finish a loop around before stopping. /// </summary> public void Stop() { if (started) { CaptureTime.Stop(); // Signal the shutdown event _shutdownEvent.Set(); // Make sure to resume any paused threads _pauseEvent.Set(); // Wait for the thread to exit _thread.Join(); Started = false; Capturing = false; } }
public override string ToString() { if (Source == InputSourceData.InputSource.Override) { return(String.Format("{0}:{1}", Source, CaptureTime.ToString())); } else if (Source == InputSourceData.InputSource.Bloomberg) { return(String.Format("{0}:{1}:{2}", Source, CaptureTime.ToString(), BBData.ToString())); } else if (Source == InputSourceData.InputSource.Missing) { return("MISSING"); } else { return(base.ToString()); } }
/// <summary> /// Used to restart the thread when it has been paused by the Pause function. /// </summary> public void Resume() { Capturing = true; CaptureTime.Start(); _pauseEvent.Set(); }
/// <summary> /// This will pause the thread from running. It can be resumed by using Resume function. /// </summary> public void Pause() { Capturing = false; CaptureTime.Stop(); _pauseEvent.Reset(); }
public override XmlNode Save(XmlDocument doc) { XmlNode nameNode = doc.CreateElement("bulbcapture"); nameNode.Attributes.Append(ScriptManager.CreateAttribute(doc, "capturetime", CaptureTime.ToString())); nameNode.Attributes.Append(ScriptManager.CreateAttribute(doc, "iso", Iso)); nameNode.Attributes.Append(ScriptManager.CreateAttribute(doc, "aperture", Aperture)); return(nameNode); }
public override string ToString() { return(String.Format("{0}:{1}", Source, CaptureTime.ToString())); }
public override string ToString() { return ($"Date: {CaptureTime.ToString("dd/MM/yyyy")}\nDevice: {TheDevice.SeriesNumber}. \n - Exposition: {Exposition.ToString("0.00")} - Temperature: {Temperature}\n"); }