当前位置: 首页>>代码示例>>C#>>正文


C# ChangeSet.Update方法代码示例

本文整理汇总了C#中ChangeSet.Update方法的典型用法代码示例。如果您正苦于以下问题:C# ChangeSet.Update方法的具体用法?C# ChangeSet.Update怎么用?C# ChangeSet.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ChangeSet的用法示例。


在下文中一共展示了ChangeSet.Update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MeasurementCache

        public MeasurementCache(DatabaseTemplate template)
        {
            var values = new ChangeSet();
            template.binaries.EachIndex((m, i) => values.Update(new Binary(Flags.RESTART), Convert.ToUInt16(i)));
            template.doubleBinaries.EachIndex((m, i) => values.Update(new DoubleBitBinary(Flags.RESTART), Convert.ToUInt16(i)));
            template.counters.EachIndex((m, i) => values.Update(new Counter(Flags.RESTART), Convert.ToUInt16(i)));
            template.frozenCounters.EachIndex((m, i) => values.Update(new FrozenCounter(Flags.RESTART), Convert.ToUInt16(i)));
            template.analogs.EachIndex((m, i) => values.Update(new Analog(Flags.RESTART), Convert.ToUInt16(i)));
            template.binaryOutputStatii.EachIndex((m, i) => values.Update(new BinaryOutputStatus(Flags.RESTART), Convert.ToUInt16(i)));
            template.analogOutputStatii.EachIndex((m, i) => values.Update(new AnalogOutputStatus(Flags.RESTART), Convert.ToUInt16(i)));
            template.timeAndIntervals.EachIndex((m, i) => values.Update(new TimeAndInterval(0, 0, IntervalUnits.Undefined), Convert.ToUInt16(i)));

            this.Load(values);
        }
开发者ID:automatak,项目名称:dnp3-simulator,代码行数:14,代码来源:MeasurementCache.cs

示例2: LoadSingleBinaryOutputStatus

 void LoadSingleBinaryOutputStatus(bool value, ushort index, DateTime timestamp)
 {
     var changes = new ChangeSet();
     changes.Update(new BinaryOutputStatus(value, 0x01, timestamp), index);
     loader.Load(changes);
 }
开发者ID:automatak,项目名称:dnp3-simulator,代码行数:6,代码来源:CommandHandlerControl.cs

示例3: handler_AnalogCommandAccepted

 void handler_AnalogCommandAccepted(double value, ushort index)
 {
     if (this.InvokeRequired)
     {
         this.BeginInvoke(new Action(() => handler_AnalogCommandAccepted(value, index)));
     }
     else
     {
         var output = String.Format("Accepted Analog: {0} - {1}", value, index);
         this.listBoxLog.Items.Add(output);
         if (checkBoxMapAnalog.Checked)
         {
             var changes = new ChangeSet();
             changes.Update(new AnalogOutputStatus(value, 0x01, DateTime.Now), index);
             loader.Load(changes);
         }
     }
 }
开发者ID:automatak,项目名称:dnp3-simulator,代码行数:18,代码来源:CommandHandlerControl.cs

示例4: UpdateValues

        private void UpdateValues()
        {
            var changes = new ChangeSet();
            var now = DateTime.Now;

            changes.Update(new Binary(closed, 1, now), 0);

            if (closed)
            {
                changes.Update(new Analog(currentA.Current, 1, now), 0);
                changes.Update(new Analog(currentB.Current, 1, now), 1);
                changes.Update(new Analog(currentC.Current, 1, now), 2);

                this.labelValueIA.Text = String.Format("IA: {0}", currentA.Current);
                this.labelValueIB.Text = String.Format("IB: {0}", currentB.Current);
                this.labelValueIC.Text = String.Format("IC: {0}", currentC.Current);

                currentA.MoveNext();
                currentB.MoveNext();
                currentC.MoveNext();
            }
            else
            {
                changes.Update(new Analog(0, 1, now), 0);
                changes.Update(new Analog(0, 1, now), 1);
                changes.Update(new Analog(0, 1, now), 2);

                this.labelValueIA.Text = String.Format("IA: {0}", 0);
                this.labelValueIB.Text = String.Format("IB: {0}", 0);
                this.labelValueIC.Text = String.Format("IC: {0}", 0);
            }

            changes.Update(new Analog(voltageA.Current, 1, now), 3);
            changes.Update(new Analog(voltageB.Current, 1, now), 4);
            changes.Update(new Analog(voltageC.Current, 1, now), 5);

            this.labelValueVA.Text = String.Format("VA: {0}", voltageA.Current);
            this.labelValueVB.Text = String.Format("VB: {0}", voltageB.Current);
            this.labelValueVC.Text = String.Format("VC: {0}", voltageC.Current);

            voltageA.MoveNext();
            voltageB.MoveNext();
            voltageC.MoveNext();

            outstation.Load(changes);
        }
开发者ID:automatak,项目名称:dnp3-simulator,代码行数:46,代码来源:OutstationForm.cs


注:本文中的ChangeSet.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。