コード例 #1
0
ファイル: SelectRemoteSystem.cs プロジェクト: anndream/anpr-1
        public SelectRemoteSystem(APPLICATION_DATA appData)
        {
            InitializeComponent();
            m_AppData = appData;
            m_AppData.AddOnClosing(OnClose, APPLICATION_DATA.CLOSE_ORDER.FIRST);
            m_Log = (ErrorLog) m_AppData.Logger;

            m_AppData.CurrentlyLoggedInRemoteServer = (object)new RemoteHosts(m_AppData, true);// assign a nullHost as a place holder until the use selects an actual server

            MessageGenerators = new MessageGeneratorEvents(this);

            buttonLogout.Visible = false;
            buttonLogout.Enabled = false;

            m_StatsViewer = new StatsViewer(m_AppData);
            //744, 57
            m_StatsViewer.Location = new Point(744, 57);
            this.Controls.Add(m_StatsViewer);

            bool hostsLoaded = false;
            string hostfile = UserSettings.Get(UserSettingTags.REMOTEHOSTS_LastHostFileUsed);
            if (hostfile != null)
            {
                if (File.Exists(hostfile))
                {
                    m_HostFile = hostfile;
                    LoadHostsFromFile(hostfile);
                    hostsLoaded = true;
                }
            }
            if ( ! hostsLoaded)
                AddLocalDefaultHost();
        }
コード例 #2
0
ファイル: ConfigureEmailUC.cs プロジェクト: anndream/anpr-1
        public ConfigureEmailUC(APPLICATION_DATA appData)
        {
            InitializeComponent();

            m_AppData = appData;
            m_EmailServices = (EmailServices) m_AppData.EmailServices;
        }
コード例 #3
0
        public ControlCenterMainForm()
        {
            InitializeComponent();

            m_ScreenLogger = new ScreenLogger();// debug tool

            // load up the AppData object so the rest of the app has acccess to global resources

            m_AppData = new APPLICATION_DATA();
            m_AppData.LogToScreen = m_ScreenLogger;

            m_Log = new ErrorLog(m_AppData);
            m_AppData.Logger = m_Log;

            m_ScreenLogger.Show();

            m_AppData.RCSProtocol = (object)new RCS_Protocol.RCS_Protocol(m_AppData,null);
            m_AppData.TCPClient = (object)new RCSClientLib.RCSClient(null, m_AppData);

            this.FormClosing += new FormClosingEventHandler(Form1_FormClosing);

            tabControlMain.Click += new EventHandler(tabControlMain_Click);

            // not logged in

            m_AppData.LoggedIn = APPLICATION_DATA.LoggedInAs.NOT_LOGGED_IN;

            // start on the select server tab
            tabControlMain.SelectedTab = tabPageSelectServer;
            m_CurrentPage = tabControlMain.SelectedTab;
            LoadSelectServerUC();
        }
コード例 #4
0
ファイル: RemoteHosts.cs プロジェクト: anndream/anpr-1
        public RemoteHosts(APPLICATION_DATA appData, bool IsNullHost)
        {
            m_AppData = appData;
            m_AppData.AddOnClosing(Stop, APPLICATION_DATA.CLOSE_ORDER.FIRST);

            singleton = new object();

            m_IsNullHost = IsNullHost;

            MessageEventHandlers = new MessageEventHandlersClass(this);
            MessageEventGenerators = new MessageEventGeneratorsClass(this);

            TCPClient = new RCSClientLib.RCSClient(m_AppData);// each host gets its own client connection

            // load up handlers for receiving messages from the TCP Client object

            TCPClient.MessageEventGenerators.OnRxHostName += MessageEventHandlers.OnRxServerName;
            TCPClient.MessageEventGenerators.OnRxValidAdminPW += MessageEventHandlers.OnRxValidAdminPassword;
            TCPClient.MessageEventGenerators.OnRxValidViewerPW += MessageEventHandlers.OnRxValidViewerPassword;
            TCPClient.MessageEventGenerators.OnRxInvalidPassword += MessageEventHandlers.OnRxInvalidPassword;
            TCPClient.MessageEventGenerators.OnRxChannelList += OnReceiveChannels;
            TCPClient.MessageEventGenerators.OnRxJpeg += MessageEventHandlers.OnRxJpeg;
            TCPClient.MessageEventGenerators.OnRxHealthStatus += MessageEventHandlers.OnRxStats;

            RCSProtocol = (RCS_Protocol.RCS_Protocol) m_AppData.RCSProtocol;

            StartHeatlthStatusPolling();
        }
