|
Hi!
We have to visualize a maschine scheduling plan in a winform-application...
An example of such a plan in ascii-style:
machine |00:00|00:10|00:20|00:30|00:40|00:50
--------|---------------------------------------
M1 |Job1A| |Job2A|Job3C| |Job1B
M2 | |Job3B| | | |
M3 |Job3A| |Job1A|Job2B|Job3C|
------------------------------------------------
| | | | | |
I hope you get the idea
First idea:
Find a free control that can display gantt-charts --> no (appropriate) found
--> the good ones are not free, unfortunately these are no option for a university assignment
Second idea:
We use a datagrid, with many, many columns. Each column represents a certain timespan.
The rows are the machines, and a marked cell means that the machine y is busy at time x.
For each job that was scheduled, we wan't to use a different color, part-jobs of the same job have
the same color.
Unfortunatelly we encountered several problems:
We use a datatable as datasource for the grid, and "..Columns.Add(...)"
seems to have severe performance problems for #columns>2000, for #columns>10000
the computation time is inacceptable. The same problems, in an even more akward fashion
occured while binding the DataTable ot the datagrid.
I think the problem is that we have many columns (>100.000) with only a few
rows (<100).
If anyone has an idea how to get over these performance problems
or how to visualize the machine scheduling plan in a completely different way,
your help would be greatly appreciated...
with kind regards,
Benjamin Jung
|
|
|
|
|
Just paint it in a user control - how hard could it be?
100,000 objects is too big for any C# model - figure a way to paint only the part the user can see, incrementally reading the necessary data.
You can usually do this pretty well by creating a matrix of cells which fills the user control, and then "rolling" the data behind them as the user scrolls.
|
|
|
|
|
I've got a second form (LogonUser) that I'm opening with a ShowDialog() method inside a button event; I would like to pass this second form the value of a boolean public variable (IsLoggedOn) I have declared in Form1. Any help would be greatly appreciated.
This is how I'm opening the second from========================
LogonUser validateLogonUser = new LogonUser();
validateLogonUser.MyParentForm = this;
validateLogonUser.StartPosition = FormStartPosition.CenterParent;
validateLogonUser.ShowDialog();
|
|
|
|
|
Just expose a property on the second form and set it from the first form.
Like this.
class SecondForm : Form
{
bool val;
public bool IsLoggedOn
{
set { val = value; }
}
}
class FirstForm : Form
{
public void SomeMethod()
{
SecondForm sf = new SecondForm();
sf.IsLoggedOn = this.IsLoggedOn;
...
sf.ShowDialog();
}
}
Or, if you are passing "this" to the second form (like you did in your sample code), you can directly access the public variable, provided MyParentForm is typed strongly.
I'd recommend the first approach though.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks for responding. I've been chipping away at this problem and I've had some success with the following code blocks:
form1.cs=====================================
LogonUser validateLogonUser = new LogonUser();
validateLogonUser.MyParentForm = this;
validateLogonUser.loggedOnUser = this.validatedUser;
validateLogonUser.StartPosition = FormStartPosition.CenterParent;
validateLogonUser.ShowDialog();
LogonUser.cs=================================
public Form1 MyParentForm;
private void LogonUser_Load(object sender, EventArgs e)
{
this.textBoxUserName.text = this.loggedOnUser;
}
I don't seem to be using any reference to MyParentForm or Form1 properties to access the value passed from Form1? It works, but I don't know why.
|
|
|
|
|
It works because of this line
rich_wenger wrote: validateLogonUser.loggedOnUser = this.validatedUser;
You are setting the value of the loggedOnUser variable in LogOnUser to the one in Form1.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi. You can do it bay many ways.
one of the simplest way is to write the value of boolean to the hard desk and then to read it from the second form.
in the first form:
private void SaveInfo()
{
try
{
FileStream file = new FileStream("info.txt",FileMode.Create);
StreamWriter sw = new StreamWriter(file);
sw.WriteLine(IsLoggedOn.ToString(),true);
sw.Close();
}
catch(System.Exception se)
{
MessageBox.Show(se.ToString());
}
}
and then you have to call this method from the method that call the other form.
in the second form:
private bool ReadInfo()
{
try
{
FileStream file = new FileStream("info.txt",FileMode.Open);
StreamReader sr = new StreamReader(file);
bool b = sr.ReadLine();
sr.Close();
}
catch(System.Exception se)
{
MessageBox.Show(se.ToString());
}
return b;
}
so now bool b has the value of IsLoggedOn.
There are other ways but this on is simple.
Thanks.
Asaad Mamoun Hassan
Bc in Computer Science.
|
|
|
|
|
Whoa, don't you think it is overkill to write to the hard disk just for passing a value to an in-memory object? And what would happen if two instances of the form are launched at the same time?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Guys, beginner question
Some times when you get some code examples from the web, you stack with problem that code snippet doesn’t contain namespace “using” section
e.g. code : HttpUtility.HTMLDecode(“blah”)
if you don’t know in witch namespace HttpUtility present, you are in troubles
so, is some Visual Studio tool can search for a namespace ?
thanks for you attention
KZ
and may the source be with you
|
|
|
|
|
Just search for "HttpUtility class" in the documentation (index in MSDN Library or msdn.microsoft.com). The class overview shows the complete namespace.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa - 10x a 1000000
exactly what i wanted
and may the source be with you
|
|
|
|
|
I've been reading about sockets for the past two days. I've got a few questions, mostly relating to the differences between synchronous and asynchronous behavior.
I'm writing the following application:
Data Server: Must be able to have multiple clients connected. Once a client has connected, it must be able to recieve data from that client and return data to that client at all times. It will need to be able to recieve and processing data from more than one client at a time.
Data Client: The client simply connects, then sends data either at intervals (1-4 XML formated data strings per second), or manually when a user chooses. The data needs to be sent to the server (while connected) and then the client needs to wait for a response.
From what I've read, using the TcpListener/TcpClient interface is synchronous: If there are multiple clients connected - if one client is sending data, another cannot be sending data. But if I use a threaded socket interface using asynchornous methods, then data from multiple clients can be recieved at the same time. Am I understanding this correctly?
Can someone recommend a good solution for this? Do I need to use the asynchronous socket methods? Do I need to use threads? I've found many examples of tcp/client interfaces, but most of the authors don't explain the benefits/limitations of their code - so it's hard to know if I should base my work from what they're presenting. Does anyone know of a good tutorial that will meet my needs for this project?
... as always, Thanks for the help.
|
|
|
|
|
I have recently written something similar to you Data Server, and it works as follows. In the main thread I spawn a new thread which just listens (using TcpListener ) for incoming TCP connections.
When a new connection arrives the TcpListener passes a Socket object on the way out of AcceptSocket . I pass this socket to a ThreadPool worker thread which will handle the rest of the communication for that connection, meanwhile the listener thread loops back and waits for another socket connection. That provides a straight-foward multithreaded server approach - the server can communicate with several clients at the same time with each conversation in isolation from the others.
As far as the client goes, that should be just straight forward socket stuff using either Socket or TcpClient .
It's gone midnight here and I'm going to bed, but if you'd like me to send some sample source code through drop me a line and I'll do it tomorrow.
Rob Philpott.
|
|
|
|
|
Hi out there,
I try to add an new column to a ListView at runtime. When I initial the ListView everything works perfectly. But when I use:
ListView.Columns.Add("SomeText",-2,HorizontalAlignment.Center);
within the programm nothing happens. Even if I add an update or refresh argument.
Any ideas?
thx for your support.
woops00
|
|
|
|
|
Hi Gurus,
Please help me, i am looking for the best solution for reading mails from exchange server. I have gone through two technologies right now, one is MAPI and the other is WEBDAV. With MAPI, i have one confusion; Do i need Microsoft Outlook installed on my machine for using MAPI? Please tell me some good articles for that. We are not permitted to install OUTLOOK on the server. Also i am looking for some good articles on WEBDAV. Looking for the best solution !!
Thanks,
Sumit
|
|
|
|
|
Presently i am able to read the bios but not the Fanspeed of the CPU.Can anyone help to do so ie the speed of the CPU fan from bios.
Ajai
|
|
|
|
|
Same question from me also..
Is it possible ??
|
|
|
|
|
Hai All,
I Have to use a dll that is compiled in delphi 5.
Can it be used directly in the COM.
I am new to Com programming.
Actually if the dll generated in the Delphi is compatable i have to use it in my .net environment by writing a wrapper class.
Please help me.
sukanyavarma
|
|
|
|
|
May be worth asking in a Delphi forum? Chances are that it should be possible, as Borland have Delphi .NET and I'd guess it will have features to interoperate with legacy Delphi code.
Kevin
|
|
|
|
|
Is there any way to make Digitally signed emails and recipient can verify through Digital ID of sender in .NET?
R A M
|
|
|
|
|
Hi,
This is problem about Image processing.
let me describe whole situation.
We are working on project of image processing(talking about OMR).
In that image there are multiple answers and we have to find out which answer is marked and which is not marked out of four answers and for that we are doing recognisation(OMR).
Here marked answers are in pencil colors.
In this project we are using colored image(one image is having one color) and from that colored image we are filtering particular color by drawing rectanlge on one color and that color should be dropped out from the whole image so after that filtering we can get good results of marked answers.
For filtering the colors we had made one algorithm which find out what is MinR,MaxR,MinG,MaxG,MinB,MaxB of that rectangle for which u are dropping colors.
Now problem is that,while finding out Min. values of R,G,B we are getting values of Pencil colors also into that Min. R,G,B (although we had selected color like purple,in that purple color some pencil colors are also there ) and if i am tring to removing from Min. to Max range of those selected rectangle color then pencil colors are also removing so marked answers are also removed and due to that recognisation is not doing properly.
I hope you understand the problem.
Pls. help me out.
Thanks in advance.
montu3377
|
|
|
|
|
No, I don't really understand the problem.
What are the "colored images"? Are you separating the image into RGB colour channels?
Where are you drawing the rectangle? What do you mean by dropping a color?
What are the minimum and maximum values for? How are they calculated?
---
b { font-weight: normal; }
|
|
|
|
|
I have a form with several text boxes and i want the entry in each form to populate a seperate row in my database table , is there a way to do this?
remiodufuye
|
|
|
|
|
hi,
i'm using Component One TrueDBGrid in my form.
one of the columns is the "Amount" field. ItShould allow users to enter only integers or float type. But if he attempts to enter characters, error provider should be shown..this will be done in RowColChange event of the grid...so he shuld not be able to enter any characters or special characters..
Please tell me how i'll do this...i tried using the EditMask property of the grid i.e.
tdbgridOnewayReturn.Splits[0].DisplayColumn[3].DataColumn.EditMask = "0000000.00";
but this doesn't take decimal..if i enter 0000332.99, then it saves as 3329900..which is not correct.
But if i use NumberFormat property of the grid :
tdbgridOnewayReturn.Splits[0].DisplayColumns[3].DataColumn.NumberFormat = "Fixed";
then,the user can also enter characters..which is not correct..
please do tell me how i'll resolve this problem....
thanx ..
|
|
|
|
|
I am having trouble writing an arraylist in the console. Below is the code, I believe everything is working well, but I have no way of writing the array. Any help would be appreciated!
using System;
using System.Collections;
public class PrimeFinder
{
public static void Main()
{
// Creates and initializes the prime number array
ArrayList primeNumbers = new ArrayList();
for(int i = 2; i < 100; i++)
{
bool divisible = false;
foreach(int number in primeNumbers)
if(i % number == 0)
divisible = true;
if(divisible == false)
primeNumbers.Add(i);
}
// Display the prime number list
}
}
|
|
|
|