Exemple #1
0
        public static void rigInfoPopulate(string profileName, int id)
        {
            bool infoExists = false;

            foreach (info infoI in camInfo)
            {
                if (profileName == infoI.profileName && infoI.webcam == rig[id].cameraName)
                {
                    rig[id].friendlyName  = infoI.friendlyName;
                    rig[id].displayButton = infoI.displayButton;

                    rig[id].cam.MotionDetector.areaDetectionWithin = infoI.areaDetectionWithin;
                    rig[id].cam.MotionDetector.areaDetection       = infoI.areaDetection;

                    rig[id].cam.MotionDetector.rectX      = infoI.rectX;
                    rig[id].cam.MotionDetector.rectY      = infoI.rectY;
                    rig[id].cam.MotionDetector.rectHeight = infoI.rectHeight;
                    rig[id].cam.MotionDetector.rectWidth  = infoI.rectWidth;
                    rig[id].cam.movementVal = infoI.movementVal;



                    rig[id].cam.alarmActive   = infoI.alarmActive;
                    rig[id].cam.publishActive = infoI.publishActive;

                    infoExists = true;

                    break;
                }
            }

            //create the info
            if (!infoExists)
            {
                info infoI = new info();

                infoI.profileName = profileName;
                infoI.webcam      = rig[id].cameraName;
                camInfo.Add(infoI);

                rig[id].displayButton = infoI.displayButton;

                rig[id].cam.MotionDetector.areaDetectionWithin = infoI.areaDetectionWithin;
                rig[id].cam.MotionDetector.areaDetection       = infoI.areaDetection;
                rig[id].cam.MotionDetector.rectX      = infoI.rectX;
                rig[id].cam.MotionDetector.rectY      = infoI.rectY;
                rig[id].cam.MotionDetector.rectHeight = infoI.rectHeight;
                rig[id].cam.MotionDetector.rectWidth  = infoI.rectWidth;
                rig[id].cam.movementVal = infoI.movementVal;
            }
        }
Exemple #2
0
        public static void addInfo(string infoType, object val)
        {
            if (infoType == "webcam")
            {
                infoIdx++;
                info p_item = new info();
                camInfo.Add(p_item);
                camInfo[infoIdx].webcam = (string)val;
            }

            if (camInfo.Count > 0)
            {
                if (infoType == "profileName")
                {
                    camInfo[infoIdx].profileName = (string)val;
                }
                if (infoType == "friendlyName")
                {
                    camInfo[infoIdx].friendlyName = (string)val;
                }

                if (infoType == "areaDetection")
                {
                    camInfo[infoIdx].areaDetection = (bool)val;
                }
                if (infoType == "areaDetectionWithin")
                {
                    camInfo[infoIdx].areaDetectionWithin = (bool)val;
                }


                if (infoType == "alarmActive")
                {
                    camInfo[infoIdx].alarmActive = (bool)val;
                }
                if (infoType == "publishActive")
                {
                    camInfo[infoIdx].publishActive = (bool)val;
                }


                //may be of use in future
                if (infoType == "areaOffAtMotion")
                {
                    camInfo[infoIdx].areaOffAtMotion = (bool)val;
                }
                //may be of use in future

                if (infoType == "rectX")
                {
                    camInfo[infoIdx].rectX = (int)val;
                }
                if (infoType == "rectY")
                {
                    camInfo[infoIdx].rectY = (int)val;
                }
                if (infoType == "rectWidth")
                {
                    camInfo[infoIdx].rectWidth = (int)val;
                }
                if (infoType == "rectHeight")
                {
                    camInfo[infoIdx].rectHeight = (int)val;
                }
                if (infoType == "movementVal")
                {
                    camInfo[infoIdx].movementVal = (double)val;
                }
                if (infoType == "displayButton")
                {
                    camInfo[infoIdx].displayButton = (int)val;
                }



                if (infoType == "pubImage")
                {
                    camInfo[infoIdx].pubImage = (bool)val;
                }
                if (infoType == "pubTime")
                {
                    camInfo[infoIdx].pubTime = (int)val;
                }
                if (infoType == "pubHours")
                {
                    camInfo[infoIdx].pubHours = (bool)val;
                }
                if (infoType == "pubMins")
                {
                    camInfo[infoIdx].pubMins = (bool)val;
                }
                if (infoType == "pubSecs")
                {
                    camInfo[infoIdx].pubSecs = (bool)val;
                }
                if (infoType == "publishWeb")
                {
                    camInfo[infoIdx].publishWeb = (bool)val;
                }
                if (infoType == "publishLocal")
                {
                    camInfo[infoIdx].publishLocal = (bool)val;
                }
                if (infoType == "timerOn")
                {
                    camInfo[infoIdx].timerOn = (bool)val;
                }
                if (infoType == "fileURLPubWeb")
                {
                    camInfo[infoIdx].fileURLPubWeb = (string)val;
                }
                if (infoType == "filenamePrefixPubWeb")
                {
                    camInfo[infoIdx].filenamePrefixPubWeb = (string)val;
                }
                if (infoType == "cycleStampCheckedPubWeb")
                {
                    camInfo[infoIdx].cycleStampCheckedPubWeb = (int)val;
                }
                if (infoType == "startCyclePubWeb")
                {
                    camInfo[infoIdx].startCyclePubWeb = (int)val;
                }
                if (infoType == "endCyclePubWeb")
                {
                    camInfo[infoIdx].endCyclePubWeb = (int)val;
                }
                if (infoType == "currentCyclePubWeb")
                {
                    camInfo[infoIdx].currentCyclePubWeb = (int)val;
                }
                if (infoType == "stampAppendPubWeb")
                {
                    camInfo[infoIdx].stampAppendPubWeb = (bool)val;
                }
                if (infoType == "fileDirPubLoc")
                {
                    camInfo[infoIdx].fileDirPubLoc = (string)val;
                }
                if (infoType == "filenamePrefixPubLoc")
                {
                    camInfo[infoIdx].filenamePrefixPubLoc = (string)val;
                }
                if (infoType == "fileDirPubCust")
                {
                    camInfo[infoIdx].fileDirPubCust = (bool)val;
                }
                if (infoType == "cycleStampCheckedPubLoc")
                {
                    camInfo[infoIdx].cycleStampCheckedPubLoc = (int)val;
                }
                if (infoType == "startCyclePubLoc")
                {
                    camInfo[infoIdx].startCyclePubLoc = (int)val;
                }
                if (infoType == "endCyclePubLoc")
                {
                    camInfo[infoIdx].endCyclePubLoc = (int)val;
                }
                if (infoType == "currentCyclePubLoc")
                {
                    camInfo[infoIdx].currentCyclePubLoc = (int)val;
                }
                if (infoType == "stampAppendPubLoc")
                {
                    camInfo[infoIdx].stampAppendPubLoc = (bool)val;
                }

                if (infoType == "publishFirst")
                {
                    camInfo[infoIdx].publishFirst = (bool)val;
                }
                if (infoType == "lastPublished")
                {
                    camInfo[infoIdx].lastPublished = (int)val;
                }
            }

            //}
        }