public static void rigInfoPopulate(string profileName, int id) { bool infoExists = false; foreach (cameraSpecificInfo 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.areaDetectionWithin = infoI.areaDetectionWithin; rig[id].cam.areaDetection = infoI.areaDetection; rig[id].cam.rectX = infoI.rectX; rig[id].cam.rectY = infoI.rectY; rig[id].cam.rectHeight = infoI.rectHeight; rig[id].cam.rectWidth = infoI.rectWidth; rig[id].cam.movementVal = infoI.movementVal; //rig[id].cam.timeSpike = infoI.timeSpike; //rig[id].cam.toleranceSpike = infoI.toleranceSpike; rig[id].cam.alarmActive = infoI.alarmActive; rig[id].cam.publishActive = infoI.publishActive; infoExists = true; break; } } //create the info if (!infoExists) { cameraSpecificInfo infoI = new cameraSpecificInfo(); infoI.profileName = profileName; infoI.webcam = rig[id].cameraName; camInfo.Add(infoI); rig[id].displayButton = infoI.displayButton; rig[id].cam.areaDetectionWithin = infoI.areaDetectionWithin; rig[id].cam.areaDetection = infoI.areaDetection; rig[id].cam.rectX = infoI.rectX; rig[id].cam.rectY = infoI.rectY; rig[id].cam.rectHeight = infoI.rectHeight; rig[id].cam.rectWidth = infoI.rectWidth; rig[id].cam.movementVal = infoI.movementVal; //rig[id].cam.timeSpike = infoI.timeSpike; //rig[id].cam.toleranceSpike = infoI.toleranceSpike; } }
public static void addInfo(infoEnum infoType, object val) { if (infoType == infoEnum.webcam) { //newcode //rigItem rig_item = new rigItem(); //rig_item.cameraName = (string)val; //rig.Add(rig_item); //newcode infoIdx++; cameraSpecificInfo p_item = new cameraSpecificInfo(); camInfo.Add(p_item); camInfo[infoIdx].webcam = (string)val; } if (camInfo.Count > 0) { if (infoType == infoEnum.profileName) { camInfo[infoIdx].profileName = (string)val; } if (infoType == infoEnum.friendlyName) { camInfo[infoIdx].friendlyName = (string)val; } if (infoType == infoEnum.areaDetection) { camInfo[infoIdx].areaDetection = (bool)val; } if (infoType == infoEnum.areaDetectionWithin) { camInfo[infoIdx].areaDetectionWithin = (bool)val; } if (infoType == infoEnum.alarmActive) { camInfo[infoIdx].alarmActive = (bool)val; } if (infoType == infoEnum.publishActive) { camInfo[infoIdx].publishActive = (bool)val; } //may be of use in future if (infoType == infoEnum.areaOffAtMotion) { camInfo[infoIdx].areaOffAtMotion = (bool)val; } //may be of use in future if (infoType == infoEnum.rectX) { camInfo[infoIdx].rectX = (int)val; } if (infoType == infoEnum.rectY) { camInfo[infoIdx].rectY = (int)val; } if (infoType == infoEnum.rectWidth) { camInfo[infoIdx].rectWidth = (int)val; } if (infoType == infoEnum.rectHeight) { camInfo[infoIdx].rectHeight = (int)val; } if (infoType == infoEnum.movementVal) { camInfo[infoIdx].movementVal = (double)val; } if (infoType == infoEnum.timeSpike) { camInfo[infoIdx].timeSpike = (int)val; } if (infoType == infoEnum.toleranceSpike) { camInfo[infoIdx].toleranceSpike = (int)val; } if (infoType == infoEnum.lightSpike) { camInfo[infoIdx].lightSpike = (bool)val; } if (infoType == infoEnum.displayButton) { camInfo[infoIdx].displayButton = (int)val; } if (infoType == infoEnum.pubImage) { camInfo[infoIdx].pubImage = (bool)val; } if (infoType == infoEnum.pubTime) { camInfo[infoIdx].pubTime = (int)val; } if (infoType == infoEnum.pubHours) { camInfo[infoIdx].pubHours = (bool)val; } if (infoType == infoEnum.pubMins) { camInfo[infoIdx].pubMins = (bool)val; } if (infoType == infoEnum.pubSecs) { camInfo[infoIdx].pubSecs = (bool)val; } if (infoType == infoEnum.publishWeb) { camInfo[infoIdx].publishWeb = (bool)val; } if (infoType == infoEnum.publishLocal) { camInfo[infoIdx].publishLocal = (bool)val; } if (infoType == infoEnum.timerOn) { camInfo[infoIdx].timerOn = (bool)val; } if (infoType == infoEnum.fileURLPubWeb) { camInfo[infoIdx].fileURLPubWeb = (string)val; } if (infoType == infoEnum.filenamePrefixPubWeb) { camInfo[infoIdx].filenamePrefixPubWeb = (string)val; } if (infoType == infoEnum.cycleStampCheckedPubWeb) { camInfo[infoIdx].cycleStampCheckedPubWeb = (int)val; } if (infoType == infoEnum.startCyclePubWeb) { camInfo[infoIdx].startCyclePubWeb = (int)val; } if (infoType == infoEnum.endCyclePubWeb) { camInfo[infoIdx].endCyclePubWeb = (int)val; } if (infoType == infoEnum.currentCyclePubWeb) { camInfo[infoIdx].currentCyclePubWeb = (int)val; } if (infoType == infoEnum.stampAppendPubWeb) { camInfo[infoIdx].stampAppendPubWeb = (bool)val; } if (infoType == infoEnum.fileDirPubLoc) { camInfo[infoIdx].fileDirPubLoc = (string)val; } if (infoType == infoEnum.filenamePrefixPubLoc) { camInfo[infoIdx].filenamePrefixPubLoc = (string)val; } if (infoType == infoEnum.fileDirPubCust) { camInfo[infoIdx].fileDirPubCust = (bool)val; } if (infoType == infoEnum.cycleStampCheckedPubLoc) { camInfo[infoIdx].cycleStampCheckedPubLoc = (int)val; } if (infoType == infoEnum.startCyclePubLoc) { camInfo[infoIdx].startCyclePubLoc = (int)val; } if (infoType == infoEnum.endCyclePubLoc) { camInfo[infoIdx].endCyclePubLoc = (int)val; } if (infoType == infoEnum.currentCyclePubLoc) { camInfo[infoIdx].currentCyclePubLoc = (int)val; } if (infoType == infoEnum.stampAppendPubLoc) { camInfo[infoIdx].stampAppendPubLoc = (bool)val; } if (infoType == infoEnum.publishFirst) { camInfo[infoIdx].publishFirst = (bool)val; } if (infoType == infoEnum.lastPublished) { camInfo[infoIdx].lastPublished = (int)val; } if (infoType == infoEnum.ipWebcamAddress) { camInfo[infoIdx].ipWebcamAddress = (string)val; } if (infoType == infoEnum.ipWebcamUser) { camInfo[infoIdx].ipWebcamUser = (string)val; } if (infoType == infoEnum.ipWebcamPassword) { camInfo[infoIdx].ipWebcamPassword = (string)val; } } }
public static object rigInfoGet(string profile, string webcamIdentifier, infoEnum property) { cameraSpecificInfo infoI = CamsInfo.Where(x => x.profileName == profile && x.webcam == webcamIdentifier).FirstOrDefault(); if (property == infoEnum.friendlyName) { return(infoI.friendlyName); } if (property == infoEnum.areaDetection) { return(infoI.areaDetection); } if (property == infoEnum.areaDetectionWithin) { return(infoI.areaDetectionWithin); } if (property == infoEnum.areaOffAtMotion) { return(infoI.areaOffAtMotion); } if (property == infoEnum.rectX) { return(infoI.rectX); } if (property == infoEnum.rectY) { return(infoI.rectY); } if (property == infoEnum.rectWidth) { return(infoI.rectWidth); } if (property == infoEnum.rectHeight) { return(infoI.rectHeight); } if (property == infoEnum.movementVal) { return(infoI.movementVal); } if (property == infoEnum.timeSpike) { return(infoI.timeSpike); } if (property == infoEnum.toleranceSpike) { return(infoI.toleranceSpike); } if (property == infoEnum.lightSpike) { return(infoI.lightSpike); } if (property == infoEnum.alarmActive) { return(infoI.alarmActive); } if (property == infoEnum.publishActive) { return(infoI.publishActive); } if (property == infoEnum.pubImage) { return(infoI.pubImage); } if (property == infoEnum.pubTime) { return(infoI.pubTime); } if (property == infoEnum.pubHours) { return(infoI.pubHours); } if (property == infoEnum.pubMins) { return(infoI.pubMins); } if (property == infoEnum.pubSecs) { return(infoI.pubSecs); } if (property == infoEnum.publishWeb) { return(infoI.publishWeb); } if (property == infoEnum.publishLocal) { return(infoI.publishLocal); } if (property == infoEnum.timerOn) { return(infoI.timerOn); } if (property == infoEnum.fileURLPubWeb) { return(infoI.fileURLPubWeb); } if (property == infoEnum.filenamePrefixPubWeb) { return(infoI.filenamePrefixPubWeb); } if (property == infoEnum.cycleStampCheckedPubWeb) { return(infoI.cycleStampCheckedPubWeb); } if (property == infoEnum.startCyclePubWeb) { return(infoI.startCyclePubWeb); } if (property == infoEnum.endCyclePubWeb) { return(infoI.endCyclePubWeb); } if (property == infoEnum.currentCyclePubWeb) { return(infoI.currentCyclePubWeb); } if (property == infoEnum.stampAppendPubWeb) { return(infoI.stampAppendPubWeb); } if (property == infoEnum.fileDirPubLoc) { return(infoI.fileDirPubLoc); } if (property == infoEnum.filenamePrefixPubLoc) { return(infoI.filenamePrefixPubLoc); } if (property == infoEnum.fileDirPubCust) { return(infoI.fileDirPubCust); } if (property == infoEnum.cycleStampCheckedPubLoc) { return(infoI.cycleStampCheckedPubLoc); } if (property == infoEnum.startCyclePubLoc) { return(infoI.startCyclePubLoc); } if (property == infoEnum.endCyclePubLoc) { return(infoI.endCyclePubLoc); } if (property == infoEnum.currentCyclePubLoc) { return(infoI.currentCyclePubLoc); } if (property == infoEnum.stampAppendPubLoc) { return(infoI.stampAppendPubLoc); } if (property == infoEnum.publishFirst) { return(infoI.publishFirst); } if (property == infoEnum.lastPublished) { return(infoI.lastPublished); } if (property == infoEnum.ipWebcamAddress) { return(infoI.ipWebcamAddress); } if (property == infoEnum.ipWebcamUser) { return(infoI.ipWebcamUser); } if (property == infoEnum.ipWebcamPassword) { return(infoI.ipWebcamPassword); } return(null); }