Ejemplo n.º 1
0
        public RoomNode(KNXRoom knx, BackgroundWorker worker)
            : base(knx, worker)
        {
            Name = ImageKey = SelectedImageKey = MyConst.View.KnxRoomType;
            SetText(this.Title);

            if (ImportedHelper.IsLessThan2_0_3())
            {
                if (!string.IsNullOrEmpty(knx.Symbol))
                {
                    this.Symbol = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.Symbol));
                    //this.Symbol = ImageHelper.GetDiskImage(Path.Combine(this.ImagePath, knx.Symbol));
                }
            }
            else if (ImportedHelper.IsLessThan2_5_6())
            {
                this.Symbol = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_SYMBOL));
                //this.Symbol = ImageHelper.GetDiskImage(Path.Combine(this.ImagePath, NAME_SYMBOL));
            }
            else
            {
                this.Symbol = knx.Symbol;
            }

            PinCode            = knx.PinCode;
            this.IsDefaultRoom = (EBool)Enum.ToObject(typeof(EBool), knx.DefaultRoom);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// KNXImageButton 转 ImageButtonNode
        /// </summary>
        /// <param name="knx"></param>
        public ImageButtonNode(KNXImageButton knx, BackgroundWorker worker)
            : base(knx, worker)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxImageButtonType;

            SetText(this.Title);

            this.ReadAddressId   = knx.ReadAddressId ?? new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = knx.WriteAddressIds ?? new Dictionary <string, KNXSelectedAddress>();

            if (ImportedHelper.IsLessThan2_5_6())
            {
                this.ImageOn  = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_IMAGEON));
                this.ImageOff = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_IMAGEOFF));
            }
            else
            {
                this.ImageOn  = knx.ImageOn;
                this.ImageOff = knx.ImageOff;
            }

            if (ImportedHelper.IsLessThan2_7_1())
            {
                this.Alpha = .0f;
            }
        }
Ejemplo n.º 3
0
        public DigitalAdjustmentNode()
            : base()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxDigitalAdjustmentType;

            this.Text  = UIResMang.GetString("TextDigitalAdjustment");
            this.Title = UIResMang.GetString("TextDigitalAdjustment") + index;
            SetText(this.Title);

            this.Size      = new Size(180, 40);
            this.FlatStyle = EFlatStyle.Stereo;
            this.TitleFont = new STFont(Color.Yellow, 28);

            this.ReadAddressId   = new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = new Dictionary <string, KNXSelectedAddress>();

            this.LeftImage      = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "reduce.png"));
            this.RightImage     = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "increase.png"));
            this.DecimalDigit   = EDecimalDigit.Zero;
            this.MaxValue       = 30;
            this.MinValue       = 16;
            this.RegulationStep = ERegulationStep.One;
            this.Unit           = EMeasurementUnit.None;
            this.ValueFont      = new STFont(Color.Yellow, 28);
        }
        public TimerButtonNode(KNXTimerButton knx, BackgroundWorker worker)
            : base(knx, worker)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxTimerButtonType;
            SetText(this.Title);

            this.ReadAddressId   = knx.ReadAddressId ?? new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = knx.WriteAddressIds ?? new Dictionary <string, KNXSelectedAddress>();

            if (ImportedHelper.IsLessThan2_0_3())
            {
                if (!string.IsNullOrEmpty(knx.Icon))
                {
                    this.Symbol = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.Icon));
                }
            }
            else if (ImportedHelper.IsLessThan2_5_6())
            {
                this.Symbol = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_SYMBOL));
            }
            else
            {
                this.Symbol = knx.Symbol;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// KNXSwitch 转 SwitchNode
        /// </summary>
        /// <param name="knx"></param>
        public SwitchNode(KNXSwitch knx, BackgroundWorker worker)
            : base(knx, worker)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxSwitchType;

            SetText(this.Title);

            this.ReadAddressId   = knx.ReadAddressId ?? new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = knx.WriteAddressIds ?? new Dictionary <string, KNXSelectedAddress>();

            if (ImportedHelper.IsLessThan2_0_3())
            {
                if (!string.IsNullOrEmpty(knx.ImageOn))
                {
                    this.ImageOn = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.ImageOn));
                }
                if (!string.IsNullOrEmpty(knx.ImageOff))
                {
                    this.ImageOff = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.ImageOff));
                }
            }
            else if (ImportedHelper.IsLessThan2_5_6())
            {
                this.ImageOn  = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_IMAGEON));
                this.ImageOff = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_IMAGEOFF));
            }
            else
            {
                this.ImageOn  = knx.ImageOn;
                this.ImageOff = knx.ImageOff;
            }

            this.ColorOn  = ColorHelper.HexStrToColor(knx.ColorOn);
            this.ColorOff = ColorHelper.HexStrToColor(knx.ColorOff);
        }
Ejemplo n.º 6
0
        public ShutterNode()
            : base()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxShutterType;

            this.Text  = UIResMang.GetString("TextShutter");
            this.Title = UIResMang.GetString("TextShutter") + index;
            SetText(this.Title);

            this.Size            = new Size(60, 60);
            this.Padding         = new Padding(15);
            this.Radius          = 30;
            this.FlatStyle       = EFlatStyle.Flat;
            this.Alpha           = 0.6f;
            this.BackgroundColor = Color.White;

            this.Symbol   = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResCtrlDir, "Shutter_On.png"));
            this.ImageOn  = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResCtrlDir, "Shutter_On.png"));
            this.ImageOff = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResCtrlDir, "Shutter_Off.png"));

            this.ShutterUpDown                 = new KNXObject();
            this.ShutterStop                   = new KNXObject();
            this.AbsolutePositionOfShutter     = new KNXObject();
            this.AbsolutePositionOfBlinds      = new KNXObject();
            this.StateUpperPosition            = new KNXObject();
            this.StateLowerPosition            = new KNXObject();
            this.StatusActualPositionOfShutter = new KNXObject();
            this.StatusActualPositionOfBlinds  = new KNXObject();
        }
Ejemplo n.º 7
0
        public SceneButtonNode()
            : base()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxSceneButtonType;

            this.Text  = UIResMang.GetString("TextSceneButton");
            this.Title = UIResMang.GetString("TextSceneButton") + index;
            SetText(this.Title);

            this.Size      = new Size(180, 40);
            this.FlatStyle = EFlatStyle.Stereo;

            this.Clickable = EBool.Yes;

            this.ReadAddressId   = new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = new Dictionary <string, KNXSelectedAddress>();

            this.ImageOn = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "on4.png"));
            this.ColorOn = this.BackgroundColor;

            this.ImageOff = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "off4.png"));
            this.ColorOff = this.BackgroundColor;

            this.IsGroup      = EBool.No;
            this.DefaultValue = 1;
        }
