Esempio n. 1
0
 private void reqPhoto(int camID)
 {
     if (tcpCli[camID].status == 2)
     {
         tcpCli[camID].Send("s." + index[camID] + ".");
         LoadLatestImg loadimg = new LoadLatestImg(camID, locCurrent, "c:/RoboFTP/" + camID + "/" + index[camID] + ".0.jpg");
         index[camID]++;
         Console.WriteLine("index[" + camID + "] = " + index[camID]);
     }
     //Console.WriteLine("Could not request photo of name: " + index[camID] + ".0.jpg from Camera: " + camID + " ERROR: not connected");
 }
Esempio n. 2
0
        private void HandleKeyDownEvent(object sender, KeyEventArgs e)
        {
            string filename;

            string[] c;
            int      i;

            switch (e.Key)
            {
            case Key.A:     //Left cam Back
                i = 2;
                do
                {
                    disp[i]--;
                    filename = "C:/RoboFTP/" + i + "/" + disp[i] + ".0.jpg";
                } while ((!File.Exists(filename) && disp[i] >= 0));
                Console.WriteLine("BAK Attempting to open:" + filename);
                if (!File.Exists(filename))
                {
                    return;
                }
                // if (disp[i] > index[i])
                //    index[i] = disp[i];
                imgLeft.Source = LoadLatestImg.loadImg(filename, false);
                c       = filename.Split(new char[] { '.', '/' });
                disp[i] = Convert.ToInt32(c[c.Length - 3]);
                MainWindow.mainWind.tCurrFileLeft.Text = disp[i].ToString();
                Globals.live[i] = false;
                tLiveLeft.Text  = "REVIEW";
                break;

            case Key.S:     //Left cam live
                i = 2;
                Globals.live[i] = true;
                tLiveLeft.Text  = "LIVE";
                break;

            case Key.D:     //Left cam Forward
                i = 2;
                do
                {
                    disp[i]++;
                    filename = "C:/RoboFTP/" + i + "/" + disp[i] + ".0.jpg";
                } while ((!File.Exists(filename) && disp[i] <= index[i]));
                Console.WriteLine("FWD Attempting to open:" + filename);
                if (!File.Exists(filename))
                {
                    return;
                }
                imgLeft.Source = LoadLatestImg.loadImg(filename, false);
                c                  = filename.Split(new char[] { '.', '/' });
                disp[i]            = Convert.ToInt32(c[c.Length - 3]);
                tCurrFileLeft.Text = disp[i].ToString();
                Globals.live[i]    = false;
                tLiveLeft.Text     = "REVIEW";
                break;

                #region center
            case Key.J:     //Center cam Back
                i = 1;
                do
                {
                    disp[i]--;
                    filename = "C:/RoboFTP/" + i + "/" + disp[i] + ".0.jpg";
                } while ((!File.Exists(filename) && disp[i] >= 0));
                Console.WriteLine("BAK Attempting to open:" + filename);
                if (!File.Exists(filename))
                {
                    return;
                }
                imgCenter.Source = LoadLatestImg.loadImg(filename, false);
                c       = filename.Split(new char[] { '.', '/' });
                disp[i] = Convert.ToInt32(c[c.Length - 3]);
                tCurrFileCenter.Text = disp[i].ToString();
                tLiveCenter.Text     = "REVIEW";
                Globals.live[i]      = false;
                break;

            case Key.K:     //Center cam live
                i = 1;
                tLiveCenter.Text = "LIVE";
                Globals.live[i]  = true;
                break;

            case Key.L:     //Center cam Forward
                i = 1;
                do
                {
                    disp[i]++;
                    filename = "C:/RoboFTP/" + i + "/" + disp[i] + ".0.jpg";
                } while ((!File.Exists(filename) && disp[i] <= index[i]));
                Console.WriteLine("FWD Attempting to open:" + filename);
                if (!File.Exists(filename))
                {
                    return;
                }
                imgCenter.Source = LoadLatestImg.loadImg(filename, false);
                c       = filename.Split(new char[] { '.', '/' });
                disp[i] = Convert.ToInt32(c[c.Length - 3]);
                tCurrFileCenter.Text = disp[i].ToString();
                Globals.live[i]      = false;
                tLiveCenter.Text     = "REVIEW";
                break;

                #endregion
                #region Right
            case Key.NumPad4:     //Right cam Back
                i = 0;
                do
                {
                    disp[i]--;
                    filename = "C:/RoboFTP/" + i + "/" + disp[i] + ".0.jpg";
                } while ((!File.Exists(filename) && disp[i] >= 0));
                Console.WriteLine("BAK Attempting to open:" + filename);
                if (!File.Exists(filename))
                {
                    return;
                }
                imgRight.Source = LoadLatestImg.loadImg(filename, false);
                c                   = filename.Split(new char[] { '.', '/' });
                disp[i]             = Convert.ToInt32(c[c.Length - 3]);
                tCurrFileRight.Text = disp[i].ToString();
                tLiveRight.Text     = "REVIEW";
                Globals.live[i]     = false;
                break;

            case Key.NumPad5:     //Right cam live
                i = 0;
                tLiveRight.Text = "LIVE";
                Globals.live[i] = true;
                break;

            case Key.NumPad6:     //Right cam Forward
                i = 0;
                do
                {
                    disp[i]++;
                    filename = "C:/RoboFTP/" + i + "/" + disp[i] + ".0.jpg";
                } while ((!File.Exists(filename) && disp[i] <= index[i]));
                Console.WriteLine("FWD Attempting to open:" + filename);
                if (!File.Exists(filename))
                {
                    return;
                }
                imgRight.Source = LoadLatestImg.loadImg(filename, false);
                c                   = filename.Split(new char[] { '.', '/' });
                disp[i]             = Convert.ToInt32(c[c.Length - 3]);
                tCurrFileRight.Text = disp[i].ToString();
                Globals.live[i]     = false;
                tLiveRight.Text     = "REVIEW";
                break;
                #endregion
            }
        }