コード例 #1
0
ファイル: Survey.cs プロジェクト: lewis810/HueApp
        public Survey(List<EditProject.SurveyData> _pSurvey_data, string _project_name, ScenarioData _sData)
        {
            InitializeComponent();
            pSurvey_data = _pSurvey_data;
            project_name = _project_name;
            sData = _sData;
            pfc.AddFontFile(Path.Combine(Application.StartupPath, "KOPUBDOTUM_PRO_LIGHT.OTF"));

            for (int i = 0; i < sData.getSData().Count; i++)
            {
                cb_analysis_survey_selectScenario.Items.Add(sData.getSData()[i].title);
            }
            if (sData.getSData().Count == 0)
            {
                cb_analysis_survey_selectScenario.Items.Add("데이터없음");
            }
            cb_analysis_survey_selectScenario.SelectedIndex = 0;


            btn_analysis_show_survey.Font = new Font(pfc.Families[0], 14, FontStyle.Regular);

            //font
            label_1.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);
            label_2.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);
            label_result.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);
            cb_analysis_survey_selectScenario.Font = new Font(pfc.Families[0], 14, FontStyle.Regular);
            cb_analysis_survey_selectTest.Font = new Font(pfc.Families[0], 14, FontStyle.Regular);

            //location
            cb_analysis_survey_selectScenario.Location = new Point(80, label_1.Location.Y + label_1.Height + 10);

            label_2.Location = new Point(80, cb_analysis_survey_selectScenario.Location.Y + cb_analysis_survey_selectScenario.Height + 20);
            cb_analysis_survey_selectTest.Location = new Point(80, label_2.Location.Y + label_2.Height + 10);

        }
コード例 #2
0
ファイル: Dots.cs プロジェクト: lewis810/HueApp
        public Dots(List<EditProject.TotalData> _pTotal_data, string _project_name, ScenarioData _sData)
        {
            InitializeComponent();
            pTotal_data = _pTotal_data;
            sData = _sData;
            project_name = _project_name;

            pfc.AddFontFile(Path.Combine(Application.StartupPath, "KOPUBDOTUM_PRO_LIGHT.OTF"));

            string cPath = @"C:\Users\" + Environment.UserName + "\\Dropbox\\IMAGE\\" + project_name;
            IEnumerable<string> imagenames = Directory.GetFiles(cPath, "*.*", SearchOption.AllDirectories)
                .Where(s => s.EndsWith(".jpg") || s.EndsWith(".jpeg") || s.EndsWith(".png"));

            image_names = imagenames.Cast<string>().ToList();

            for(int i = 0; i < sData.getSData().Count; i++)
            {
                cb_analysis_dots_selectScenario.Items.Add(sData.getSData()[i].title);

            }
            if (sData.getSData().Count == 0)
            {
                cb_analysis_dots_selectScenario.Items.Add("데이터없음");
            }
            cb_analysis_dots_selectScenario.SelectedIndex = 0;


            for (int i = 0; i < image_names.Count; i++)                       //이거 시나리오 콤보박스 인덱스 change에서 사용
            {
                cb_analysis_dots_selectImage.Items.Add(Path.GetFileName(image_names[i]));
            }
            cb_analysis_dots_selectImage.Sorted = true;

            if (image_names.Count == 0)
            {
                cb_analysis_dots_selectImage.Items.Add("데이터없음");
            } 
            cb_analysis_dots_selectImage.SelectedIndex = 0;

         


            btn_analysis_show_dot.Font = new Font(pfc.Families[0], 14, FontStyle.Regular);

            label_1.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);
            label_2.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);
            label_3.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);
            cb_analysis_dots_selectScenario.Font = new Font(pfc.Families[0], 14, FontStyle.Regular);
            cb_analysis_dots_selectTest.Font = new Font(pfc.Families[0], 14, FontStyle.Regular);
            cb_analysis_dots_selectImage.Font = new Font(pfc.Families[0], 14, FontStyle.Regular);
            label_detail_info_title.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);
            label_click.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);
            label_time.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);
            label_shortest.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);
            label_longest.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);
            label_visit.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);
            label_testdate.Font = new Font(pfc.Families[0], 18, FontStyle.Regular);

            cb_analysis_dots_selectScenario.Location = new Point(80, label_1.Location.Y + label_1.Height + 10);

            label_2.Location = new Point(80, cb_analysis_dots_selectScenario.Location.Y + cb_analysis_dots_selectScenario.Height + 20);
            cb_analysis_dots_selectTest.Location = new Point(80, label_2.Location.Y + label_2.Height + 10);

            label_3.Location = new Point(80, cb_analysis_dots_selectTest.Location.Y + cb_analysis_dots_selectTest.Height + 20);
            cb_analysis_dots_selectImage.Location = new Point(80, label_3.Location.Y + label_3.Height + 10);



            label_click.Text = "클릭 수 : ";
            label_time.Text = "체류 시간 : ";
            label_visit.Text = "방문 횟수 : ";
            label_shortest.Text = "최단 체류 시간 : ";
            label_longest.Text = "최장 체류 시간 : ";
            label_testdate.Text = "테스트 일자 : ";

        }
コード例 #3
0
ファイル: FileDownloader.cs プロジェクト: lewis810/HueApp
        public FileDownloader(string[] _filenames, ScenarioData _sData, string _project_name, string _user_id)
        {
            Console.WriteLine("다운로드 세션 시작");

            filenames = _filenames;
            sData = _sData;
            user_id = _user_id;
            project_name = _project_name;
            under_bar_index = new List<int>();

            string mPath = @"C:\Users\" + Environment.UserName + "\\Nudge\\";
            DirectoryInfo di = new DirectoryInfo(mPath);

            if (di.Exists == false)
            {
                di.Create();
            }

            FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://[email protected]/uploads/");
            request.Credentials = new NetworkCredential("kyjk3", "sogong123");
            request.Method = WebRequestMethods.Ftp.ListDirectory;

            //encoding 한글깨짐방지
            StreamReader streamReader = new StreamReader(request.GetResponse().GetResponseStream(), Encoding.Default, true);

            List<string> fileNames = new List<string>();
            string fileName = streamReader.ReadLine();

            while (fileName != null)
            {
                //여기서 xml의 이름에 대한 조건을 걸어서 필요한 xml만 리스트에 넣기 -> 이 정보만 다운
                //시나리오 이름(받아온 거) 디바이스 정보(새로 추출)를 가지고 조건 걸기
                //시나리오 정보로 먼저 비교해서 반복문 로드 줄이기

                Console.WriteLine("@@@@@@" + fileName);
                if (fileName.Contains(project_name) && fileName.Contains(user_id))
                {
                    Console.WriteLine("들어옴 : " + fileName + "\n" + sData.getSData().Count.ToString());
                    
                    for (int p = 0; p < sData.getSData().Count; p++)
                    {
                        Console.WriteLine("제목 : " + sData.getSData()[p].title + "// fileName : " + fileName);
                        under_bar_index.Clear();
                        for (int k = 0, h = 0; k < fileName.Length; k++)
                        {
                            if (fileName[k].CompareTo('_') == 0)
                            {
                                under_bar_index.Add(k);
                                h++;
                            }
                        }

                        string device_id = fileName.Substring(under_bar_index[2] + 1, (under_bar_index[3] - under_bar_index[2]) - 1);
                        string scenario = fileName.Substring(under_bar_index[1] + 1, (under_bar_index[2] - under_bar_index[1]) - 1);
                        string scenario_tag = fileName.Substring(0, under_bar_index[0]);

                        Console.WriteLine("대박" + device_id);


                        Console.WriteLine("시나리오 : " + scenario);

                        if (sData.getSData()[p].title.CompareTo(scenario) == 0)
                        {
                            Console.WriteLine("있음1");

                            //디바이스정보 추출
                            
                            //같은 시나리오 데이터 중에 해당 디바이스 정보가 있으면 다운 x
                            bool exist = false;
                            for (int i = 0; i < filenames.Length; i++)
                            {
                                //번호 //device_id //
                                Console.WriteLine("비교 : " + filenames[i] + " == " + device_id +",, "+ scenario_tag);

                                if (filenames[i].Contains(scenario) && filenames[i].Contains(device_id) && Path.GetFileName(filenames[i]).Substring(0, under_bar_index[0]).CompareTo(scenario_tag) == 0)
                                {
                                    Console.WriteLine("이미 다운로드 되어있음");
                                    exist = true;
                                }
                            }

                            if (exist == false)
                            {
                                //같은 시나리오 이름에 디바이스 정보가 없는 데이터
                                Console.WriteLine("다운로드 목록에 추가.");
                                fileNames.Add(fileName);
                            }

                            break;
                        }
                    }

                    

                }
                //fileNames.Add(fileName);
                fileName = streamReader.ReadLine();
            }

            request = null;
            streamReader = null;

            string remoteUri = "http://kyjk3.cafe24.com/uploads/";
            string myStringWebResource = null;
            // Create a new WebClient instance.
            WebClient myWebClient = new WebClient();
            myWebClient = new System.Net.WebClient();

            for (int i = 0; i < fileNames.Count; i++)
            {
                //Console.WriteLine("in " + fileNames[i]);

                if (fileNames[i].Contains(".xml"))
                {
                    // Concatenate the domain with the Web resource filename.
                    myStringWebResource = remoteUri + fileNames[i];
                    Uri uri = new Uri(myStringWebResource);
                    Console.WriteLine("Downloading File \"{0}\" from \"{1}\" .......\n\n", fileNames[i], myStringWebResource);
                    // Download the Web resource and save it into the current filesystem folder.
                    // 특정 폴더로 파일 저장
                    myWebClient.DownloadFileAsync(uri, mPath + fileNames[i]);
                    while (myWebClient.IsBusy)
                    {

                    }
                    Console.WriteLine("Successfully Downloaded File \"{0}\" from \"{1}\"", fileNames[i], myStringWebResource);
                    Console.WriteLine("\nDownloaded file saved in the following file system folder:\n\t" + Application.StartupPath);
                }
            }


            Console.WriteLine("다운로드 세션 종료");
        }