Ejemplo n.º 8
0
        public DimmerNode()
            : base()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxDimmerType;

            this.Text  = UIResMang.GetString("TextDimmer");
            this.Title = UIResMang.GetString("TextDimmer") + index;
            SetText(this.Title);

            this.Size            = new Size(60, 60);
            this.Padding         = new Padding(15);
            this.FlatStyle       = EFlatStyle.Flat;
            this.Radius          = 30;
            this.Alpha           = 0.6f;
            this.BackgroundColor = Color.White;

            this.Symbol   = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResCtrlDir, "Dimmer_Off.png"));
            this.ImageOn  = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResCtrlDir, "Dimmer_On.png"));
            this.ImageOff = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResCtrlDir, "Dimmer_Off.png"));

            this.Switch        = new KNXObject();
            this.DimRelatively = new KNXObject();
            this.DimAbsolutely = new KNXObject();
            this.StateOnOff    = new KNXObject();
            this.StateDimValue = new KNXObject();
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 从模板中导入控件
        /// </summary>
        /// <param name="knx"></param>
        /// <param name="worker"></param>
        /// <param name="DirSrcImg"></param>
        public WebCamerNode(KNXWebCamer knx, BackgroundWorker worker, string DirSrcImg)
            : this(knx, worker)
        {
            this.Id = GenId(); // 创建新的Id

            this.BackgroundImage = ProjResManager.CopyImageRename(Path.Combine(DirSrcImg, knx.BackgroundImage));
            this.Symbol          = ProjResManager.CopyImageRename(Path.Combine(DirSrcImg, knx.Symbol));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 从模板中导入控件
        /// </summary>
        /// <param name="knx"></param>
        /// <param name="worker"></param>
        /// <param name="DirSrcImg"></param>
        public ShutterNode(KNXShutter knx, BackgroundWorker worker, string DirSrcImg)
            : this(knx, worker)
        {
            this.Id = GenId(); // 创建新的Id

            this.Symbol   = ProjResManager.CopyImageRename(Path.Combine(DirSrcImg, knx.Symbol));
            this.ImageOn  = ProjResManager.CopyImageRename(Path.Combine(DirSrcImg, knx.ImageOn));
            this.ImageOff = ProjResManager.CopyImageRename(Path.Combine(DirSrcImg, knx.ImageOff));
        }
Ejemplo n.º 11
0
        public AreaNode()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.View.KnxAreaType;

            this.Text  = UIResMang.GetString("TextArea");
            this.Title = UIResMang.GetString("TextArea") + index;
            SetText(this.Title);

            //this.Symbol = ImageHelper.GetDiskImage(Path.Combine(MyCache.ProjectResImgDir, "default_icon.png"));
            this.Symbol = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "symbol2.png"));

            this.PinCode = "";
        }
Ejemplo n.º 12
0
        public PageNode() : base()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.View.KnxPageType;

            this.Text  = UIResMang.GetString("TextPage");
            this.Title = UIResMang.GetString("TextPage") + index;
            SetText(this.Title);

            this.Size   = MyCache.AppSize;
            this.Alpha  = 1;
            this.Radius = 0;

            this.BackgroundImage = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "bj7.png"));
        }
Ejemplo n.º 13
0
        public RoomNode()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.View.KnxRoomType;

            this.Text  = UIResMang.GetString("TextRoom");
            this.Title = UIResMang.GetString("TextRoom") + index;
            SetText(this.Title);

            this.Symbol = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "room.png"));

            //this.Symbol = ImageHelper.GetDiskImage(Path.Combine(MyCache.ProjectResImgDir, "Room.png"));
            this.PinCode       = "";
            this.IsDefaultRoom = EBool.No;
        }
Ejemplo n.º 14
0
        public AppNode(KNXApp knx, BackgroundWorker worker)
            : base(knx, worker)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.View.KnxAppType;
            SetText(this.Title);

            //MyCache.Width = this.Width;
            //MyCache.Height = this.Height;
            MyCache.AppSize = this.Size;

            this.About = knx.About;

            if (ImportedHelper.IsLessThan2_0_3())
            {
                //this.Width = 1280;
                //this.Height = 800;
                this.Size = new Size(1280, 800);

                if (!string.IsNullOrEmpty(knx.Symbol))
                {
                    this.Symbol = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.Symbol));
                }
                else if (!string.IsNullOrEmpty(knx.Logo))
                {
                    this.Symbol = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.Logo));
                }
                if (!string.IsNullOrEmpty(knx.BackgroundImage))
                {
                    this.BackgroundImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.BackgroundImage));
                }
            }
            else if (ImportedHelper.IsLessThan2_5_6())
            {
                this.Symbol          = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_SYMBOL));
                this.BackgroundImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_BACKGROUNDIMAGE));
            }
            else
            {
                //this.Width = knx.Width;
                //this.Height = knx.Height;
                this.Size            = new Size(knx.Width, knx.Height);
                this.Symbol          = knx.Symbol;
                this.BackgroundImage = knx.BackgroundImage;
            }

            GetProjectVersion();
        }
        public TimerButtonNode(KNXTimerButton knx, BackgroundWorker worker, string DirSrcImg)
            : this(knx, worker)
        {
            this.Id = GenId(); // 创建新的Id

            if (ImportedHelper.IsLessThan2_5_6())
            {
                string knxImage     = GetImageName(knx.Id);              // KNX图片资源名称
                string knxImagePath = Path.Combine(DirSrcImg, knxImage); // KNX图片资源路径

                this.Symbol = ProjResManager.CopyImageRename(Path.Combine(knxImagePath, NAME_SYMBOL));
            }
            else
            {
                this.Symbol = ProjResManager.CopyImageRename(Path.Combine(DirSrcImg, knx.Symbol));
            }
        }
Ejemplo n.º 16
0
        public PageNode(KNXPage knx, BackgroundWorker worker, string DirSrcImg)
            : this(knx, worker)
        {
            this.Id = GenId(); // 创建新的Id

            if (ImportedHelper.IsLessThan2_5_6())
            {
                string knxImage     = GetImageName(knx.Id);              // KNX图片资源名称
                string knxImagePath = Path.Combine(DirSrcImg, knxImage); // KNX图片资源路径

                this.BackgroundImage = ProjResManager.CopyImageRename(Path.Combine(knxImagePath, NAME_BACKGROUNDIMAGE));
            }
            else
            {
                this.BackgroundImage = ProjResManager.CopyImageRename(Path.Combine(DirSrcImg, knx.BackgroundImage));
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 从工程文件中导入控件
        /// </summary>
        /// <param name="knx"></param>
        public BlindsNode(KNXBlinds knx, BackgroundWorker worker)
            : base(knx, worker)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxBlindsType;
            SetText(this.Title);

            this.ReadAddressId   = knx.ReadAddressId ?? new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = knx.WriteAddressIds ?? new Dictionary <string, KNXSelectedAddress>();

            if (ImportedHelper.IsLessThan2_0_3())
            {
                if (!string.IsNullOrEmpty(knx.LeftImage))
                {
                    this.LeftImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.LeftImage));
                }
                if (!string.IsNullOrEmpty(knx.RightImage))
                {
                    this.RightImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.RightImage));
                }
            }
            else
            if (ImportedHelper.IsLessThan2_5_6())
            {
                this.LeftImage  = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_LEFTIMAGE));
                this.RightImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_RIGHTIMAGE));
            }
            else
            {
                this.LeftImage  = knx.LeftImage;
                this.RightImage = knx.RightImage;
            }

            if (ImportedHelper.IsLessThan2_5_2())
            {
                this.LeftTextFont  = new STFont(knx.LeftTextFontColor, knx.LeftTextFontSize);
                this.RightTextFont = new STFont(knx.RightTextFontColor, knx.RightTextFontSize);
            }
            else
            {
                this.LeftTextFont  = new STFont(knx.LeftTextFont);
                this.RightTextFont = new STFont(knx.RightTextFont);
            }
            this.LeftText  = knx.LeftText;
            this.RightText = knx.RightText;
        }
Ejemplo n.º 18
0
        public AreaNode(KNXArea knx, BackgroundWorker worker)
            : base(knx, worker)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.View.KnxAreaType;
            SetText(this.Title);

            //this.Symbol = ImageHelper.GetDiskImage(Path.Combine(this.ImagePath, NAME_SYMBOL));
            this.PinCode = knx.PinCode;

            if (ImportedHelper.IsLessThan2_5_6())
            {
                this.Symbol = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_SYMBOL));
            }
            else
            {
                this.Symbol = knx.Symbol;
            }
        }
Ejemplo n.º 19
0
        public SwitchNode(KNXSwitch knx, BackgroundWorker worker, string DirSrcImg)
            : this(knx, worker)
        {
            this.Id = GenId(); // 创建新的Id

            if (ImportedHelper.IsLessThan2_5_6())
            {
                string knxImage     = GetImageName(knx.Id);              // KNX图片资源名称
                string knxImagePath = Path.Combine(DirSrcImg, knxImage); // KNX图片资源路径

                this.ImageOn  = ProjResManager.CopyImageRename(Path.Combine(knxImagePath, NAME_IMAGEON));
                this.ImageOff = ProjResManager.CopyImageRename(Path.Combine(knxImagePath, NAME_IMAGEOFF));
            }
            else
            {
                this.ImageOn  = ProjResManager.CopyImageRename(Path.Combine(DirSrcImg, knx.ImageOn));
                this.ImageOff = ProjResManager.CopyImageRename(Path.Combine(DirSrcImg, knx.ImageOff));
            }
        }
Ejemplo n.º 20
0
        public DigitalAdjustmentNode(KNXDigitalAdjustment knx, BackgroundWorker worker, string DirSrcImg)
            : this(knx, worker)
        {
            this.Id = GenId(); // 创建新的Id

            if (ImportedHelper.IsLessThan2_5_6())
            {
                string knxImage     = GetImageName(knx.Id);              // KNX图片资源名称
                string knxImagePath = Path.Combine(DirSrcImg, knxImage); // KNX图片资源路径

                this.LeftImage  = ProjResManager.CopyImageRename(Path.Combine(knxImagePath, NAME_LEFTIMAGE));
                this.RightImage = ProjResManager.CopyImageRename(Path.Combine(knxImagePath, NAME_RIGHTIMAGE));
            }
            else
            {
                this.LeftImage  = ProjResManager.CopyImageRename(Path.Combine(DirSrcImg, knx.LeftImage));
                this.RightImage = ProjResManager.CopyImageRename(Path.Combine(DirSrcImg, knx.RightImage));
            }
        }
        public TimerButtonNode()
            : base()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxTimerButtonType;

            this.Text  = UIResMang.GetString("TextTimer");
            this.Title = UIResMang.GetString("TextTimer") + index;
            SetText(this.Title);

            this.Size      = new Size(180, 40);
            this.Padding   = new Padding(0);
            this.FlatStyle = EFlatStyle.Flat;

            this.Symbol = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "timer1.png"));

            this.ReadAddressId   = new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = new Dictionary <string, KNXSelectedAddress>();
        }
Ejemplo n.º 22
0
        public SliderSwitchNode(KNXSliderSwitch knx, BackgroundWorker worker)
            : base(knx, worker)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxSliderSwitchType;
            SetText(this.Title);

            this.ReadAddressId   = knx.ReadAddressId ?? new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = knx.WriteAddressIds ?? new Dictionary <string, KNXSelectedAddress>();

            if (ImportedHelper.IsLessThan2_0_3())
            {
                if (!string.IsNullOrEmpty(knx.LeftImage))
                {
                    this.LeftImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.LeftImage));
                }
                if (!string.IsNullOrEmpty(knx.RightImage))
                {
                    this.RightImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.RightImage));
                }
                if (!string.IsNullOrEmpty(knx.SliderImage))
                {
                    this.SliderImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.SliderImage));
                }
            }
            else if (ImportedHelper.IsLessThan2_5_6())
            {
                this.LeftImage   = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_LEFTIMAGE));
                this.RightImage  = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_RIGHTIMAGE));
                this.SliderImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_SLIDERIMAGE));
            }
            else
            {
                this.LeftImage   = knx.LeftImage;
                this.RightImage  = knx.RightImage;
                this.SliderImage = knx.SliderImage;
            }

            this.IsRelativeControl = (EBool)Enum.ToObject(typeof(EBool), knx.IsRelativeControl);
            this.Orientation       = (Orientation)Enum.ToObject(typeof(Orientation), knx.Orientation);
            this.SliderWidth       = knx.SliderWidth < MIN_SLDER_WIDTH ? MIN_SLDER_WIDTH : knx.SliderWidth;
        }
