Beispiel #1
0
 public void Run()
 {
     try {
         // Select a point
         Console.WriteLine("\nPlease enter the equipment ID to retrieve all related points:");
         string equipmentID = Console.ReadLine();
         IEnumerable <MetasysPoint> equipmentPoints = client.GetEquipmentPoints(new Guid(equipmentID));
         Console.WriteLine($"Points found: {equipmentPoints.Count()}");
         foreach (var p in equipmentPoints)
         {
             Console.WriteLine($"\n{p.ShortName}: {p.Label}, {p.PresentValue?.StringValue}");
         }
     }
     catch (Exception exception) {
         log.Logger.Error(string.Format("An error occured while getting space information - {0}", exception.Message));
         Console.WriteLine("\n \nAn Error occurred. Press Enter to return to Main Menu");
     }
     Console.ReadLine();
 }
Beispiel #2
0
        private void GetEquipmentPoints(MetasysObject sampleEquipment)
        {
            /* SNIPPET 5: START */
            IEnumerable <MetasysPoint> equipmentPoints = client.GetEquipmentPoints(sampleEquipment.Id);
            MetasysPoint point        = equipmentPoints.FindByShortName("Analog Input-1");
            string       presentValue = point.PresentValue?.StringValue;

            Console.WriteLine(point);

            /*
             *  {
             *    "EquipmentName": "AHU-07",
             *    "ShortName": "CLG-O",
             *    "Label": "Cooling Output",
             *    "Category": "",
             *    "IsDisplayData": true,
             *    "ObjectId": "9dd107cf-e8dc-583a-9557-813395ae1971",
             *    "AttributeUrl": "https://win2016-vm2/api/v2/enumSets/509/members/85",
             *    "ObjectUrl": "https://win2016-vm2/api/v2/objects/9dd107cf-e8dc-583a-9557-813395ae1971",
             *    "PresentValue": {
             *      "StringValue": "0",
             *      "StringValueEnumerationKey": null,
             *      "NumericValue": 0.0,
             *      "BooleanValue": false,
             *      "ArrayValue": null,
             *      "Attribute": "presentValue",
             *      "Id": "9dd107cf-e8dc-583a-9557-813395ae1971",
             *      "Reliability": "Reliable",
             *      "ReliabilityEnumerationKey": "reliabilityEnumSet.reliable",
             *      "Priority": "0 (No Priority)",
             *      "PriorityEnumerationKey": "writePriorityEnumSet.priorityNone",
             *      "IsReliable": true
             *    }
             *  }
             */
            /* SNIPPET 5: END */
        }