Exemplo n.º 1
0
 public DBUtility(bool dbEncrypt)
 {
     SQLiteHelper.SetPassWordFlag = dbEncrypt;
     SQLiteHelper.SetSignature    = Ini.GetItemValue("sizeInfo", "appSignature");
 }
Exemplo n.º 2
0
        private void CreateModelData()
        {
            this.InsertSerialInfo(new SerialInfo()
            {
                PortName = "COM1",
                BaudRate = 9600,
                DataBits = 8,
                Parity   = 0,
                StopBits = 1,
                TimeOut  = 200
            });
            Color       colorFoot = Color.FromArgb(Convert.ToInt32(Ini.GetItemValue("colorInfo", "colorFoot")));
            ElementInfo info      = new ElementInfo();

            //箭头
            info.Name      = enumComponent.NONE.ToString();
            info.FootType  = enumComponentType.NormalComponent;
            info.Size      = new Size(0, 0);
            info.BackColor = Color.Gray;
            info.LineFoots = new List <LineFoot>();
            info.BackImage = "img\\arrow.png";
            AddNewBaseComponent(info);
            //74HC244
            info.Name   = "74HC244";
            info.Number = "aaaaaaaa";
            //info.FootType = enumComponentType.Chips;
            info.FootType  = enumComponentType.NormalComponent;
            info.Size      = new Size(374, 280);
            info.BackColor = Color.Gray;
            info.LineFoots = new List <LineFoot>()
            {
                new LineFoot()
                {
                    LocX = 35, LocY = 0, InnerIdx = 1
                },
                new LineFoot()
                {
                    LocX = 70, LocY = 0, InnerIdx = 2
                },
                new LineFoot()
                {
                    LocX = 105, LocY = 0, InnerIdx = 3
                },
                new LineFoot()
                {
                    LocX = 140, LocY = 0, InnerIdx = 4
                },
                new LineFoot()
                {
                    LocX = 175, LocY = 0, InnerIdx = 5
                },
                new LineFoot()
                {
                    LocX = 210, LocY = 0, InnerIdx = 6
                },
                new LineFoot()
                {
                    LocX = 245, LocY = 0, InnerIdx = 7
                },
                new LineFoot()
                {
                    LocX = 280, LocY = 0, InnerIdx = 8
                },
                new LineFoot()
                {
                    LocX = 315, LocY = 0, InnerIdx = 9
                },
                new LineFoot()
                {
                    LocX = 350, LocY = 0, InnerIdx = 10
                },

                new LineFoot()
                {
                    LocX = 35, LocY = 280, InnerIdx = 11
                },
                new LineFoot()
                {
                    LocX = 70, LocY = 280, InnerIdx = 12
                },
                new LineFoot()
                {
                    LocX = 105, LocY = 280, InnerIdx = 13
                },
                new LineFoot()
                {
                    LocX = 140, LocY = 280, InnerIdx = 14
                },
                new LineFoot()
                {
                    LocX = 175, LocY = 280, InnerIdx = 15
                },
                new LineFoot()
                {
                    LocX = 210, LocY = 280, InnerIdx = 16
                },
                new LineFoot()
                {
                    LocX = 245, LocY = 280, InnerIdx = 17
                },
                new LineFoot()
                {
                    LocX = 280, LocY = 280, InnerIdx = 18
                },
                new LineFoot()
                {
                    LocX = 315, LocY = 280, InnerIdx = 19
                },
                new LineFoot()
                {
                    LocX = 350, LocY = 280, InnerIdx = 20
                }
            };
            info.BackImage = "img\\74HC244.jpg";
            AddNewBaseComponent(info);
            //74Serial
            info.Name   = "74Serial";
            info.Number = string.Empty;
            //info.FootType = enumComponentType.Chips;
            info.FootType  = enumComponentType.NormalComponent;
            info.Size      = new Size(246, 176);
            info.BackColor = Color.Gray;
            info.LineFoots = new List <LineFoot>()
            {
                new LineFoot()
                {
                    Name = "1", LocX = 17, LocY = 0, InnerIdx = 1
                },
                new LineFoot()
                {
                    Name = "2", LocX = 52, LocY = 0, InnerIdx = 2
                },
                new LineFoot()
                {
                    Name = "3", LocX = 87, LocY = 0, InnerIdx = 3
                },
                new LineFoot()
                {
                    Name = "4", LocX = 122, LocY = 0, InnerIdx = 4
                },
                new LineFoot()
                {
                    Name = "5", LocX = 157, LocY = 0, InnerIdx = 5
                },
                new LineFoot()
                {
                    Name = "6", LocX = 192, LocY = 0, InnerIdx = 6
                },
                new LineFoot()
                {
                    Name = "7", LocX = 227, LocY = 0, InnerIdx = 7
                },

                new LineFoot()
                {
                    Name = "1", LocX = 17, LocY = 176, InnerIdx = 8
                },
                new LineFoot()
                {
                    Name = "2", LocX = 52, LocY = 176, InnerIdx = 9
                },
                new LineFoot()
                {
                    Name = "3", LocX = 87, LocY = 176, InnerIdx = 10
                },
                new LineFoot()
                {
                    Name = "4", LocX = 122, LocY = 176, InnerIdx = 11
                },
                new LineFoot()
                {
                    Name = "5", LocX = 157, LocY = 176, InnerIdx = 12
                },
                new LineFoot()
                {
                    Name = "6", LocX = 192, LocY = 176, InnerIdx = 13
                },
                new LineFoot()
                {
                    Name = "7", LocX = 227, LocY = 176, InnerIdx = 14
                }
            };
            info.BackImage = "img\\74Serial.png";
            AddNewBaseComponent(info);
            //运放
            info.Name      = enumComponent.Amplifier.ToString();
            info.FootType  = enumComponentType.NormalComponent;
            info.Size      = new Size(140, 140);
            info.BackColor = Color.Gray;
            info.LineFoots = new List <LineFoot>(8)
            {
                new LineFoot()
                {
                    Color = colorFoot, Name = "1", LocX = 15, LocY = 0, InnerIdx = 1
                },
                new LineFoot()
                {
                    Color = colorFoot, Name = "2", LocX = 50, LocY = 0, InnerIdx = 2
                },
                new LineFoot()
                {
                    Color = colorFoot, Name = "3", LocX = 85, LocY = 0, InnerIdx = 3
                },
                new LineFoot()
                {
                    Color = colorFoot, Name = "4", LocX = 120, LocY = 0, InnerIdx = 4
                },

                new LineFoot()
                {
                    Color = colorFoot, Name = "5", LocX = 15, LocY = 140, InnerIdx = 5
                },
                new LineFoot()
                {
                    Color = colorFoot, Name = "6", LocX = 50, LocY = 140, InnerIdx = 6
                },
                new LineFoot()
                {
                    Color = colorFoot, Name = "7", LocX = 85, LocY = 140, InnerIdx = 7
                },
                new LineFoot()
                {
                    Color = colorFoot, Name = "8", LocX = 120, LocY = 140, InnerIdx = 8
                }
            };
            info.BackImage = "img\\amplifier.png";
            AddNewBaseComponent(info);
            //电阻
            info.Name      = enumComponent.Resistance.ToString();
            info.Number    = "resistan";
            info.FootType  = enumComponentType.NormalComponent;
            info.Size      = new Size(35, 10);
            info.BackColor = Color.Gray;
            info.LineFoots = new List <LineFoot>(2)
            {
                new LineFoot()
                {
                    Color = colorFoot, Name = "左", LocX = 0, LocY = 5, InnerIdx = 1
                },
                new LineFoot()
                {
                    Color = colorFoot, Name = "右", LocX = 35, LocY = 5, InnerIdx = 2
                }
            };
            info.BackImage = "img\\resistance.png";
            AddNewBaseComponent(info);
            //二极管
            info.Name      = enumComponent.Diode.ToString();
            info.Number    = string.Empty;
            info.FootType  = enumComponentType.NormalComponent;
            info.Size      = new Size(35, 10);
            info.BackColor = Color.Gray;
            info.LineFoots = new List <LineFoot>(2)
            {
                new LineFoot()
                {
                    Color = colorFoot, Name = "左", LocX = 0, LocY = 5, InnerIdx = 1
                },
                new LineFoot()
                {
                    Color = colorFoot, Name = "右", LocX = 35, LocY = 5, InnerIdx = 2
                }
            };
            info.BackImage = "img\\diode.png";
            AddNewBaseComponent(info);
            //三极管
            info.Name      = enumComponent.Triode.ToString();
            info.FootType  = enumComponentType.NormalComponent;
            info.Size      = new Size(70, 140);
            info.BackColor = Color.Gray;
            info.LineFoots = new List <LineFoot>(2)
            {
                new LineFoot()
                {
                    Color = colorFoot, Name = "左", LocX = 0, LocY = 70, InnerIdx = 1
                },
                new LineFoot()
                {
                    Color = colorFoot, Name = "右", LocX = 70, LocY = 70, InnerIdx = 2
                },
                new LineFoot()
                {
                    Color = colorFoot, Name = "下", LocX = 35, LocY = 140, InnerIdx = 3
                }
            };
            info.BackImage = "img\\triode.png";
            AddNewBaseComponent(info);
            //电容
            info.Name      = enumComponent.Capacitor.ToString();
            info.FootType  = enumComponentType.NormalComponent;
            info.Size      = new Size(58, 90);
            info.BackColor = Color.Gray;
            info.LineFoots = new List <LineFoot>(2)
            {
                new LineFoot()
                {
                    Color = colorFoot, Name = "左", LocX = 11, LocY = 90, InnerIdx = 1
                },
                new LineFoot()
                {
                    Color = colorFoot, Name = "右", LocX = 46, LocY = 90, InnerIdx = 2
                }
            };
            info.BackImage = "img\\capacitor.png";
            AddNewBaseComponent(info);
        }