|
Hey dear Griff, I would like to ask you here that "As MySQL is open source and there are many articles for connecting the .Net application with MySQL db, and no where I have found that someone have specified this Named Pipes protocol thing in order to connect to MySQL dB although I have checked firewall. As our client is the owner of the MySQL Database, I think some dB level permission is to be granted in order to access the dB remotely. What do you say dear Griff on this?
Thanks
|
|
|
|
|
Hey dear Griff, the error is coming as "Connection unexpectedly terminated". I am just going sick over this issue Kindly help someone.
|
|
|
|
|
I am using onlyconnect html editor
On typing on it using hindi fonts such as kruti dev ,kantipur I am getting unnecessary spaces
I dont knw how to remove them
whereas these fonts are working well with the IE installed on the system...
also, I have set the encoding to unicode...
Need help urgently.. will be really very grateful
Thanks in advance..
|
|
|
|
|
This is not a C# issue; try posting in the 'General Indian' forum.
It's time for a new signature.
|
|
|
|
|
Hello again, I have one more question if I may...
I have the following classes for my patient simulator
patient - object for holding patient data/stats
simulator - the simulator engine to control things
form1 - my main app dialog
and some more
Now, I have a number of resources associated with some of the above, for exaple, when I populate the patient class by loading data from a patient file, I want a picture of that patient to load into my main form.
Where do i add the picture?
Should I add the file path to the picture to the patient class, or hold a list of file path resources in my main app, and use a funtion to load the relevent pic depending on how the patient class is populated.
Same goes for sounds,
For example my ecg class will create and display an animation of an ecg based on the simulation. should I add the relevent ecg graph array data, sounds etc into that object, or the main form.
Hope the above makes sense, and thank you for your help.
Steve
|
|
|
|
|
Hi,
I would suggest that you embed the resources to your application. Have a look at this article:
http://support.microsoft.com/?scid=kb%3Ben-us%3B319292&x=10&y=10[^]
You can then load your data using a StreamReader. Save the name of the file and sounds within your Patient-class, since each patient I think has a different picture and sound.
Hope this helps a bit.
Regards
Sebastian
|
|
|
|
|
I would have to disagree with SeMartins.
If the picture is of the patient, then it should be stored with other patient information. Otherwise, when you add a new patient, how do you include a picture? Embedding them in your resources is a bad move as you would have to define them at build time, or play silly buggers.
Either: store the file path with the patient data and load the image when you need it, or include the picture in a database with your other patient information - the latter means there is only one place to go for all relevant info - again, you do not have to load the image until you need it for display.
Again with sounds, these should be stored either as a file reference or database field (depending on the size) and loaded only when you need them.
The general rule is: If it is part of the object info, let the object deal with it. Your main form is concerned with user interaction - displaying patient and EGC info to the user, and relating user generated changes to that info back to the object, not with how the object is stored.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Thank you for the positive feed back, it is well appreciated.
Thank you
Steve
|
|
|
|
|
You're totally right. Due to my missing morning coffee I assumed that your patient data is fixed (since it is just a demo, isn't it). If the data itself is not fixed, store it within a file or (better) database as already suggested by OriginalGriff.
You could also place the picture and sounds into the patient data file by embedding the data as base64 strings... So you got everything in one place.
Regards
Sebastian
|
|
|
|
|
|
Ok, If I have learned correctly, one should limit an app to maybe 1 or 2 timers.
I have a timer object set to triger every second, but I need a number of different events to happen at different times.
For example,
every 1 second...timer triggers
every 3 seconds, run function A
every 10 seconds, run function B
etc
Now, I cant figure out how to do this properly. I know I need variables to keep tabs on elapsed times, but would some kind coder please give me an example of how I may do this please?
Thank you
Steve
|
|
|
|
|
Hi,
1.
you can have several timers, however I would avoid having dozens of them.
2.
you can easily combine two or more periodic timer requirements and serve them by a single timer, basically it works like this (code looks like C#, has not been tested):
public class MultiTimerDemo {
private int timerCounter17=0;
private int timerCounter5=0;
public MultiTimerDemo() {
Windows.Forms.Timer timer=new Windows.Forms.Timer();
timer.Interval=1000;
timer.Tick+=ticker;
timer.Start();
}
private void ticker(object sender, EventArgs e) {
if (--timerCounter5<=0) {
timerCounter5=5;
.. now do whatever needs to be done every 5 seconds
}
if (--timerCounter17<=0) {
timerCounter17=17;
.. now do whatever needs to be done every 17 seconds
}
}
}
The above illustrates how one actual timer can be turned into two or more virtual timers.
You can easily add virtual timers. And of course you could make things more dynamic (provide code to add and remove all kinds of virtual timers) by using lists and delegates.
|
|
|
|
|
Thanx alot Luc, just what I needed!
Steve
|
|
|
|
|
One timer. One second interval. Keep a DateTime of when each task last ran. When the timer elapses, iterate the tasks to see which are due.
That's basically what I do, but with the tasks configured in a database.
|
|
|
|
|
Hi again coders.
I am writing my first, simple patient simulator.
I need to play a sound file on repeat, while the simulator is running.
It is a beep beep kind of file for the ECG machine (EKG in america, I am in UK)
I have a time object in my c# app, set to triger every second so I can track each second of the currently running simulation.
I tried to add my playsound() function here, but it is being reset every second (I understand why, but I cannot figure out what to do)
The whole sound file lasts approx 12 seconds, and needs to repeat straignt after it ends, for as long as the sim is running)
Sorry if it a basic question, but what functions do I need, and where would I put them to allow me to do this?
Thank you
Steve
|
|
|
|
|
stephen.darling wrote: I have a time object in my c# app, set to triger every second
Perhaps you could have this trigger every 12 seconds? Or if it needs to be every second, have a variable track how many times it has triggered and every 12 times, you can play the sound (the other 11 times you'd skip the sound playing since it's already playing and you'd do whatever you do on that trigger).
stephen.darling wrote: I tried to add my playsound() function here
Speaking of adding your playsound function here, you should post some code here so we know the actual functions you are using to play the sound and which objects you are using for your timer.
|
|
|
|
|
Hello and thank you.
Here is my code, but it is rough as i have not yet created the classes etc, it is all happening within the form function
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;
using System.IO;
using System.Text;
using System.Runtime.InteropServices;
namespace SimMed
{
public partial class simmedForm : Form
{
[DllImport("winmm.dll")]
private static extern bool PlaySound(string lpszName, int hModule, int dwFlags);
#region Variables
private int nTime;
private int patientHeartRate;
private int patientBloodPressure;
private int patientTemp;
private int patientBreathRate;
private int patientConciousLevel;
#endregion
public simmedForm()
{
InitializeComponent();
HeartBpmLed.Text = ("72");
patientHeartRate = 72;
startNewSimulation(false);
}
private void startNewSimulation(bool restart)
{
if (timer1.Enabled) timer1.Stop();
if (!timer1.Enabled) InitTimer();
}
private void InitTimer()
{
timer1.Interval = 1000;
timer1.Enabled = true;
}
private void PlayWav(int play)
{
string myFile = ".\\Sounds\\default.wav";
switch (play)
{
case 1:
myFile = ".\\Sounds\\ecg.wav";
break;
case 2:
myFile = ".\\Sounds\\ecg.wav";
break;
case 3:
myFile = ".\\Sounds\\ecg.wav";
break;
case 4:
myFile = ".\\Sounds\\ECG Alarm.wav";
break;
case 5:
myFile = ".\\Sounds\\Flatline.wav";
break;
case 6:
myFile = ".\\Sounds\\Medicalventilator.wav";
break;
case 7:
myFile = ".\\Sounds\\PulseOximeter.wav";
break;
case 8:
myFile = ".\\Sounds\\Heartbeat.wav";
break;
case 9:
myFile = ".\\Sounds\\Won.wav";
break;
case 10:
myFile = ".\\Sounds\\illegal.wav";
break;
default:
break;
}
PlaySound(myFile, 0, 0x0003);
}
private void simmedForm_Load(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
Random r1 = new Random(unchecked((int)DateTime.Now.Ticks));
nTime++;
patientHeartRate = 72 + r1.Next(0, 5);
HeartBpmLed.Text = patientHeartRate.ToString();
PlayWav(1);
}
}
}
Thank you
|
|
|
|
|
|
Ah, OK.
I will look into this function.
Thank you
|
|
|
|
|
|
Thank you for that really useful information <Sarcasm mode="off" />
Did you mean to post it somewhere else, or are you just not big on reading?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
So write an article then.
|
|
|
|
|
How does it differ from storing my stored procedures as plain text files and pulling them from harddisk as needed?
I are Troll
|
|
|
|
|
How are you able to control objects in your project with stored procedures? Not objects in database.
Without hard-coding it into your code.
|
|
|
|
|
hove82 wrote: Not objects in database.
Without hard-coding it into your code.
You're sounding like a salesman. Don't do that if you want a decent opinion.
I put objects in my database by serializing them. I put assemblies in my database as blobs, based on the source-code that's stored in a NVARCHAR. Updating the text in the NVARCHAR gives a new build-number, and there's a certain amount of builds in a release
What's the motivation behind the original question? Do you plan on using their software and looking for people with previous experience, are you evaluating idea's, or what? Without a decent list of features, it's hard to say whether or not it would fit a specific task.
Yes, it's definitely handy for those people who don't want to spend the time on building that part of the infrastructure themselves. There's room for logging-frameworks, for exception-handling frameworks, should be room for a macro/configurationmanager framework.
Is it Open Source? If yes, then why not write an article on it's use, and how it could save people time?
I are Troll
|
|
|
|
|