Beispiel #1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            TrayStatus ts = (TrayStatus)value;
            string     color;

            switch (ts)
            {
            case TrayStatus.TS_Loading:
                color = "LightBlue";
                break;

            case TrayStatus.TS_Measuring:
                color = "LightBlue";
                break;

            case TrayStatus.TS_Measured:
                color = "LightGreen";
                break;

            case TrayStatus.TS_Unloading:
                color = "LightBlue";
                break;

            case TrayStatus.TS_Error:
                color = "Red";
                break;

            default:
                color = "Transparent";
                break;
            }
            return(color);
        }
Beispiel #2
0
 public static void UpdateTraysStatus(List<string> trayIds,TrayStatus status)
 {
     using (IUnitOfWork unit = MSSqlHelper.DataContext())
     {
         ValidateMsg<Trays> msg = new ValidateMsg<Trays>() { Valid = false };
         ITraysRep tr = new TraysRep(unit);
         List<Trays> ts = tr.GetByIds(trayIds);
         foreach (Trays t in ts)
             t.status = (int)status;
         unit.Submit();
     }
 }
Beispiel #3
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            TrayStatus      ts     = (TrayStatus)value;
            SolidColorBrush result = null;

            switch (ts)
            {
            case TrayStatus.TS_Empty:
                result = new SolidColorBrush(Colors.Gray);
                break;

            case TrayStatus.TS_Idle:
                result = new SolidColorBrush(Colors.LightYellow);
                break;

            case TrayStatus.TS_Wait:
                result = new SolidColorBrush(Colors.AliceBlue);
                break;

            case TrayStatus.TS_Loading:
                result = new SolidColorBrush(Colors.LightBlue);
                break;

            case TrayStatus.TS_Measuring:
                result = new SolidColorBrush(Colors.LightBlue);
                break;

            case TrayStatus.TS_Measured:
                result = new SolidColorBrush(Colors.LightGreen);
                break;

            case TrayStatus.TS_Unloading:
                result = new SolidColorBrush(Colors.LightBlue);
                break;

            case TrayStatus.TS_Error:
                result = new SolidColorBrush(Colors.Red);
                break;

            case TrayStatus.TS_Placed:
                result = new SolidColorBrush(Colors.LightYellow);
                break;

            default:
                result = new SolidColorBrush(Colors.Gray);
                break;
            }
            return(result);
        }
Beispiel #4
0
 public static void UpdateTraysStatus(List <string> trayIds, TrayStatus status)
 {
     using (IUnitOfWork unit = MSSqlHelper.DataContext())
     {
         ValidateMsg <Trays> msg = new ValidateMsg <Trays>()
         {
             Valid = false
         };
         ITraysRep    tr = new TraysRep(unit);
         List <Trays> ts = tr.GetByIds(trayIds);
         foreach (Trays t in ts)
         {
             t.status = (int)status;
         }
         unit.Submit();
     }
 }
Beispiel #5
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            TrayStatus ts     = (TrayStatus)value;
            string     status = "";

            switch (ts)
            {
            case TrayStatus.TS_Idle:
                status = "空闲";
                break;

            case TrayStatus.TS_Placed:
                status = "放置";
                break;

            case TrayStatus.TS_Wait:
                status = "等待测量";
                break;

            case TrayStatus.TS_Loading:
                status = "上料中";
                break;

            case TrayStatus.TS_Measuring:
                status = "测量中";
                break;

            case TrayStatus.TS_Measured:
                status = "测量完成";
                break;

            case TrayStatus.TS_Unloading:
                status = "下料中";
                break;

            case TrayStatus.TS_Error:
                status = "错误";
                break;

            default:
                status = "";
                break;
            }
            return(status);
        }
Beispiel #6
0
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values.Any(x => x == DependencyProperty.UnsetValue))
            {
                return(DependencyProperty.UnsetValue);
            }
            string     result = "空槽";
            TrayStatus ts     = (TrayStatus)values[0];

            if (ts != TrayStatus.TS_Empty)
            {
                result = string.Format("槽位{0}: 料盘类别:{1},料盘ID:{2}", values[1].ToString(), values[2].ToString(), values[3].ToString());
            }
            else
            {
                result = string.Format("空闲槽位{0}", values[1].ToString());
            }
            return(result);
        }
