Helptextsts/ Events

Post Reply
MrMaus
Posts: 1
Joined: Tue Oct 20, 2015 7:24 am

Helptextsts/ Events

Post by MrMaus »

Hello Together
I am new to this forum. Now I am really running into issues.

My enterprise is constantly making its Prodcts better. I now face the challenge to integrate a helptext to the Alarmmessages.

At this point I will Explain Goal and what does work, and then where the problem is:

My enterprise produces 10 different components, then puts them in different arangements and Quantity(0-99) together. The Panel mus be pretty standard, sofar that works well.
Now the Custumers desire is that er is not only a simple alarm like
"Element xyz did not reach endposition"
but in addition to that ( as their staff can be completly untechnical) an other information like
-check if element xyz can move freely
-check if all sensors are attatched to the module and not free hanging
- call maintenance for help
Now that my enterprise exports to any given country like: USA, Germany, Czech Republic, China and so on, everything must be translatable, as most of the staff can only speak their native language.

i have defined a class

Code: Select all

	public class DefAlm
	{
		public AlarmItem AlmItm{ get; set; }
		public int grp{ get; set; }
		public int alm{ get; set; }
		public string helpText{get; set;}
	}
Where i get every alarmitem, with the helptext and write it to a list

Code: Select all

foreach(AlarmGroup z in this.AlarmGroups )// For each alarmgroup
				{
					int i=0;

					foreach(AlarmItem x in z.AlarmItems )// For Each Alarm Item
					{
						
						tempstring=helpText[0].Text; //Set Helptext to "No helptext avalible" as Standard
						foreach(TextLibTexts help in helpText) //Search heltext for the acual message
						{
							if((help.belt== grp) && (help.aux==i) )
							{
								tempstring=help.Text;
							}
						}
						
						almList.Add(new DefAlm(){ //Define new DefAlm and add it to DefAlm List
						AlmItm=x,
						grp= grp,
						alm=i,
						helpText=tempstring
						});
						i++;
					     }
					grp++;
				
				

				}
And Finally i Add an eventhandler to each alarm element on the list.

Code: Select all

			foreach(DefAlm x in almList) //Add eventhandler to  every item and Readout the almList to logfile
			{
				x.AlmItm.AlarmActive+= new EventHandler(AlmActiv) ;	
			}

Until here Everything is fine.
Now is the hard Part:

if an Event goes off i just log what happens

Code: Select all

		private void AlmActiv(System.Object sender, System.EventArgs e)
		{
			Globals.Logger.WriteLog("Sender\t"+sender.ToString(), true);
                            }

Which returns me following:
Sender [TestFault2 (69)][State: Active][Id: b987d84b-7195-4678-8d9c-103829af13fd][ItemId: d8f19072-4382-4c57-864a-0a9721c93d2a]
i would expec something like the Displayname of the alarm element, which gave out tuhe event, what i find here is the Text of the alarmelement. the(69) is some parameter, which is not always there and not really related to the Position in the List or whatever! How can I now get somthing usefull out of this?
The Testfault2 could be a text that does not mean to be the same Helptext.... Can someone help? i would really be very thankfull!

Greetings MrMaus

User avatar
Jae V
Posts: 117
Joined: Wed Jan 15, 2020 11:00 am

Re: Helptextsts/ Events

Post by Jae V »

Hello,
We understand that this is a very old post. If there is anyone who is still experiencing this or similar issues and require assistance, please visit us at https://www.beijerelectronics.us/en-US/ ... ___support or give us call at 801.708.6690. Thank you.
Best regards,
Jason
(801) 708-6690
Technical Support
Contact Us



Beijer Electronics AB
http://www.beijerelectronics.us

Post Reply