Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OEE only starts tracking at 12pm #48

Open
JackIsAKiwi opened this issue Jul 11, 2023 · 2 comments
Open

OEE only starts tracking at 12pm #48

JackIsAKiwi opened this issue Jul 11, 2023 · 2 comments

Comments

@JackIsAKiwi
Copy link

Love the software, i'm just in the process of adding all our mills and lathes and its been fantastic to have that overview of the factory. The only issue i'm having is that the tracking only appears to start at midday for the OEE. I'm wondering if it's due to my timezone as we are based in New Zealand, do I need to adjust something before I compile?

@JackIsAKiwi
Copy link
Author

Sorted, calculated the time zone offset based on the local time zone rather than the UTC time zone in TrakHound-Dashboard/Pages/Dashboard/OeeHourTimeline/Controls
/Row.xaml.cs

public void UpdateData(List<Data.HourInfo> hours)
{
if (hours != null)
{
foreach (var hourData in HourDatas)
{
hourData.Reset();
}

    TimeZoneInfo localTimeZone = TimeZoneInfo.Local;
    TimeSpan timeZoneOffset = localTimeZone.GetUtcOffset(DateTime.UtcNow);

    foreach (var hour in hours)
    {
        int h = hour.Hour + timeZoneOffset.Hours;
        if (h >= 24) h -= 24;

        var match = HourDatas.Find(o => o.StartHour == h);
        if (match != null)
        {
            match.Oee = hour.Oee;

            if (hour.PlannedProductionTime > 0)
            {
                if (hour.Oee > 0.75) match.Status = 2;
                else if (hour.Oee > 0.5) match.Status = 1;
                else if (hour.Oee >= 0) match.Status = 0;
            }
            else match.Status = -1;
        }
    }
}

}

@siculas
Copy link

siculas commented Oct 19, 2023

Set the time zone of the computer where TrakHound is installed to "UTC". Synchronize your computer time with your local time. Check the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants