示例#1
0
 private void button2_Click(object sender, EventArgs e)
 {
     SetDay   = int.Parse(textBox3.Text);
     SetDay_K = double.Parse(textBox4.Text);
     SetDay_D = double.Parse(textBox5.Text);
     KL.Add(SetDay_K);
     DL.Add(SetDay_D);
     for (int i = SetDay; i < HL.Count; i++)
     {
         var    h   = HL.GetRange(i - SetDay, SetDay + 1).ToList();
         var    l   = LL.GetRange(i - SetDay, SetDay + 1).ToList();
         var    v   = VL.GetRange(i - SetDay, SetDay + 1).ToList();
         double max = h.Max();
         double min = l.Min();
         double RSV = ((v.Last() - min) / (max - min)) * 100d;
         double k   = ((2d / 3d) * KL.Last()) + ((1d / 3d) * RSV);
         double d   = ((2d / 3d) * DL.Last()) + ((1d / 3d) * k);
         KL.Add(k);
         DL.Add(d);
     }
     using (StreamWriter sw = new StreamWriter(textBox2.Text))
     {
         for (int i = 0; i < KL.Count; i++)
         {
             sw.Write(KL[i].ToString("0.00") + " ");
         }
         sw.WriteLine("");
         for (int i = 0; i < KL.Count; i++)
         {
             sw.Write(DL[i].ToString("0.00") + " ");
         }
         sw.WriteLine("");
     }
     Process.Start(textBox2.Text);
 }
示例#2
0
 public Behavior(VL.Behavior xmlBehavior)
 {
     id = xmlBehavior.IDString;
     destination = xmlBehavior.destination;
     duration = xmlBehavior.duration;
     nextBehavior = xmlBehavior.nextBehavior;
     primaryValue = xmlBehavior.primaryValue;
     secondaryValue = xmlBehavior.secondaryValue;
     offSet = xmlBehavior.offset;
     period = xmlBehavior.period;
     toggle = xmlBehavior.toggle;
 }
示例#3
0
 public GunEmplacement(VL.TrackType trackType, VL.GunType gunType, Vector2 positionOffset, float radius, float depthOffset, BaseType baseType, Monster srcMonster)
 {
     this.gunType = gunType;
     this.trackType = trackType;
     this.positionOffset = positionOffset;
     this.radius = radius;
     this.baseRadius = .75f * radius;
     this.depthOffset = depthOffset;
     this.baseType = baseType;
     this.gunLine = srcMonster.position.direction;
     this.gunNormal = Vector3.Cross(gunLine, srcMonster.position.normal);
     this.position = srcMonster.position;
 }
示例#4
0
        public void atualizalista()
        {
            ListaConta.Items.Clear();

            SqlDataReader leitor;
            string        DESCRI, SITU;
            int           COD;
            DateTime      DATAV;
            double        VL;
            SqlCommand    selecionafilme = new SqlCommand();
            SqlConnection conexao        = new SqlConnection();



            conexao = new SqlConnection("Data Source = DESKTOP-L0FTKI7; Initial Catalog = ALTERNATIVA; Integrated Security=SSPI");
            conexao.Open();


            selecionafilme = new SqlCommand("select CODIGO AS COD, DESCRICAO as DESCRI,VALOR as VL,DATAV as DATAV, SITUACAO AS SITU from CONTAS WHERE DATAV >= '" + DTVencimento.Value + "' AND SITUACAO != 'Paga' ORDER BY DATAV ASC", conexao);


            leitor = selecionafilme.ExecuteReader();
            while (leitor.Read() == true)
            {
                COD    = int.Parse(leitor["COD"].ToString());
                DESCRI = leitor["DESCRI"].ToString();
                VL     = double.Parse(leitor["VL"].ToString());
                DATAV  = DateTime.Parse(leitor["DATAV"].ToString());
                SITU   = leitor["SITU"].ToString();


                ListViewItem itemLista = new ListViewItem(COD.ToString());

                ListViewItem.ListViewSubItem subitemLista = new ListViewItem.ListViewSubItem(itemLista, DESCRI);
                itemLista.SubItems.Add(subitemLista);
                subitemLista = new ListViewItem.ListViewSubItem(itemLista, VL.ToString("0.00"));
                itemLista.SubItems.Add(subitemLista);
                subitemLista = new ListViewItem.ListViewSubItem(itemLista, DATAV.ToShortDateString());
                itemLista.SubItems.Add(subitemLista);
                subitemLista = new ListViewItem.ListViewSubItem(itemLista, SITU);
                itemLista.SubItems.Add(subitemLista);

                ListaConta.Items.Add(itemLista);
            }


            leitor.Close();
            conexao.Close();
            contasdodia();
        }
示例#5
0
        public static string Aye(string words)
        {
            char[]        coal = words.ToCharArray();
            char[]        V    = { 'a', 'e', 'i', 'o', 'u' };
            const string  VL   = "aeiou";
            List <string> New  = new List <string>();
            int           L    = coal.Length;

            if (coal[0] == V[0] || coal[0] == V[1] || coal[0] == V[2] || coal[0] == V[3] || coal[0] == V[4])
            {
                return($"{words}way");
            }

            foreach (string word in words.Split(' '))
            {
                string One   = word.Substring(0, 1);
                string Two   = word.Substring(0, 2);
                string Three = word.Substring(0, 3);

                string small = word.Substring(1);


                string rest     = word.Substring(1, L - 1);
                string restwo   = word.Substring(2, L - 2);
                string resthree = word.Substring(3, L - 3);


                int current     = VL.IndexOf(One);
                int currentwo   = VL.IndexOf(Two);
                int currenthree = VL.IndexOf(Three);


                if (coal[1] == V[0] || coal[1] == V[1] || coal[1] == V[2] || coal[1] == V[3] || coal[1] == V[4])
                {
                    New.Add(rest + One + "ay");
                    break;
                }
                if (coal[2] == V[0] || coal[2] == V[1] || coal[2] == V[2] || coal[2] == V[3] || coal[2] == V[4])
                {
                    New.Add(restwo + Two + "ay");
                    break;
                }
                if (coal[3] == V[0] || coal[3] == V[1] || coal[3] == V[2] || coal[3] == V[3] || coal[3] == V[4])
                {
                    New.Add(resthree + Three + "ay");
                    break;
                }
            }
            return(string.Join(" ", New));
        }
示例#6
0
文件: Room.cs 项目: kevincos/Vexed
 public Room(VL.Room xmlRoom)
 {
     id = xmlRoom.IDString;
     center = new Vector3(xmlRoom.centerX, xmlRoom.centerY, xmlRoom.centerZ);
     size = new Vector3(xmlRoom.sizeX, xmlRoom.sizeY, xmlRoom.sizeZ);
     blocks = new List<Block>();
     doodads = new List<Doodad>();
     monsters = new List<Monster>();
     projectiles = new List<Projectile>();
     decorations = new List<Decoration>();
     jumpRings = new List<JumpRing>();
     tunnels = new List<Tunnel>();
 }
示例#7
0
    /// <summary>
    /// If this link is an image link, then auto-generate a thumbnail for it
    /// </summary>
    /// <param name="thisLink"></param>
    /// <param name="UrlPath"></param>
    public void SaveLink2Thumbnails(VL.ORM.Link thisLink)
    {
        try
        {
            // Start load the image and save it to our server
            WebRequest wr = WebRequest.Create(thisLink.Url);
            // Don't want to let it load too long,
            // If it takes too long, just leave it
            wr.Timeout = 2000;
            WebResponse wrs = wr.GetResponse();

            // Get the image to our memory
            System.Drawing.Image tmpImage = System.Drawing.Image.FromStream(wrs.GetResponseStream());
            thisLink.Save2Thumnail(tmpImage);
            wrs.Close();
        }
        catch
        {
        }
    }
示例#8
0
文件: Block.cs 项目: kevincos/Vexed
 public Block(VL.Block xmlBlock)
 {
     unfoldedBlocks = new List<Block>();
     edges = new List<Edge>();
     behaviors = new List<Behavior>();
     color = xmlBlock.color;
     id = xmlBlock.IDString;
 }
示例#9
0
文件: Doodad.cs 项目: kevincos/Vexed
        public Doodad(VL.DoodadType type, Vector3 position, Vector3 normal, Vector3 direction)
        {
            id = "d_"+type.ToString();
            srcDoodad = this;
            this.type = type;
            this.position = new Vertex(position, normal, Vector3.Zero, direction);
            this.spawnPosition = new Vertex(position, normal, Vector3.Zero, direction);
            behaviors = new List<Behavior>();
            currentBehavior = null;
            if (type == VL.DoodadType.LeftDoor || type == VL.DoodadType.RightDoor)
                stateTransition = 0;

            if (isOrb)
                active = true;
        }
示例#10
0
文件: Doodad.cs 项目: kevincos/Vexed
        public Doodad(VL.Doodad xmlDoodad, Vector3 normal)
        {
            srcDoodad = this;
            this.type = xmlDoodad.type;
            this.id = xmlDoodad.IDString;
            this.targetBehavior = xmlDoodad.targetBehavior;
            this.targetObject = xmlDoodad.targetObject;
            this.expectedBehavior = xmlDoodad.expectBehavior;
            this.activationCost = xmlDoodad.activationCost;

            this.abilityType = (AbilityType)xmlDoodad.ability;
            this.originalAbilityType = (AbilityType)xmlDoodad.ability;
            this.position = new Vertex(xmlDoodad.position, normal, Vector3.Zero, xmlDoodad.up);
            this.spawnPosition = new Vertex(xmlDoodad.position, normal, Vector3.Zero, xmlDoodad.up);
            behaviors = new List<Behavior>();
            currentBehavior = null;

            if (isOrb)
                active = true;
            if (type == VL.DoodadType.BluePowerStation)
                orbsRemaining = 1;
            if (type == VL.DoodadType.RedPowerStation)
                orbsRemaining = 1;

            if (type == VL.DoodadType.WallSwitch)
                stateTransition = 0;
            if (isStation)
                stateTransition = 0;
        }
示例#11
0
文件: Sector.cs 项目: kevincos/Vexed
 public Sector(VL.Sector xmlSector)
 {
     id = xmlSector.IDString;
     center = xmlSector.center;
     roomList = new List<Room>();
 }