博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
结对开发:电梯调度(2)
阅读量:6718 次
发布时间:2019-06-25

本文共 2995 字,大约阅读时间需要 9 分钟。

 

组员:赵天  李金吉

分工:赵天:概要设计与编码。

        李金吉:详细设计与调试。

界面

详细代码

 

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Threading;namespace ele{    //调度程序,调度4部电梯        public partial class Form1 : Form    {                //public elevator_work[] elevatorProcess = new elevator_work[4];                public Form1()        {            InitializeComponent();             elevator_work elevatorProcess0 = new elevator_work();             elevator_work elevatorProcess1 = new elevator_work();             elevator_work elevatorProcess2 = new elevator_work();             elevator_work elevatorProcess3 = new elevator_work();            Thread t1 = new Thread(new ParameterizedThreadStart(elevatorProcess0.run));            Thread t2 = new Thread(new ParameterizedThreadStart(elevatorProcess1.run));            Thread t3 = new Thread(new ParameterizedThreadStart(elevatorProcess2.run));            Thread t4 = new Thread(new ParameterizedThreadStart(elevatorProcess3.run));                    }        static public class outOrder//外部请求        {            static public int[] upgoing = new int[21];                                         //上行 目的地状态栏:0为没有请求 1为有请求               static public int[] downgoing = new int[21];                                       //下行 目的地状态栏:0为没有请求 1为有请求        }        static public int SUM = 0;        public void ele0_showup()        {            this.textBox1.Location = new Point(this.textBox1.Location.X, this.textBox1.Location.Y + -20);            Thread.Sleep(300);               }        public void ele1_showup()        {            this.textBox2.Location = new Point(this.textBox2.Location.X, this.textBox2.Location.Y + -20);            Thread.Sleep(300);        }        public void ele2_showup()        {            this.textBox3.Location = new Point(this.textBox1.Location.X, this.textBox3.Location.Y + -20);            Thread.Sleep(300);        }        public void ele3_showup()        {            this.textBox4.Location = new Point(this.textBox1.Location.X, this.textBox4.Location.Y + -20);            Thread.Sleep(300);        }        public void ele0_showdown()        {            this.textBox1.Location = new Point(this.textBox1.Location.X, this.textBox1.Location.Y + 20);            Thread.Sleep(300);        }        public void ele1_showdown()        {            this.textBox1.Location = new Point(this.textBox1.Location.X, this.textBox1.Location.Y + 20);            Thread.Sleep(300);        }        public void ele2_showdown()        {            this.textBox1.Location = new Point(this.textBox1.Location.X, this.textBox1.Location.Y + 20);            Thread.Sleep(300);        }        public void ele3_showdown()        {            this.textBox1.Location = new Point(this.textBox1.Location.X, this.textBox1.Location.Y + 20);            Thread.Sleep(300);        }

 

转载于:https://www.cnblogs.com/lijinji/p/3609032.html

你可能感兴趣的文章
ArcGIS Server GP服务发布与测试(基础版)
查看>>
使用 asp.net mv4开发企业级办公OA
查看>>
Erlang中带超时的receive
查看>>
面向对象的开发范式
查看>>
poj 2455 Secret Milking Machine
查看>>
SVN:更新、同步与提交 PS:被锁定之解决方法
查看>>
ActiveX(ocx) + DLL(wosa) + JS:实现BS硬件调用框架(一)
查看>>
语言精粹【摘要】
查看>>
has been injected into other beans[XXXXXXXXXX] in its raw version as part of a circular reference
查看>>
继承时,当父子类都具有相同的成员变量,默认情况下是直接调用子类的成员变量,当要调用父类的成员变量则需要使用super关键之...
查看>>
npm 命令
查看>>
commons-io-2.5-bin
查看>>
linux下安装一款笔记软件(为知笔记)
查看>>
HP Instant Information
查看>>
Maven 手动添加 JAR 包到本地仓库
查看>>
电子辅助的个体化严密控制策略比常规方法更有效地帮助早期RA实现全面控制病情[EULAR2015_THU0122]...
查看>>
【BZOJ3529】数表
查看>>
最坏的不是面试被拒,而是没面试机会,以面试官视角分析哪些简历至少能有面试机会...
查看>>
python的文件操作与目录操作os模块
查看>>
客户端存储cookie
查看>>