PVC window calculator for the site on JS. Part 1. Analytics

    This article will focus on the window calculator. Yes, I know that their sea, but the one I want to talk about is special. It allows you to calculate the cost of window products on the site with an average deviation from the calculation program for production at 0.002%. At the time of the launch of the project (May 2011), this calculator was the only solution of its kind. I don’t know how things are now, but judging by the periodic calls, I admit that little has changed.

    Project Features:


    Qualitative preliminary analytics of the task. It was she who determined the boundary that made it possible to create a simple tool for the main target audience, which fully takes into account the specific requirements for ~ 90% of products requiring calculation. The first part will be about that.

    Choosing HTML5 Canvas as the basis for graphical implementation. Many developers still believe that this technology is “experimental” and is not suitable for services aimed at the general public. What can I say about March 2011? .. This choice cost me a kilogram of neurons, but it fully paid off. The second part will be devoted to this, as well as other specifics that had to be fought during the implementation of the task.

    For those who are not interested in analytical calculations, I suggest immediately familiarizing yourself withconstructor demo .


    The dream of "absolute" accuracy.


    Everyone has dreams. Even the old stump in the spring, according to one famous song.

    If you are engaged in the production of PVC windows, then you very likely have a dream that sounds something like this: “It would be nice for my clients to consider window constructions for themselves with 100% accuracy, otherwise I don’t have managers to service them but let's find it so ... expensive ... and so? ”

    What is the “one hundred percent” accuracy of calculating the cost of construction? This is when the received price of the product coincides (with an acceptable margin of error) with the price of calculation in the production program with the manager of the receiving order. “Price without an asterisk” is about it.

    If the cost calculated by the calculator on the site diverges from that at which the product is accepted for production - there is no point in such a calculator. There is a fundamental difference between “check with the manager” or ± 5% and “the exact cost here and now”.

    So: the client must independently calculate the final cost of the product without contacting the company managers at the stage of settlement (taking their time).

    The target audience of the window calculator on the site


    If roughly, we have the following groups:
    1. retail customers;
    2. small and medium dealers;
    3. large dealers;
    4. window manufacturers and software manufacturers for window manufacturers;

    Retail buyer

    - this is a "man from the street." He just wanted a window. He may even have some philistine ideas about the coolness and chamber profile and the presence of an “inert vacuum” in glass units, but this is weakly correlated with reality.

    The retail customer, as a rule, is not able to consciously choose a profile system for his window. Therefore, companies working with this consumer category often form narrow model lines based on specific profile systems so as not to fool the buyer with an abundance of options.

    Not unimportant moment are measurements. How much can you trust measurements provided by the customer? Almost impossible. Therefore, companies have a staff of surveyors traveling to the place of proposed work.

    In these conditions, it makes no sense to talk about creating a calculator for a retail buyer. And the reason here is non-technical. We need the exact price of the product, but it cannot be obtained in the absence of reliable sizes and adequate requirements for the product. All this is made out already at the stage of customer contact with the manager in the office or with a company representative “in the field”. In these cases, the site is usually already out of date.

    So: the creation of a window calculator for a retail buyer that in practice would solve the problem of “100% calculation of the cost of a product on a site” is likely to make no sense. They simply will not be used.
    Fact: I, as a person who wrote a window calculator with my own hand and knowing how the window is arranged in the smallest details, when my hour strikes, I still can’t decide on my own profile and double-glazed windows, not to mention removing the correct dimensions from the opening. This is my official statement.

    Small and medium dealers

    - these are the guys who are where you have no time. They are especially numerous in small towns and in rural areas. A large company may not keep its representatives in settlements in the far north, but barges loaded with windows sail north along the Yenisei every summer. Naturally, someone puts them on the ground.

    More generally, it is a mobile intermediary between consumer and producer. This is not always a legal entity. The key feature of this group is “Today I take from you, tomorrow from a competitor, but we do not say goodbye”. Nothing personal.

    What problems? There are many such intermediaries. And everyone needs to know the cost of the product here and now. Together, they give a good volume of orders, but they are capable of their urgent requests to annoy any department to combat customers.

    Conclusions: if you give these guys the opportunity to calculate the exact cost of the structure directly “in the field” and immediately inform it to the end customer, taking into account their mark-up, they are forever.
    Fact: now this is actually happening. The guys come to the customer with a laptop with mobile Internet. Take measurements. Immediately consider the site design. Add your own and tell the price. If the price does not suit, they can immediately change the profile, accessories and adjust the solution to an acceptable amount. The sales department of the manufacturer, meanwhile, is drinking tea with cake, because Marinka from accounting has his birthday today.

    Large dealers

    - these are those that if they glaze then immediately the microdistrict, well, at least the house. Typically, orders for typical products are made, but in good batches. Quite often, they have their own structures equivalent to average dealers in the style of environmental impact with all the consequences for the manufacturer’s sales department. Plus another cart of pathos.

    Conclusions: In such organizations, people who process orders are already accustomed to comfort. These are office workers. They can tell you a lot about peace of mind on their pages on social networks. And calls to the tormented sales department of the manufacturer do not contribute to this balance. If you as a “serious manufacturing company” provide convenient tools for working, they will work with you.
    Fact: issues related to informal forms of establishing relationships in tune with the behavior of artillery under the influence of shock loads on the carriage, I deliberately leave out the scope of this article.

    Window manufacturers and software manufacturers for window manufacturers

    - I learned about this category after implementation. Companies that are engaged in their own developments in the field of systems for calculating window structures began to come to me. One company from Omsk even sent me a demonstration of their product, which was written in SilverLight with a clear focus on integration with web-based computing components. The product was very raw, but maybe the guys have advanced over the past time.

    If in general, then the motivation is always about the same: the current solutions for the industry are expensive, so we will write our own, with cards and girls. Personally, I’m worried about this approach, but those who finance such projects know better.
    Fact: write your SuperOkna, Facebook or in extreme cases Vkontaktik - it is always fresh. Do not let doubt kill your dream!


    The arrangement of the customer company at the time of spring 2011


    Product Components:
    • Six profile systems (now eight);
    • Each system allows several sizes of filling thicknesses (double-glazed windows, sandwich panels), which pulls the zoo along the glazing beads;
    • Two types of fittings for sashes (ROTO, VORNE);
    • Two types of sealing rubber.
    • In 2013, profile lamination was added;

    ~ 90% of orders - products in a rectangular frame with right angles.

    The company is positioned in the market primarily as a manufacturer.
    Share composition of the clientele (approximately, because a trade secret):
    • 20% retail;
    • 80% dealers of all calibers;

    In absolute terms: censored .

    Settlement program in production: SuperOkna version 5 (Currently version 7).
    Fact: Yes, licensed. No, they didn’t pay for advertising. Yes, it's a shame!

    Technical task


    As a result, a decision is made to create a full-fledged window designer - as a tool for dealers who are appointed as the main target audience of the project.

    The designer should work on the company's website in modern browsers supporting HTML5 Canvas. It was decided that the dealer would be interested in such a calculator no less than the manufacturer, because he will receive a tool that saves time and nerves when calculating various variants of the same product “here and now”. All that is required of him is to use a modern browser.

    A decision is made to refuse to calculate non-standard products on the website with oblique corners or bent structural elements in view of the small number of such orders in the total mass. As a rule, “non-standards” still require consulting the client with the manager. There is no sense in the calculator in this situation, while the requirements for the designer are greatly simplified.

    A complete constructive modeling of the product, with a detailed calculation of each component, is taken as a concept. No preliminary schemes for “standard kopecks” and “troyoshki”. Any “space” with right angles that can be made in production should be modeled by the designer without exception. All honestly. Only hardcore!

    The designer must ensure that all elements of the product comply with technological restrictions (dimensions, area, compliance with the sets of selected fittings). Structural units that fall out of acceptable ranges should be marked as erroneous.

    The designer should allow equalizing the openings geometrically and “according to the luminous flux” for the construction of any complexity (who is crying in the subject).

    The calculator should calculate the cost of the product with an accuracy as close as possible to the result of calculations on production software (SuperOkna). It is also necessary to calculate the weight of the product in multiples of one kilogram. The calculation should take into account not only the cost of components, but also the cost of all operations of assembly of the structure in production. All this is desirable on the fly.

    It's not over yet


    All of the above in the previous section was implemented by me in two months. In addition to me, the head of the customer company participated in the project as a technical consultant and accomplice in numerous brainstorming sessions. Technical literacy and the adequacy of this person in fact determined the success of the undertaking.

    As I wrote at the beginning, the average deviation of the calculation results in the calculator from the calculation in production software was 0.002%. What can be attributed to losses in algorithms for rounding values. For reverse engineering proprietary software with closed source, it turned out very much.

    Then followed the development of an ordering system on the site. Development of a similar calculator for calculating aluminum structures. Development of a real-time system to ensure and control production processes ... I also plan to write about this somehow.

    Subsequent operation of the designer, both separately and as part of an order system, confirmed the correctness of the selected solutions. We determined to whom, what and how to, and did what is 100% to solve the task in specific conditions.

    UPD: Functional demo of the constructor .

    PS


    Regarding typos, please write in a personal.

    Also popular now: