Inheritance: MonoBehaviour
示例#1
0
        public TestRTDViewModel()
        {
            Data = new ObservableCollectionCore <RTDItem>();
            Data.Add(RTDItem.CreateItem());
            Stations = new ObservableCollectionCore <RTDStation>();
            Stations.Add(new RTDStation()
            {
                StationNo = "一工位", StationName = "尾气检测"
            });
            Stations.Add(new RTDStation()
            {
                StationNo = "二工位", StationName = "测重检测"
            });
            Stations.Add(new RTDStation()
            {
                StationNo = "三工位", StationName = "外廓检测"
            });
            Stations.Add(new RTDStation()
            {
                StationNo = "四工位", StationName = "灯光检测"
            });

            UpdataCP(CP);
            CPS.Add(CP);
            CP2 = new ControlParameter();

            DI.Param1 = new Random(Guid.NewGuid().GetHashCode()).Next(0, 100).ToString();
            DI.Param2 = new Random(Guid.NewGuid().GetHashCode()).Next(0, 100).ToString();
            DI.Param3 = new Random(Guid.NewGuid().GetHashCode()).Next(0, 100).ToString();
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,YearsInService,Region,HasCompassion,Zodiac")] CPS cPS)
        {
            if (id != cPS.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cPS);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CPSExists(cPS.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cPS));
        }
示例#3
0
 internal CommCapabilities()
 {
     this.wPacketLength = (ushort) Marshal.SizeOf(this);
     this.dwProvSpec1 = CPS.COMMPROP_INITIALIZED;
     this.dwProvCapabilities = new BitVector32(0);
     this.dwSettableParams = new BitVector32(0);
     this.dwSettableBaud = new BitVector32(0);
     this.dwSettableStopParityData = new BitVector32(0);
 }
示例#4
0
 internal CommCapabilities()
 {
     this.wPacketLength            = (ushort)Marshal.SizeOf(this);
     this.dwProvSpec1              = CPS.COMMPROP_INITIALIZED;
     this.dwProvCapabilities       = new BitVector32(0);
     this.dwSettableParams         = new BitVector32(0);
     this.dwSettableBaud           = new BitVector32(0);
     this.dwSettableStopParityData = new BitVector32(0);
 }
 public async Task<IActionResult> Create([Bind("ID,YearsInService,Region,HasCompassion,Zodiac")] CPS cPS)
 {
     if (ModelState.IsValid)
     {
         _context.Add(cPS);
         await _context.SaveChangesAsync();
         return RedirectToAction(nameof(Index));
     }
     return View(cPS);
 }
示例#6
0
    /// <summary>
    /// Synchronously processes a single command
    /// </summary>
    /// <param name="command">The command to process</param>
    /// <returns></returns>
    public CommandResult ProcessCommand(ICommandSpec command)
    {
        var completion =
            from p in CPS.Pattern(command)
            let q                 = p.Queue
                            let x = p.Executor
                                    from s in q.Enqueue(command, SystemNode.Local)
                                    from d in q.Dispatch()
                                    let r = x.Execute(d)
                                            from c in CPS.ExecStore.Complete(r)
                                            select r;

        return(completion.ValueOrElse(() =>
                                      new CommandResult(command, null, false, completion.Message, 0)));
    }
示例#7
0
        public static void LoadRom()
        {
            //this.Close();
            Mame.exit_pending = true;
            Thread.Sleep(100);

            mame.Timer.lt = new List <mame.Timer.emu_timer>();
            sSelect       = RomInfo.Rom.Name;
            //Machine.FORM = this;
            Machine.rom           = RomInfo.Rom;
            Machine.sName         = Machine.rom.Name;
            Machine.sParent       = Machine.rom.Parent;
            Machine.sBoard        = Machine.rom.Board;
            Machine.sDirection    = Machine.rom.Direction;
            Machine.sDescription  = Machine.rom.Description;
            Machine.sManufacturer = Machine.rom.Manufacturer;
            Machine.bRom          = true;
            Machine.lsParents     = new List <String>();
            Machine.lsParents.Add("ffight");
            int i;

            switch (Machine.sBoard)
            {
            case "CPS-1":
            case "CPS-1(QSound)":
            case "CPS2":
                Video.nMode = 3;
                CPS.CPSInit();
                break;
            }
            if (Machine.bRom)
            {
                Mame.init_machine();
                Generic.nvram_load();
            }
            else
            {
                MessageBox.Show("error rom");
            }
            if (Machine.bRom)
            {
                Mame.exit_pending = false;
                t1 = new Thread(Mame.mame_execute);
                t1.Start();
            }
        }
