public wldFile(wCpu cpu) { List<wCpuBlock> blocks = cpu.blocks; blocks.Sort(); data = new List<byte>(); foreach (wCpuBlock block in blocks) { if ((block.data != null) && (block.blockType != wBlockType.SFC) && (block.blockType != wBlockType.SFB)) data.AddRange(block.data); } }
/// <summary> /// Main Constructor for the Tungsten Form Class /// </summary> public Tungsten() { InitializeComponent(); if (!System.IO.Directory.Exists(appDataPath)) { System.IO.Directory.CreateDirectory(appDataPath); } MyCpu = new wCpu(); loadPlcBookmarks(); }
public wldFile(wCpu cpu) { List <wCpuBlock> blocks = cpu.blocks; blocks.Sort(); data = new List <byte>(); foreach (wCpuBlock block in blocks) { if ((block.data != null) && (block.blockType != wBlockType.SFC) && (block.blockType != wBlockType.SFB)) { data.AddRange(block.data); } } }
private void populateBlockList(wCpu cpu) { foreach (wCpuBlock b in cpu.blocks) { ListViewItem li = new ListViewItem(); li.Text = b.ToString(); li.SubItems.Add(b.name); li.SubItems.Add(b.author); li.SubItems.Add(b.loadSize.ToString()); li.SubItems.Add(b.codeDate); li.SubItems.Add(b.interfaceDate); li.Group = lstBlockList.Groups[b.blockType.ToString().ToLower()]; lstBlockList.Items.Add(li); } }
public static void save(wCpu cpu) { System.Xml.Serialization.XmlSerializer writer = new System.Xml.Serialization.XmlSerializer(typeof(wCpu)); SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "VS7 files (*.VS7)|*.VS7|All files (*.*)|*.*"; dialog.FileName = "S7PROG.VS7"; dialog.FilterIndex = 1; dialog.RestoreDirectory = true; if (dialog.ShowDialog() == DialogResult.OK) { System.IO.StreamWriter file = new System.IO.StreamWriter(dialog.OpenFile()); writer.Serialize(file, cpu); file.Close(); } }
private void printCpuInfo(wCpu cpu) { List<string> s = new List<string>(); s.Add(cpu.orderCode); s.Add("CPU Serial Number:\t" + cpu.serialNumber); s.Add("OB Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.OB)); s.Add("FC Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.FC)); s.Add("FB Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.FB)); s.Add("DB Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.DB)); s.Add("SFC Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.SFC)); s.Add("SFB Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.SFB)); s.Add("SDB Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.SDB)); foreach (string i in s) { //txtCpuInfo.AppendText(i + System.Environment.NewLine); } }
private void printCpuInfo(wCpu cpu) { List <string> s = new List <string>(); s.Add(cpu.orderCode); s.Add("CPU Serial Number:\t" + cpu.serialNumber); s.Add("OB Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.OB)); s.Add("FC Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.FC)); s.Add("FB Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.FB)); s.Add("DB Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.DB)); s.Add("SFC Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.SFC)); s.Add("SFB Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.SFB)); s.Add("SDB Count:\t" + MyCpu.blocks.Count(x => x.blockType == wBlockType.SDB)); foreach (string i in s) { //txtCpuInfo.AppendText(i + System.Environment.NewLine); } }
public Monitor(wCpu myCpu) { InitializeComponent(); this.myCpu = myCpu; }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { MyCpu = vs7File.open(); printCpuInfo(MyCpu); }
private void populateBlockList(wCpu cpu) { foreach(wCpuBlock b in cpu.blocks) { ListViewItem li = new ListViewItem(); li.Text = b.ToString(); li.SubItems.Add(b.name); li.SubItems.Add(b.author); li.SubItems.Add(b.loadSize.ToString()); li.SubItems.Add(b.codeDate); li.SubItems.Add(b.interfaceDate); li.Group = lstBlockList.Groups[b.blockType.ToString().ToLower()]; lstBlockList.Items.Add(li); } }
public sslListing (wCpu cpu) { this.cpu = cpu; }
/* * Menu Strip Event Methods */ private void newToolStripMenuItem_Click(object sender, EventArgs e) { MyCpu = new wCpu(); //txtCpuInfo.Text = ""; }
public sslListing(wCpu cpu) { this.cpu = cpu; }