public MainForm(Form adamForm)
        {
            InitializeComponent();
            loadingBox       = new LoadingBox();
            this.adamForm    = adamForm;
            this.MinimizeBox = false; // this is a workaround for skip mininum error

            //CheckForIllegalCrossThreadCalls = false; // 防止串口回调报错

            // 初始化model
            serialPort  = new SerialPort();
            grMapper    = new GlassRecipePowderMapper();
            powderModel = new PowderModel();
            logger      = new TextLogger();

            // 注册回调
            serialPort.DataReceived += new SerialDataReceivedEventHandler(dataReceived);

            loadClients();
            loadGlasses();
            loadRecipes();
            textBox1.Text = "" + Settings.RawMaterialQuality; // 原料质量

            // 状态栏监视定时器
            timer1.Start();
            // 质量更新定时器
            timer2.Start();
            // 清零监视定时器
            timer3.Start();
        }
        public ManagerForm(Form form)
        {
            InitializeComponent();

            adamForm    = form;
            powderModel = new PowderModel();
            grMapper    = new GlassRecipePowderMapper();
        }
 public VoEditBox(IPowderModel powderModel, IGlassRecipePowderMapper grModel, GlassRecipeVo vo)
     : base(powderModel, grModel)
 {
     oldVo                   = vo;
     comboBox2.Text          = vo.Customer;
     comboBox3.Text          = vo.GlassName;
     textBox4.Text           = vo.Weight.ToString();
     comboBox1.SelectedIndex = comboBox1.Items.IndexOf(vo.PowderName);
 }
        public PowderBox(ManagerForm form, IPowderModel model)
        {
            InitializeComponent();

            this.form             = form;
            this.model            = model;
            model.PowdersUpdated += loadPowders;

            loadPowders();
        }
Beispiel #5
0
        public AbstractVoBox(IPowderModel powderModel, IGlassRecipePowderMapper mapper)
        {
            InitializeComponent();
            this.powderModel = powderModel;
            this.dataMapper  = mapper;
            label5.Visible   = false;

            // comboBox1以其选择的条目作为最终数据
            powderModel.findPowders()
            .ForEach(p => comboBox1.Items.Add(p.PowderName));

            // comboBox2和comboBox3以其text作为最终数据
            dataMapper.findCustomers()
            .ForEach(c => comboBox2.Items.Add(c));
            dataMapper.findGlasses()
            .ForEach(g => comboBox3.Items.Add(g));
        }
Beispiel #6
0
        public PowderAddBox(IPowderModel model)
        {
            InitializeComponent();

            this.model = model;
        }
Beispiel #7
0
 public VoAddBox(IPowderModel powderModel, IGlassRecipePowderMapper mapper)
     : base(powderModel, mapper)
 {
 }