Пример #1
0
        void InitPalette()
        {
            _palette.Clear();

            /*
             * var elementNames = new [] {
             *      "NcContact.xml",
             *      "NoContact.xml",
             *      "Coil.xml",
             *      "NotCoil.xml",
             *      "OnTimer.xml",
             *      "OffTimer.xml",
             *      "CycleTimer.xml",
             *      "SetCoil.xml",
             *      "ResetCoil.xml",
             *      "Line.xml",
             *      "Properties.xml",
             *      "Cursor.xml",
             *      "Latch.xml"};
             */

            var elementNames = Directory.GetFiles((@"Element" + Path.DirectorySeparatorChar).GetAbsolutePath());

            foreach (var el in elementNames
                     .Select(name =>
                             !string.IsNullOrEmpty(name) ?
                             ConfigManager.Read <DrawingElement> (name)
                                        : new DrawingElement {
                Type = ElementType.None, Primitives = new List <Drawable>()
            }))
            {
                el.SetupContainer();
                var surface = new PrimitivesSurface()
                {
                    IsPalette = true
                };
                if (el.Type == ElementType.Latch)
                {
                    surface.Add(new Position {
                        X = 0, Y = 0
                    });
                    surface.Add(new Position {
                        X = 0, Y = 1
                    });
                    surface.Add(el, new Position {
                        X = 0, Y = 0
                    });
                }
                else
                {
                    surface.Add(el, new Position {
                        X = 0, Y = 0
                    });
                }
                surface.Tooltip = el.Tooltip;
                _palette.Add(surface);
            }
        }
Пример #2
0
        void InitArduino()
        {
            _arduino.Clear();


            var elementNames = Directory.GetFiles((@"Buttons" + Path.DirectorySeparatorChar).GetAbsolutePath());

            foreach (var el in elementNames
                     .Select(name =>
                             !string.IsNullOrEmpty(name) ?
                             ConfigManager.Read <DrawingElement> (name)
                                        : new DrawingElement {
                Type = ElementType.None, Primitives = new List <Drawable>()
            }))
            {
                el.SetupContainer();
                var surface = new PrimitivesSurface()
                {
                    IsButton = true
                };
                surface.Add(el, new Position {
                    X = 0, Y = 0
                });
                surface.Tooltip = el.Tooltip;
                _arduino.Add(surface);
            }
        }
		public void Initialize()
		{
			var el = ConfigManager.Read<DrawingElement> (("Element" + System.IO.Path.DirectorySeparatorChar + "sample.xml").GetAbsolutePath());
			el.SetupContainer ();
			Surface = new PrimitivesSurface () { IsPalette = true };
			Surface.Add (el, new Position{ X = 0, Y = 0 });
		}
Пример #4
0
        void InitPalette()
        {
            _palette.Clear();

            var elementNames = Directory.GetFiles((@"Element" + Path.DirectorySeparatorChar).GetAbsolutePath());

            foreach (var el in elementNames
                     .Select(name =>
                             !string.IsNullOrEmpty(name) ?
                             ConfigManager.Read <DrawingElement> (name)
                                        : new DrawingElement {
                Type = ElementType.None, Primitives = new List <Drawable>()
            }))
            {
                el.SetupContainer();
                var surface = new PrimitivesSurface()
                {
                    IsPalette = true
                };
                if (el.Type == ElementType.Latch)
                {
                    surface.Add(new Position {
                        X = 0, Y = 0
                    });
                    surface.Add(new Position {
                        X = 0, Y = 1
                    });
                    surface.Add(el, new Position {
                        X = 0, Y = 0
                    });
                }
                else
                {
                    surface.Add(el, new Position {
                        X = 0, Y = 0
                    });
                }
                surface.Tooltip = el.Tooltip;
                _palette.Add(surface);
            }
        }
Пример #5
0
        public void Initialize()
        {
            var el = ConfigManager.Read <DrawingElement> (("Element" + System.IO.Path.DirectorySeparatorChar + "sample.xml").GetAbsolutePath());

            el.SetupContainer();
            Surface = new PrimitivesSurface()
            {
                IsPalette = true
            };
            Surface.Add(el, new Position {
                X = 0, Y = 0
            });
        }
Пример #6
0
        public void InitSurface()
        {
            Surface = new PrimitivesSurface();

            _contactsCount = _instance.Config.ContactsCount;
            _rowsCount     = _instance.Config.RowsCount;

            for (uint j = 0; j < _rowsCount; j++)
            {
                for (uint i = 0; i < _contactsCount + 1; i++)
                {
                    Surface.Add(new Position {
                        X = i, Y = j
                    });
                }
            }
        }
Пример #7
0
		public void InitSurface ()
		{
			Surface = new PrimitivesSurface ();

			_contactsCount = _instance.Config.ContactsCount;
			_rowsCount = _instance.Config.RowsCount;

			for (uint j = 0; j < _rowsCount; j++) {
				for (uint i = 0; i < _contactsCount + 1; i++) {
					Surface.Add (new Position{ X = i, Y = j });
				}
			}
		}
Пример #8
0
		void InitArduino()
		{
			_arduino.Clear ();


			var elementNames = Directory.GetFiles ((@"Buttons"+  Path.DirectorySeparatorChar).GetAbsolutePath ());

			foreach (var el in elementNames
				.Select(name => 
					!string.IsNullOrEmpty(name) ? 
					ConfigManager.Read<DrawingElement> (name)
					: new DrawingElement{ Type = ElementType.None, Primitives = new List<Drawable>()}))
			{
				el.SetupContainer ();
				var surface = new PrimitivesSurface () { IsButton = true};
				surface.Add (el, new Position{ X = 0, Y = 0 });
				surface.Tooltip = el.Tooltip;
				_arduino.Add (surface);
			}
		}
Пример #9
0
		void InitPalette()
		{
			_palette.Clear ();

			var elementNames = Directory.GetFiles ((@"Element"+  Path.DirectorySeparatorChar).GetAbsolutePath ());

			foreach (var el in elementNames
				.Select(name => 
					!string.IsNullOrEmpty(name) ? 
					ConfigManager.Read<DrawingElement> (name)
					: new DrawingElement{ Type = ElementType.None, Primitives = new List<Drawable>()}))
			{
				el.SetupContainer ();
				var surface = new PrimitivesSurface () {IsPalette = true};
				if (el.Type == ElementType.Latch) {
					surface.Add (new Position{ X = 0, Y = 0 });
					surface.Add (new Position{ X = 0, Y = 1 });
					surface.Add (el, new Position{ X = 0, Y = 0 });
				} else {
					surface.Add (el, new Position{ X = 0, Y = 0 });
				}
				surface.Tooltip = el.Tooltip;
				_palette.Add (surface);
			}
		}