Git Product home page Git Product logo

Comments (4)

cstook avatar cstook commented on August 23, 2024

Sorry you are having a problem. I don't have access to a linux computer right now, but it seems to work OK with windows and LTspice XVII(x64) May 18 2019, 11:16:30 US Pacific.

Starting Julia...
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.1 (2019-05-16)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> [ Info: Importing Revise
julia> 

julia> using LTspice

julia> cd("C:\\Users\\Chris\\.julia\\packages\\LTspice\\BdDwC\\examples\\example 1")

julia> example1 = LTspiceSimulation("example1.asc",tempdir=true)
LTspiceSimulation:
circuit path = C:\Users\Chris\AppData\Local\Temp\jl_11D8.tmp\example1.asc

Parameters
Rload                     = 75.0

Measurements
Pload


julia> example1["Rload"] = 20.0
20.0

julia> loadpower = example1["Pload"]
0.00408163

julia> loadpower = example1(100.0)
1-element LTspice.MeasurementValuesArray{Float64,1}:
 0.00444444

julia> 

It also passes tests on Travis.

I'm not sure whats going on here. Let me poke around some more.

from ltspice.jl.

cstook avatar cstook commented on August 23, 2024

It probably can't find the LTspice executable. You can specify the location with the executablepath parameter.

For example, on my windows machine, the LTspice executable location can be specified as follows.

example1 = LTspiceSimulation("example1.asc",executablepath="\\Program Files\\LTC\\LTspiceXVII\\XVIIx64.exe",tempdir=true)

Give this a try and see if it helps.

Also, it's easier to read if you enclose code, and sample output in triple backquotes instead of a screenshot.

from ltspice.jl.

warrendale avatar warrendale commented on August 23, 2024

Thanks. It turns out it CAN find the executable. The problem is that it is not associated with wine when being called via the julia run() function. If I make the following change and rebuild LTspice.jl it works fine.

function run!(x::LTspiceSimulation, force=false)
  flush(x,force)
  if x.status.ismeasurementsdirty || force
    if x.executablepath != ""  # so travis dosen't need to load LTspice
      @static if Sys.islinux()
        drive_c = "/home/$(ENV["USER"])/.wine/drive_c"
        winecircuitpath = joinpath("C:",relpath(x.circuitpath,drive_c))
        run(`wine $(x.executablepath) -b -Run $winecircuitpath`)
      else
        run(`$(x.executablepath) -b -Run $(x.circuitpath)`)
      end
    end
    parselog!(x)
    x.status.ismeasurementsdirty = false
  end
end

from ltspice.jl.

cstook avatar cstook commented on August 23, 2024

Thanks for fixing my code! I'll update the code on GitHub.

from ltspice.jl.

Related Issues (4)

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.