I have an object graph that abstracts the operation of a machine. It will calculate paths, so there are several large lists of points. Currently I am using Zedgraph to plot these lists. Originally I was using Zedgraph's PointPairList for these points. Everything worked OK. But it didn't seem proper to be so closely coupled to Zedgraph. As an interim solution I have created PointPairLists that are identical to Zedgraph (but in my own namespace). I am having trouble casting these to Zedgraph PointPairLists. (I was hoping to avoid having to iterate through these rather large lists.) Here is my question: Is there an elegant solution? Any helpful references or search terms would be helpful. (I did find an MSDN reference to writing custom casting operators.) I feel like I am missing something obvious. Thank you- Squeak
Squeaker
Posts
-
Casting Issues -
How add multiple iconsI found this article that gives some good info on this subject: http://msdn2.microsoft.com/en-us/library/ms951285.aspx[^] Best regards- Squeaker
-
Help with my class using Serial Port Class"not all code paths return..." means that you have some "if" statements and there is some possible condition where you can get to the end of your Method without encountering a "return" statement. I can't follow the braces in your code, but you probably need a return somewhere. Look at your statement: if (readCalBytes == 9) If the condition is false then there is no return. I think a return belongs after your last brace. You have to make incremental discovery. 1. Can you verify that the "K" command that you are sending out is actually being transmitted??? With a scope, a terminal program, or perhaps a LED indicator on the acc. board??? 2. Did you try putting a break point at: readCal = COM_Port.SCIPort.ReadByte(); Squeak
-
Help with my class using Serial Port ClassBy the way, Step 2 in my previous message; about verifying that the accelerometer board is communicating by using a known good terminal program is the most important step you can take. Because if something is wrong with it or the cable, you can work for a year on your program and you will find no joy. Joy is important! Squeak
-
Help with my class using Serial Port ClassLooking at your code for SciGetCal() it looks like it should work. Since this method returns an integer, you need to define a variable like ( int result; ) and then call your function like ( result = SciGetCal(...); } 1. Are you getting any errors? 2. Have you tried a normal serial communications program to see that the accelerometer board is working properly? HyperTerminal is the worst choice. If you need to get a simple one, I recommend Br@y Terminal. Free. And it doesn't install anything on your computer. 3. Do you have the serial port set up with proper baud rate, parity, stop bits, etc. ?? 4. In Visual Studio you should put a break point when you start into your SciGetCal() method and step through the code line by line. This is pretty straight-forward since you only have a few lines of code. Are you using Visual Studio? What version? 5. Are you using Net 2.0?? Don't despair! Serial communications is tricky. Regards- Squeak
-
Help with my class using Serial Port ClassYou need to provide some additional information. Like what error are you getting? It would be helpful if you gave a slightly more comprehensive idea of what you are doing. I have two comments: 1) In your first "for" loop you have a "return 1" statement. So you won't get to the rest of your code. 2) You may need to add references to the SCICommunications class. Visual Studio will complain if these references are needed. Is SCICommunications class something you wrote, or is it from a third party?? I Googled it but I didn't find anything. Best regards- Squeaker
-
Its is possible to make it on vb.net?If you do a Google search using the terms: fingerprint reader you can find a lot of information. There are many vendors for this peripheral. Microsoft is one possible vendor. Their device was listed on Amazon for about $23 (US dollars). Good luck with your project. the Squeaker
-
serial communicationYou need to set up your serial port so that all serial parameters match the parameters of the sensor that you are trying to communicate with. This includes baud rate, start bits, stop bits, parity, etc. If you don't have a datasheet that gives you these parameters, you will have to do some experimentation. I would suggest that you get a simple terminal program so that you can easily verify operation. I recommend Br@y terminal. Only because it is very lightweight, and it lets you set all parameters from the main screen. Once you know all the serial parameters, it should be easy to get your program to work. There are many good example of serial software on CP that will help you. Also, once you get Br@y terminal to work with your sensor, you can test your code with Br@y. -squeaker-
-
Advanced file propertiesI believe that what you are looking for are called "Extended File Properties". I think you can get some useful info on Google. I used to have a VB6 program that (I didn't write it) that would extract the extend file properties. I looked, but couldn't find it. Google had many hits. If you find something good, please post the link. Best regards- Squeaker
-
Event handler MaddnessThanks. I am building the tree dynamically. I knew there was a way to do this, but you made it very clear. I think I can make that work. Squeaker
-
Event handler MaddnessThis is what I wanted to do, but I need a little clarification. It looks like you are saying that all Car objects can fire the same event, and the eventArgs will include an index so I will know which car raised the event. If that is correct, then how do I declare the same event in each Car?? Thanks Squeaker
-
Event handler MaddnessI am trying to understand how to hook up some event handlers. Here is an analogy to my situation: I have an object tree that represents all passenger trains in a train station. It looks like this:
Station .....Trains .........Train_0 ..............Cars ................Car_0 ...................Passengers ..........................Passenger_0 ..........................Passenger_1 .........Train_1 ..............etc...
Each of these objects fire events (like when passengers board a car). I have a Form where I want to display status of Trains, Cars, Passengers etc. I need to attach the handlers in the Form, but must be done dynamically, and I have no clue. For testing I tried this, but I get a runtime error if the collections are empty:Station.Trains[1].Cars[5].CarsChanged += new CarsChangedEventHandler(Cars_Changed);
I have spent a good bit of time searching for info. Any suggestions would most helpful. I'm guessing that C# has an elegant solution (in lieu of my duck tape). Thanks in advance- -
Correct way to reset the modemYou may need a comma after the "+++" Escape Sequence command. Many modems expect a pause at this point. Each modem manufacturer interprets the AT commands somewhat differently and it is sometimes difficult to find a command that will work for all modems. I recommend that you perform a Google search using terms like: "AT Command", Reset, Escape, and DTR. If you know the manufacturer of the modem chipset (like Rockwell or U.S. Robotics) you can go to their website and get the AT Command Document that explains exactly how their AT Commands work. For your purposes it may be better to reset the modem by dropping DTR (requires certain state set by AT&D command), but is takes less time. (Check me on that.) Regards,