public Worker() { cameraList = new List <OpenALPRmilestoneCameraName>(); CameraMapper.LoadCameraList(cameraList); lastMappingUpdateTime = CameraMapper.GetLastWriteTime(); openALPRList = new List <KeyValuePair <string, string> >(); OpenALPRLNameHelper.LoadCameraNameList(openALPRList); dicBlack = new Dictionary <string, string>(); AlertListHelper.LoadAlertList(dicBlack); lastAlertUpdateTime = AlertListHelper.GetLastWriteTime(); }
private IList <OpenALPRmilestoneCameraName> GetCameraFromMapping(string cameraId) { DateTime temp = CameraMapper.GetLastWriteTime(); if (temp != lastMappingUpdateTime) { CameraMapper.LoadCameraList(cameraList); lastMappingUpdateTime = temp; Program.Log.Info("Reload camera mapping list"); } List <OpenALPRmilestoneCameraName> cameras = cameraList.Where(c => c.OpenALPRId == cameraId).ToList(); if (cameras.Count == 0) { Program.Log.Warn($"{cameraId} not found in the local camera list"); } return(cameras); }