Ejemplo n.º 23
0
        public WebCamerNode()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxWebCamViewerType;

            this.Text  = UIResMang.GetString("TextWebCamer");
            this.Title = UIResMang.GetString("TextWebCamer") + index;
            SetText(this.Title);

            this.Size            = new Size(400, 400);
            this.Padding         = new Padding(15);
            this.DisplayBorder   = EBool.Yes;
            this.BorderColor     = Color.DarkGreen;
            this.Radius          = 10;
            this.FlatStyle       = EFlatStyle.Flat;
            this.Alpha           = 0.3f;
            this.BackgroundColor = Color.DarkGreen;

            this.Symbol = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResCtrlDir, "WebCamer.png"));
        }
Ejemplo n.º 24
0
        public AreaNode(KNXArea knx, BackgroundWorker worker, string DirSrcImg)
            : this(knx, worker)
        {
            this.Id = GenId(); // 创建新的Id

            //string knxImage = GetImageName(knx.Id); // KNX图片资源名称
            //string knxImagePath = Path.Combine(DirSrcImg, knxImage); // KNX图片资源路径
            //FileHelper.CopyFolderContent(knxImagePath, this.ImagePath, true); // 拷贝KNX图片资源

            //this.Symbol = ImageHelper.GetDiskImage(Path.Combine(this.ImagePath, NAME_SYMBOL));
            if (ImportedHelper.IsLessThan2_5_6())
            {
                string knxImage     = GetImageName(knx.Id);              // KNX图片资源名称
                string knxImagePath = Path.Combine(DirSrcImg, knxImage); // KNX图片资源路径

                this.Symbol = ProjResManager.CopyImageRename(Path.Combine(knxImagePath, NAME_SYMBOL));
            }
            else
            {
                this.Symbol = ProjResManager.CopyImageRename(Path.Combine(DirSrcImg, knx.Symbol));
            }
        }
Ejemplo n.º 25
0
        /// <summary>
        /// PageNode 转 KNXPage
        /// </summary>
        /// <param name="knx"></param>
        public PageNode(KNXPage knx, BackgroundWorker worker)
            : base(knx, worker)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.View.KnxPageType;
            SetText(this.Title);

            if (ImportedHelper.IsLessThan2_0_3())
            {
                if (!string.IsNullOrEmpty(knx.BackgroundImage))
                {
                    this.BackgroundImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.BackgroundImage));
                }
            }
            else if (ImportedHelper.IsLessThan2_5_6())
            {
                this.BackgroundImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_BACKGROUNDIMAGE));
            }
            else
            {
                this.BackgroundImage = knx.BackgroundImage;
            }
        }
Ejemplo n.º 26
0
        public AppNode()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.View.KnxAppType;

            this.Text  = UIResMang.GetString("TextProject");
            this.Title = UIResMang.GetString("TextProject") + index;
            SetText(this.Title);

            //this.Width = 1280;
            //this.Height = 800;
            this.Size = new Size(1280, 800);

            //MyCache.Width = this.Width;
            //MyCache.Height = this.Height;
            MyCache.AppSize = this.Size;

            this.About           = "KNX App UIEditor";
            this.Symbol          = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "symbol2.png"));
            this.BackgroundImage = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "bj1.jpg"));
        }
Ejemplo n.º 27
0
        public SliderSwitchNode()
            : base()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxSliderSwitchType;

            this.Text  = UIResMang.GetString("TextSliderSwitch");
            this.Title = UIResMang.GetString("TextSliderSwitch") + index;
            SetText(this.Title);

            this.Size      = new Size(360, 40);
            this.FlatStyle = EFlatStyle.Stereo;

            this.ReadAddressId   = new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = new Dictionary <string, KNXSelectedAddress>();

            this.LeftImage         = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "reduce.png"));
            this.RightImage        = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "increase.png"));
            this.IsRelativeControl = EBool.No;
            this.Orientation       = Orientation.Horizontal;
            this.SliderWidth       = 50;
        }