コード例 #5
0
ファイル: search.cs プロジェクト: anndream/anpr-1
        public SmartSearchLibUC(APPLICATION_DATA appData, ABORT_CLOSE giveup)
        {
            InitializeComponent();

            m_AppData = appData;
            m_AppData.AddOnClosing(OnClose,APPLICATION_DATA.CLOSE_ORDER.FIRST);
            m_Log = (ErrorLog)m_AppData.Logger;
            GiveUp = giveup;

            m_PathManager= (PATHS) m_AppData.PathManager ;

            textBoxMinMatch.Text = "0";

            m_SearchTool = new SearchLib(m_AppData);

            this.Text = "Smart Search";

            m_ZoomTrackLock = new object();
            trackBarZoomControl.Minimum = 0;
            trackBarZoomControl.Maximum = 1000;

            buttonUndoDelete.Enabled = false;
            dataGridView1.KeyDown += new KeyEventHandler(dataGridView1_KeyDown);

            dataGridView1.CellClick +=new DataGridViewCellEventHandler(dataGridView1_CellContentClick); // mouse click on cell
            dataGridView1.SelectionChanged += new EventHandler(dataGridView1_SelectionChanged);  // support cell selection changes by keyboard (i.e. not by mouse click)

            dataGridView1.Columns["time"].DefaultCellStyle.Format = m_AppData.TimeFormatStringForDisplay;// "dd MMM yyyy,  HH: mm: ss: ffff";

            m_SearchStatusDisplay = new SearchStatusDisplayUC(m_AppData, UserCanceledSearch);
            m_SearchStatusDisplay.Location = new Point(594, 55);
            this.Controls.Add(m_SearchStatusDisplay);
        }
コード例 #6
0
ファイル: LPRService.cs プロジェクト: anndream/anpr-1
        public LPRServiceBody()
        {
            m_AppData = new APPLICATION_DATA();

            m_AppData.HealthStatistics.AddStat("LPRStats");
            m_AppData.OnCloseServiceLoop += HandleSelfDestructEvent;
        }
コード例 #7
0
ファイル: WatchlistProcess.cs プロジェクト: anndream/anpr-1
        /// 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); }
        }
コード例 #8
0
ファイル: EventLogFiles.cs プロジェクト: anndream/anpr-1
        public EventLogFiles(APPLICATION_DATA appData)
        {
            m_AppData = appData;
            m_PathManager =(PATHS) m_AppData.PathManager;
            lineFields = new string[6];

            m_FileLock = new object();
        }
コード例 #9
0
ファイル: SearchLib.cs プロジェクト: anndream/anpr-1
        public SearchLib(APPLICATION_DATA appData)
        {
            m_SearchStopped = true;
            m_AppData = appData;
            m_PathManager =(PATHS) m_AppData.PathManager;

            m_EventLogs = new EventLogFiles.EventLogFiles(m_AppData);
        }
コード例 #10
0
ファイル: EmaiLib.cs プロジェクト: anndream/anpr-1
 public EmailServices(APPLICATION_DATA appData)
 {
     m_AppData = appData;
     m_AppData.AddOnClosing(Stop, APPLICATION_DATA.CLOSE_ORDER.MIDDLE);
     m_Log = (ErrorLog) m_AppData.Logger;
     m_SendMessagesQ = new ThreadSafeQueue<SEND_MESSAGE>(40);
     m_SendResultEvents = new ThreadSafeHashTable(40);
     m_SendResultQ = new ThreadSafeQueue<SEND_RESULT>(40);
 }
コード例 #11
0
ファイル: HealthStatistics.cs プロジェクト: anndream/anpr-1
            // servers use this constructor to actively collect and manage statistics
            /// <summary>
            /// Use this constructor on the LPR service side to instantiate the statistical counter service
            /// </summary>
            /// <param name="appData"></param>
            public HEALTH_STATISTICS(APPLICATION_DATA appData)
            {
                singleton = new object();

                LoadStatObjects();

                m_AppData = appData;
                m_AppData.AddOnClosing(Stop, CLOSE_ORDER.LAST);
                StartStatsUpdateThread();
            }
コード例 #12
0
ファイル: ConfigWatchListsUC.cs プロジェクト: anndream/anpr-1
        public ConfigWatchListsUC(APPLICATION_DATA appData)
        {
            InitializeComponent();
            m_AppData = appData;
            m_AppData.AddOnClosing(Stop, APPLICATION_DATA.CLOSE_ORDER.LAST);

            textBoxAlertMatchThreshold.Leave += new EventHandler(textBoxAlertMatchThreshold_Leave);

            m_EditingExisting = false;
        }
コード例 #13
0
ファイル: HealthStatistics.cs プロジェクト: mutita/anpr
            // servers use this constructor to actively collect and manage statistics
            /// <summary>
            /// Use this constructor on the LPR service side to instantiate the statistical counter service
            /// </summary>
            /// <param name="appData"></param>

            public HEALTH_STATISTICS(APPLICATION_DATA appData)
            {
                singleton = new object();

                LoadStatObjects();


                m_AppData = appData;
                m_AppData.AddOnClosing(Stop, CLOSE_ORDER.LAST);
                StartStatsUpdateThread();
            }
コード例 #14
0
ファイル: GenerateOCRLib.cs プロジェクト: anndream/anpr-1
        public GenerateOCRLib(APPLICATION_DATA appData, string srcDir, string outDir)
        {
            m_AppData = appData;
            m_LPREngine = (LPREngine)m_AppData.LPREngine;
            m_LPR_C_Lib = m_LPREngine.m_LPRFuntions;

            m_SourceDirectory = srcDir;

            m_DesitnationDirectory = outDir;
            m_DestinationFile = m_SourceDirectory + "\\OCR_charLib.h";
        }
コード例 #15
0
ファイル: StatsViewer.cs プロジェクト: anndream/anpr-1
        public StatsViewer( APPLICATION_DATA appData)
        {
            InitializeComponent();
            m_AppData = appData;

            m_StatGroups = m_AppData.HealthStatistics.GetGroupList();
            m_AllStats = m_AppData.HealthStatistics.GetStatList();
            m_GroupManager = new STAT_GROUP_MANAGER();
            m_GroupManager.LoadGroups(m_StatGroups);

            singleton = new object();

            ButtonSize = new Size(this.Size.Width/4, 25 );
            Locations = new Point[NUM_BUTTONS];
            m_PushStatusInfoQ = new ThreadSafeQueue<string>(2);
            m_ButtonClickHandlers = new ButtonClick[NUM_BUTTONS];

            // row one
            Locations[0] = new Point(0, 0);
            Locations[1] = new Point(ButtonSize.Width, 0);
            Locations[2] = new Point(ButtonSize.Width*2, 0);
            Locations[3] = new Point(ButtonSize.Width*3, 0);

            // row two
            Locations[4] = new Point(0, ButtonSize.Height);
            Locations[5] = new Point(ButtonSize.Width, ButtonSize.Height);
            Locations[6] = new Point(ButtonSize.Width * 2, ButtonSize.Height);
            Locations[7] = new Point(ButtonSize.Width * 3, ButtonSize.Height);

            ButtonUsed = new bool[NUM_BUTTONS];

            Buttons = new Button[NUM_BUTTONS];
            for (int b = 0; b < NUM_BUTTONS; b++)
            {
                Buttons[b] = new Button();
                ButtonUsed[b] = false;
            }

            int groupCnt = 0;
            foreach (string group in m_StatGroups)
            {
                if (groupCnt == NUM_BUTTONS) break;
                int b = GetNextAvailableButton();
                DefineButton(Buttons[b], ButtonSize, group, Locations[b], b);
                this.Controls.Add(Buttons[b]);
            }

            foreach (string group in m_StatGroups)
            {
                GridTableManager grid = new GridTableManager();
                grid.CreateGrid(new Size(this.Size.Width, this.Size.Height - 50), new Point(0, 50));
                m_GroupManager[group].AddGrid(grid);
            }
        }
コード例 #16
0
        public VideoPlayerMainForm(APPLICATION_DATA appData, UserClosedThePlayerDelegate closedCallBack)
        {
            InitializeComponent();
            m_AppData = appData;
            videoPlayer1.AppData = m_AppData;

            m_UserClosedThePlayer = closedCallBack;

            this.FormClosing += new FormClosingEventHandler(VideoPlayerMainForm_FormClosing);
            m_AppData.AddOnClosing(Stop,APPLICATION_DATA.CLOSE_ORDER.LAST);
        }
コード例 #17
0
ファイル: DSFileDecoder.cs プロジェクト: anndream/anpr-1
        public DSFileDecoder(APPLICATION_DATA appData, Panel parentPanel, Form parentForm, int chan)
        {
            m_AppData = appData;
            m_AppData.AddOnClosing(OnStop, APPLICATION_DATA.CLOSE_ORDER.FIRST);
            m_Log = (ErrorLog)m_AppData.Logger;

            m_Channel = chan;
            m_ParentForm = parentForm;
            m_ParentPanel = parentPanel;

            lockSampleGrabberState = new object();
        }
コード例 #18
0
        public ConfigSourceChannels(APPLICATION_DATA appData)
        {
            InitializeComponent();
            m_AppData = appData;

            textBoxChan1.Leave += new EventHandler(textBoxChan1_Leave);
            textBoxChan2.Leave += new EventHandler(textBoxChan2_Leave);
            textBoxChan3.Leave += new EventHandler(textBoxChan3_Leave);
            textBoxChan4.Leave += new EventHandler(textBoxChan4_Leave);

            LoadVideoStandardSettings();
        }
コード例 #19
0
ファイル: Form1.cs プロジェクト: anndream/anpr-1
        public Form1()
        {
            InitializeComponent();

            m_AppData = new APPLICATION_DATA();
            m_AppData.LogToScreen = (object)new ScreenLogger();
            m_ViewImagesThread = new Thread(GetImages);
            m_TCPConnection = new RCSClientLib.RCSClient( m_AppData);
            m_AppData.tcpconnection = (object)m_TCPConnection;

            this.FormClosing += new FormClosingEventHandler(Form1_FormClosing);
        }
コード例 #20
0
ファイル: SelectRemoteSystem.cs プロジェクト: anndream/anpr-1
        public SelectRemoteSystem(APPLICATION_DATA appData)
        {
            InitializeComponent();
            m_AppData = appData;
            m_AppData.AddOnClosing(OnClose, APPLICATION_DATA.CLOSE_ORDER.FIRST);
            m_Log = (ErrorLog) m_AppData.Logger;

            dataGridViewRemoteHostList.RowHeadersVisible = false;

            buttonLogout.Visible = false;
            buttonLogout.Enabled = false;
        }
コード例 #21
0
ファイル: ImportImageDrive.cs プロジェクト: anndream/anpr-1
        public ImportImageDrive(APPLICATION_DATA appData)
        {
            InitializeComponent();
            m_AppData = appData;
            m_AppData.AddOnClosing(Stop, APPLICATION_DATA.CLOSE_ORDER.MIDDLE);
            m_Log = (ErrorLog)m_AppData.Logger;

            m_PathManager = (PATHS)m_AppData.PathManager;
            m_DVR = (DVR)m_AppData.DVR;

            m_CancelMove = new CancelObject();
            m_CancelMove.cancel = false;
        }
コード例 #22
0
ファイル: LPREngine.cs プロジェクト: anndream/anpr-1
        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); }
        }
コード例 #23
0
ファイル: Paths.cs プロジェクト: anndream/anpr-1
 // constructor
 public PATHS(string systemName, bool parentIsDVR, APPLICATION_DATA appData)
 {
     singleton = new object();
     StorageDir = "DVRSTORAGE";
     TempDir = "TEMPFILES";
     PreMotionDir = "PREMOTION";
     SystemName = systemName;
     accumulatedSize = 0;
     Enabled = false;
     ParentIsDVR = parentIsDVR;
     m_AppData = appData;
     m_AppData.AddOnClosing(Stop, APPLICATION_DATA.CLOSE_ORDER.FIRST);
     m_Log = (ErrorLog)m_AppData.Logger;
 }
