Exemplo n.º 1
0
 private void btnPrice_Click(object sender, EventArgs e)
 {
     //((((cosT+wm+(0.5 * wd ))/SH+aft)*2)+8)/32
     if (!string.IsNullOrEmpty(tbCost.Text))
     {
         //int Cost = tbCost.Text;
         Double Cost = Int32.Parse(tbCost.Text);
         Double WD   = Int32.Parse(tbWD.Text);
         Double WM   = Int32.Parse(tbWM.Text);
         Double SH   = Int32.Parse(tbSh.Text);
         Double AFT  = Int32.Parse(tbAft.Text);
         Double TT;
         if (WD >= 50)
         {
             TT = Math.Round(((((Cost + WM + (0.3 * WD)) / ((100 - SH) / 100) + AFT) * 2) + 8) / 32, 3);
         }
         else
         {
             TT = Math.Round(((((Cost + WM + (0.5 * WD)) / ((100 - SH) / 100) + AFT) * 2) + 8) / 32, 3);
         }
         tb_PRICE.Text = TT.ToString();
     }
     else
     {
         tb_PRICE.DataBindings.Clear();
         tb_PRICE.DataBindings.Add("Text", bs, "PRICE");
     }
 }
Exemplo n.º 2
0
        public static string Thanhtien(string Soluong, string Dongia, string Giamgia)
        {
            Double SL, DG, GG, TT;

            if (Soluong == "")
            {
                SL = 0;
            }
            else
            {
                SL = Convert.ToDouble(Soluong);
            }
            if (Dongia == "")
            {
                DG = 0;
            }
            else
            {
                DG = Convert.ToDouble(Dongia);
            }
            if (Giamgia == "")
            {
                GG = 0;
            }
            else
            {
                GG = Convert.ToDouble(Giamgia);
            }
            TT = DG * SL - DG * SL * GG / 100;
            return(TT.ToString());
        }
Exemplo n.º 3
0
        static double[] AB2B3, AE, A3, A4;                                       //输出
        static void Main(string[] args)
        {
            #region 参数值输入
            try
            {
                Console.WriteLine("请按格式输入值,否则都按默认值计算!!!");
                Console.Write("请输入w1(弧度制,例如3派请输入 3PI):");
                string temp = Console.ReadLine().Replace("PI", "");
                W1 = Convert.ToDouble(temp) * Math.PI;

                Console.Write("请输入θ1(角度制,且小于360°,列如90°请输入 90):");
                TT = Convert.ToDouble(Console.ReadLine()); //角度
                T1 = Angle2Radian(TT);                     //弧度

                Console.Write("请输入l1:");
                L1 = Convert.ToDouble(Console.ReadLine());
                Console.Write("请输入l3:");
                L3 = Convert.ToDouble(Console.ReadLine());
                Console.Write("请输入l4:");
                L4 = Convert.ToDouble(Console.ReadLine());
                Console.Write("请输入l6:");
                L6 = Convert.ToDouble(Console.ReadLine());
                Console.Write("请输入l6':");
                _L6 = Convert.ToDouble(Console.ReadLine());
            }
            catch
            {
                Console.Write("输入格式不对,默认值进行计算");
            }
            #endregion

            #region 循环次数计算
            int n = (int)(360 - T1);
            n = n / 10 + 1;
            Console.WriteLine("循环{0}次", n.ToString());
            S3    = new double[n]; SE = new double[n]; T3 = new double[n]; T4 = new double[n];
            VB2B3 = new double[n]; VE = new double[n]; W3 = new double[n]; W4 = new double[n];
            AB2B3 = new double[n]; AE = new double[n]; A3 = new double[n]; A4 = new double[n];
            #endregion
            int i = 0;
            //for (int j = 0; j < n; j++)
            //{
            //    Console.Write("{0}\t", j);
            //}
            Console.WriteLine("角度\tS3\tSE\tθ3\tθ4\tVB2B3\tVE\tW3\tW4\tAB2B3\tAE\tε3\tε4");
            for (; TT <= 360.0; TT += 10.0)
            {
                T1 = Angle2Radian(TT);
                AnalysisPosition(out S3[i], out SE[i], out T3[i], out T4[i]);
                AnalysisSpeed(S3[i], T3[i], T4[i], out VB2B3[i], out VE[i], out W3[i], out W4[i]);
                AnalysisAcceleration(S3[i], T3[i], T4[i], W3[i], W4[i], VB2B3[i], out AB2B3[i], out AE[i], out A3[i], out A4[i]);
                Console.WriteLine(TT.ToString() + "°\t{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}\t{11}",
                                  Math.Round(S3[i], 3), Math.Round(SE[i], 3), Math.Round(T3[i], 3), Math.Round(T4[i], 3),
                                  Math.Round(VB2B3[i], 3), Math.Round(VE[i], 3), Math.Round(W3[i], 3), Math.Round(W4[i], 3),
                                  Math.Round(AB2B3[i], 3), Math.Round(AE[i], 3), Math.Round(A3[i], 3), Math.Round(A4[i], 3));
                i++;
            }
            Console.ReadLine();
        }
Exemplo n.º 4
0
 public Token(TT type)
 {
     Type = type;
     if (MyTranslator.stringValues.TryGetValue(type, out string value))
     {
         StringValue = value;
     }
     else
     {
         StringValue = type.ToString();
     }
 }
        public void incTT()
        {
            if (TT <= num)
            {
                wp.textBox5.Text = TT.ToString();
                wp.textBox6.Text = TR.ToString();
                wp.textBox7.Text = controlP.ToString();
                wp.textBox8.Text = reloj.ToString();
                ReturnBloqProcess();

                reloj++;
                TT++;
                TR = h - TT;
            }
            else if (TT >= num)
            {
                controlP--;

                if (controlP == 0)
                {
                    SendToFinal(sh1, false);
                    t.Stop();
                    wp.textBox7.Text = "0";
                    MessageBox.Show("El proceso termino");

                    int             count = ls5.Count();
                    AllProcessStats alp   = new AllProcessStats(ls5);
                    alp.Show();
                }
                else if (controlP > 0)
                {
                    SendToFinal(sh1, false);
                    EliminateProcess(false);
                    ReturnBloqProcess();
                    AddNewProcess();
                    //globalCantProcss2--;
                    //sh1++;
                    TT = 0;
                    TR = 0;
                }
            }
        }
Exemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            numlot      = 0;
            list1[0]    = new List <Process>();
            CantProcess = int.Parse(comboBox1.Text);

            for (int i = 1; i <= CantProcess; i++)
            {
                Process pr = new Process();

                GenID();
                GenOp();
                GenTE();

                //numlot++;
                pr.IDs       = ID.ToString();
                pr.OP        = cOp;
                pr.TE        = TT.ToString();
                pr.Nombre    = "--";
                pr.Flag      = "0";
                pr.FirstTime = true;

                list1[0].Add(pr);

                //if (numlot <= 4)
                //{
                //    list1[ListInd].Add(pr);
                //}
                //else if (numlot > 4)
                //{
                //    ListInd++;
                //    numlot = 1;
                //    list1[ListInd] = new List<Process>();
                //    list1[ListInd].Add(pr);
                //}
            }

            this.Hide();
            Processwindow wp1 = new Processwindow(list1);

            wp1.Show();
        }
Exemplo n.º 7
0
 public override string ToString()
 {
     return(Type.ToString() + ": " + StringValue);
 }
Exemplo n.º 8
0
        public void DisplayDefaultOf2 <TT>() //Generische Methode
        {
            TT item = default(TT);

            Console.WriteLine($"Default value of {typeof(TT)} is {(item == null ? "null" : item.ToString())}.");
        }