aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/App.config
blob: 158702ed32b19c0095cba8d46422f57d2ca85333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
    </providers>
  </entityFramework>
  
  <runtime>
  
       <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  
            <dependentAssembly>
  
                 <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
  
                 <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
  
            </dependentAssembly>
  
       </assemblyBinding>
  
  </runtime>
</configuration>
ht .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.BL.Enumerations;

namespace Tango.MachineStudio.Statistics.Models
{
    public class JobRunModel
    {
        public JobRun JobRun { get; set; }

        public Machine Machine { get; set; }

        public User User { get; set; }

        public TimeSpan? UploadDuration { get; set; }

        public TimeSpan? HeatingDuration { get; set; }

        public RmlModel Rml { get; set; }

        public String Gen
        {
            get
            {
                return JobRun.MachineTypeEnum.ToShortName();
            }
        }

        public double ActualStartPosition
        {
            get { return JobRun.MachineTypeEnum == MachineTypes.Eureka ? JobRun.ActualStartPosition * 4 : JobRun.ActualStartPosition; }
        }

        public double ActualEndPosition
        {
            get
            {
                if (JobRun.ActualEndPosition > 0)
                {
                    return JobRun.MachineTypeEnum == MachineTypes.Eureka ? JobRun.ActualEndPosition * 4 : JobRun.ActualEndPosition;
                }
                else
                {
                    return JobRun.MachineTypeEnum == MachineTypes.Eureka ? JobRun.EndPosition * 4 : JobRun.EndPosition;
                }
            }
        }

        public double Distance
        {
            get
            {
                return ActualEndPosition - ActualStartPosition;
            }
        }

        public double LogicalLengthMeters
        {
            get
            {
                return (JobRun.MachineTypeEnum == MachineTypes.Eureka ? JobRun.JobLogicalLength * 4 : JobRun.JobLogicalLength);
            }
        }

        public double ActualLength
        {
            get { return LogicalLengthMeters * JobRun.NumberOfUnits; }
        }

        public void Init()
        {
            if (JobRun.HeatingStartDate != null)
            {
                UploadDuration = JobRun.HeatingStartDate - JobRun.StartDate;
            }

            if (JobRun.ActualStartDate != null && JobRun.HeatingStartDate != null)
            {
                HeatingDuration = JobRun.ActualStartDate - JobRun.HeatingStartDate;
            }

            if (JobRun.MachineTypeEnum == MachineTypes.Eureka)
            {
                JobRun.JobLogicalLength *= 4;
                JobRun.JobLength *= 4;
                JobRun.EndPosition *= 4;
            }
        }
    }
}