Beispiel #7
0
        public Tray GetTray(Route route, float position, TrayStatus status)
        {
            Tray trayLoad = CreateTray(TrayLoadHeight, TrayLoadWidth, TrayLoadLength, TrayLoadWeight, DefaultLoadColor.ToString(), status, TrayStacks);

            if (route != null)
            {
                ((ATCTray)trayLoad).SetYaw(((StraightConveyor)route.Parent.Parent).Width, ((StraightConveyor)route.Parent.Parent).CaseOrientation);
                ((ATCTray)trayLoad).PresetStateCode = "OK";

                if (position == 0)
                {
                    if (trayLoad.Yaw == 0)
                    {
                        position = position + (trayLoad.Length / 2);
                    }
                    else
                    {
                        position = position + (trayLoad.Width / 2);
                    }
                }
                route.Add(trayLoad, position);
            }
            return(trayLoad);
        }
Beispiel #8
0
        public TrayStatus GetValues()
        {
            try
            {
                TrayStatus ret = new TrayStatus();
                try
                {
                    ret.Add(new DetailedData_Usage(
                                eDisplayItem.MemCPU,
                                100, (long)C9_CPUSlowdown._sLastCpuUsage, "test", false));
                }
                catch (SystemException se)
                {
                    ret.__Add(DateTime.Now, eDisplayItem.__Error, "MemCPU: " + se.Message);
                }

                try
                {
                    ret.Add(new DetailedData_Usage(
                                eDisplayItem.MemRAM,
                                (long)ramTotal, (long)ramCounter.NextValue(), "(Mb)", false));
                }
                catch (SystemException se)
                {
                    ret.__Add(DateTime.Now, eDisplayItem.__Error, "MemRAM: " + se.Message);
                }

                try
                {
                    ret.Add(GetTotalFreeDiskSpace());
                }
                catch (SystemException se)
                {
                    ret.__Add(DateTime.Now, eDisplayItem.__Error, "MemCDrive: " + se.Message);
                }

                try
                {
                    ret.Add(new DetailedData_BMPs(
                                new BmpFileHandler(".").GetSortedList().Length));
                }
                catch (SystemException se)
                {
                    ret.__Add(DateTime.Now, eDisplayItem.__Error, "MemBMPs: " + se.Message);
                }

                try
                {
                    long?size = NiceTray._2InfoDisplay_FromApp.TheApp?.FileSize();
                    if (!size.HasValue)
                    {
                        size = -1;
                    }
                    ret.Add(new DetailedData_Logfile(size.Value));
                }
                catch (SystemException se)
                {
                    ret.__Add(DateTime.Now, eDisplayItem.__Error, "MemBMPs: " + se.Message);
                }

                return(ret);
            }
            catch
            {
                return(TrayStatus.Error("memory ERROR"));
            }
        }
