Git Product home page Git Product logo

materialchartplugin's People

Contributors

dependabot[bot] avatar ruhiel avatar terry-u16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

materialchartplugin's Issues

[1.1]バケツが0になるとエラー落ちする

OS: Windows 10 x64 TH2(2015 Autumn Update適用済)

発生経緯:
2015秋イベントE-3に出撃→帰投。
中破~大破艦にバケツ使用→残数0になる。
左のメニューから工廠に移動し、不要艦娘を解体した。解体のローディング中~直後に動作停止した。
一度落として再起動すると、ローディング画面(ぷかぷか丸)まではいくが、母港画面に移行する前に動作停止する。
OS再起動してもダメ。

差異点:
高速修復材が0になった。
バケツが0になったのは着任直後以来で、今回最も大きな差異点である。通常使用している間はバケツは0にならず、このような現象は起きていなかった。

解決方法:
別ブラウザ(Firefox)でアクセスし、高速修復材を5個購入した。
「提督業も忙しい!」を起動し、ログインすると母港画面まで進んだ。

問題があると推測される箇所:
error.txtの一番上にあるのが『MaterialChartPlugin.Models.Utilities.ChartUtilities.GetInterval(Int32 min, Int32 max)』であり、これが原因と推測した。
該当コードは以下の通り。

    public static int GetInterval(int min, int max)
    {
        // グラフの数値軸目盛を自動算出するアルゴリズム: いげ太のブログ
        // http://igeta.cocolog-nifty.com/blog/2007/11/graph_scale.html
        // を参考に作成

        if (max <= min)
            throw new ArgumentException(); // ←これによりエラー落ち

        int difference = max - min; // 最上位桁値
        int shift = 1;              // 桁上げ倍率

        while (difference >= 10)
        {
            difference /= 10;
            shift *= 10;
        }

        if (difference >= 5)
            return shift * 2;
        else if (difference >= 2)
            return shift;
        else
            return shift * 4 / 10;
    }

上記の呼び出しコードは、
this.mostRepairTool = RepairTool; // mostRepairToolは区間内の最大バケツ量
var interval = ChartUtilities.GetInterval(0, mostRepairTool);

→バケツが0、つまり this.mostRepairTool = 0 だったことにより、 max<=min の条件を満たし、ArgumentException()がthrowされたと推測される。

解決案

・mostRepairTool = 0の時は、グラフ軸の値を強制してしまう(強制的にmostRepairTool=5にするなど)。
・(可能なら)Exceptionをthrowすると全て動作停止してしまうので、本体の動作を止めずにログに残す方法を検討する。

エラーログ(error.txt)より

ERROR, date = 2015/12/05 2:24:20 +09:00, sender = 名前:KanColleViewer.exe
コンテキスト ポリシーがありません。
,
System.ArgumentException: 値が有効な範囲にありません。
場所 MaterialChartPlugin.Models.Utilities.ChartUtilities.GetInterval(Int32 min, Int32 max)
場所 MaterialChartPlugin.ViewModels.ToolViewModel.SetRepairToolYAxis(Int32 mostRepairTool)
場所 MaterialChartPlugin.ViewModels.ToolViewModel.UpdateData(TimeMaterialsPair newData)
場所 System.Reactive.AnonymousSafeObserver1.OnNext(T value) 場所 System.Reactive.Linq.ObservableImpl.Throttle1._.Propagate(IScheduler self, UInt64 currentid)
場所 System.Reactive.Concurrency.DefaultScheduler.<>c__DisplayClass4`1.b__3(Object _)
場所 System.Reactive.Concurrency.ConcurrencyAbstractionLayerImpl.Timer.Tick(Object state)
場所 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
場所 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
場所 System.Threading.TimerQueueTimer.CallCallback()
場所 System.Threading.TimerQueueTimer.Fire()
場所 System.Threading.TimerQueue.FireNextTimers()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.