Git Product home page Git Product logo

simconnect's Issues

The sample can not continue when i start a new flight

I use your sample code in my program. When my first flight is over,the get var stoped.But when i back to the home page and start a new flight,the program did not continue to run.I have to close and open it again.can you help me ?

G1000 events doesn't work

I have problem with all g1000 events. None of them work for me. I have no problems with other events like AUTOPILOT_ON, COM_RADIO_FRACT_INC etc. But all events for G1000 like G1000_PFD_MENU_BUTTON, G1000_PFD_SOFTKEY1 does not work with cessna 172 skyhawk.

Do i have to pass any value? I tried 0,1,2,10,100. I don’t have any g1000 mod.

send event stops geting vars

Is someone is able to help me?

func main() {
    sc, err := simconnect.NewEasySimConnect()
    if err != nil {
        panic(err)
    }
    go connectToSimVars(sc)

    time.Sleep(3 * time.Second)
    event := sc.NewSimEvent(simconnect.KeyAutopilotOff)
    event.Run()

    for {
                fmt.Println(sc.IsAlive())
        time.Sleep(time.Second * 3)
    }
}

func connectToSimVars(sc *simconnect.EasySimConnect) <-chan []simconnect.SimVar {
    cSimVar, err := sc.ConnectToSimVar(
        simconnect.SimVarPlaneAltitude(),
        simconnect.SimVarAutopilotMaster(),
    )
    if err != nil {
        panic(err)
    }

    for {
        result := <-cSimVar
        fmt.Println(result)
    }
}

after i run this program i get updated sim data few time every second. After i send event to sc loop in connectToSimVars() stops. But i still get info that sc is alive (last loop)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.