Example #1
0
        public static void Db2O(EFData.LightElement dbObj, LightElement obj)
        {
            obj.Id            = dbObj.Id;
            obj.Name          = dbObj.Name;
            obj.PointType     = (LS_Library.PointTypeEnum)dbObj.PointType;
            obj.StartPoint    = dbObj.StartPoint;
            obj.PointCount    = dbObj.PointCount;
            obj.Direction     = (Direction)dbObj.Direction;
            obj.ColorSequence = dbObj.ColorSequence;
            obj.Remark        = dbObj.Remark;

            obj.Partition    = new Partition();
            obj.ControlSpace = new ControlSpace();

            Db2O(dbObj.Partition, obj.Partition);
            Db2O(dbObj.ControlSpace, obj.ControlSpace);

            if (dbObj.ControlChannel != null)
            {
                ControlChannel cCh = new ControlChannel();
                Db2O(dbObj.ControlChannel, out cCh);
                obj.ControlChannel = cCh;
            }

            //if (obj.ControlSpace.Prefix == "AN" || obj.ControlSpace.Prefix == "DX")
            //{
            //    if (obj.PointType == LS_Library.PointTypeEnum.RGB)
            //        obj.ColorSequenceList = LightElement.ColorSequenseRGB;
            //    if (obj.PointType == LS_Library.PointTypeEnum.RGBW)
            //        obj.ColorSequenceList = LightElement.ColorSequenseRGBW;
            //}
        }
Example #2
0
        /****************************************************************/

        #region LightElement

        public static void O2Db(LightElement obj, EFData.LightElement dbObj)
        {
            dbObj.Name          = obj.Name;
            dbObj.PointType     = (EFData.PointTypeEnum)obj.PointType;
            dbObj.StartPoint    = obj.StartPoint;
            dbObj.PointCount    = obj.PointCount;
            dbObj.Direction     = (EFData.Direction)obj.Direction;
            dbObj.ColorSequence = obj.ColorSequence;
            dbObj.Remark        = obj.Remark;

            //dbObj.Ix = obj.Ix;


            //if (obj is LightStrip)
            //{
            //    (dbObj as EFData.LightStrip).Direction = (EFData.Direction)(obj as LightStrip).Direction;
            //    (dbObj as EFData.LightStrip).PointCount = (obj as LightStrip).PointCount;
            //    (dbObj as EFData.LightStrip).ColorSequence = (obj as LightStrip).ColorSequence;
            //}
        }