Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structure data object from MmsVariableSpecification is diffrent with value when received dataset from rcb #502

Open
Tivaty opened this issue Apr 10, 2024 · 3 comments
Labels

Comments

@Tivaty
Copy link

Tivaty commented Apr 10, 2024

Problem:

Structure data object from MmsVariableSpecification is diffrent with value when received dataset from rcb

Code:

Debug.WriteLine("\t" + dataObj.name);
// when receiving data from rcb, we receive full dataset so we need index element to retrieve data correctly

List<string> daNames = con.GetDataDirectoryFC(ObjectReference.getElementName(dataObj.name));
for (int ii = 0; ii < daNames.Count; ii++)
{
	// only DA with same type FC is add to dataset tree
	if (ObjectReference.getFC(daNames[ii]) == ObjectReference.getFC(dataObj.name)) 
	{
		string daName = daNames[ii];
		string daRef = ObjectReference.getElementName(dataObj.name) + "." + ObjectReference.getElementName(daName);

		var daElements = new DataElement(daRef, rcbRef: dsNode.rcbRef, dsNode.rptId, new List<int>(doElement.ElementIndex));
		daElements.ElementIndex.Add(ii);

		MmsVariableSpecification specification = con.GetVariableSpecification(daRef, ObjectReference.getFC(daName));

		Debug.WriteLine("\t\t" + daName + " : " + specification.GetType() + "(" + specification.Size() + ")");
		doElement.AddChild(daElements);

		if (specification.GetType() == MmsType.MMS_STRUCTURE)
		{
			for (int iii = 0; iii < specification.Size(); iii++)
			{
				MmsVariableSpecification elementSpec = specification.GetElement(iii);

				string daSpecName = daRef + "." + elementSpec.GetName();
				var daSpecElement = new DataElement(daSpecName, dsNode.rcbRef, dsNode.rptId, new List<int>(daElements.ElementIndex));
				daSpecElement.ElementIndex.Add(iii);

				Debug.WriteLine("\t\t\t" + elementSpec.GetName() + " : " + elementSpec.GetType());
				daElements.AddChild(daSpecElement);

				if (elementSpec.GetType() == MmsType.MMS_STRUCTURE)
				{
					for (int iiii = 0; iiii < elementSpec.Size(); iiii++)
					{
						MmsVariableSpecification elementSpecSpec = elementSpec.GetElement(iiii);
						string daSpecSpecName = daSpecName + "." + elementSpecSpec.GetName();
						var daSpecSpecElement = new DataElement(daSpecSpecName, dsNode.rcbRef, dsNode.rptId, new List<int>(daSpecElement.ElementIndex));
						daSpecSpecElement.ElementIndex.Add(iiii);

						Debug.WriteLine("\t\t\t\t" + elementSpecSpec.GetName() + " : " + elementSpecSpec.GetType());
						daSpecElement.AddChild(daSpecSpecElement);
					}
				}
			}
		}
	}
}

Result when read DataObject atrribute names:

17:25:13:418		BCU_131_T1SP/GGIO110.Ind1[ST]
17:25:14:179			q[ST] : MMS_BIT_STRING(-13)
17:25:14:179			stVal[ST] : MMS_BOOLEAN(-1)
17:25:14:179			t[ST] : MMS_UTC_TIME(-1)

=> quality is in position 0

Result when received a rcb:

element 0 included for reason REASON_INTEGRITY {True, 0000000000000, 4/10/2024 8:29:26 AM +00:00} data-ref: BCU_131_T1SP/GGIO110$ST$Ind1

=> quality is in position 1

@mzillgith
Copy link
Contributor

The GetDataDirectoryFC function is based on the get-name-list-service. This service returns the result in alphabetic order and not the real order in the data model. Therefore this service is not suitable to determine the order of elements in data set entries.

@Tivaty
Copy link
Author

Tivaty commented Apr 11, 2024

The GetDataDirectoryFC function is based on the get-name-list-service. This service returns the result in alphabetic order and not the real order in the data model. Therefore this service is not suitable to determine the order of elements in data set entries.

==> Please tell me which service or method I can get the correct order of data set / data object entries

@Tivaty
Copy link
Author

Tivaty commented May 28, 2024

@mzillgith Please, Can you tell me how to get the correct order of Data Attribute name ?
I can not parse data from Dataset - Report because I can not get to the correct order name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants