Esempio n. 1
0
        /***************************************************** Property ***************************************************/


        public OEEEnergyManager(OEEFactory factory)
        {
            machineGroups = factory.MachineGroups;
            InitializeComponent();
            InitializeParameters();
            InitializeChart();
            InitializeList();
        }
        /***************************************************** Property ***************************************************/

        /***************************************************** Functions ***************************************************/
        public OEEStaffManager(OEEFactory thefactory)
        {
            factory   = thefactory;
            workshops = factory.Workshops;
            staffs    = factory.Staffs;
            InitializeComponent();
            InitializeParameters();
        }
 /****************************************** Function ****************************************/
 public OEEMachineManager(OEEFactory factory)
 {
     machineGroups = factory.MachineGroups;
     InitializeComponent();
     InitializeQueryCondition();
     InitialTabOutputCapacity();
     InitialTabOutputStatus();
     InitialTabOutputHours();
     InitialOutputCapacityChartInfo();
     DoQuery();
 }
        /***************************************************** Property ***************************************************/

        public OEESummaryManager(OEEFactory factory)
        {
            machineGroups = factory.MachineGroups;
            InitializeComponent();
            InitializeParameters();
            InitializeOEESummary();
            InitializeTabPerformance();
            InitializeTabHoursRate();
            InitialTabQualityRate();

            DoQuery();
        }
Esempio n. 5
0
        public DataTable QueryLabourHourDetails(int year, int month, string name, OEEFactory factory)
        {
            DateTime queryStartTime = OEEUtils.ConvertToDayStartOfMonth(year, month);
            DateTime queryEndTime   = OEEUtils.ConvertToDayEndOfMonth(year, month);

            OEEMachineGroup[] machineGroups = factory.MachineGroups;
            DataTable         dt            = null;

            for (int groupIndex = 0; groupIndex < machineGroups.Count(); groupIndex++)
            {
                foreach (OEEMachine machine in machineGroups[groupIndex].Machines)
                {
                    DataTable temp         = new DataTable();
                    string    dataBaseName = machine.getDeviceDatabaseName();
                    string    commandText  = "select dispatchCode," +
                                             "productCode," +
                                             "productName," +
                                             "processName," +
                                             "serialNumber," +
                                             "startTime," +
                                             "completeTime," +
                                             "qualifyNum, " +
                                             "unqualifyNum," +
                                             "machineID from " +
                                             "`" + gVariable.dispatchListTableName + "`" +
                                             " where completeTime >= '" + queryStartTime.ToString(OEETypes.QUERY_TIME_FORMAT) +
                                             "' and completeTime <= '" + queryEndTime.ToString(OEETypes.QUERY_TIME_FORMAT) +
                                             "' and reportor = '" + _id + "'";
                    temp = mySQLClass.queryDataTableAction(dataBaseName, commandText, null);

                    try
                    {
                        object[] obj = new object[temp.Columns.Count];
                        if (dt == null)
                        {
                            dt = temp.Clone();
                        }
                        for (int i = 0; i < temp.Rows.Count; i++)
                        {
                            temp.Rows[i].ItemArray.CopyTo(obj, 0);
                            dt.Rows.Add(obj);
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
            }

            return(dt);
        }
        //private OEEMachine[] machines;
        /***************************************************** Property ***************************************************/

        public OEECostManager(OEEFactory factory)
        {
            machineGroups = factory.MachineGroups;
            InitializeComponent();
        }
Esempio n. 7
0
        public OEETypes.OutputInHours QueryLabourHour(DateTime startTime, DateTime endTime, OEEFactory factory)
        {
            DateTime queryStartTime = OEEUtils.ConvertToStartOfDay(startTime);
            DateTime queryEndTime   = OEEUtils.ConvertToEndOfDay(endTime);

            OEEMachineGroup[] machineGroups = factory.MachineGroups;
            DataTable         dt            = null;

            for (int groupIndex = 0; groupIndex < machineGroups.Count(); groupIndex++)
            {
                foreach (OEEMachine machine in machineGroups[groupIndex].Machines)
                {
                    DataTable temp         = new DataTable();
                    string    dataBaseName = machine.getDeviceDatabaseName();
                    string    commandText  = "select startTime, completeTime, qualifyNum, unqualifyNum from " + "`" + gVariable.dispatchListTableName + "`" +
                                             " where completeTime >= '" + queryStartTime.ToString(OEETypes.QUERY_TIME_FORMAT) + "' and completeTime <= '" + queryEndTime.ToString(OEETypes.QUERY_TIME_FORMAT) + "' and reportor = '" + _id + "'";
                    temp = mySQLClass.queryDataTableAction(dataBaseName, commandText, null);

                    try
                    {
                        object[] obj = new object[temp.Columns.Count];
                        if (dt == null)
                        {
                            dt = temp.Clone();
                        }
                        for (int i = 0; i < temp.Rows.Count; i++)
                        {
                            temp.Rows[i].ItemArray.CopyTo(obj, 0);
                            dt.Rows.Add(obj);
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
            }

            return(CalculateLabourHour(dt));
        }