How to find Camera MAKE and MODEL.

I started with …

Home > Plug-in Integration > Samples Index > Server Side Carrousel

For each selected camera, I would like to get MAKE and MODEL.

I could not find those pieces of information.

Here is the list of things that did not work for me …

====LOOP Through [Panasonic SPxxx/SFxxx/SWxxx no I/O Camera Series (**.**.**.***) - Camera 1].Properties …

[0]Address: http://**.**.**.***:****/

[1]Channel: 0

[2]UserName: ****

[3]Password: *****

[4]Location:

[5]Description:

[6]Enabled: No

[7]WebServerURI: http://**.**.**.***:****/

[8]ProductID: Panasonic WV-SP105

[9]LastModified: Friday, March 31, 2017 3:18:12 PM

[10]FPS: 8.0

[11]PTZ: No

[12]DBID: ********-****-****-****-************

[13]MacAddress: ************

[14]UsingPrebuffer: True

[15]Prebufferms: 3

[16]RecordingFPS: 5

[17]EdgeStorageEnabled: False

[18]StorageId: ********-****-****-****-************

[19]StorageName: t1

… DONE.LOOP Through [camItem].Properties.

cam.Name…: Panasonic SPxxx/SFxxx/SWxxx no I/O Camera Series (10.11.11.190) - Camera 1

cam.ShortName..:

cam.Description:

cam.DisplayName: Panasonic SPxxx/SFxxx/SWxxx no I/O Camera Series (10.11.11.190) - Camera 1

cam.Id…: ********-****-****-****-************

cam.ItemCategry: Item

cam.ParentPath.: Hardware[********-****-****-****-************]/CameraFolder

cam.Path…: Camera[********-****-****-****-************]

= LOOP Through cam.PropertyKeys …

[0]:id: ********-****-****-****-************

[1]:Name: Panasonic SPxxx/SFxxx/SWxxx no I/O Camera Series (10.11.11.190) - Camera 1

[2]:Channel: 0

[3]:Description:

[4]:CreatedDate: 0001-01-01T00:00:00.0000000

[5]:LastModified: 2017-03-31T19:18:12.0800000Z

[6]:GisPoint: POINT EMPTY

[7]:ShortName:

[8]:Icon: 0

[9]:CoverageDirection: 0

[10]:CoverageDepth: 0

[11]:CoverageFieldOfView: 0

[12]:RecordingFramerate: 5

[13]:RecordKeyframesOnly: False

[14]:RecordOnRelatedDevices: True

[15]:RecordingEnabled: True

[16]:PrebufferEnabled: True

[17]:PrebufferInMemory: True

[18]:PrebufferSeconds: 3

[19]:EdgeStorageEnabled: False

[20]:EdgeStoragePlaybackEnabled: False

[21]:ManualRecordingTimeoutEnabled: True

[22]:ManualRecordingTimeoutMinutes: 5

[23]:RecordingStorage: Storage[********-****-****-****-************]

… DONE.LOOP Through cam.PropertyKeys.

If you use configuration API to access the camera (either through raw configuration API or using ConfigurationItems.Camera) you will see that the camera items has a Hardware in its ParentPath property. If you then look up the hardware using this path you will see that the hardware has a HardwareDriverPath which can be used for looking up the HardwareDriver. On these 3 objects together you should be able to find the information you need.

I think I need help knowing what to do with …

ParentPath: Hardware[f92043f8-2e15-4c3a-bf81-10315e524bbe]/CameraFolder

… to “look up the hardware using this path” like you said?

I parsed out the “f92043f8-2e15-4c3a-bf81-10315e524bbe” and tried to use it.

But that was probably wrong. Doing that led to:

traversing the config to find the above guid, and several Hardware() constructors, I either got exceptions and then later I got all blank MAKE and MODEL’s.

Please let me know how to "look up the hardware using this path". Thanks.

Not working code I’m using that results in Blank MAKE and MODEL

