예제 #1
0
        internal static string BSTPath = "%USERPROFILE%\\AppData\\Local\\BSTEnterprise\\InquiryReports"; //\\Proddbhttpzadc1pbst02.zutari.com";
        internal static Excel.Worksheet ImportReport(string FileName)                                    //Import the report onto a new sheet
        {
            Excel.Application xlAp = Globals.ThisAddIn.Application;
            Excel.Workbook    XlWb = xlAp.ActiveWorkbook;
            Excel.Worksheet   XlSh;
            Excel.QueryTable  QT;
            string            ConnectionString;

            try
            {
                //Import BST report
                xlAp.ScreenUpdating = false;
                XlSh             = XlWb.Sheets.Add();
                ConnectionString = "FINDER;file:///" + Environment.ExpandEnvironmentVariables(BSTPath + "\\" + FileName);
                QT = XlSh.QueryTables.Add(Connection: ConnectionString, Destination: XlSh.Range["$A$1"]);
                QT.WebSelectionType = Excel.XlWebSelectionType.xlEntirePage;
                QT.Refresh(false);
                QT.Delete();
                xlAp.ScreenUpdating = true;
                return(XlSh);
            }
            catch (Exception ex)
            {
                Globals.ThisAddIn.ExMsg(ex);
                return(null);
            }
        }
예제 #2
0
        private void BttnTest_Click(object sender, RoutedEventArgs e)
        {
            QT qt = new QT();

            qt.LuaConnect();
            try
            {
            }
            finally
            {
                qt.LuaDisconnect();
            }
        }
예제 #3
0
        private async void LoadInstruction(BookInstruction B, bool useCache)
        {
            if (!BookInstruction.OpLocks.AcquireLock(B.GID, out AsyncLocks <string, bool> .QueueToken QT))
            {
                await QT.Task;
            }

            SpiderBook SBook = await SpiderBook.CreateSAsync(B.ZoneId, B.ZItemId, B.BookSpiderDef);

            if (Shared.Storage.FileExists(SBook.MetaLocation))
            {
                B.LastCache = Shared.Storage.FileTime(SBook.MetaLocation).LocalDateTime;
            }

            if (useCache && (B.Packed == true || Shared.BooksDb.Volumes.Any(x => x.Book == B.Entry)))
            {
                if (B.Packed != true)
                {
                    B.PackSavedVols(SBook.PSettings);
                }
            }
            else
            {
                bool UpdateFailed = true;

                await SBook.Process();

                if (SBook.Processed && SBook.ProcessSuccess)
                {
                    B.LastCache = DateTime.Now;
                    BookInstruction BUpdate = SBook.GetBook();

                    if (BUpdate.Packable && BUpdate.Packed != true)
                    {
                        BUpdate.PackVolumes(SBook.GetPPConvoy());
                        B.Update(BUpdate);
                        UpdateFailed = false;
                    }
                }

                // Cannot download content, use cache if available
                if (UpdateFailed && Shared.BooksDb.Volumes.Any(x => x.Book == B.Entry))
                {
                    Logger.Log(ID, "Spider failed to produce instructions, using cache instead", LogType.WARNING);
                    B.PackSavedVols(SBook.PSettings);
                }
            }

            QT.TrySetResult(true);
            OnComplete(B);
        }
