initial commit lets start
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
)
|
||||
|
||||
type Project struct {
|
||||
XMLName xml.Name `xml:"project"`
|
||||
Xmlns string `xml:"xmlns,attr"`
|
||||
FileHeader FileHeader `xml:"fileHeader"`
|
||||
ContentHeader ContentHeader `xml:"contentHeader"`
|
||||
Types Types `xml:"types"`
|
||||
Instances Instances `xml:"instances"`
|
||||
AddData *AddData `xml:"addData"`
|
||||
}
|
||||
|
||||
func (p *Project) AddFileHeader(companyName, productName, productversion string) {
|
||||
p.FileHeader = FileHeader{
|
||||
CompanyName: companyName,
|
||||
ProductName: productName,
|
||||
ProductVersion: productversion,
|
||||
}
|
||||
p.FileHeader.SetCurrentCreationDateTime()
|
||||
}
|
||||
|
||||
func (p *Project) AddContentHeader(projectName string) {
|
||||
p.ContentHeader = ContentHeader{
|
||||
Name: projectName,
|
||||
}
|
||||
p.FileHeader.SetCurrentCreationDateTime()
|
||||
p.ContentHeader.SetCoordinateDefault()
|
||||
p.ContentHeader.AddAddData().AddProjectInformation(URL_PLCOPENXML, HANDLE_IMPLEMENTATION)
|
||||
}
|
||||
|
||||
func (p *Project) AddApplication(url, handleUnknown string) *Data {
|
||||
if p.AddData == nil {
|
||||
p.AddData = NewAddData()
|
||||
}
|
||||
return p.AddData.AddApplication(url, handleUnknown)
|
||||
}
|
||||
Reference in New Issue
Block a user