public IEnumerable <FFile> TakeBuffer()
        {
            while (true)
            {
                FFile r = null;

                FSDBContext db = new FSDBContext(SyncPath);

                r = db.FFiles
                    .FirstOrDefault(r1 => true &&
                                    (r1.Status == FFileStatus.New || r1.Status == FFileStatus.Existing) &&
                                    r1.Path.Contains(db.Fullpath) &&
                                    r1.ProcessingStatus == null
                                    );
                if (r == null)
                {
                    yield break;
                }
                else
                {
                    r.ProcessingStatus = ProcessingStatus.Processing;
                    db.SaveChanges();
                    yield return(r);
                }
            }
        }
Ejemplo n.º 2
0
        public void ShowDuplicatesBtn()
        {
            if (!FFile.Equals(""))
            {
                //WorkBook wb = WorkBook.Load(FFile);
                //WorkSheet ws = wb.WorkSheets.First();
                //string cellValue = ws["A1"].ToString();
                //Console.WriteLine($"A2: {cellValue}");
                ReadExcel();
                CreateExcel();
                bool sugsuc;
                SuggestedStus = new BindableCollection <StudentModel>(Utils.Suggestions(mouldedStudents, out sugsuc));

                if (sugsuc)
                {
                    IsVisibileSuggestion = true;
                    IsVisibileDropExcel  = false;
                }
            }
            //string k = "Dagmawi Negussu, 0937886725. [email protected]" +
            //    ": Bereket Yohannes, 0912345678, [email protected]";
            //bool ap;
            //List<StudentModel> stus = StudentModel.GetStudents(k,out ap);
            //if (ap)
            //{
            //    foreach(StudentModel st in stus)
            //    {
            //        Console.WriteLine("$$$ "+ st.Name + " : " + st.Phone + " : " + st.Email + " : " + st.Params + " : " + st.Errors);
            //    }
            //}
        }
Ejemplo n.º 3
0
        /// <summary>
        /// return SetID
        /// </summary>
        /// <param name="file"></param>
        /// <returns>SetID</returns>
        public string AddPhoto(FFile file)
        {
            var tittle = GetTittleFromPath(file.Path);
            var set    = db.Sets.FirstOrDefault(r => r.UserID == Flickr.User.UserId && r.Tittle.ToLower() == tittle.ToLower());

            if (set == null)
            {
                set = GetOrCreateThenAssign(tittle, file.PhotoID);
            }
            else
            {
                Flickr f = new Flickr();
                f.PhotosetsAddPhoto(set.SetsID, file.PhotoID);
            }

            return(set.SetsID);
        }
Ejemplo n.º 4
0
        public CustomCodeGroups()
        {
            // Obtain references to the main application's objects, devices and members. (See MCF Dev Guide.)
            FCodeGroupFolder gcodes = (FCodeGroupFolder)FObject.GetRef("GCodes");
            FCodeGroupFolder mcodes = (FCodeGroupFolder)FObject.GetRef("MCodes");

            controller = FDevice.GetRef("Controller");

            MainProgram          = FFile.GetRef("NcFile.MainProgram");
            MainProgram.Changed += MainProgram_Changed;  // Hint: tab twice after you type the "+=" for some VS magic!

            theIniFile.TheFile = g.ApplicationDirectory + @"\PowerPmacNC.ini";

            // Add G-code groups:
            // - the order of items below will determine the order they display in the Machine View list of Gcode Groups
            //new FCodeGroup<ECustomGGroup>(gcodes, controller, "CustomGGroup", "Custom G-code group", ECustomGGroup.None);

            // Add M-code groups:
            // - the order of items below will determine the order they display in the Machine View list of Mcode Groups
            //new FCodeGroup<ECustomMGroup>(mcodes, controller, "CustomMGroup", "Custom M-code group", ECustomMGroup.M200);
            OutfileLoggingGroup = new FCodeGroup <EOutfileLoggingGroup>(mcodes, controller, "OutfileLoggingGroup", "Locator Pins M-code group", EOutfileLoggingGroup.M31);
            HoldDownsGroup      = new FCodeGroup <EHoldDownsGroup>(mcodes, controller, "HoldDownsGroup", "Hold Downs M-code group", EHoldDownsGroup.M41);
            LocatorPinsGroup    = new FCodeGroup <ELocatorPinsGroup>(mcodes, controller, "LocatorPinsGroup", "Locator Pins M-code group", ELocatorPinsGroup.M51);

            // Handlers (if needed) to react to a G-Mcode group changing
            //HoldDownsGroup.Changed += HoldDownsGroup_Changed;  // add a Changed handler
            OutfileLoggingGroup.Changed += OutfileLoggingGroup_Changed;  // add a Changed handler

            //go to INI file to get user set parameters for Outfile processing
            // - these are in the "PowerPmacNC.ini" file on the main NC14 application
            // - these are in the section [Router_Addin] of Ini file
            OutfilePath       = theIniFile.GetValue("Router_Addin", "OutfilePath", "C:\\Outfile\\");
            OutfileName       = theIniFile.GetValue("Router_Addin", "OutfileName", "Outfile.txt");
            OutfileDelimiter  = theIniFile.GetValue("Router_Addin", "OutfileDelimiter", ",");
            MachineName       = theIniFile.GetValue("Router_Addin", "MachineName", "Watoga");
            AvgFeedrateEnable = theIniFile.GetValue("Router_Addin", "AvgFeedrateEnable", "1");
            AvgOverideEnable  = theIniFile.GetValue("Router_Addin", "AvgOverideEnable", "1");


            //Key Down Handler defined
            g.theMachine.KeyDown += OnKeyDown;
        }
        public bool Add(FileInfo file)
        {
            bool  isAdded = false;
            FFile v       = null;

            if (file.Exists)
            {
                v = db.FFiles.FirstOrDefault(r => r.Path == file.FullName);

                if (v == null)
                {
                    db.FFiles.Add(new FFile()
                    {
                        Path = file.FullName, Status = FFileStatus.New
                    });
                    db.SaveChanges();
                    isAdded = true;
                }
            }
            return(isAdded);
        }