Пример #1
0
        private void InsertTemperatureSensor(string name, DateTime time, SensorType sensorType, bool isActive)
        {
            int coreSize = 5;

            CoreNumber [] coreIndex = new CoreNumber[coreSize];
            for (int i = 0; i < coreSize; ++i)
            {
                coreIndex[i] = CoreNumber.None;
            }

            if (this.CoreOneCheck.Checked)
            {
                coreIndex[1] = CoreNumber.Core_1;
            }
            if (this.CoreTwoCheck.Checked)
            {
                coreIndex[2] = CoreNumber.Core_2;
            }
            if (this.CoreThreeCheck.Checked)
            {
                coreIndex[3] = CoreNumber.Core_3;
            }
            if (this.CoreFourCheck.Checked)
            {
                coreIndex[4] = CoreNumber.Core_4;
            }
            for (byte i = 1; i < coreSize; ++i)
            {
                if (coreIndex[i] != CoreNumber.None)
                {
                    TempertaureSensorConfig tempConfig = new TempertaureSensorConfig()
                    {
                        Name       = name,
                        MadeTime   = time,
                        SensorType = sensorType,
                        IsActive   = isActive,
                        CoreIndex  = coreIndex[i]
                    };
                    System.Data.Linq.Table <BaseSensorConfig> table = dbManager.dc.BaseSensorConfigs;
                    table.InsertOnSubmit(tempConfig);
                }
            }
        }
 public TempSensorConfigItem(TempertaureSensorConfig tempSensor)
     : base(tempSensor)
 {
     this.tempSensor = tempSensor;
 }