skeleton

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 11 Imported by: 0

README

FreePDM Skeleton

A PDM for FreeCAD

Skeleton

  • Reading the files for meta-data and storing the meta-data in the DB
  • Modifying the meta-data
  • Select material and surface finish and calculate the weight of the part
  • Dealing with users. Who did what? (this can be dealth with the meta-data DB)
  • Partnumbering
  • Adding an owner, checker, approver
  • Dealing with the history of the parts (this can be dealth with the meta-data DB)
  • Dealing with the -four- assembly types. I am sure that they all have their own quirks
  • Copying files (incl. its dependencies. Everything below and drawings, all optional)
  • Storing and reading versions and releases
  • Dealing with states (temporary ones, before putting into a release), again in the data DB
  • Dealing with checkin and checkout
  • Importing and exporting files (in the data DB and meta-data DB)
  • Dealing with projects (creating, modifying, closing, re-opening) in the data DB
  • Dealing with a database backend. The preferred one is PostgreSQL.
  • Use SQLAlchemy https://en.wikipedia.org/wiki/SQLAlchemy or an other ORM
  • Dealing with other info (such as LidbreOffice files and other media)
  • Adding, Renaming and deleting files. Renaming can be tricky when the file is used in assemblies.
  • Replacing files in assemblies

Documentation

Index

Constants

View Source
const (
	Directory    = "Directory"
	FCStd        = "FCStd"
	Assembly_A2P = "Assembly_A2P"
	Assembly_A3  = "Assembly_A3"
	Assembly_A4  = "Assembly_A4"
	Drawing      = "Drawing"
	Part         = "Part"
	Group        = "Group"
	ConfTable    = "ConfTable"
	FC_Document  = "FC_Document"
	FC_Old       = "FC_Old"
	Other        = "Other"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectoryList

type DirectoryList struct {
	Nr          int // number
	Filename    string
	Description string // file description
	State       string // state of item
	Version     string
	// Filetype FileType   // Dir or File
	Filesize int64 // file size
}

type DirectoryModel

type DirectoryModel struct {
	PurgeList     []string
	Directory     string
	DirectoryList []DirectoryList
}

type Document

type Document struct {
	XMLName        xml.Name `xml:"Document" json:"-"`
	SchemaVersion  int      `xml:"SchemaVersion,attr"`
	ProgramVersion string   `xml:"ProgramVersion,attr"`
	FileVersion    int      `xml:"FileVersion,attr"`
	Properties     struct {
		XMLName        xml.Name    `xml:"Properties" json:"-"`
		Count          int         `xml:"Count,attr"`
		TransientCount int         `xml:"TransientCount,attr"`
		UProperty      []UProperty `xml:"_Property"`
		Property       []Property  `xml:"Property"`
	}
	Objects struct {
		XMLName      xml.Name     `xml:"Objects" json:"-"`
		Count        int          `xml:"Count,attr"`
		Dependencies int          `xml:"Dependencies,attr"`
		ObjectDeps   []ObjectDeps `xml:"ObjectDeps"`
		Object       []Object     `xml:"Object"`
	}
}

The overall document XML structure

type Extensions

type Extensions struct {
	XMLName   xml.Name `xml:"Extensions" json:"-"`
	Count     int      `xml:"Count,attr" json:"Count"`
	Extension []struct {
		Name string `xml:"Name,attr" json:"Name,omitempty"`
		Type string `xml:"Type,attr" json:"Type,omitempty"`
	}
}

type ItemDataModel

type ItemDataModel struct {
	FileName string
	// contains filtered or unexported fields
}

func InitItemDataModel

func InitItemDataModel(filename string) (ret ItemDataModel)

func (ItemDataModel) GetFileName

func (idm ItemDataModel) GetFileName() string

func (*ItemDataModel) ReadFcFile

func (idm *ItemDataModel) ReadFcFile()

func (ItemDataModel) Save

func (idm ItemDataModel) Save()

type ItemDrawing

type ItemDrawing struct {
}

type Object

type Object struct {
	XMLName    xml.Name    `xml:"Object" json:"-"`
	Name       string      `xml:"name,attr" json:"name"`
	Type       *string     `xml:"type,attr" json:"type,omitempty"`
	Id         *int        `xml:"id,attr" json:"id,omitempty"`
	Extension  *bool       `xml:"Extensions,attr" json:"extensions,omitempty"`
	Extensions *Extensions `xml:"Extensions" json:"Extensions,omitempty"`
}

type ObjectDeps

type ObjectDeps struct {
	XMLName xml.Name `xml:"ObjectDeps" json:"-"`
	Name    string   `xml:"Name,attr" json:"Name"`
	Count   int      `xml:"Count,attr" json:"Count"`
	Dep     *[]struct {
		Name string `xml:"Name,attr" json:"Name,omitempty"`
	} `xml:"Dep" json:"Dep,omitempty"`
}

type Properties

type Properties struct {
	XMLName        xml.Name    `xml:"Properties" json:"-"`
	Count          int         `xml:"Count,attr"`
	TransientCount int         `xml:"TransientCount,attr"`
	PProperty      []UProperty `xml:"_Property"`
	Property       []Property  `xml:"Property"`
}

type Property

type Property struct {
	XMLName xml.Name `xml:"Property" json:"-"`
	Name    string   `xml:"name,attr" json:"name"`
	Type    string   `xml:"type,attr" json:"type"`
	Status  *int     `xml:"status,attr" json:"status,omitempty"`
	String  *struct {
		Value string `xml:"value,attr" json:"value,omitempty"`
	} `xml:"String" json:"String,omitempty"`
	Bool *struct {
		Value string `xml:"value,attr" json:"value,omitempty"`
	} `xml:"Bool" json:"Bool,omitempty"`
	Uuid *struct {
		Value string `xml:"value,attr" json:"value,omitempty"`
	} `xml:"Uuid" json:"Uuid,omitempty"`
	Map *struct {
		Count int `xml:"count,attr" json:"value,omitempty"`
	} `xml:"Map" json:"Map,omitempty"`
}

type StringHolder

type StringHolder struct {
	Name  string
	Value string
}

type UProperty

type UProperty struct {
	XMLName xml.Name `xml:"_Property" json:"-"`
	Name    string   `xml:"name,attr" json:"name"`
	Type    string   `xml:"type,attr" json:"type"`
	Status  int      `xml:"status,attr" json:"status"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL