示例#1
0
        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);
            }
        }
示例#2
0
        /// <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();
        }
示例#3
0
        /// <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();
        }
示例#4
0
        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);
                }
            }
        }
示例#5
0
 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);
     }
 }
示例#6
0
        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();
            }
        }
示例#7
0
 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);
     }
 }
示例#8
0
        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();
            }
        }
示例#9
0
        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);
            }
        }
示例#10
0
 public Monitor(wCpu myCpu)
 {
     InitializeComponent();
     this.myCpu = myCpu;
 }
示例#11
0
 public Monitor(wCpu myCpu)
 {
     InitializeComponent();
     this.myCpu = myCpu;
 }
示例#12
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     MyCpu = vs7File.open();
     printCpuInfo(MyCpu);
 }
示例#13
0
 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);
         
     }
 }
示例#14
0
 public sslListing (wCpu cpu)
 {
     this.cpu = cpu;
 }
示例#15
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     MyCpu = vs7File.open();
     printCpuInfo(MyCpu);
 }
示例#16
0
        /*
         * Menu Strip Event Methods
         */

        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MyCpu = new wCpu();
            //txtCpuInfo.Text = "";
        }
示例#17
0
        /*
         * Menu Strip Event Methods
         */

        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MyCpu = new wCpu();
            //txtCpuInfo.Text = "";
        }
示例#18
0
 public sslListing(wCpu cpu)
 {
     this.cpu = cpu;
 }