Strange problem with IE and SVG[Adobe Svg].

July 17, 2009 by ealis

Shift Reporting Service: Part2

June 5, 2009 by ealis

Upon inspecting the shift reports available it’s obvious that the daily report doesn’t rely purely on the shift logs. It seems that the only information that end up in the daily reports are the shift notes [written text which describes important event in each shifts]. It seems that these most of the values captured in shift reports are the values aquired at the end of the shift. 

This is different from what we’ve originally anticipated. With the data from the shift log being less important it was decided that shift reporting will be left alone for the time being.

So the next level of document is the daily report. Unlike the daily report, which shows equipment status/reading at the time of the shift, the daily report only contain data on the total generation and fuel consumption. The format used for one of the Plant is very simple and it fits within a single page. Aside from generation and consumption there’s data on the coal stock, efficiency, running days and a few other key information. But there is a graph. These documents are prepared in excel.

To understand more on the process of the preparation of the daily report we’ve gone down south to our power plant in Johor. 2100MW at it’s peak, but mostly we’re at 1800MW. Upon talking with the OE onsite we’ve found out hoe these daily reports are completed.

  • The first thing that OE do every morning is completing yesterday’s report [each report cover from 00:00 to 23:59].
  • The first part is on the generation details;
    • Generation details can be acquired from the LTDS (Long Term Data Storage Server), faster then there is this problem on getting to the control room [LTDS is not remotely accessible]
    • or a webportal for the LTDS. [Slower and for some reason data is in 2 decimal point]
    • data acquired is in average of 30 minutes block.
    • data transfered exported from both method will be in .csv
  • Then they will acquire data on the fuel side [coal handling], this can either be through e-mail, or the old way phone. Even thorugh email it’s in pdf form. [she point out there's a problem with consistency(yes we have girls as an engineer), but somebody pointed out to me this is common in coal stock evaluation]
  • transfer everything into an excel template. 
  • Read note from the 2 shift logs and important item will make it’s way to the daily report. [I wish to be able to make this automatic, but processing sentence, that's NLP, not yet]
  • Repeat the same process for the two other units.

And every Thursday she’ll prepare a weekly report. 

on to part 3: coding

The cobbler among blacksmiths.

June 5, 2009 by ealis

For an engineer who is working in the power industry as programmer things hasn’t been easy for me. The title may have pointed out the little akwardness of this whole thing. 

When you’re doing something that everybody else can’t really appreciate it’s hard to keep on a straight face. Just like a cobbler who is working in metal workshop. Everybody else is busy forging metal why you sitting alone sewing some shoe. While all of the other blacksmith has already have many shoes, and of the best brand, redwings, nike etc. You in your cubicle with no support whatsoever, just keep on sewing and sewing. And then all the other blacksmith comes to your cubicle and says “still sewing those shoes, bah nobody is using it”.  The shoe I’m sewing will not turn out to be redwings or nike, it’s very unique, . .  just say it’s a magical shoe, you can find a few in the market, but it wouldn’t come witth any known brand.

What makes things even harder is that, on of the shoe that I’m sewing is for the blacksmiths themselve. But they already have something another shoe for the same function. And this shoe that they like to use, . . .  let just say it just like “selipar Jepun” not even a shoe on my count. When I went to their workshop they would say, your shoe is no good, I we already got a “selipar jepun” and we’re fine with our “selipar jepun”. 

If I want to blame somebody I would blame my boss. Asking me to be a cobbler, even he knew that I’m a blacksmith by trade. But to blame him for asking me to do something that I really like would be a moot point. In any case I should be thanking him.

How would a cobbler gain a little respect in a blacksmith’s world.

The World with XML

May 29, 2009 by ealis

I would like to say, If everything I know is in xml, this world would be a better place!!! Everything is structured. I can understand it, you can understand it, even the machine can understand it. There’ll be no issue in interoperability. One can work with any data in their own way. I don’t have to worry about my language of liking, as they all understand XML. How I wish everything is in XML. Everybody will be free from the chain of any legacy. It’s my data, so I should have every right to control it, not some program that would bound me to do my bidding in their way. XML.

Shift Reporting Service

May 19, 2009 by ealis

This is a power generation company, so we have a few Power Plants of our own; at the same time we are the operator of these plants. So we have many shifts; and at the end of each shift a report is generated. So all this while the way these documents are prepared is with MS Word, and dumped into a NAS. This was cool back in 2000, but not so now.
This is kinda outside of EALIS Seek development, but it is still related to web development. Anyhow, few months ago we implemented Sharepoint, for an online claim system. Yeah I know sharepoint for the sake of claims; we do have some money to burn; in the name of advancement and ease of claims.
The Claims system is suppose to be operational, but I haven’t have access to it just yet, both Claims System and Sharepoint. There using sharepoint + infopath. I’ve seen a glance of the form on infopath just haven’t used it. No of the people I know, have ever used it.
Anyhow the boss asked me to do some work to get a proper Shift Reporting System. Since SharePoint is in the picture, why not use it. By year end the plan was to get a sharepoint license for each staff, so access will be made possible throughout the company. Few weeks ago I’ve attended a basic training on Sharepoint, point out to the trainer on our intention with SRS;
His feed back was;
1. Just use Sharepoint as a dumping ground like NAS – User will still prepare their document in their own way: hence no resistance, the only change will be on the dumping side: expect little resistance. The only upside of this is that sharepoint is more structured and there’s a crawler. But in essence, this is just like using NAS only prettier. Information is not properly structured here, content is just being crawled into a bunch of text; no substance.
2. Use Sharepoint + Infopath – This how we did it for claims, so it is a good way to go… right. Not according to the trainer; he advised against this because according to him [he said don't quote him; since no one is reading this who cares] infopath 2007 will be the last iteration of infopath, as the function will be absorbed to sharepoint webforms. Does make sense to me. So no point in developing something that will last 3 years. Then there’s the problem of resistance from end user; as it is very different from preparing a word document. There’s also problem on fetching historic data.
3. Use Sharepoint + asp.net + webforms – This is the most difficult way to go; but it is more flexible. One of my requirement for the forms is that it must resemble the experience of working with ms word, to achieve this there is one key ingredient; historic data. I expect user can reload the forms with data from previous report, and amend the changes onto the historic data and save it as a new document. This one requirement has made option 3 as the only viable option.

Those are his 3 recomendations

4. I can write webforms on asp add with some ajax. Historic data fetching is achievable; but this route will surely greeted with resistance on end user side as the experience is entirely different. I don’t one to develop anything that no one use. On top of that it will be ugly.

After giving some serious thought the first idea came back to mind: dumping document into Sharepoint; but this time a custom crawler will be written to crawl the document back.

Sidetrack, ever since office 2007, in compliance with world order every office doc are in pure XML files. How bout that, and this files are enclosed in a zip file and named docx, xlsx etc. So you can actually unzip these files and get their XML content. This will be helpful in gathering data without infopath or sharepoint.

Since end user will still prepare document like they always do, there will be no resistance; there’s a few new kinks though;
- the must use office 2007
- they must not change document structure
- they must refrain themselves from excess formating, might mess original structure.
The only change to the original workflow now is instead of dumping to NAS, we dump it to sharepoint; little resistance.

see part 2

SVG Charts

April 23, 2009 by ealis

I’ve been toying with the idea of writing a code to render SVG Charts server side and serve it to user. I know there are a lot of solution out there that do graphs, but most of them are in flash or a system the spew out images. I have to admit they they all look nice, and quite affordable. But I realized that there are no good SVG chart engine out there. And this not in any of my KPIs just decided that it is a good project to start.
Below the quickpress (in the admin dashboard), there is a nice flash chart running.
I’ve written the code in asp and for now I’ve got 4 charts running pie(easy), bar, line, and scatter. I’m trying to make it as web 2.0 as possible, the reflective base, that semi-circle shade etc. For the charts available i’ve added the option to make each more presentable, pie-doughnut, pi-split, bar&line with 3-D look, line-fill etc. In the end it looked quite, it can even beat excel 2003 (not 2007) generated graphs easily on the look dept (as any of the web chart engine available).
But more work need to be done to it; more charts type to be added, live trending (with ajax), etc. The code is in asp, but later I’m planning to rewrite it in javascript, and instead of having the data sent to asp in url encode, I’m planning to put some not existent data island on the html and have javascript parse that data island.
How do I add svg stuff to wordpress.

EALIS – ECLIPSE (Nisoft) Link

April 23, 2009 by ealis

Finally access to eclipse database server, the rep from Nisoft has provided me access to a table which stores custom information. The table only contains data that are of interest to Ealis, so it is small. Since I’ve already written the code for the interface it didn’t take long before I managed to get a test version running. The instruction was to have the status from ECLIPSE (a work permit software) to be graphically displayed on our system drawing (svg).
I have to admit I don’t have a very good web design instinct, so the interface look bleak and flat. While on the subject of my weak point, I don’t think I’m a good programmer either. The code and html part is everywhere, maybe i need to have a go at asp.net the only reason why i jumped straight to asp because it’s supported by default on 2003 server. Most of the time when I do any interface work the were no feedback, but this time around I’ve got boss to look after the development work. She have an idea of her own. So presented to her my idea, then she gave out her view. Changed the look, then she gave out more ideas. By the third revision she decided it was best to ask our boss. And then he had some idea of his own, another three revision. Funnily enough I’m back to my original design. Then he said maybe it is best if the user were the one who decide how the interface should look like.
The biggest problem when you talk to somebody who is not a programmer they have the impression that everything is programmable. And seeing me an engineer by trade, just happened to be programming, doing an OK job at on strengthen their idea that it’s that easy.
Enough with that, the foundation for the link is there, just needed some view on how it should look like. The way the link work is simple, any sets of drawings contains a set of equipments. Get the drawing-equipment list compare it back to the eclipse link and feed that back through xml back to the svg. Then do so fancy effect onto the equipment representation on the drawings.
One thing I realized that now, for the first time eclipse has a link with a database that is not under my care. I should take extra precautions since the server is a critical server. Aside from the drawing link, I’ve slide some code to make the main query shows their eclipse status, at first I hardcoded the whole thing to my search program, two days later I found that EALIS failed to properly generate it’s pages, then I realized, eclipse db server is down at site.
Knowing this I’ve realized that there’s another new issue that I am facing, my services especially EALIS-eclipse link will depends on the availability of eclipse db server on site, if the server or the connection is down the service will not be available. So instead of hardcoding it onto my search program, I’ve put some JavaScript trigger inside the search code so that data is filled by ajax. Doing this ensures the continuity of the main service while providing the EALIS-Eclipse functionality. But in doing so only made the code messier. But I can worry about that later. Where do I need to look to have a go at good code writing practices. Been looking around the net and not much help.

Comos Fill to SVG Path Fill.

February 23, 2009 by ealis

Object in Comos can be color filled. It was not implemented in the previous engine. creating a filled path in comos creates a few additional lines in the CRP file compared to writing a normal line. The first step involve defining the path itself, the next step is assigning a line to a variable while the final one involve adding the line variable to the path itself. 

The code is written in such a way that the fill path is only drawn only after the current object is fully drawn. The reason for this is because there is no way on telling weather the last line has been added to the path. I dont think this code will play nice with arc element. 

Aside from the arc problem there is also the fact that in order for path fill to work in svg the path need to be continuos so for a triangle the line must be defined in such that point a to b, b to c and c to a. THe problem with crp is that isted of points the defined item are line so the three elements defiend wil be line ab, bc, ca. The code will only work if the line element is arrenged in such a manner, but it will get messed up if the element are defined differently ab, ca, bc or even ab cb ca. damnn. I can think of a solution but maybe later.

Svg creation optimization, XMLdom from flatfile.

February 23, 2009 by ealis

The reason why it was written flatfilely because it was easy to begin with, but as the code grew it seems problematic. The fact that elements are written all over the place, ugly. It seems that using XMLdom was way much eassier that I’ve anticipated, damnn. One note though it seems that getElementById doesnt work, supposably I need to use nodeFromId; never managed to get it to work as well, double damnn. 

Funnyly enough there seems to be no performace gain from flatfile to xmldom. It was another reason for the jump to XMLdom. But I do get a cleaner code. A few optimazation were also done to cut down the size of the svg file in this process. the obvious one to round all the number to the nearest 1/10.  Better use of CSS to further cuts repetitive usage of fill, stroke on the same value. The use tag now held fewer attributes, most of the trigger are added by javascript on load. 

But the most significant optimization actually came from optimizing the pipe representation (done in comos). I’ve realised this for quite some time, but never done anything about it. In comos every unique pipe can be added. A single tile of the pipe is drawn for reference inside the system, the way this pipe representation made into the final drawing is that it bacame a repetative tile. Most of the tile are 2 units in length, so for a pipe of length 1000 units, there will be 500 tiles of the same pipe, brutely effective in execution but this ends up strining any machnine that displaying it’s drawing. So I’ve increased the tile size to 5 units, and most of the drawings now are hald their original sizes. The better way of doing this would be using some stroke template for pipes (not sure if svg do this, something like the pattern fill)

Alongside that code are also updated so that line thickness and color are accounted for both object and free line. On top of that filled item in Comos are now filled inside the SVG as well [different post].

ECC Graphical repersentation messup.

February 23, 2009 by ealis

The other day, a member of the team requested for a unique representation of object that has been gone through ECC. At that time I decided it simply to use a feature that actually lies in connections that allow connection repersentation to be edited thorugh property manipulation. To do this the RI tab from pipe/connections are moved to a higher hierachy, hence affecting all the other object. To my amazement it does work as expected. The color of every object now can be manipulated through it’s property. A simple script has been witten to get all the object that has gone through ECC and all these item turned brown. Later it will be implemented onto the ecc object themselves so that this will be automated. 

This is very much a simpler approcah to revisioning, Comos does have it’s own internal revisioning engine, the only problem is that once it is turned on there will be limited control on the actual revisioning as it will be automated, all the little changes will be marked. The way these item are marked are less than favourable, no control over it. In the end if this feature is turned on the resulting document will look messy.

To me with our methodology on ECC, it was best to use the input from ECC to actually shoe these changes. It does work, now edited/ECCed item are colored brown an are clearly visible in each drawing.

But last week realised that the property seems to effect the whole graphical representation of each object in each drawing. So now everything is black, line thickness are fixed to 0.35. The worst part is that this happens as these documents are opened and saved. Since the it was like 3 weeks since I implement this. Most of the drawings now are pitch black. Seems like removing the proprerty from the base object doesn’t change anything. 

With this grave error I now realize what the first part of the gemotry function in the crp files error are refering to; the locally edited symbol, while the second one (used for svg) is the actual displayed item. The error seems to place the original symbol into the locally edited geometry function and placed a blackened, 0.35 thick symbols into the displayed area. To remedy things every symbol affected (which is all of them) has to be reset to default.

Damn!!