public Window3()
 {
     InitializeComponent();
        delRun = new DelRun(Run);
        delUpdateUI = new DelUpdateUI(UpdateUI);
        sb = (Storyboard)Resources["myAni"];
 }
Ejemplo n.º 2
0
 public UControlCreateSurvey(ISurveyRequestService surveyRequestService)
 {
     InitializeComponent();
     _surveyRequest = surveyRequestService;
     _surveyRequest.ResponseReceived += SurveyRequest_ResponseReceived;
     _delUpdateUI = updateAnswerDashBoard;
 }
Ejemplo n.º 3
0
        //刷到上行卡时的操作
        public void CarUp(object car)
        {
            try
            {
                //获取站名
                ((CarData)car).stationName = CommonData.stations.GetValueByKey("StationID", (((CarData)car).stationID), "Name").ToString();
                //保存信息
                data = (CarData)car;
                //延迟三秒
                GetStableWeightUp.tag = 1;
                Thread.Sleep(5*1000);

                int s = 0;
                //称重
                lock (GetStableWeightUp.myarray)
                {
            data.allWeight = GetStableWeightUp.getstable(ref s);
                    foreach (double item in GetStableWeightUp.myarray)
                    {
                        data.uplist += item + ",";
                    }
                }
                GetStableWeightUp.tag = 0;
                state = s * 100;
                //拍照
                data.picPath = GetPic();
                //
                DelUpdateUI d = new DelUpdateUI(UpdateUI);
                this.Invoke(d,1);
            }
            catch (Exception ex) { LogWriter.WriteLog(ex.Message+"\n"+ex.StackTrace); }
        }
Ejemplo n.º 4
0
        //刷到下行卡时的操作
        public void CarDown()
        {
            try
            {
                int s = 0;
                data.downTime = DateTime.Now.ToString("yy-MM-dd,HH:mm");
                //延迟3秒
                GetStableWeight.tag = 1;
                Thread.Sleep(6000);

                //读取重量
                lock (GetStableWeight.myarray)
                {
                    data.carWeight = GetStableWeight.getstable(ref s);

                    foreach (double item in GetStableWeight.myarray)
                    {
                        data.downlist += item + ",";
                    }
                }
                GetStableWeight.tag = 0;
                if (s != 0)
                    state += s % 10;
                //更新界面
                DelUpdateUI d = new DelUpdateUI(UpdateUI);
                this.Invoke(d, 0);
                //保存数据
                SaveData();
            }
            catch (Exception ex) { LogWriter.WriteLog(ex.Message + "\n" + ex.StackTrace); }
        }
 public MainWindowViewModel(MainWindow MainWindowWnd)
 {
     _MainWindowWnd = MainWindowWnd;
     _UpdateUI = this.UpdateUI;
 }