예제 #4
0
        private static void Drawing_OnDraw(EventArgs args)
        {
            if (!Me.IsDead)
            {
                //var wts = Drawing.WorldToScreen(Me.Position);

                if (Config.Item("drawrange").GetValue <bool>())
                {
                    Render.Circle.DrawCircle(Me.Position, wrange, System.Drawing.Color.White, 3);
                }

                if (Config.Item("drawengage").GetValue <bool>())
                {
                    Render.Circle.DrawCircle(Me.Position, Me.AttackRange + e.Range + 10, System.Drawing.Color.White, 3);
                }

                if (Maintarget.IsValidTarget(900) && Config.Item("drawtarg").GetValue <bool>())
                {
                    Render.Circle.DrawCircle(
                        Maintarget.Position, Maintarget.BoundingRadius - 50, System.Drawing.Color.Yellow, 6);
                }

                if (Config.Item("debugtrue").GetValue <bool>())
                {
                    Render.Circle.DrawCircle(Me.Position, truerange, System.Drawing.Color.Yellow, 3);
                }

                if (Config.Item("drawpassive").GetValue <bool>())
                {
                    var wts = Drawing.WorldToScreen(Me.Position);
                    if (Me.Spellbook.CanUseSpell(SpellSlot.Q) == SpellState.NotLearned)
                    {
                        Drawing.DrawText(wts[0] - 48, wts[1] + 10, System.Drawing.Color.White, "Q: Not Learned!");
                    }
                    else if (QT <= 0)
                    {
                        Drawing.DrawText(wts[0] - 30, wts[1] + 10, System.Drawing.Color.White, "Q: Ready");
                    }
                    else
                    {
                        Drawing.DrawText(
                            wts[0] - 30, wts[1] + 10, System.Drawing.Color.White, "Q: " + QT.ToString("0.0"));
                    }
                }
            }

            if (Config.Item("debugdmg").GetValue <bool>() && Maintarget.IsValidTarget(1000))
            {
                var wts = Drawing.WorldToScreen(Maintarget.Position);
                if (!r.IsReady())
                {
                    Drawing.DrawText(wts[0] - 75, wts[1] + 40, System.Drawing.Color.Yellow,
                                     "Combo Damage: " + (float)(ra * 3 + rq * 3 + rw + rr + ri + ritems));
                }
                else
                {
                    Drawing.DrawText(wts[0] - 75, wts[1] + 40, System.Drawing.Color.Yellow,
                                     "Combo Damage: " + (float)(ua * 3 + uq * 3 + uw + rr + ri + ritems));
                }
            }

            if (Maintarget.IsValidTarget(1000) && Config.Item("drawkill").GetValue <bool>())
            {
                var wts = Drawing.WorldToScreen(Maintarget.Position);

                if ((float)(ra + rq * 2 + rw + ri + ritems) > Maintarget.Health)
                {
                    Drawing.DrawText(wts[0] - 20, wts[1] + 20, System.Drawing.Color.LawnGreen, "Kill!");
                }
                else if ((float)(ra * 2 + rq * 2 + rw + ritems) > Maintarget.Health)
                {
                    Drawing.DrawText(wts[0] - 40, wts[1] + 20, System.Drawing.Color.LawnGreen, "Easy Kill!");
                }
                else if ((float)(ua * 3 + uq * 2 + uw + ri + rr + ritems) > Maintarget.Health)
                {
                    Drawing.DrawText(wts[0] - 65, wts[1] + 20, System.Drawing.Color.LawnGreen, "Full Combo Kill!");
                }
                else if ((float)(ua * 3 + uq * 3 + uw + rr + ri + ritems) > Maintarget.Health)
                {
                    Drawing.DrawText(wts[0] - 70, wts[1] + 20, System.Drawing.Color.LawnGreen, "Full Combo Hard Kill!");
                }
                else if ((float)(ua * 3 + uq * 3 + uw + rr + ri + ritems) < Maintarget.Health)
                {
                    Drawing.DrawText(wts[0] - 40, wts[1] + 20, System.Drawing.Color.LawnGreen, "Cant Kill!");
                }
            }
        }
예제 #5
0
        private async void LoadInst(BookInstruction b)
        {
            if (!BookInstruction.OpLocks.AcquireLock(b.GID, out AsyncLocks <string, bool> .QueueToken QT))
            {
                await QT.Task;
            }

            foreach (VolInstruction VInst in b.GetVolInsts())
            {
                Shared.LoadMessage("SubProcessRun", VInst.Title);
                // This should finalize the chapter info
                var Convoy = await VInst.Process(b);
            }

            Shared.LoadMessage("CompilingTOC", b.Title);

            IEnumerable <Volume> Vols = b.GetVolInsts().Remap(x => x.ToVolume(b.Entry));

            if (Vols.Any())
            {
                List <Volume> NewVolumes = new List <Volume>();
                Vols.ExecEach(Vol =>
                {
                    string VID  = Vol.Meta[AppKeys.GLOBAL_VID];
                    Volume NVol = b.Entry.Volumes.FirstOrDefault(x => x.Meta[AppKeys.GLOBAL_VID] == VID) ?? Vol;
                    if (NVol != Vol)
                    {
                        NVol.Title     = Vol.Title;
                        NVol.Index     = Vol.Index;
                        NVol.Json_Meta = Vol.Json_Meta;
                    }

                    Shared.BooksDb.LoadCollection(NVol, x => x.Chapters, x => x.Index);

                    List <Chapter> NewChapters = new List <Chapter>();
                    Vol.Chapters.ExecEach(Ch =>
                    {
                        string CID  = Ch.Meta[AppKeys.GLOBAL_CID];
                        Chapter NCh = NVol.Chapters.FirstOrDefault(x => x.Meta[AppKeys.GLOBAL_CID] == CID) ?? Ch;
                        if (NCh != Ch)
                        {
                            NCh.Title     = Ch.Title;
                            NCh.Index     = Ch.Index;
                            NCh.Json_Meta = Ch.Json_Meta;
                        }
                        NewChapters.Add(NCh);
                    });

                    NewVolumes.Add(NVol);
                });

                b.Entry.Volumes = NewVolumes;
                b.SaveInfo();
            }
            else
            {
                MessageBus.SendUI(GetType(), AppKeys.HS_NO_VOLDATA, b);
            }

            QT.TrySetResult(true);
            OnComplete(b);
        }
예제 #6
0
    public IcosaHedron() : base("IcosaHedron")
    {
        //基本の頂点を生成
        this.yps = new List <YP> ()
        {
            new YP(0, 90),

            new YP(72 * 0, 45f),
            new YP(72 * 1, 45f),
            new YP(72 * 2, 45f),
            new YP(72 * 3, 45f),
            new YP(72 * 4, 45f),

            new YP(72 * 0 + 36, -45f),
            new YP(72 * 1 + 36, -45f),
            new YP(72 * 2 + 36, -45f),
            new YP(72 * 3 + 36, -45f),
            new YP(72 * 4 + 36, -45f),
            new YP(0, -90)
        };

        //this.yps.ToDictionary(yp=>new KeyValuePair<int,YP>(1,1));

        //QT.Euler (-30, 324, 0) * V3.Forward,
        this.vertics = new Vertics(
            this.yps.Select(yp => QT.Euler(yp.X, yp.Y, 0) * V3.Forward).ToList <Vector3> ()
            );
        //1始まりのインデックス
        this.triangles = new Triangles {
            //上段

            /*
             * new TriangleIndex (3, 2, 1),
             * new TriangleIndex (4, 3, 1),
             * new TriangleIndex (5, 4, 1),
             * new TriangleIndex (6, 5, 1),
             * new TriangleIndex (2, 6, 1),
             *
             *
             * new TriangleIndex (7, 2, 3),
             * new TriangleIndex (8, 3, 4),
             * new TriangleIndex (9, 4, 5),
             * new TriangleIndex (10, 5, 6),
             * new TriangleIndex (11, 6, 2),
             *
             * new TriangleIndex (7, 3, 8),
             * new TriangleIndex (8, 4, 9),
             * new TriangleIndex (9, 5, 10),
             * new TriangleIndex (10, 6, 11),
             * new TriangleIndex (11, 2, 7),
             */
            //下段

            new TriangleIndex(8, 12, 7),

            //new TriangleIndex (12, 8, 9),

            /*
             * new TriangleIndex (12, 9, 10),
             *
             * new TriangleIndex (12, 10, 11),
             * new TriangleIndex (12, 11, 7),
             */
        };
    }