示例#8
0
        private void btnDraw_Click(object sender, EventArgs e)
        {
            GetData();
            CPS.bRender0G = cbL0.Checked;
            CPS.bRender1G = cbL1.Checked;
            CPS.bRender2G = cbL2.Checked;
            CPS.bRender3G = cbL3.Checked;
            CPS.GetData();
            Bitmap bm1 = CPS.GetAllGDI();

            pictureBox1.Width  = bm1.Width;
            pictureBox1.Height = bm1.Height;
            pictureBox1.Image  = bm1;
            tbL0.Text          = CPS.l0G.ToString();
            tbL1.Text          = CPS.l1G.ToString();
            tbL2.Text          = CPS.l2G.ToString();
            tbL3.Text          = CPS.l3G.ToString();
        }
示例#9
0
        private void btnDrawtile_Click(object sender, EventArgs e)
        {
            int i1;
            int code, color;

            try
            {
                Bitmap bm1 = null;
                code  = int.Parse(tbCode.Text, NumberStyles.HexNumber);
                color = int.Parse(tbColor.Text, NumberStyles.HexNumber);
                CPS.GetData();
                for (i1 = 0; i1 < CPS.nColorG; i1++)
                {
                    if (i1 % 16 == 15)
                    {
                        CPS.cc1G[i1] = Palette.trans_color;
                    }
                }
                if (cbLayer.SelectedIndex == 0)
                {
                    bm1 = GetTile0(0, code, color);
                }
                else if (cbLayer.SelectedIndex == 1)
                {
                    bm1 = GetTile0(1, code, color);
                }
                else if (cbLayer.SelectedIndex == 2)
                {
                    bm1 = GetTile1(code, color);
                }
                else if (cbLayer.SelectedIndex == 3)
                {
                    bm1 = GetTile2(code, color);
                }
                pictureBox1.Image = bm1;
            }
            catch
            {
                MessageBox.Show("error input");
            }
        }
 public static extern BOOL ImmNotifyIME(IntPtr hIMC, NI dwAction, CPS dwIndex, int dwValue);