#region 1ST.TRY to get MAKE and MODEL
for (int dumbIdx = 0; dumbIdx < 1; dumbIdx++)
{
	// 2020-05-14
	VideoOS.Platform.ConfigurationItems.Camera currentCamera = new VideoOS.Platform.ConfigurationItems.Camera(camItem.FQID);
	gotTo = 870;
	string parentPath = currentCamera.ParentPath;
	gotTo = 880;
	// [_]: Look up the hardware using this path.
	// currentCamera.ParentPath: Hardware[f043f928-215e-4b2a-bf81-10315ebe4b52]/CameraFolder
	//try1: VideoOS.Platform.ConfigurationItems.Hardware hWare
	//try1: 	= new VideoOS.Platform.ConfigurationItems.Hardware(camItem.FQID.ServerId, parentPath);
	string[] parentPathAy1 = parentPath.Split(']');
	string[] parentPathAy2 = parentPathAy1[0].Split('[');
	if (parentPathAy2.Length < 2)
	{
		configCameras.CameraConfigs[camIdx].Make = (productID != null ? productID : "unknown");
		configCameras.CameraConfigs[camIdx].Model = (productID != null ? productID : "unknown");
		break; // break out of dummy loop
	}
	string hardwareGuid = parentPathAy2[1];
	int methodToTry = 3;
	FQID hardwareItemsRoot_FQID = null;
	#region 3 constructors for Hardware()
	// Hardware (ServerId serverId, ConfigurationItem hardware) 
	// Hardware (ServerId serverId, string path) 
	// Hardware (FQID fqid) 
	#endregion 3 constructors for Hardware()
	VideoOS.Platform.ConfigurationItems.Hardware hWare = null;
	Item ConfigurationItem_hardware = null; // ConfigurationItem hardware
	switch (methodToTry)
{
	case 1:
		hWare = new VideoOS.Platform.ConfigurationItems.Hardware(camItem.FQID);
		break;
	case 2:
		hWare = new VideoOS.Platform.ConfigurationItems.Hardware(camItem.GetParent().FQID);
		break;
	case 3:
		//might.not.be.related: VideoOS.Platform.ConfigurationItems.Hardware hWare = new VideoOS.Platform.ConfigurationItems.Hardware(hardwareGuid);
		//VideoOS.Platform.ConfigurationItems.getc
		// [_]get: hWare = ;
		// Given: currentCamera.ParentPath: Hardware[f0f94328-215e-4ab2-bf81-1031e45ebb52]/CameraFolder
		// .....: string hardwareGuid = parentPathAy2[1];
		hWare = null;
		//List<Item> hardwareItemsRoot = Configuration.Instance.GetItemsByKind(Kind.Hardware);
		List<Item> hardwareItemsRoot = Configuration.Instance.GetItems();
		hardwareGuid = hardwareGuid.ToLower(); //  parentPathAy2[1];
		for (int hIdx = 0; hIdx < hardwareItemsRoot.Count; hIdx++)
		{
			#region loop through
			//private static FQID traverseHardwareConfig(Item hardwareItem, string hardwareGuid)
			FQID hWareFQID = traverseHardwareConfig(hardwareItemsRoot[hIdx], hardwareGuid, ref ConfigurationItem_hardware);
			if (hWareFQID != null)
			{
				#region 3 constructors for Hardware()
				// Hardware (ServerId serverId, ConfigurationItem hardware) 
				// Hardware (ServerId serverId, string path) 
				// Hardware (FQID fqid) 
				#endregion 3 constructors for Hardware()
				hWare = new VideoOS.Platform.ConfigurationItems.Hardware(hWareFQID);
				//hWare = new VideoOS.Platform.ConfigurationItems.Hardware(camItem.FQID.ServerId, ConfigurationItem_hardware.CameraFolder);
				//hWare = new VideoOS.Platform.ConfigurationItems.Hardware(camItem.FQID.ServerId, ConfigurationItem_hardware.path);
				break;
			}
			#endregion loop through
		}
		break;
    }
 
	gotTo = 890;
	// [_]: You will see that the hardware has a HardwareDriverPath
	// ? hWare.HardwareDriverPath
	string deviceDriver_name = hWare.HardwareDriverPath;
	gotTo = 900;
	// [_]: HardwareDriverPath can be used for looking up the HardwareDriver.
	if (hardwareItemsRoot_FQID == null)
		break; // break out of dummy loop
	VideoOS.Platform.ConfigurationItems.HardwareDriver hWareDriver
		//= new VideoOS.Platform.ConfigurationItems.HardwareDriver(camItem.FQID.ServerId, deviceDriver_name);
		= new VideoOS.Platform.ConfigurationItems.HardwareDriver(hardwareItemsRoot_FQID);
 
	//Exception.on.above.line: "Value cannot be null. Parameter name: path"
 
	gotTo = 910;
	//HardwareDriver(ServerId serverId, string path)
	// ...: On these 3 objects together you should be able to find the information you need.
	gotTo = 920;
	configCameras.CameraConfigs[camIdx].Make = hWareDriver.GetProperty("Make");
	configCameras.CameraConfigs[camIdx].Model = hWareDriver.GetProperty("Model");
 
}
#endregion 1ST.TRY to get MAKE and MODEL

Forgive me for not trying to understand your code and please try this:

Camera camera = new Camera(cameraFQID);
Hardware hardware = new Hardware(EnvironmentManager.Instance.CurrentSite.ServerId, camera.ParentItemPath);
label1.Text= hardware.Model;

Does it fit?