コード例 #24
0
ファイル: Form1.cs プロジェクト: anndream/anpr-1
        public Form1()
        {
            InitializeComponent();

            m_AppData = new APPLICATION_DATA();

            m_Log = new ErrorLog(m_AppData);

            m_AppData.Logger = m_Log;

            this.FormClosing += new FormClosingEventHandler(Form1_FormClosing);

            m_S2255Controller = new S2255Controller.S2255Controller(S2255Controller.S2255Controller.PAL_NTSC_MODE.NTSC, m_AppData);
        }
コード例 #25
0
ファイル: LiveView.cs プロジェクト: anndream/anpr-1
        public LiveView( APPLICATION_DATA appData)
        {
            InitializeComponent();

            m_AppData = appData;

            m_AppData.AddOnClosing(Stop, APPLICATION_DATA.CLOSE_ORDER.LAST);

            m_Log = (ErrorLog)m_AppData.Logger;

            LoadServerEventHandlers();

            m_GetImagesThread = new Thread(GetImagesLoop);
            m_GetImagesThread.Start();
        }
コード例 #26
0
ファイル: MovieFiles.cs プロジェクト: anndream/anpr-1
        public MovieFiles(APPLICATION_DATA appData)
        {
            m_AppData = appData;
            m_AppData.AddOnClosing(OnClose, APPLICATION_DATA.CLOSE_ORDER.MIDDLE);
            m_Log = (ErrorLog)m_AppData.Logger;
            MovieControlSingleton = new object();
            m_ProcessThread = new Thread(ProcessLoop);
            m_PlayCommandsQ = new ThreadSafeQueue<MOVIE_PLAY_CONTROL_OBJECT>(20);
            m_NewFramesToPushQ = new ThreadSafeQueue<FRAME>(240);
            m_PushFramesToCosumersThread = new Thread(PushFramesToConsumersLoop);

            m_MasterFileList = new ThreadSafeHashTable(1000);

            vChans = new VIRTUAL_CHANNEL[m_AppData.MAX_VIRTUAL_CHANNELS];
        }
コード例 #27
0
ファイル: LPRServiceCore.cs プロジェクト: anndream/anpr-1
        public LPRServiceEntryPoint()
        {
            m_AppData = new APPLICATION_DATA();

            SetConfigPath();

            m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.LPRServiceVersionString.LPRServiceVersionString_version].StatString.RegisterForUse(true);

            string ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            ver = ver.Replace('.', '^');// the . is used as a delimeter in the stats reporting

            m_AppData.HealthStatistics[(int)APPLICATION_DATA.HEALTH_STATISTICS.LPRServiceVersionString.LPRServiceVersionString_version].StatString.SetValue=ver;

            m_AppData.OnCloseServiceLoop += HandleSelfDestructEvent;
        }
コード例 #28
0
ファイル: Connection.cs プロジェクト: anndream/anpr-1
        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();
            }
        }