示例#11
0
        public void LoadRom()
        {
            mame.Timer.lt         = new List <mame.Timer.emu_timer>();
            sSelect               = RomInfo.Rom.Name;
            Machine.FORM          = this;
            Machine.rom           = RomInfo.Rom;
            Machine.sName         = Machine.rom.Name;
            Machine.sParent       = Machine.rom.Parent;
            Machine.sBoard        = Machine.rom.Board;
            Machine.sDirection    = Machine.rom.Direction;
            Machine.sDescription  = Machine.rom.Description;
            Machine.sManufacturer = Machine.rom.Manufacturer;
            Machine.lsParents     = RomInfo.GetParents(Machine.sName);
            int i;

            switch (Machine.sBoard)
            {
            case "CPS-1":
            case "CPS-1(QSound)":
            case "CPS2":
                Video.nMode = 3;
                itemSize    = new ToolStripMenuItem[Video.nMode];
                for (i = 0; i < Video.nMode; i++)
                {
                    itemSize[i]        = new ToolStripMenuItem();
                    itemSize[i].Size   = new Size(152, 22);
                    itemSize[i].Click += new EventHandler(itemsizeToolStripMenuItem_Click);
                }
                itemSize[0].Text = "512x512";
                itemSize[1].Text = "512x256";
                itemSize[2].Text = "384x224";
                resetToolStripMenuItem.DropDownItems.Clear();
                resetToolStripMenuItem.DropDownItems.AddRange(itemSize);
                itemSelect();
                cpsToolStripMenuItem.Enabled     = true;
                neogeoToolStripMenuItem.Enabled  = false;
                namcos1ToolStripMenuItem.Enabled = false;
                CPS.CPSInit();
                CPS.GDIInit();
                break;

            case "Neo Geo":
                Video.nMode = 1;
                itemSize    = new ToolStripMenuItem[Video.nMode];
                for (i = 0; i < Video.nMode; i++)
                {
                    itemSize[i]        = new ToolStripMenuItem();
                    itemSize[i].Size   = new Size(152, 22);
                    itemSize[i].Click += new EventHandler(itemsizeToolStripMenuItem_Click);
                }
                itemSize[0].Text = "320x224";
                resetToolStripMenuItem.DropDownItems.Clear();
                resetToolStripMenuItem.DropDownItems.AddRange(itemSize);
                Video.iMode = 0;
                itemSelect();
                cpsToolStripMenuItem.Enabled     = false;
                neogeoToolStripMenuItem.Enabled  = true;
                namcos1ToolStripMenuItem.Enabled = false;
                Neogeo.NeogeoInit();
                Neogeo.GDIInit();
                break;

            case "Namco System 1":
                Video.nMode = 1;
                itemSize    = new ToolStripMenuItem[Video.nMode];
                for (i = 0; i < Video.nMode; i++)
                {
                    itemSize[i]        = new ToolStripMenuItem();
                    itemSize[i].Size   = new Size(152, 22);
                    itemSize[i].Click += new EventHandler(itemsizeToolStripMenuItem_Click);
                }
                itemSize[0].Text = "288x224";
                resetToolStripMenuItem.DropDownItems.Clear();
                resetToolStripMenuItem.DropDownItems.AddRange(itemSize);
                Video.iMode = 0;
                itemSelect();
                cpsToolStripMenuItem.Enabled     = false;
                neogeoToolStripMenuItem.Enabled  = false;
                namcos1ToolStripMenuItem.Enabled = true;
                Namcos1.Namcos1Init();
                Namcos1.GDIInit();
                break;

            case "IGS011":
                Video.nMode = 1;
                itemSize    = new ToolStripMenuItem[Video.nMode];
                for (i = 0; i < Video.nMode; i++)
                {
                    itemSize[i]        = new ToolStripMenuItem();
                    itemSize[i].Size   = new Size(152, 22);
                    itemSize[i].Click += new EventHandler(itemsizeToolStripMenuItem_Click);
                }
                itemSize[0].Text = "512x240";
                resetToolStripMenuItem.DropDownItems.Clear();
                resetToolStripMenuItem.DropDownItems.AddRange(itemSize);
                Video.iMode = 0;
                itemSelect();
                cpsToolStripMenuItem.Enabled     = false;
                neogeoToolStripMenuItem.Enabled  = false;
                namcos1ToolStripMenuItem.Enabled = false;
                IGS011.GDIInit();
                IGS011.IGS011Init();
                break;

            case "PGM":
                Video.nMode = 1;
                itemSize    = new ToolStripMenuItem[Video.nMode];
                for (i = 0; i < Video.nMode; i++)
                {
                    itemSize[i]        = new ToolStripMenuItem();
                    itemSize[i].Size   = new Size(152, 22);
                    itemSize[i].Click += new EventHandler(itemsizeToolStripMenuItem_Click);
                }
                itemSize[0].Text = "448x224";
                resetToolStripMenuItem.DropDownItems.Clear();
                resetToolStripMenuItem.DropDownItems.AddRange(itemSize);
                Video.iMode = 0;
                itemSelect();
                cpsToolStripMenuItem.Enabled     = false;
                neogeoToolStripMenuItem.Enabled  = false;
                namcos1ToolStripMenuItem.Enabled = false;
                PGM.PGMInit();
                PGM.GDIInit();
                break;
            }
            if (Machine.bRom)
            {
                Mame.init_machine();
                Generic.nvram_load();
            }
            else
            {
                MessageBox.Show("error rom");
            }
        }