コード例 #4
0
ファイル: EditProject.cs プロジェクト: lewis810/HueApp
        //from edit_image
        public EditProject(string _myPath, LinkData _pData, ScenarioData _sData, string _user_id, List<TotalData> _total_data)
        {
            InitializeComponent();

            _main = new main();
            myPath = _myPath;
            pData = _pData;
            sData = _sData;
            user_id = _user_id;
            pData.SetDownload(false);       //edit image에서 edit project로 넘어오면 download를 다시 하지 않게 함
            total_data = _total_data;

            SetupButton();

            for(int i = 0; i < sData.getSData().Count; i++)
            {
                listBox_scenario.Items.Add(sData.getSData()[i].title);
            }

            Assembly assembly = Assembly.GetAssembly(typeof(ImageListView));

            imageListView_EditProject.SetRenderer(new ImageListViewRenderers.DefaultRenderer());
            imageListView_EditProject.SortColumn = 0;
            imageListView_EditProject.SortOrder = Manina.Windows.Forms.SortOrder.AscendingNatural;

            string cacheDir = Path.Combine(
                Path.GetDirectoryName(new Uri(assembly.GetName().CodeBase).LocalPath),
                "Cache"
                );
            if (!Directory.Exists(cacheDir))
                Directory.CreateDirectory(cacheDir);
            imageListView_EditProject.PersistentCacheDirectory = cacheDir;
            imageListView_EditProject.Columns.Add(ColumnType.Name);
            imageListView_EditProject.Columns.Add(ColumnType.Dimensions);
            imageListView_EditProject.Columns.Add(ColumnType.FileSize);
            imageListView_EditProject.Columns.Add(ColumnType.FolderName);

            cm = new ContextMenu();
            cm.MenuItems.Add("Delete", new System.EventHandler(this.imageListView_menuItem_delete_click));
        }