/// <summary> /// Create a clone of the collection /// </summary> /// <returns></returns> public CameraCollection clone(bool keepRunning = false) { CameraCollection C = new CameraCollection(); foreach (CameraValues CV in this.cameras) { CameraValues CVNEW = new CameraValues(); C.cameras.Add(CV.clone(keepRunning)); } return(C); }
/// <summary> /// Take the given XML string and parse it into each Camera /// </summary> /// <param name="xml">string of xml that contains everything</param> /// <returns></returns> public void newList(string xml) { try { //Declare the xmlDocument variable XmlDocument xmlDoc = new XmlDocument(); //Load the XML string into the xmlDoc variable xmlDoc.LoadXml(xml); //Sort all of the main XML tags into a collection XmlNodeList cam = xmlDoc.GetElementsByTagName("recordNumber"); //Loop through out colletion and use the values that we currenctly need for (int i = 0; i < cam.Count; i++) { //Declare the camera CameraValues CV = new CameraValues(); //Fill the camera with out values CV.loadCam(cam[i].OuterXml); //Add the camera to the list cameras.Add(CV); } } catch { if (cameras.Count <= 0) { CameraValues CV = new CameraValues(); cameras.Add(CV); } } //Make sure that all of the numbers are in order fixNumbers(); //Make sure that the list is in order sortList(); Program.save("CAM"); }
/// <summary> /// When you set a collection = another collection, when you change any values, it will be reflected in the other collection /// This gives us the option to make a safe copy /// </summary> /// <param name="CV">CameraValues that we want to copy</param> /// <returns></returns> public CameraValues clone(bool keepRunning = false) { CameraValues newCV = new CameraValues(); //Start assigning values if (keepRunning) { newCV.running = this.running; } newCV.cameraIndex = this.cameraIndex; newCV.location = this.location; newCV.CameraID = this.CameraID; newCV.URL = this.URL; newCV.numberImages = this.numberImages; newCV.face_detect_top = this.face_detect_top; newCV.face_detect_left = this.face_detect_left; newCV.face_detect_height = this.face_detect_height; newCV.face_detect_width = this.face_detect_width; newCV.face_detect_min_height_prop = this.face_detect_min_height_prop; newCV.face_detect_max_height_prop = this.face_detect_max_height_prop; newCV.frame_interval = this.frame_interval; newCV.reduce_frame_step = this.reduce_frame_step; newCV.generate_templates = this.generate_templates; newCV.perform_ranking = this.perform_ranking; newCV.verification_thresh = this.verification_thresh; newCV.save_xml_results = this.save_xml_results; newCV.save_xml_folder = this.save_xml_folder; newCV.remove_files = this.remove_files; newCV.post_xml = this.post_xml; newCV.post_url = this.post_url; newCV.save_images = this.save_images; newCV.save_images_folder = this.save_images_folder; newCV.save_only_verified = this.save_only_verified; newCV.root_tag = this.root_tag; newCV.person_name = this.person_name; newCV.person_name_tag = this.person_name_tag; newCV.person_id = this.person_id; newCV.person_id_tag = this.person_id_tag; newCV.processed_frames = this.processed_frames; newCV.processed_frames_tag = this.processed_frames_tag; newCV.head_id = this.head_id; newCV.head_id_tag = this.head_id_tag; newCV.stream_type = this.stream_type; newCV.stream_type_tag = this.stream_type_tag; newCV.stream_connection_info = this.stream_connection_info; newCV.stream_connection_info_tag = this.stream_connection_info_tag; newCV.stream_index = this.stream_index; newCV.stream_index_tag = this.stream_index_tag; newCV.verification_threshold = this.verification_threshold; newCV.verification_threshold_tag = this.verification_threshold_tag; newCV.frame_number = this.frame_number; newCV.frame_number_tag = this.frame_number_tag; newCV.utc_time = this.utc_time; newCV.utc_time_tag = this.utc_time_tag; newCV.ranked_results = this.ranked_results; newCV.ranked_results_n = this.ranked_results_n; newCV.ranked_results_tag = this.ranked_results_tag; newCV.matched_person_name = this.matched_person_name; newCV.matched_person_name_tag = this.matched_person_name_tag; newCV.matched_person_id = this.matched_person_id; newCV.matched_person_id_tag = this.matched_person_id_tag; newCV.matched_image_id = this.matched_image_id; newCV.matched_image_id_tag = this.matched_image_id_tag; newCV.date_time_stamp = this.date_time_stamp; newCV.date_time_stamp_tag = this.date_time_stamp_tag; newCV.confidence_measure = this.confidence_measure; newCV.confidence_measure_tag = this.confidence_measure_tag; newCV.focus_measure = this.focus_measure; newCV.focus_measure_tag = this.focus_measure_tag; newCV.eye_positions = this.eye_positions; newCV.eye_positions_tag = this.eye_positions_tag; newCV.face_box = this.face_box; newCV.face_box_tag = this.face_box_tag; newCV.match_score = this.match_score; newCV.match_score_tag = this.match_score_tag; newCV.matched_status = this.matched_status; newCV.matched_status_tag = this.matched_status_tag; newCV.tracked_image = this.tracked_image; newCV.tracked_image_tag = this.tracked_image_tag; newCV.matched_person_thumbnail = this.matched_person_thumbnail; newCV.matched_person_thumbnail_tag = this.matched_person_thumbnail_tag; newCV.matched_thumbnail = this.matched_thumbnail; newCV.matched_thumbnail_tag = this.matched_thumbnail_tag; //Return the new CameraValues return(newCV); }