本文整理汇总了C#中ErrorLog.Trace方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorLog.Trace方法的具体用法?C# ErrorLog.Trace怎么用?C# ErrorLog.Trace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorLog
的用法示例。
在下文中一共展示了ErrorLog.Trace方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoteConnectionServer
public RemoteConnectionServer( APPLICATION_DATA appData )
{
try
{
m_AppData = appData;
m_AppData.AddOnClosing(OnClose, APPLICATION_DATA.CLOSE_ORDER.MIDDLE);
m_Log = (ErrorLog)m_AppData.Logger;
m_FrameLock = new object();
m_FrameGenerator = (FrameGenerator)m_AppData.FrameGenerator;
m_NumberChannels = m_FrameGenerator.GetNumberOfPhysicalChannels();
m_ConsumerID = m_FrameGenerator.GetNewConsumerID();
m_CurrentImageQ = new ThreadSafeQueue<FRAME>[m_NumberChannels];
m_CurrentPlateNumberQ = new ThreadSafeQueue<FRAME>[m_NumberChannels];
m_Log = (ErrorLog)m_AppData.Logger;
m_LocalHostPortsTable = new ThreadSafeHashTable(5);
m_Server = new List<ConnectionServer>();
}
catch (Exception ex) { m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL); }
}
示例2: WatchLists
/// constructor
///
public WatchLists(APPLICATION_DATA appData)
{
try
{
// load stored data
mapURL = UserSettings.Get(UserSettingTags.GPSMAPURL);
if (mapURL == null)
mapURL = "http://maps.google.com/maps?q=";
m_AppData = appData;
m_Log = (ErrorLog)m_AppData.Logger;
m_AppData.AddOnClosing(Stop, APPLICATION_DATA.CLOSE_ORDER.MIDDLE);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.WatchList.WatchList_LastAlert].StatString.RegisterForUse(true);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.WatchList.WatchList_NumAlerts].Accumulator.RegisterForUse(true);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.WatchList.Watchlist_NumListsLoaded].Accumulator.RegisterForUse(true);
m_Stop = false;
m_NewLPRResultQ = new ThreadSafeQueue<FRAME>(60);
m_AlertsToBeGeneratedQ = new ThreadSafeQueue<FRAME>(60);
m_SettingsTags = new WatchListDynamicTags();
m_LoadListSingleton = new object();
m_WatchLists = LoadListsFromUserConfig();
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.WatchList.Watchlist_NumListsLoaded].Accumulator.SetValue = m_WatchLists.Count;
}
catch (Exception ex) { m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL); }
}
示例3: ConnectionServer
public ConnectionServer( IPAddress addr, int port, MessageReceivedCallback callback, APPLICATION_DATA appData)
{
m_MessageReceviedCallback = callback;
m_ip_port = port;
m_IPAddr = addr;
m_AppData = appData;
m_Log = (ErrorLog)m_AppData.Logger;
string ViewerPassword;
string AdminPassword;
try
{
ViewerPassword = UserSettings.Get(UserSettingTags.PWLPRServiceViewer);
if (ViewerPassword == null) m_Log.Log("ViewerPW is null", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_Log.Log("viewer pw = " + ViewerPassword, ErrorLog.LOG_TYPE.INFORMATIONAL);
m_Log.Log("user path = " + UserSettings.GetAppPath(), ErrorLog.LOG_TYPE.INFORMATIONAL);
if (ViewerPassword == null)
ViewerPassword = " ";
else
ViewerPassword = Encryption.DecryptText(ViewerPassword);
AdminPassword = UserSettings.Get(UserSettingTags.PWLPRServiceAdmin);
if (AdminPassword == null)
AdminPassword = " ";
else
AdminPassword = Encryption.DecryptText(AdminPassword);
m_AppData.ServiceAdminPW = AdminPassword;
m_AppData.ServiceViewPW = ViewerPassword;
m_Clients = new List<ClientConnection>(); ;
listner = new TcpListener(addr, 13000);
listner.Server.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);// this line is key, or else you get an exception because the OS does not release the socket if you re-start
listner.Start();
StartClientConnectWaitThread();
}
catch (Exception ex)
{
m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL);
Stop();
}
}
示例4: DVR
// constructor
public DVR(APPLICATION_DATA appData)
{
try
{
m_AppData = appData;
m_AppData.AddOnClosing(Stop, APPLICATION_DATA.CLOSE_ORDER.MIDDLE);
m_Log = (ErrorLog)m_AppData.Logger;
PauseFlag = new PAUSE_FLAG();
PauseFlag.Pause = true;
FileAccessControl = new FILE_SYSTEM_ACCESS(PauseFlag, m_AppData);
try
{
Paths = new PATHS(m_AppData.ThisComputerName, true, m_AppData);
m_AppData.PathManager = (object)Paths;
}
catch (Exception ex) { m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL); }
m_EventLogFile = new EventLogFiles.EventLogFiles(m_AppData);
// PRE MOTION BUFFER LENGHT
m_NumberOfFramesToPrePostBuffer = 30; // this many frames before and after moton event, if too small, files may be erased before motion is detected because of processing lag
////////
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.DVR.DVR_DriveName].StatString.RegisterForUse(true);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.DVR.DVR_DriveReady].boolean.RegisterForUse(true);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.DVR.DVR_FreeSpace].SnapshotDouble.RegisterForUse(true);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.DVR.DVR_UsedSpace].SnapshotDouble.RegisterForUse(true);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.DVR.DVR_DriveHotSwap].StatString.RegisterForUse(true);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.System.System_Drive].StatString.SetValue = "No drive ";
m_FrameGenerator = (FrameGenerator)m_AppData.FrameGenerator;
m_DriveManager = new DriveManager(m_AppData, OnExternalDriveChange, Paths.StorageDir);
// alway use external storage
if ( m_AppData.RunninAsService)
{
int count = 0;
Paths.Drive = m_DriveManager.GetDrive(ref count);
PauseFlag.DriveExists = true;
if (count > 1)
{
PauseFlag.Pause = true;
m_Log.Log("Too many external drives on start", ErrorLog.LOG_TYPE.FATAL);
//m_MessageBoxMessage = "Too many external drives on start. Please connect only one external drive and re-start the LPR Service.";
//RunMessageBoxDialog();
}
else if (Paths.Drive == null)
{
PauseFlag.Pause = true;
m_Log.Log("External Drive not found", ErrorLog.LOG_TYPE.FATAL);
// m_MessageBoxMessage = "External drive not found. Please connect one external drive";
PauseFlag.DriveExists = false;
// RunMessageBoxDialog();
}
}
m_ConsumerID = m_FrameGenerator.GetNewConsumerID();
m_NewFrameQ = new ThreadSafeQueue<FRAME>(240, "QueueOverruns_DVR_NewFrameQ", m_AppData);
m_MotionDetectedQ = new ThreadSafeQueue<FRAME>(240, "QueueOverruns_DVR_MotionDetectedQ", m_AppData);
m_DirectyToStorageQ = new ThreadSafeQueue<FRAME>(240, "QueueOverruns_DVR_DirectyToStorageQ", m_AppData);
m_NewLPRRecordQ = new ThreadSafeQueue<FRAME>(m_LPRRecordQueLen, "QueueOverruns_DVR_NewLPRRecordQ", m_AppData);
m_TempFileList = new ThreadSafeList<TEMPFILES>(120);
m_NumSourceChannels = (m_AppData.RunninAsService) ? m_AppData.MAX_PHYSICAL_CHANNELS : m_AppData.MAX_VIRTUAL_CHANNELS;
m_PreMotionRecords = new PRE_MOTION_RECORDS[m_NumSourceChannels];
m_DVRLoopThread = new Thread(DVRLoop);
m_ReportDVRStats = new Thread(ReportDVRStatusLoop);
m_TempFileCleanUpThread = new Thread(TempFilesCleanUpLoop);
m_MaintainFileSystemSizeLimit = new Thread(MaintainFileSystemSizeLimitLoop);
}
catch (Exception ex) { m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL); }
}
示例5: ClientConnection
public ClientConnection(Socket socket, string ipAddr, MessageReceivedCallback messageReceived,ConnectionClosedCallBack closedCB, APPLICATION_DATA appData )
{
ipAddress = ipAddr;
m_AppData = appData;
m_Log = (ErrorLog)m_AppData.Logger;
try
{
protocol = new RCS_Protocol.RCS_Protocol(m_AppData, ipAddr);
MessageReceived = messageReceived;
ConnectionClosed = closedCB;
connection = socket;
connection.Blocking = true;
}
catch (Exception ex)
{
m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL);
Close();
ConnectionClosed(this);
}
}
示例6: ConfigurePSSMainForm
public ConfigurePSSMainForm()
{
InitializeComponent();
try
{
this.Text = "First Evidence LPR Service Control, version " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
m_AppData = new APPLICATION_DATA();
m_AppData.Logger = new ErrorLog(m_AppData, true);
m_Log = (ErrorLog) m_AppData.Logger;
SetConfigPath();
m_AppData.AddOnClosing(Stop, APPLICATION_DATA.CLOSE_ORDER.LAST);
m_ConfigWatchListsUC = new ConfigWatchListsUC.ConfigWatchListsUC(m_AppData);
m_EmailServices = new EmailServices(m_AppData);
m_AppData.EmailServices = (object)m_EmailServices;
m_EmailServices.StartThreads();
m_ConfigureEmailUC = new ConfigureEmailUC.ConfigureEmailUC(m_AppData);
m_ConfigureGPS_UC = new ConfigureGPS_UC.ConfigureGPS_UC();
m_ConfigureGPS_UC.AppData = m_AppData;
m_ConfigureGPS_UC.Location = new Point(50, 60);
m_ConfigureSourceChannels = new ConfigureSourceChannels.ConfigSourceChannels(m_AppData);
tabPageConfigureWatchLists.Controls.Add(m_ConfigWatchListsUC);
tabPageConfigureEmail.Controls.Add(m_ConfigureEmailUC);
tabPageConfigureGPS.Controls.Add(m_ConfigureGPS_UC);
tabPageChannels.Controls.Add(m_ConfigureSourceChannels);
this.FormClosing += new FormClosingEventHandler(ConfigurePSSMainForm_FormClosing);
bool serviceInstalled = IsServiceInstalled();
ServiceControllerStatus status;
bool serviceRunning = IsServiceRunning(out status);
SetServiceStatus(serviceRunning, serviceInstalled);
m_CheckServiceStatusThread = new Thread(CheckServiceStatusLoop);
m_CheckServiceStatusThread.Start();
//////////// remove unwanted pages
// get rid of the password and activationt tabs
tabControlMain.TabPages.Remove(tabPageEnterPasswords);
tabControlMain.TabPages.Remove(tabPageActivation);
//if ( ActivateLicense.IsActivated())
//{
// tabControlMain.TabPages.Remove(tabPageActivation);
//}
}
catch (Exception ex) { m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL); }
}
示例7: Start
//.........这里部分代码省略.........
//////////////////////////////////////
//
// start error reporting lib ( decides if local and/or remote reporting)
m_AppData.Logger = new ErrorLog(m_AppData);
m_Log = (ErrorLog)m_AppData.Logger;
m_Log.Log("Starting LPR Services", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_Log.Log("using file in path: " + UserSettings.GetAppPath(), ErrorLog.LOG_TYPE.INFORMATIONAL);
//////////////////////////////////////
//
// start email lib (used by error reporting lib for remote error notifications and by the watch list processor)
m_Log.Log("Loading Email module", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_AppData.EmailServices = new EmailServices(m_AppData);
m_Email = (EmailServices)m_AppData.EmailServices;
//////////////////////////////////////
//
// load the Frame Generator
m_Log.Log("Loading Frame Generator module", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_AppData.FrameGenerator = (object)new FrameGenerator(m_AppData, AsService);
//////////////////////////////////////
//
// load the DVR
m_AppData.DVRMode = APPLICATION_DATA.DVR_MODE.STORE_ON_MOTION;
m_Log.Log("Loading DVR module", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_DVR = new DVR(m_AppData);
m_AppData.DVR = (object)m_DVR;
//////////////////////////////////////
//
// start the TCP Server
if (m_AppData.RunninAsService)
{
m_Log.Log("Loading TCP module", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_RCServer = new RemoteConnectionServer.RemoteConnectionServer(m_AppData);
}
//////////////////////////////////////
//
// load the LPR Engine
m_Log.Log("Loading LPR Engine", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_LPREngine = new LPREngine(m_AppData);
m_AppData.LPREngine = m_LPREngine;
//////////////////////////////////////
//
// load the Watch List Processor
m_Log.Log("Loading Watch List module", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_WatchList = new WatchLists(m_AppData);
// now that all modules are loaded, let them register with each other for event communications
m_Log.Log("Starting registrations", ErrorLog.LOG_TYPE.INFORMATIONAL);
if (m_AppData.RunninAsService)
{
m_RCServer.StartRegistration();
}
m_DVR.StartRegistration();
m_LPREngine.StartRegistration();
m_WatchList.StartRegistration();
// now let all modules start their threads
if (m_AppData.RunninAsService)
{
m_Log.Log("Starting TCP Server", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_RCServer.StartThreads();
}
m_Log.Log("Starting DVR", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_DVR.StartThreads();
m_Log.Log("Starting LPR Engine", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_LPREngine.StartThreads();
m_Log.Log("Starting Watch list processor", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_WatchList.StartThreads();
m_Log.Log("Starting Email Services", ErrorLog.LOG_TYPE.INFORMATIONAL);
m_Email.StartThreads();
// is everyone happy?
//if (!m_DVR.GetDVRReady || !((FrameGenerator)m_AppData.FrameGenerator).GetReadyStatus)
//{
// m_Log.Log("Error, self destruct", ErrorLog.LOG_TYPE.FATAL);
// m_AppData.SelfDestruct();
//}
}
catch (Exception ex) { m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL); }
}
示例8: FrameGenerator
//.........这里部分代码省略.........
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.FRAME_GENERATOR.FrameGen_GPSLocation].StatString.RegisterForUse(true);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.MOTION_DETECTION.MotionDetector_DroppedFrames].Accumulator.RegisterForUse(true);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.MOTION_DETECTION.MotionDetector_FrameCnt].Accumulator.RegisterForUse(true);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.MOTION_DETECTION.MotionDetector_FramesDetected].Accumulator.RegisterForUse(true);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.MOTION_DETECTION.MotionDetector_ProcessQCnt].Snapshot.RegisterForUse(true);
m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.MOTION_DETECTION.MotionDetector_ProcessQCnt].Peak.RegisterForUse(true);
m_EabledChannelArray = new bool[m_AppData.MAX_PHYSICAL_CHANNELS];// used tell the 2255 device which of its channels are enabled
m_LastJPEGReceived = new LAST_JPEG_RECEIVED[m_AppData.MAX_PHYSICAL_CHANNELS];
m_Channels = new CHANNEL[m_AppData.MAX_PHYSICAL_CHANNELS];
for (int c = 0; c < m_AppData.MAX_PHYSICAL_CHANNELS; c++)
{
m_LastJPEGReceived[c] = new LAST_JPEG_RECEIVED();
m_Channels[c] = new CHANNEL(c);
}
LoadChannelNames();
m_ConsumerIDs = new CONSUMER_ID();
m_CurrentGPSPosition = m_NoPositionAvailable;
m_MotionDetectionQ = new ThreadSafeQueue<FRAME>(m_MotionDetectionQueLevel, "QueueOverruns_FG_MotionDetectionQ", m_AppData);
m_AppData.MotionDetectionGettingBehind = false;
//////////////////////////////////////
//
// start the thread that pushes new frames to the registered consumers
m_AllFramesConsumerPushQ = new ThreadSafeQueue<CONSUMER_PUSH>(240, "QueueOverruns_FG_AllFramesConsumerPushQ", m_AppData);
m_MotionDetectedConsumerPushQ = new ThreadSafeQueue<CONSUMER_PUSH>(240, "QueueOverruns_FG_MotionDetectedConsumerPushQ", m_AppData); //120
PushThread = new Thread(PushLoop);
PushThread.Priority = ThreadPriority.AboveNormal;
PushThread.Start();
m_MotionDetectionThread = new Thread(MotionDetectionLoop);
m_MotionDetectionThread.Start();
//////////////////////////////////////
//
// start the S2255 controller
// the 2255 controller has a polling loop that looks for 2255 devices to be added/deleted by the user plugging/unplugging the cables
// as new devices are detected, the stored config data is read and the channels are assigned and start running as appropriate
// the image data flows into this class via callbacks. this class then pushes the data up a layer after adding GPS and time stamps.
if (AsService)
{
try
{
S2255Controller.S2255Controller.PAL_NTSC_MODE videoStandard = S2255Controller.S2255Controller.PAL_NTSC_MODE.NTSC;
string NTSC_PAL = UserSettings.Get(UserSettingTags.VideoSetup_PAL_NTSC);
if (NTSC_PAL != null)
{
if (NTSC_PAL.Equals(UserSettingTags.VideoSetup_PAL))
videoStandard = S2255Controller.S2255Controller.PAL_NTSC_MODE.PAL;
}
unsafe
{
m_S2255Controller = new S2255Controller.S2255Controller(videoStandard, m_AppData, m_EabledChannelArray);
m_S2255Controller.OnNewFrame += new S2255Controller.S2255Controller.OnNewFrameFromDeviceEvent(OnReceiveNewImageFromS2255Device);
m_S2255Controller.StartThreads();
}
}
catch (Exception ex)
{
m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL);
}
//////////////////////////////////////
//
// start the GPS Controller
string GPSPort = FindDevicePort.GetGPSCommPort();
m_GPSController = new GPSController(PutNewGPSData, m_AppData);
if (m_S2255Controller.GetReadyStatus)
m_FrameGenReadyStatus = true;
else
m_FrameGenReadyStatus = false;
}
if (!AsService)
{
MovieFileController = new MovieFiles(m_AppData);
MovieFileController.OnNewImage += new MovieFiles.OnNewImageEvent(MovieFiles_OnNewImage);
MovieFileController.Start();
}
}
catch (Exception ex) { m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL);}
}
示例9: LPREngine
public LPREngine(APPLICATION_DATA appData)
{
try
{
m_AppData = appData;
m_AppData.AddOnClosing(Stop, APPLICATION_DATA.CLOSE_ORDER.MIDDLE);
m_Log = (ErrorLog)m_AppData.Logger;
m_FrameGen = (FrameGenerator)m_AppData.FrameGenerator;
m_LPRProcessQ = new ThreadSafeQueue<FRAME>(m_LPRProcessQueSize, "QueueOverruns_LPR_LPRProcessQ", m_AppData); // this queue hold frames that come from the framegenerator and need to be processed by LPR
m_AppData.LPRGettingBehind = false;
m_LPRFinalPlateGroupOutputQ = new ThreadSafeQueue<FRAME>(60, "QueueOverruns_LPR_LPRFinalPlateGroupOutputQ", m_AppData); // filtered plate readings, grouped into similar readings, redundant readings removed
m_LPRPerFrameReadingQ = new ThreadSafeQueue<FRAME>(60, "QueueOverruns_LPR_LPRPerFrameReadingQ", m_AppData); // instantaneous output from LPR for each fram processed
m_StoredFrameData = new ThreadSafeHashableQueue(30 * 60);// 60 seconds of frames at 30fps
m_LPRFuntions = new LPROCR_Lib();
unsafe
{ // the plate group processor accumulates per-frame plate readings and consolidates them into a single plate reading where appropriate
m_LPRFuntions.RegisterPlateGroupCB(OnNewPlateGroupReady);
}
int maxW = 0, minW = 0, maxH = 0, minH = 0;
m_LPRFuntions.GetMinMaxPlateSize(ref minW, ref maxW,ref minH, ref maxH);
m_AppData.MAX_PLATE_HEIGHT = maxH;
m_AppData.MIN_PLATE_HEIGHT = minH;
m_AppData.MAX_PLATE_WIDTH = maxW;
m_AppData.MIN_PLATE_WIDTH = minW;
m_processOptions = new LPROCR_Lib.LPR_PROCESS_OPTIONS();
m_processOptions.roll = 1;
m_processOptions.rotation = 1;
// register with the frame grabber to get new bitmaps from the channel sources as they come in
m_ConsumerID = m_FrameGen.GetNewConsumerID();
// m_NumSourceChannels = m_FrameGen.GetNumberOfConfiguredChannels();
m_NumSourceChannels = (m_AppData.RunninAsService) ? m_AppData.MAX_PHYSICAL_CHANNELS : m_AppData.MAX_VIRTUAL_CHANNELS;
m_LPREngineProcessThread = new Thread(LPREngineProcessLoop);
PushLPRResultsThread = new Thread(PushLPRResultsLoop);
}
catch (Exception ex) { m_Log.Trace(ex, ErrorLog.LOG_TYPE.FATAL); }
}