1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Anyone have experience with C# Programming?

Discussion in 'HTML, Graphics & Programming' started by MrRockliffe, May 9, 2018.

  1. MrRockliffe

    Wise Guy

    Joined: Apr 14, 2014

    Posts: 1,794

    Location: Hampshire

    I've got a project I'm working on at uni, however my lecturer has a 'learn on the job' approach to teaching (i.e. can't be bothered to teach himself). It's meant that so far, I've just been using tutorials online.

    However, this time, I don't even know where to start. Throughout his lectures, he's not even mentioned the coursework, so little help there.

    The project is programming a washing machine, and creating a UI for it.

    Once I'm on a computer, I can add a little more info about the project, but if anyone has some great tutorials that may be appropriate for it, it would be greatly appreciated.

    Thanks all in advance
     
  2. namnoc

    Hitman

    Joined: Dec 21, 2005

    Posts: 575

    Location: Felixstowe

    Just design the UI and a set of washing times depending on the choices given. Once start is hit have one thread with a timer to go through the wash. At each relevant point call a dummy function to turn on water etc as you don't need to worry about writing that bit.
     
  3. MrRockliffe

    Wise Guy

    Joined: Apr 14, 2014

    Posts: 1,794

    Location: Hampshire

    Cheers - I'll give it a go and post back
     
  4. AHarvey

    Sgarrista

    Joined: Mar 6, 2008

    Posts: 8,929

    Location: Stoke area

    Seems fairly simple from a design point of view, the only thing not mentioned is cycle length.

    Think about it as though it's a old fashioned control panel, no LED screen, then move it to and LED design.

    Door Open/Closed - LED
    Door locked/unlocked - LED
    Water temp dial
    RPM dial
    Start button
    Stop Button


    If the door is open the water inlet valve is closed
    If the door is closed the inlet valve opens

    Before a cycle - door open/unlocked, inlet closed, outlet open
    Start of a cycle - door closed/locked, inlet open, outlet closed.
    During a cycle - door closed/locked, inlet open, outlet closed.
    Cycle ending - door closed/locked, outlet open, inlet closed
    Cycle ended - Machine empty of water, inlet closed, outlet open, door unlocked

    If the stop button is pressed, it jumps to cycle ending for X minutes then the door unlocks as per cycle ended.
     
  5. MrRockliffe

    Wise Guy

    Joined: Apr 14, 2014

    Posts: 1,794

    Location: Hampshire

    Thanks for the help - I've also got to animate the cycle.

    I was thinking of using something simple like paint, and getting some basic animations, rather than super fluid 60 FPS stuff.
     
  6. jsmoke

    Soldato

    Joined: Jun 17, 2012

    Posts: 5,854

    Use a picturebox control and find gif for a washing machine, a door opening/shutting and leds etc.
     
  7. Dj_Jestar

    Caporegime

    Joined: Oct 18, 2002

    Posts: 28,283

    Location: Back in East London

    You can make things fruity by explicitly implementing a finite state machine
     
  8. MrRockliffe

    Wise Guy

    Joined: Apr 14, 2014

    Posts: 1,794

    Location: Hampshire

    I've been looking into them - looks as though they get complex quickly, but it's the only thing that's made sense so far :D
     
  9. Dj_Jestar

    Caporegime

    Joined: Oct 18, 2002

    Posts: 28,283

    Location: Back in East London

    It'll help you a great deal to learn them tbh, they are very useful and are used in many applications. In fact a lot of systems use them with out realising it, too.
     
  10. MrRockliffe

    Wise Guy

    Joined: Apr 14, 2014

    Posts: 1,794

    Location: Hampshire

    Looks as though you want to be drawing out a map first, so you can work out the correct states etc - would that be the correct way of going about it?
     
  11. Dj_Jestar

    Caporegime

    Joined: Oct 18, 2002

    Posts: 28,283

    Location: Back in East London

    Yes :)
     
  12. MrRockliffe

    Wise Guy

    Joined: Apr 14, 2014

    Posts: 1,794

    Location: Hampshire

    After a bit of trial error, I've found starting with a countdown timer the best method. From there, I can have actions occur based on the time left
     
  13. MrRockliffe

    Wise Guy

    Joined: Apr 14, 2014

    Posts: 1,794

    Location: Hampshire

    Yep, so nearly done, and my method was:

    Use count down timers, set by integers. Then at certain integers, I can have certain events occur.

    I've found that to be the easiest method.

    Happy to provide code if anyone wants to know how :)
     
  14. Mynight

    Soldato

    Joined: Jun 16, 2013

    Posts: 5,323

    Would be interested to see how you've done it.