|
For each property you might decided where it is best to have the actual implementation.
I'm not sure how your data get updated and how it used.
You can uses events if you need to know when data is changed. In pratice, it might be simpler to detect changes at the oscilloscope level as you would need to connect to a single event that would contain information on the change. Thus it might be simpler if the actual implementation is in the scope (except if channel are mainly used independtly --- that is one view per channel --- in that case, events could be on each channel). It is possible to have both also.
Assuming that a TkChannel can be used only with a TkOscilloscope, they can easily share information or talk together either though functions or events.
Philippe Mori
|
|
|
|
|
I think so its better if i give u the class implementations. a quick look will clarify u everything...
What i intend to do in a bigger picture is implement a experiment which uses two kinds of hardware an oscilloscope and an encryption board. i intend to measure power waves from the fpga board when an encryption is being done, collect its waveform and store it some where. this single step is called collecting a trace. i intend to do it almost a million times in a fast manner. and record a million waveforms acquired from oscilloscope somewhere.
The have made wrappers for the original oscilloscope driver written in c++ so they are compatible with c#. the drivers are all written, they specify to IVI standard and all the methods are implemented in a form of a class.
The class hierarchy i intend to implement for the experiment is:
IOscilloscope <---- Oscilloscope <----- Visa Oscilloscope <------ (TkTDS1012B , DSO1024)
The last classes e.g. tktds1012B connects to a driver class (e.g. tk1k2kDriver and connects to required methods it requires to get data from oscilloscope.
I am providing the links to these classes:
http://www.mediafire.com/?p3hzzcn2o45qucv
Kindly if u have some time, then have a look at it...
I just want a way to implement the properties for channel class they way i implement visaoscilloscope properties in inherited classes...
Thank you for your help thus far...
|
|
|
|
|
I haven't look at your code. I don't even think I have a program to open RAR file...
Typically, I would think that you would also have:
IChannel <----- Channel <---- VisaChannel <---- ....
If the creation of the channel is done by the concrete oscilloscope, you can provide the concrete oscilloscope to the channel and from there you can do whatever you want. Handle it there, handle in parent channel class or handle it in the oscilloscope class (ideally through IOscilloscope but if you need you can also uses concrete oscilloscope classes).
The exact implementation depedds a lot on how much the implementation of channels are similar between oscilloscopes and also how existing code is implemented. Assuming that there is one driver class object for one oscilloscope that give access to channel and scope functions, then it would probably make sense that each concrete channel class would simple call the appropriate function in the corresponding scope.
Assuming that your channel do have an ID, you might have an interface IOscilloscopeForChannels that would be implemented by the oscilloscope for use by channels.
interface IOscilloscopeForChannels
{
bool IsChannelEnabled(string channelId);
}
Then a property from the channel simply call that method in the oscilloscope providing any passed argument and adding its owns ID.
You would then be able to use a channel like this:
var oscilloscope1 = GetTheOscilloscope();
var channel3 = oscilloscope1.Channels["ch3"];
channel3.IsEnabled = true;
AddToView(channel3.CurrentValue);
channel3.IsEnable = false;
Philippe Mori
|
|
|
|
|
Thank you for your help. Really appreciated...
I will have a look at this approach and implement it.
Thanks again!!!
|
|
|
|
|
Hello,
I am trying to connect c# with MATLAB. I used the deploytool in MATLAB to get the dll file to be used in my c# application. I followed the steps by step example from
MATHWORKS tells for its connectivity with c#[^].
After building my c# project, when I run, it stops working and shows run time exception as follows:
Unhandled Exception: System.TypeInitializationException: The type initializer for 'test.testclass' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT:0x8007000B)
at MathWorks.MATLAB.NET.Utility.MWMCR.mclInitializeApplication(String[] start
upOptions, Int32 startupOptionsCount)
at MathWorks.MATLAB.NET.Utility.MWMCR.InitializeApplication(String[] startupOptions)
at test.testclass..cctor()
--- End of inner exception stack trace ---
at test.testclass..ctor()
at mainApp_test.Program.Main(String[] args) in C:\Users\Abro\Documents\Visual
Studio 2008\Projects\mainApp_test\mainApp_test\Program.cs:line 44
Press any key to continue . . .
Can anyone help me solving this problem?
I am using MATLAB version 7.3, visual studio 8, windows 7 home premium, 64-bit operating system
my c# code is:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using test;
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;
namespace mainApp_test
{
class Program
{
static void Main(string[] args)
{
testclass obj = null;
double[] a = new double[1] { 10 };
double[] b = new double[1] { 33 };
MWNumericArray mwnA = new MWNumericArray(a);
MWNumericArray mwnB = new MWNumericArray(b);
MWArray[] result =null;
try
{
obj = new testclass();
result = obj.addMatlab(mwnA,mwnB);
MWNumericArray output = (MWNumericArray)result.ToArray();
Console.WriteLine(output);
}
catch(Exception)
{
throw;
}
}
}
}
|
|
|
|
|
You can start by going into your project Properties and, on the Build tab, the Platform Target has to be x86, not AnyCPU.
|
|
|
|
|
I tried to change the platform target but it has no option except Active(Any CPU)
what to do now?
|
|
|
|
|
My problem is solved and now I got the result. Thanx
|
|
|
|
|
Some years ago I used to write code in Win32 API and there was a way for file mapping. I would like to know if there is file mapping technique in .net framework? If there is, how is it done? Thanks in advance.
|
|
|
|
|
Memory Mapped files were just added in 4.0 The class name is MemoryMappedFile but I have not used it.
|
|
|
|
|
Hello,
I wish to monitor bytes per second written or read from a directory.
Is something like this revealed by .NET framework, similar to that of FileSystemWatcher?
I am attempting to monitor I/O to the DfsrPrivate folder to better understand the I/O of the dfsr.exe process.
Thanks very much,
Matt
|
|
|
|
|
You can't monitor I/O speed based on a folder. The best you're going to get is to/from the entire disk or the I/O statistics for a process.
You'd use the PerformanceCounter[^] counter class and the appropriate performance counters to get the data you want.
|
|
|
|
|
My work around is to use process monitor by the sysinternals dudes. Then parse the data.
With the proper filters in place, the log ("backing file") grows about 4MB/minute; which is manageable.
Process Monitor has a feature called File Summary (http://www.pcmag.com/slideshow_viewer/0,3253,l%253D248743%2526a%253D248736%2526po%253D13,00.asp?p=n[^]) which will summarize exactly what I want.
Now, I guess the question is, how does Process Monitor gather this information? It's likely via the processes; monitoring the process's handles and where they are reading and writing.
For me, this method, using Process Monitor, will do. However, it would still be interesting to investigate further ways to actually ways to grab the handles and identify their I/O.
Thanks,
Matt
|
|
|
|
|
Process Monitor does it by sitting over the file system I/O functions. The technique is called API Hooking. PM hooks a lot of functions covering I/O, Registry, Process, ... It maintains a huge database that is populated with the API call data. It can give you all the details on a per-process basis quite easily.
|
|
|
|
|
http://www.codeproject.com/KB/cs/tictactoewin32.aspx
why this code can't run in c# visual studio 2008 ??
please answer , i need your helped thanks
|
|
|
|
|
It's customary, with articles, to just ask on the article forum itself. After all, the author is usually best placed to judge what's wrong. I appreciate though that this is an extremely old article, so there's a good chance you won't get an answer from the author.
In this case, the answer is extremely simple. This article is written for a version of .NET that isn't supported in VS2008. Back in 2002, .NET was at version 1, and the minimum version that VS2008 supports is 2. Saying that, you could create a new project in 2008 and then copy parts of the code in from this version, bearing in mind that .NET2 introduced lots of improvements to the language such as generics.
|
|
|
|
|
Is there a way in .Net to convert a given SQL data type to a .Net data type?
Everything makes sense in someone's mind
|
|
|
|
|
It depends. Perhaps you could be a little more specific
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yes.
It's called casting[^]
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Yes, there is a way. But unless you are more specific, it is difficult to get better answers.
|
|
|
|
|
|
|
The data adapter should already do this for standard types.
|
|
|
|
|
|
Hi all,
First some context to my question:
I am working on a utility that queries the Windows registry for a large number of keys set by a particular application.
I am using multiple DataGridView (DGV) controls to display the information (Reg Key and Value) on my form. Each DGV is tied to a Dictionary using a BindingSource.
This has worked out fine for all sets of keys except for one.
- This application has provision for 10 different user-profiles.
- Associated with each user-profile are 7 SETS of feature keys.
- At any given time, the user needs to see the settings for only ONE of the 10 profiles.
- On my form, I have a collection of radiobuttons that I use to select a profile.
PROBLEM:
1. Should I use an array of dictionaries (dimension 1: profile; dimension 2: feature)? If so, how do I do this? If not, what is a better solution?
2. Can I have only 1 set of DGVs (representing the feature keys), so when I click between profiles, the DGVs are updated with the values for that profile?
Thanks for your help!
|
|
|
|