123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Edge.Core.Configuration
- {
- public class DeviceProcessorConfiguration
- {
- public List<Processor> Processor { get; set; }
- public override bool Equals(object obj)
- {
- if (obj == null) return false;
- if (!(obj is DeviceProcessorConfiguration target)) return false;
- else
- {
- if (this.Processor.Count != target.Processor.Count) return false;
- for (int i = 0; i < this.Processor.Count; i++)
- if (!this.Processor[i].Equals(target.Processor[i])) return false;
- return true;
- }
- }
- }
- public class Processor
- {
- /// <summary>
- /// Unique for each processor configuration in settings.xml
- /// </summary>
- public string Name { get; set; }
-
- public string DeviceProcessorType
- {
- get; set;
- }
- public bool Complex
- {
- get; set;
- }
- public string ConstructorArg
- {
- get; set;
- }
- //public bool IsComplex
- //{
- // get; set;
- //}
- public string Description
- {
- get; set;
- }
- /// <summary>
- /// the high numbers have the earlier initial time.
- /// </summary>
- //public int InitPriority { get; set; }
- public List<ProcessorParameter> Parameter { get; set; }
- public override bool Equals(object obj)
- {
- if (obj == null) return false;
- if (!(obj is Processor target)) return false;
- else
- {
- if (this.Name != target.Name || this.DeviceProcessorType != target.DeviceProcessorType
- //|| this.SerialNumber != target.SerialNumber
- )
- return false;
- if (this.Parameter == null && target.Parameter == null) return true;
- if (this.Parameter.Count != target.Parameter.Count) return false;
- for (int i = 0; i < this.Parameter.Count; i++)
- if (!this.Parameter[i].Equals(target.Parameter[i])) return false;
- return true;
- }
- }
- }
- public class ProcessorParameter
- {
- public string Name
- {
- get; set;
- }
- public string Value
- {
- get; set;
- }
- public bool Complex
- {
- get; set;
- }
- public string ConstructorArg
- {
- get; set;
- }
- public string Description
- {
- get; set;
- }
- public override bool Equals(object obj)
- {
- if (obj == null) return false;
- if (!(obj is ProcessorParameter target)) return false;
- else
- {
- if (this.Name != target.Name || this.Value != target.Value
- || this.ConstructorArg != target.ConstructorArg)
- return false;
- return true;
- }
- }
- }
- }
|