public AlarmProcess(ProcessReceiver m) { main = m; log = new LogCls(); logMsg = new LogMessageCallback(main.setLogMessage); }
public ObserverProcess(object cls) { main = (WindClientForm)cls; isShutdown = true; myIniFile = new IniFile(@"D:\WindLidarClient.ini"); m_sourcePath = myIniFile.Read("SOURCE_PATH"); m_backupPath = myIniFile.Read("BACKUP_PATH"); m_sts_sleep_time = System.Convert.ToInt32(myIniFile.Read("STS_SLEEP_TIME")); m_file_sleep_time = System.Convert.ToInt32(myIniFile.Read("FILE_SLEEP_TIME")); m_sta_sleep_time = System.Convert.ToInt32(myIniFile.Read("STA_SLEEP_TIME")); m_alm_sleep_time = System.Convert.ToInt32(myIniFile.Read("ALM_SLEEP_TIME")); m_data1 = myIniFile.Read("DATA1"); m_data2 = myIniFile.Read("DATA2"); waitHandle = new ManualResetEvent(false); almHandle = new ManualResetEvent(false); staHandle = new ManualResetEvent(false); log = new LogMessageCallback(main.logMessage); startProgress = new StartPointCallback(main.StartPointProgress); endProgress = new EndPointCallback(main.EndPointProgress); ingProgress = new ProgressIngCallback(main.IngProgress); alarmProcess = new AlarmProcess(this); fsLog = new LogCls(); }
public static void LogDebug(LogMessageCallback callback) { if (LogWriter.HandlesLogDebug) { callback(Logger.LogDebug); } }
public static void LogAction(LogMessageCallback callback) { if (LogWriter.HandlesLogAction) { callback(Logger.LogAction); } }
public void LogMessage(string Message) { if (Message == "") { return; } if (textBoxLog.InvokeRequired) { LogMessageCallback Temp = new LogMessageCallback(LogMessage); textBoxLog.Invoke(Temp, new object[] { Message }); } else { if (textBoxLog.Text.Length + Message.Length >= textBoxLog.MaxLength) { if (TextBoxFull != null) { TextBoxFull(this, new EventArgs()); } if (AutoClearOnFull) { textBoxLog.Clear(); } } textBoxLog.AppendText(Message); if (AddLine) { textBoxLog.AppendText(Environment.NewLine); } } }
public void LogMessage(string Message, Color?c = null, byte Level = 0) { #if DEBUG if (Level > Debug_Level) { return; } if ((Level > 0) && (!IsLike(Message))) { return; } #endif if (m_rtbLogZone != null) { if (m_rtbLogZone.InvokeRequired) { LogMessageCallback d = new LogMessageCallback(LogMessage); m_rtbLogZone.Invoke(d, new object[] { Message, c, Level }); } else { if ((m_rtbLogZone != null) && (!m_rtbLogZone.IsDisposed)) { m_rtbLogZone.SelectionStart = m_rtbLogZone.TextLength; m_rtbLogZone.SelectionLength = 0; m_rtbLogZone.SelectionColor = c ?? Color.Black; m_rtbLogZone.AppendText(Message + Environment.NewLine); m_rtbLogZone.SelectionColor = m_rtbLogZone.ForeColor; m_rtbLogZone.ScrollToCaret(); } } } }
public StatusProcess(ProcessReceiver m) { main = m; log = new LogCls(); stsLog = new LogMessageCallback(main.setLogMessage); }
public static extern void install_callbacks( NotifyRealmCallback notifyRealmCallback, GetNativeSchemaCallback nativeSchemaCallback, OpenRealmCallback openCallback, OnBindingContextDestructedCallback contextDestructedCallback, LogMessageCallback logMessageCallback, NotifiableObjectHandleBase.NotificationCallback notifyObject, DictionaryHandle.KeyNotificationCallback notifyDictionary, MigrationCallback onMigration);
public static extern void install_callbacks( NotifyRealmCallback notify_realm_callback, GetNativeSchemaCallback native_schema_callback, OpenRealmCallback open_callback, OnBindingContextDestructedCallback context_destructed_callback, LogMessageCallback log_message_callback, NotifiableObjectHandleBase.NotificationCallback notify_object, DictionaryHandle.KeyNotificationCallback notify_dictionary, MigrationCallback migration_callback, ShouldCompactCallback should_compact_callback);
public void LogMessage(string message, Color color, Font font) { if (this.TextBoxLog.InvokeRequired) { LogMessageCallback CB = new LogMessageCallback(LogMessage); this.Invoke(CB, new object[] { message, color, font }); } else { TextBoxLog.AppendText(message, color, font); TextBoxLog.ScrollToCaret(); } }
/// <summary> /// Base logging method to send data and create the message only when a logWriter is attached /// </summary> /// <param name="logType">LogTypes enumeration item</param> /// <param name="callback">A delegate to create the log message.</param> public static void Log(LogMessageType logType, LogMessageCallback callback) { if (callback == null) { return; } switch (logType) { case LogMessageType.Action: Logger.LogAction(callback); break; case LogMessageType.Debug: Logger.LogDebug(callback); break; } }
public ProcessReceiver(object obj) { main = (WindLidarServer)obj; isShutdown = true; waitHandle = new ManualResetEvent(false); stsHandle = new ManualResetEvent(false); staHandle = new ManualResetEvent(false); othHandle = new ManualResetEvent(false); log = new LogMessageCallback(main.logMessage); stsMessage = new StsMessageCallback(main.stsMessage); ftsMessage = new FtsMessageCallback(main.ftsMessage); stsDB = new StsMessageDBCallback(main.stsDB); stsProcess = new StatusProcess(this); ftsProcess = new FileProcess(this); atsProcess = new FileProcess(this); othProcess = new FileProcess(this); almProcess = new AlarmProcess(this); server = null; }
public static void LogMessage(string command, params string[] list) { if (_listViewLog == null) { return; } if (_listViewLog.InvokeRequired) { LogMessageCallback cb = new LogMessageCallback(LogMessage); _listViewLog.Invoke(cb, command, list); } else { ListViewItem lvi = _listViewLog.Items.Add(command); foreach (string s in list) { lvi.SubItems.Add(s); } _listViewLog.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); _listViewLog.EnsureVisible(_listViewLog.Items.Count - 1); } }
public static extern void set_log_callback(LogMessageCallback callback, out NativeException ex);
// Add a log entry to the log text box, ensure cross-thread support, as Spokes events come in on a different thread public void LogMessage(string callingmethodname, string message) { if (!m_debugmode || eventslog == null) return; // log is not open! if (eventslog.eventLogTextBox.InvokeRequired) { LogMessageCallback d = new LogMessageCallback(LogMessage); this.Invoke(d, new object[] { callingmethodname, message }); } else { string datetime = DateTime.Now.ToString("HH:mm:ss.fff"); if (m_debugmode && eventslog != null && !eventslog.IsDisposed) { eventslog.eventLogTextBox.AppendText(String.Format("{0}: {1}(): {2}\r\n", datetime, callingmethodname, message)); eventslog.eventLogTextBox.SelectionStart = eventslog.Text.Length; //eventslog.eventLogTextBox.ScrollToCaret(); } } }
public static extern IntPtr initialize( [MarshalAs(UnmanagedType.LPWStr)] string platform, IntPtr platform_len, [MarshalAs(UnmanagedType.LPWStr)] string platform_version, IntPtr platform_version_len, [MarshalAs(UnmanagedType.LPWStr)] string sdk_version, IntPtr sdk_version_len, UserCallback user_callback, VoidTaskCallback void_callback, BsonCallback bson_callback, LogMessageCallback log_message_callback, ApiKeysCallback api_keys_callback);
public static void LogDebug(LogMessageCallback callback) { if (LogWriter.HandlesLogDebug) callback(Logger.LogDebug); }
/// <summary> /// Logs the information /// </summary> /// <param name="information"></param> public void Log(string head, string information, LogSeverity severity = LogSeverity.Information) { LogMessageCallback?.Invoke(DateTime.Now, head, information, null, severity); }
public static void LogAction(LogMessageCallback callback) { if (LogWriter.HandlesLogAction) callback(Logger.LogAction); }
/// <summary> /// Base logging method to send data and create the message only when a logWriter is attached /// </summary> /// <param name="logType">LogTypes enumeration item</param> /// <param name="callback">A delegate to create the log message.</param> public static void Log(LogMessageType logType, LogMessageCallback callback) { if (callback == null) return; switch (logType) { case LogMessageType.Action: Logger.LogAction(callback); break; case LogMessageType.Debug: Logger.LogDebug(callback); break; } }
/// <summary> /// Logs an exception to the console with detailed exception information /// </summary> /// <param name="head"></param> /// <param name="description"></param> /// <param name="date"></param> /// <param name="exception"></param> public void LogException(Exception exception, LogSeverity severity = LogSeverity.Warning) { LogMessageCallback?.Invoke(DateTime.Now, Name, "An exception has occoured", exception, severity); }
/// <summary> /// Logs an exception to the console with detailed exception information /// </summary> /// <param name="head"></param> /// <param name="description"></param> /// <param name="date"></param> /// <param name="exception"></param> public void LogException(string information, Exception exception, LogSeverity severity = LogSeverity.Warning) { LogMessageCallback?.Invoke(DateTime.Now, Name, information, exception, severity); }
public static extern void install_callbacks( NotifyRealmCallback notifyRealmCallback, GetNativeSchemaCallback nativeSchemaCallback, OpenRealmCallback openCallback, OnBindingContextDestructedCallback contextDestructedCallback, LogMessageCallback logMessageCallback);