Beispiel #1
0
        public void Create()
        {
            // Create columns (3 in total).
            // Please see the documentation of constructors in Item_Array.ArrayColumn to
            // see which data types are supported.
            var myColumns = new SysColl.List<MsgMeas.Item_Array.ArrayColumn>()
            {
                new MsgMeas.Item_Array.ArrayColumn(typeof(DateTime), "timestamp"),
                new MsgMeas.Item_Array.ArrayColumn(typeof(double), "temperature", "Cel"),
                new MsgMeas.Item_Array.ArrayColumn(typeof(long), "batchcount")
            };

            // Create the array item and its rows (2 rows in total).
            // These must match respective column types.
            var myArray = new MsgMeas.Item_Array(myColumns)
            {
                { DateTime.Now.ToUniversalTime().AddHours(-1), -4.2, (long)29 },
                { DateTime.Now.ToUniversalTime(), -3.8, (long)32 }
            };

            // You can also use the "Add" method instead of the array initialiser shown above.
            // The Add method can take any number of arguments.
            myArray.Add(DateTime.Now.ToUniversalTime(), -2.1, (long)36);

            // Now, you can enclose the array in an Observation or Item_DataRecord. E.g.,
            var myObservation = new MsgMeas.Observation(myArray);
            byte[] xmlBytes = myObservation.ToXmlBytes();
        }
Beispiel #2
0
        private void AddProductionSchedules(ItemsControl parent, SysColl.List <MsgBiz.ProductionSchedule> schedules)
        {
            // Add each schedule
            foreach (var sched in schedules)
            {
                // Add schedule node
                var scheduleNode = AddNodeToTreeview(parent, "ProductionSchedule");

                // Adding production requests
                for (int a = 0; a < sched.ProductionRequests.Count; ++a)
                {
                    AddOneProductionRequest(scheduleNode, sched.ProductionRequests[a], a + 1);
                }
            }
        }