Ejemplo n.º 28
0
        public ImageButtonNode()
            : base()
        {
            index++;

            this.Name = this.ImageKey = this.SelectedImageKey = MyConst.Controls.KnxImageButtonType;

            this.Text  = UIResMang.GetString("TextImageButton");
            this.Title = UIResMang.GetString("TextImageButton") + index;
            SetText(this.Title);

            this.Size            = new Size(90, 90);
            this.Padding         = new Padding(10, 28, 10, 27);
            this.FlatStyle       = EFlatStyle.Flat;
            this.Radius          = 45;
            this.Alpha           = 0.6f;
            this.BackgroundColor = Color.White;

            this.ReadAddressId   = new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = new Dictionary <string, KNXSelectedAddress>();

            this.ImageOn  = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResCtrlDir, "ImageButton_On.png"));
            this.ImageOff = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResCtrlDir, "ImageButton_Off.png"));
        }
Ejemplo n.º 29
0
        public BlindsNode() : base()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxBlindsType;

            this.Text  = UIResMang.GetString("TextBlinds");
            this.Title = UIResMang.GetString("TextBlinds") + index;
            SetText(this.Title);

            this.Size      = new Size(180, 40);
            this.FlatStyle = EFlatStyle.Stereo;

            this.ReadAddressId   = new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = new Dictionary <string, KNXSelectedAddress>();

            this.LeftImage    = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "arrow_down.png"));
            this.LeftText     = "";
            this.LeftTextFont = new STFont(Color.Black, 16);

            this.RightImage    = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "arrow_up.png"));
            this.RightText     = "";
            this.RightTextFont = new STFont(Color.Black, 16);
        }
Ejemplo n.º 30
0
        public DigitalAdjustmentNode(KNXDigitalAdjustment knx, BackgroundWorker worker)
            : base(knx, worker)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxDigitalAdjustmentType;

            SetText(this.Title);

            this.ReadAddressId   = knx.ReadAddressId ?? new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = knx.WriteAddressIds ?? new Dictionary <string, KNXSelectedAddress>();

            if (ImportedHelper.IsLessThan2_0_3())
            {
                if (!string.IsNullOrEmpty(knx.LeftImage))
                {
                    this.LeftImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.LeftImage));
                }
                if (!string.IsNullOrEmpty(knx.RightImage))
                {
                    this.RightImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.RightImage));
                }
            }
            else if (ImportedHelper.IsLessThan2_5_6())
            {
                this.LeftImage  = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_LEFTIMAGE));
                this.RightImage = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_RIGHTIMAGE));
            }
            else
            {
                this.LeftImage  = knx.LeftImage;
                this.RightImage = knx.RightImage;
            }
            this.DecimalDigit = (EDecimalDigit)Enum.ToObject(typeof(EDecimalDigit), knx.DecimalDigit);
            this.MaxValue     = knx.MaxValue;
            this.MinValue     = knx.MinValue;

            if (ImportedHelper.IsLessThan2_1_8() && knx.Unit > (int)EMeasurementUnit.Centigrade)
            {
                this.Unit = (EMeasurementUnit)Enum.ToObject(typeof(EMeasurementUnit), knx.Unit - 1);
            }
            else
            {
                this.Unit = (EMeasurementUnit)Enum.ToObject(typeof(EMeasurementUnit), knx.Unit);
            }

            if (ImportedHelper.IsLessThan2_5_3())
            {
                this.RegulationStep = ERegulationStep.One;
            }
            else
            {
                if (ImportedHelper.IsLessThan2_5_4())
                {
                    knx.RegStep        += 2;
                    this.RegulationStep = (ERegulationStep)Enum.ToObject(typeof(ERegulationStep), knx.RegStep);
                }
                else
                {
                    this.RegulationStep = (ERegulationStep)EnumExtension.ConvertFrom(typeof(ERegulationStep), knx.RegulationStep);
                }
            }

            if (ImportedHelper.IsLessThan2_5_4())
            {
                this.ValueFont = this.TitleFont.Clone();
            }
            else
            {
                this.ValueFont = new STFont(knx.ValueFont);
            }
        }