Exemplo n.º 1
0
 private void ProcessRoc(RocScanMember member, Roc809 roc, IClient client)
 {
     if (member.ScanEventData)
     {
         ScanEventData(roc, client);
     }
     if (member.ScanAlarmData)
     {
         ScanAlarmData(roc, client);
     }
 }
Exemplo n.º 2
0
 private void ProcessPoint(RocScanMember member, Roc809 roc, Roc809MeasurePoint point, IClient client)
 {
     if (member.ScanMinuteData)
     {
         ScanMinuteData(roc, point, client);
     }
     if (member.ScanPeriodicData)
     {
         ScanPeriodicData(roc, point, client);
     }
     if (member.ScanDailyData)
     {
         ScanDailyData(roc, point, client);
     }
 }
Exemplo n.º 3
0
        public EditRocScanMemberForm()
        {
            InitializeComponent();

            Load += (sender, args) =>
            {
                if (!IsEdit)
                {
                    Member = new RocScanMember
                    {
                        ScanBaseId  = ScanBaseId,
                        EstimatorId = EstimatorId
                    };

                    cbScanEventData.Enabled    = !ExistentMembers.Any(m => m.EstimatorId == EstimatorId && m.ScanEventData);
                    cbScanAlarmData.Enabled    = !ExistentMembers.Any(m => m.EstimatorId == EstimatorId && m.ScanAlarmData);
                    cbScanMinuteData.Enabled   = !ExistentMembers.Any(m => m.EstimatorId == EstimatorId && m.ScanMinuteData);
                    cbScanPeriodicData.Enabled = !ExistentMembers.Any(m => m.EstimatorId == EstimatorId && m.ScanPeriodicData);
                    cbScanDailyData.Enabled    = !ExistentMembers.Any(m => m.EstimatorId == EstimatorId && m.ScanDailyData);
                }
                else
                {
                    cbScanEventData.Checked    = Member.ScanEventData;
                    cbScanAlarmData.Checked    = Member.ScanAlarmData;
                    cbScanMinuteData.Checked   = Member.ScanMinuteData;
                    cbScanPeriodicData.Checked = Member.ScanPeriodicData;
                    cbScanDailyData.Checked    = Member.ScanDailyData;

                    cbScanEventData.Enabled    = !ExistentMembers.Except(new[] { Member }).Any(m => m.EstimatorId == Member.EstimatorId && m.ScanEventData);
                    cbScanAlarmData.Enabled    = !ExistentMembers.Except(new[] { Member }).Any(m => m.EstimatorId == Member.EstimatorId && m.ScanAlarmData);
                    cbScanMinuteData.Enabled   = !ExistentMembers.Except(new[] { Member }).Any(m => m.EstimatorId == Member.EstimatorId && m.ScanMinuteData);
                    cbScanPeriodicData.Enabled = !ExistentMembers.Except(new[] { Member }).Any(m => m.EstimatorId == Member.EstimatorId && m.ScanPeriodicData);
                    cbScanDailyData.Enabled    = !ExistentMembers.Except(new[] { Member }).Any(m => m.EstimatorId == Member.EstimatorId && m.ScanDailyData);
                }

                bool showInfo = !cbScanEventData.Enabled || !cbScanAlarmData.Enabled || !cbScanMinuteData.Enabled ||
                                !cbScanPeriodicData.Enabled || !cbScanDailyData.Enabled;

                info.SetError(cbScanEventData, !showInfo ? "" : "Деякі дані обчислювача вже опитуються");

                btnSave.Enabled = cbScanEventData.Enabled || cbScanAlarmData.Enabled || cbScanMinuteData.Enabled ||
                                  cbScanPeriodicData.Enabled || cbScanDailyData.Enabled;
            };

            btnCancel.Select();
        }