コード例 #29
0
ファイル: DriveManager.cs プロジェクト: anndream/anpr-1
        //  /////////////////
        //
        //  design
        //
        //   at startup, count how many external drives are available  - there should only be one.
        //
        //   if one drive, select that drive and create the default storage directory
        //    then inform the DVR function that a drive has been found and is ready
        //
        //   setup a function to watch for changes in connected drives
        //   if a new drive is added, start the hotswap switch over, expect the previous drive to be disconnected
        //   if the currently selected drive is disconnected, notify the DVR the primary drive was lost
        //   if no drives are available, watch for new ones to be added, if one is added make it the primary.
        public DriveManager(APPLICATION_DATA appData, OnDriveChangeEvent callback, string defaultStorageDir )
        {
            try
            {
                m_AppData = appData;
                m_AppData.AddOnClosing(Stop, APPLICATION_DATA.CLOSE_ORDER.MIDDLE);
                m_Log = (ErrorLog)m_AppData.Logger;
                OnDriveChange = callback;
                m_DefaultStorageDirectory = defaultStorageDir;
                singleton = new object();

                m_HotSwapStatusString = new ThreadSafeQueue<string>(20);

                // make the list of current drives now that we are going into a active mode
                m_DriveListAtStartup = Environment.GetLogicalDrives();// to be used later if a drive change is detected

                // are we running as AnalystsWorkstation, and no repositories found? if so, then use user-config storage area instead
                bool runDriveCheckLoop = true;
                if ( ! m_AppData.RunninAsService)
                {
                    string[] drives = GetAllFirstEvidenceDrives();
                    if ( drives == null) drives = new string[0];
                    if (drives.Length < 1)
                    {
                     //   runDriveCheckLoop = false;

                        m_Log.Log("User App Path =  " + Application.UserAppDataPath, ErrorLog.LOG_TYPE.INFORMATIONAL);

                        m_CentralRepositoryDrive = Application.UserAppDataPath.Split(':')[0]+  ":\\";
                        m_SelectedDrive = m_CentralRepositoryDrive;

                        m_Log.Log("dm setting central to " + m_CentralRepositoryDrive, ErrorLog.LOG_TYPE.INFORMATIONAL);

                        RunDelayedDriveChangeNoticeThread();// run the new drive notify after this constructor completes execution
                    }
                }

                // look for drive changes..
               // SetupDriveWatcher();  // USB events do not always fire correctly when hubs are used on  certain computers
                if ( runDriveCheckLoop)
                    StartPollForDriveChangesThread();
            }
            catch (Exception ex)
            {
                m_Log.Log("DriveManager ex: " + ex.Message, ErrorLog.LOG_TYPE.FATAL);
            }
        }
コード例 #30
0
ファイル: RemoteHosts.cs プロジェクト: anndream/anpr-1
        public RemoteHosts(APPLICATION_DATA appData)
        {
            m_AppData = appData;
            //    TCPClient =(RCSClient.RCSClient) m_AppData.TCPClient; // for the primary server the user is interacting with

            MessageEventHandlers = new MessageEventHandlersClass(this);
            MessageEventGenerators = new MessageEventGeneratorsClass(this);

            TCPClient = new RCSClientLib.RCSClient(null,m_AppData);// each host gets its own client connection

            // load up handlers for receiving messages from the TCP Client object

            TCPClient.MessageEventGenerators.OnRxHostName += MessageEventHandlers.OnRxServerName;
            TCPClient.MessageEventGenerators.OnRxValidAdminPW += MessageEventHandlers.OnRxValidAdminPassword;
            TCPClient.MessageEventGenerators.OnRxValidViewerPW += MessageEventHandlers.OnRxValidViewerPassword;
            TCPClient.MessageEventGenerators.OnRxInvalidPassword += MessageEventHandlers.OnRxInvalidPassword;

            RCSProtocol = (RCS_Protocol.RCS_Protocol) m_AppData.RCSProtocol;
        }
コード例 #31
0
ファイル: MultiLevelDataGrid.cs プロジェクト: anndream/anpr-1
        public MultiLevelDataGrid(APPLICATION_DATA appData, System.Drawing.Size size, System.Drawing.Point location, string name, UserControl parent)
        {
            m_AppData = appData;
            m_Log = (ErrorLog) m_AppData.Logger;

            m_MainGrid = new DataGridView();
            m_SubGrids = new List<DataGridView>();
            m_GroupHashTable = new Hashtable();
            m_SubGroupHashTable = new Hashtable();

            plusSign = (Bitmap)Bitmap.FromFile(Application.StartupPath + "//plus.bmp");

            minusSign = (Bitmap)Bitmap.FromFile(Application.StartupPath + "//minus.bmp");

            InitMainContainerGrid(m_MainGrid, size, location, name);
               //     AddExpandIconCol(m_MainGrid);

            parent.Controls.Add(m_MainGrid);
        }
コード例 #32
0
ファイル: FrameBuffer.cs プロジェクト: mutita/anpr
 public FRAME(APPLICATION_DATA appData)
 {
     singleton = new object();
     m_AppData = appData;
 }