Beispiel #9
0
        //public string GetTest()
        //{
        //    MS = new MemoryStream();
        //    addHeader("Test");
        //    addBodyTest();
        //    addFooter();
        //    return SB.ToString();
        //}

        public void GetData(string request, out MemoryStream msOut, out string ContentType)
        {
            MS = new MemoryStream();
            KnownFiles.eKnownFiles which;
            if (KnownFiles.IsKnown(request, out which))
            {
                addHeader(KnownFiles.Get(which));
                addBodyLinks(KnownFiles.GetAll());
                addBodyFile(which);
                addFooter();
            }
            else if (request == "Screen")
            {
                Bitmap bAll = ImageCapture.GetAll();
                bAll.Save(MS, System.Drawing.Imaging.ImageFormat.Png);
                this.ContentType = "image/png";
            }
            else if (request == "FullInfo")
            {
                this.ContentType = "text/plain";
                TrayStatus full = Mem.GetValues();
                if (DisplayTextController._globInstance != null)
                {
                    full.AddRange(DisplayTextController._globInstance.GetStatus());
                }
                MSAppendLine(full.ToString());
            }
            else if (request == "FullInfoIM")
            {
                this.ContentType = "text/plain";
                StringBuilder sb   = new StringBuilder();
                TrayStatus    full = Mem.GetValues();
                if (DisplayTextController._globInstance != null)
                {
                    full.AddRange(DisplayTextController._globInstance.GetStatus());
                }
                full.TheList.ForEach(i => i.ToIntermapperInfo(sb));
                MSAppendLine(sb.ToString());
            }
            else if (request == "Memory")
            {
                addHeader(request);
                addBodyLinks(KnownFiles.GetAll());
                MSAppendLine("<pre>");
                MSAppendLine(Mem.GetValues().ToString());
                MSAppendLine("</pre>");
                addFooter();
            }
            else if (request == "DelPic")
            {
                addHeader(request);
                addBodyLinks(KnownFiles.GetAll());
                foreach (BmpFileHandler.PathAndDate f1 in new BmpFileHandler(".").GetSortedList())
                {
                    if (f1.Path.Contains("zapi"))
                    {
                        File.Delete(f1.Path);
                        MSAppendLine(f1.Path + "<br />");
                    }
                }
                addFooter();
            }
            else if (request == "ListPic")
            {
                addHeader(request);
                addBodyLinks(KnownFiles.GetAll());
                MSAppendLine("<pre>");
                foreach (BmpFileHandler.PathAndDate f1 in new BmpFileHandler(".").GetSortedList())
                {
                    MSAppendLine(f1.LastWrite.ToString() + " " + f1.Path + "<br />");
                }
                MSAppendLine("</pre>");
                addFooter();
            }
            else if (request.StartsWith("ShowPic_"))
            {
                try
                {
                    int id = int.Parse(request.Substring("ShowPic_".Length));
                    addHeader(request);
                    addBodyLinks(KnownFiles.GetAll());
                    MSAppendLine("<br>");
                    MSAppendLine("<br>");
                    foreach (BmpFileHandler.PathAndDate f1 in new BmpFileHandler(".").GetSortedList())
                    {
                        MSAppendLine(f1.Path);
                        MSAppendLine("<br>");
                        MSAppendLine(string.Format("<img src=\"Pic_{0}\" width=\"600\" height=\"500\" > ", f1.Path));
                        MSAppendLine("<hr>");
                    }
                    addFooter();
                }
                catch (Exception _)
                {
                }
            }
            else if (request.StartsWith("Pic_"))
            {
                string path = null;
                try
                {
                    path = request.Substring("Pic_".Length).Replace("%20", " ");
                    Bitmap bAll = new System.Drawing.Bitmap(path);
                    bAll.Save(MS, System.Drawing.Imaging.ImageFormat.Png);
                    this.ContentType = "image/png";
                }
                catch (Exception _)
                {
                }
            }
            else if (request == "DelLog")
            {
                addHeader(request);
                addBodyLinks(KnownFiles.GetAll());
                KnownFiles.ioDelete(KnownFiles.eKnownFiles.Log);
                addFooter();
            }
            else if (request == "Step")
            {
                addHeader(request);
                addBodyLinks(KnownFiles.GetAll());
                MSAppendLine("<pre>");
                MSAppendLine("_6WhatsAppProcess_Real performs steps to send a whatsapp message:<br>");
                MSAppendLine("Step 1: findSearchWindow and enter tel<br>");
                MSAppendLine("Step 2: findAccount and Click it<br>");
                MSAppendLine("Step 3: verify account string top rigth position<br>");
                MSAppendLine("Step 4: find type-msg-here, and enter text<br>");
                MSAppendLine("</pre>");
                addFooter();
            }
            else
            {
                addHeader("No selection");
                addBodyLinks(KnownFiles.GetAll());
                addFooter();
            }

            msOut       = this.MS;
            ContentType = this.ContentType;
        }
