Beispiel #1
0
        static void Main(string[] args)
        {
            // This factory method is new in 2.8.
            PISystem ps = PISystem.CreatePISystem("PISRV01");

            //This is an example
            //using (new AFProbe("FindElementsByAttribute", ps))
            //{
            //    AFDatabase db = ps.Databases["Feeder Voltage Monitoring"];

            //    AFElementTemplate elemTemplate = db.ElementTemplates["Substation Transformer"];

            //    var avq = new[]
            //    {
            //        new AFAttributeValueQuery(elemTemplate.AttributeTemplates["Model"], AFSearchOperator.Equal, "506A"),
            //    };

            //    var elements = AFElement.FindElementsByAttribute(null, "*", avq, true, AFSortField.Name, AFSortOrder.Ascending, 100);
            //}

            using (new AFProbe("PrintAttributeCounts", ps))
            {
                // Your code here
            }

            Console.WriteLine("Press any key to quit");
            Console.ReadKey();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            // This factory method is new in 2.8.
            PISystem ps = PISystem.CreatePISystem("PISRV01");

            using (new AFProbe("PrintAttributeCounts", ps))
            {
                AFDatabase db = ps.Databases["Feeder Voltage Monitoring"];

                // Build search object
                AFSearchToken searchToken = new AFSearchToken(
                    filter: AFSearchFilter.Root,
                    searchOperator: AFSearchOperator.Equal,
                    value: db.Elements["Assets"].GetPath());

                AFElementSearch elementSearch = new AFElementSearch(db, "Feeders and Transformers", new[] { searchToken });

                Console.WriteLine("Feeders and Transformers");
                // Use full load: true to fully load the elements
                foreach (AFElement element in elementSearch.FindElements(fullLoad: true))
                {
                    Console.WriteLine("Element: {0}, # Attributes: {1}", element.Name, element.Attributes.Count);
                }
                Console.WriteLine();
            }

            Console.WriteLine();
            Console.WriteLine("Press any key to quit");
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            PISystem   system = PISystem.CreatePISystem("localhost");
            AFDatabase kitdb  = system.Databases["Database85"];

            SwitchToJapanese(kitdb);

            // Create the translation service.

            kitdb.CheckIn();
            Console.ReadLine();
        }
 public EventFrameSearch()
 {
     InitializeComponent();
     this.db = PISystem.CreatePISystem("localhost").Databases["JDIData"];
 }