Пример #1
0
        public string UpdateImages()
        {
            DateTime tmnow   = DateTime.Now;
            string   result  = "";
            int      nsec    = Util.getTimeDiff_Second(tm_create);
            int      nUpload = 0;

            for (int i = 0; i < RECORD.Length; i++)
            {
                RobotPenImages img = RECORD[i];
                if (img != null)
                {
                    int    seat  = i + 1;
                    int    uid   = Global.getUidBySeat(seat);
                    string names = "";
                    foreach (RobotPenImageGroup group in img.grouplist)
                    {
                        if (group.status == 0)
                        {
                            //TODO: upload
                            foreach (RobotPenImageItem item in group.imglist)
                            {
                                names += (names.Length > 0 ? "|" : "") + item.imgName;
                                string imgPath = m_ImgDir + "\\" + item.imgName;
                                Common.uploadPicture(imgPath);
                                group.status = 1;
                                nUpload++;
                            }
                        }
                    }
                    if (names.Length > 0)
                    {
                        string result_item = uid + ":" + names;
                        result += (result.Length > 0 ? ";" : "") + result_item;
                    }
                }
            }

            if (nUpload > 0)
            {
                Common.uploadRobortPenEvent(rid, createtime, result, nsec);//同步到本地服务和云服务器
            }
            return("");
        }
Пример #2
0
        public FormDraw()
        {
            InitializeComponent();
            this.DoubleBuffered = true;

            Log.Info("FormDraw.create");

            for (int i = 0; i < MAX; i++)
            {
                szTrail[i] = new Trail();
                if (RECORD[i] == null)
                {
                    RECORD[i] = new RobotPenImages();
                }
            }

            //No xiti.id
            rid = Global.getSchoolID() + "-" + Global.getClassID() + "-" + DateTime.Now.ToString("yyyyMMddHHmmss");
            SetPanel();
            this.Height = screenHeight;
            this.Width  = screenWidth;

            StartPosition = FormStartPosition.Manual;
            SetDesktopLocation(0, screenHeight - this.Height);
            if (panelImg == null)
            {
                panelImg = new Bitmap(panel1.Width, panel1.Height);
            }

            this.TopMost = true;
#if DEBUG
            this.TopMost = false;//PPTPractise
#endif
            this.Hide();
            labelName.Text  = "";
            labelIndex.Text = "";
            init();
            openDevice();

            //清空界面
            Graphics grap = this.panel1.CreateGraphics();
            grap.Clear(this.BackColor);
            grap.Dispose();
        }
Пример #3
0
        public string GetImages(int index)
        {
            RobotPenImages r = RECORD[index];

            return(r.toJson());
        }