Beispiel #10
0
        /// <summary>
        /// Method to return a Tray load
        /// </summary>
        /// <param name="transportSection">The transport section to add the load too</param>
        /// <param name="distance">The position distance along the transport section</param>
        /// <param name="trayData">Base tray data</param>
        /// <param name="trayStatus">Tray status (Empty, Loaded or Stacked)</param>
        /// <returns>Load of type Tray</returns>
        public static Tray FeedTrayLoad(ITransportSection transportSection, float distance, BaseCaseData trayData, TrayStatus trayStatus)
        {
            Tray trayLoad;
            IEmulationController controller = Core.Assemblies.Assembly.Items.Values.ToList().FirstOrDefault(x => x is IEmulationController) as IEmulationController;

            if (controller != null)
            {
                trayLoad = controller.GetTray(transportSection.Route, 0, trayStatus);
                if (trayLoad != null) //It is not necesary to implement this just return null case load from the controller and a standard load will be created
                {
                    return(trayLoad);
                }
            }
            try
            {
                TrayInfo trayInfo = new TrayInfo();
                trayInfo.color      = Color.Peru;
                trayInfo.filename   = Tray.Mesh;
                trayInfo.Status     = trayStatus;
                trayInfo.TrayStacks = 6;

                //LoadHeight includes the height of the tray (280mm)
                trayInfo.LoadHeight = 0.410f;
                trayInfo.LoadWidth  = 0.4f;
                trayInfo.LoadLength = 0.6f;

                //Set the dimensions of a tray (This is the standard size)
                trayInfo.length = 0.65f;
                trayInfo.width  = 0.45f;
                trayInfo.height = 0.058f; // Actual size is 0.063f but reduced so visible space can be added in stack (0.005f space)

                trayLoad = new Tray(trayInfo);

                trayLoad.Case_Data = trayData;
                transportSection.Route.Add(trayLoad, distance);
                Load.Items.Add(trayLoad);

                string SSCCBarcode = GetSSCCBarcode();
                if (SSCCBarcode != "")
                {
                    trayLoad.SSCCBarcode    = SSCCBarcode;
                    trayLoad.Identification = SSCCBarcode;
                }
                return(trayLoad);
            }
            catch (Exception se)
            {
                Core.Environment.Log.Write(se);
                Core.Environment.Scene.Pause();
                return(null);
            }
        }
Beispiel #11
0
 protected ATCTray CreateTray(float height, float width, float length, float weight, string color, TrayStatus status, uint trayStacks)
 {
     return(CreateTray("", FeedLoad.GetSSCCBarcode(), "", "", "", "", height, width, length, weight, color, status, trayStacks));
 }
Beispiel #12
0
        protected ATCTray CreateTray(string mts, string tuIdent, string tuType, string source, string destination, string presetStateCode, float height, float width, float length, float weight, string color, TrayStatus status, uint trayStacks)
        {
            TrayInfo trayInfo = new TrayInfo();

            trayInfo.LoadColor  = LoadColor(color);
            trayInfo.filename   = Tray.Mesh;
            trayInfo.Status     = status;
            trayInfo.TrayStacks = trayStacks;

            //LoadHeight includes the height of the tray (50mm)
            trayInfo.LoadHeight = height;
            trayInfo.LoadWidth  = width;
            trayInfo.LoadLength = length;
            //TODO: Weight

            //Set the dimensions of a tray
            trayInfo.length = 0.65f;
            trayInfo.width  = 0.45f;
            trayInfo.height = 0.058f; // Actual size is 0.063f but reduced so visible space can be added in stack (0.005f space)

            ATCTray trayLoad = new ATCTray(trayInfo);

            trayLoad.TUIdent         = tuIdent;
            trayLoad.TUType          = tuType;
            trayLoad.Source          = source;
            trayLoad.Destination     = destination;
            trayLoad.PresetStateCode = presetStateCode;
            trayLoad.Weight          = weight;

            //Add project fields to load
            Load.Items.Add(trayLoad);

            if (ProjectFields.Count > 0)
            {
                foreach (string field in ProjectFields)
                {
                    trayLoad.ProjectFields.Add(field, "");
                }
            }

            return(trayLoad);
        }